| | |
| | | void MainWindow::installWindowAgent() { |
| | | auto agent = new QWK::WidgetWindowAgent(this); |
| | | if (!agent->setup(this)) { |
| | | qDebug() << "Frameless handle failed to initialize."; |
| | | return; |
| | | qFatal("Frameless handle failed to initialize."); |
| | | } |
| | | |
| | | auto titleLabel = new QLabel(); |
| | |
| | | protected: |
| | | WindowBar(WindowBarPrivate &d, QWidget *parent = nullptr); |
| | | |
| | | QScopedPointer<WindowBarPrivate> d_ptr; |
| | | const std::unique_ptr<WindowBarPrivate> d_ptr; |
| | | }; |
| | | |
| | | } |
| | |
| | | |
| | | class WindowBarPrivate { |
| | | Q_DECLARE_PUBLIC(WindowBar) |
| | | Q_DISABLE_COPY(WindowBarPrivate) |
| | | public: |
| | | WindowBarPrivate(); |
| | | virtual ~WindowBarPrivate(); |
| | |
| | | return true; |
| | | } |
| | | *result = HTCLIENT; |
| | | return true; |
| | | } else { |
| | | if (full) { |
| | | *result = HTCLIENT; |
| | |
| | | return true; |
| | | } |
| | | *result = HTCLIENT; |
| | | return true; |
| | | } |
| | | return true; |
| | | } |
| | | default: |
| | | break; |
| | |
| | | QRect QuickItemDelegate::mapGeometryToScene(const QObject *obj) const { |
| | | auto item = static_cast<const QQuickItem *>(obj); |
| | | const QPointF originPoint = item->mapToScene(QPointF(0.0, 0.0)); |
| | | #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) |
| | | const QSizeF size = item->size(); |
| | | #else |
| | | const QSizeF size = {item->width(), item->height()}; |
| | | #endif |
| | | return QRectF(originPoint, size).toRect(); |
| | | } |
| | | |