From a04d1012c789069f57b05ca60875ae07a601a7b4 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Fri, 8 May 2020 15:54:47 +0800 Subject: [PATCH] Fix non-Quick builds. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.cpp b/main.cpp index 931b2fc..919c943 100644 --- a/main.cpp +++ b/main.cpp @@ -4,9 +4,13 @@ #include #include #include +#ifdef QT_QUICK_LIB #include #include #include +#else +#include +#endif #include #include #include @@ -35,6 +39,7 @@ static void updateQtFrame(QWindow *const window, const int titleBarHeight) { } } +#ifdef QT_QUICK_LIB class MyQuickView : public QQuickView { Q_OBJECT Q_DISABLE_COPY_MOVE(MyQuickView) @@ -54,6 +59,7 @@ protected: Q_SIGNALS: void windowSizeChanged(const QSize &); }; +#endif int main(int argc, char *argv[]) { // High DPI scaling is enabled by default from Qt 6 @@ -138,6 +144,7 @@ int main(int argc, char *argv[]) { WinNativeEventFilter::addFramelessWindow(hWnd_widget, &data_widget, true); widget.show(); +#ifdef QT_QUICK_LIB // Qt Quick example: MyQuickView view; const auto hWnd_qml = reinterpret_cast(view.winId()); @@ -175,8 +182,11 @@ int main(int argc, char *argv[]) { view.resize(800, 600); WinNativeEventFilter::addFramelessWindow(hWnd_qml, nullptr, true); view.show(); +#endif return QApplication::exec(); } +#ifdef QT_QUICK_LIB #include "main.moc" +#endif