| | |
| | | #include <QtWidgets/QApplication> |
| | | #include <QtGui/QFont> |
| | | #include <QtCore/QDebug> |
| | | |
| | | #include "mainwindow.h" |
| | | |
| | |
| | | |
| | | void MainWindow::installWindowAgent() { |
| | | // 1. Setup window agent |
| | | auto agent = new QWK::WidgetWindowAgent(this); |
| | | if (!agent->setup(this)) { |
| | | qFatal("QWK failed to initialize."); |
| | | } |
| | | QWK::WidgetWindowAgent *agent = QWK::QWK_Initialize(this); |
| | | |
| | | // 2. Construct your title bar |
| | | auto menuBar = []() { |
| | |
| | | QuickWindowAgent(QuickWindowAgentPrivate &d, QObject *parent = nullptr); |
| | | }; |
| | | |
| | | inline QuickWindowAgent *QWK_Initialize(QQuickWindow *window) { |
| | | auto agent = new QuickWindowAgent(window); |
| | | agent->setup(window); |
| | | return agent; |
| | | } |
| | | |
| | | } |
| | | |
| | | #endif // QUICKWINDOWAGENT_H |
| | |
| | | WidgetWindowAgent(WidgetWindowAgentPrivate &d, QObject *parent = nullptr); |
| | | }; |
| | | |
| | | inline WidgetWindowAgent *QWK_Initialize(QWidget *w) { |
| | | auto agent = new WidgetWindowAgent(w); |
| | | agent->setup(w); |
| | | return agent; |
| | | } |
| | | |
| | | } |
| | | |
| | | #endif // WIDGETWINDOWAGENT_H |