From 5a00eece870bb044fead9d4fdb63cb95e5199f6b Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 30 Jun 2023 08:27:51 +0200 Subject: [PATCH] Added QQuickWidget to demo application for testing OpenGl QtQuick on Linux --- demo/MainWindow.cpp | 18 +++++++++++++++++- demo/demo.pro | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index fb0a51b..b074ff7 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) @@ -407,6 +408,17 @@ struct MainWindowPrivate return DockWidget; } + /** + * Create QQuickWidget for test for OpenGL and QQuick + */ + ads::CDockWidget *createQQuickWidget() + { + QQuickWidget *widget = new QQuickWidget(); + ads::CDockWidget *dockWidget = new ads::CDockWidget("Quick"); + dockWidget->setWidget(widget); + return dockWidget; + } + #ifdef Q_OS_WIN #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) @@ -424,7 +436,6 @@ struct MainWindowPrivate } #endif #endif - }; //============================================================================ @@ -557,6 +568,11 @@ void MainWindowPrivate::createContent() // Create image viewer DockWidget = createImageViewer(); DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget); + + // Create quick widget + DockWidget = createQQuickWidget(); + DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, true); + DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget); } diff --git a/demo/demo.pro b/demo/demo.pro index 3df699b..913b5be 100644 --- a/demo/demo.pro +++ b/demo/demo.pro @@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/.. TARGET = AdvancedDockingSystemDemo DESTDIR = $${ADS_OUT_ROOT}/lib -QT += core gui widgets +QT += core gui widgets quick quickwidgets include(../ads.pri)