Added QQuickWidget to demo application for testing OpenGl QtQuick on Linux

This commit is contained in:
Uwe Kindler 2023-06-30 08:27:51 +02:00
parent 09e4e6fa5a
commit 5a00eece87
2 changed files with 18 additions and 2 deletions

View File

@ -62,6 +62,7 @@
#include <QPointer>
#include <QMap>
#include <QElapsedTimer>
#include <QQuickWidget>
#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);
}

View File

@ -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)