File tree Expand file tree Collapse file tree 6 files changed +33
-12
lines changed Expand file tree Collapse file tree 6 files changed +33
-12
lines changed Original file line number Diff line number Diff line change 1616 run : |
1717 sudo apt-get update --fix-missing
1818 sudo apt-get install qt5-default
19- sudo apt-get install qtbase5-private-dev
19+ sudo apt-get install qtbase5-private-dev qtdeclarative5-dev
2020 - name : qmake
2121 run : qmake
2222 - name : make
Original file line number Diff line number Diff line change @@ -320,7 +320,9 @@ Screenshot Ubuntu:
320320## Build
321321
322322The Linux build requires private header files. Make sure that they are installed.
323- The library uses SVG icons, so ensure that Qt SVG support is installed.
323+ The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
324+ application creates a ` QQuickWidget ` for testing, so ensure that the required
325+ libraries are installed.
324326
325327### Qt5 on Ubuntu 18.04 or 20.04
326328
@@ -331,13 +333,13 @@ sudo apt install qt5-default qtbase5-private-dev
331333### Qt5 on Ubuntu 22.04
332334
333335``` bash
334- sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5
336+ sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
335337```
336338
337339### Qt6 on Ubuntu 22.04
338340
339341``` bash
340- sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6
342+ sudo apt install qt6-default qt6- base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
341343```
342344
343345Open the ` ads.pro ` file with QtCreator and start the build, that's it.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
22project (ads_demo VERSION ${VERSION_SHORT} )
33
44find_package (QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
5- find_package (Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
5+ find_package (Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets Quick QuickWidgets REQUIRED)
66if (WIN32 AND QT_VERSION_MAJOR LESS 6)
77 find_package (Qt${QT_VERSION_MAJOR} COMPONENTS AxContainer REQUIRED)
88endif ()
@@ -21,7 +21,9 @@ add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
2121target_include_directories (AdvancedDockingSystemDemo PRIVATE "${CMAKE_CURRENT_SOURCE_DIR} /../src" )
2222target_link_libraries (AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR} ::Core
2323 Qt${QT_VERSION_MAJOR} ::Gui
24- Qt${QT_VERSION_MAJOR} ::Widgets)
24+ Qt${QT_VERSION_MAJOR} ::Widgets
25+ Qt${QT_VERSION_MAJOR} ::Quick
26+ Qt${QT_VERSION_MAJOR} ::QuickWidgets)
2527if (WIN32 AND QT_VERSION_MAJOR LESS 6)
2628 target_link_libraries (AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR} ::AxContainer)
2729endif ()
Original file line number Diff line number Diff line change 6262#include < QPointer>
6363#include < QMap>
6464#include < QElapsedTimer>
65+ #include < QQuickWidget>
6566
6667
6768#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
@@ -407,6 +408,17 @@ struct MainWindowPrivate
407408 return DockWidget;
408409 }
409410
411+ /* *
412+ * Create QQuickWidget for test for OpenGL and QQuick
413+ */
414+ ads::CDockWidget *createQQuickWidget ()
415+ {
416+ QQuickWidget *widget = new QQuickWidget ();
417+ ads::CDockWidget *dockWidget = new ads::CDockWidget (" Quick" );
418+ dockWidget->setWidget (widget);
419+ return dockWidget;
420+ }
421+
410422
411423#ifdef Q_OS_WIN
412424#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
@@ -424,7 +436,6 @@ struct MainWindowPrivate
424436 }
425437#endif
426438#endif
427-
428439};
429440
430441// ============================================================================
@@ -559,6 +570,11 @@ void MainWindowPrivate::createContent()
559570 // Create image viewer
560571 DockWidget = createImageViewer ();
561572 DockManager->addDockWidget (ads::LeftDockWidgetArea, DockWidget);
573+
574+ // Create quick widget
575+ DockWidget = createQQuickWidget ();
576+ DockWidget->setFeature (ads::CDockWidget::DockWidgetClosable, true );
577+ DockManager->addDockWidget (ads::LeftDockWidgetArea, DockWidget);
562578}
563579
564580
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
22
33TARGET = AdvancedDockingSystemDemo
44DESTDIR = $${ADS_OUT_ROOT }/lib
5- QT += core gui widgets
5+ QT += core gui widgets quick quickwidgets
66
77include (../ads.pri )
88
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ struct FloatingDockContainerPrivate
378378 QWidget* MouseEventHandler = nullptr ;
379379 CFloatingWidgetTitleBar* TitleBar = nullptr ;
380380 bool IsResizing = false ;
381+ bool MousePressed = false ;
381382#endif
382383
383384 /* *
@@ -1336,12 +1337,12 @@ void CFloatingDockContainer::resizeEvent(QResizeEvent *event)
13361337 Super::resizeEvent (event);
13371338}
13381339
1339- static bool s_mousePressed = false ;
1340+
13401341// ============================================================================
13411342void CFloatingDockContainer::moveEvent (QMoveEvent *event)
13421343{
13431344 Super::moveEvent (event);
1344- if (!d->IsResizing && event->spontaneous () && s_mousePressed )
1345+ if (!d->IsResizing && event->spontaneous () && d-> MousePressed )
13451346 {
13461347 d->setState (DraggingFloatingWidget);
13471348 d->updateDropOverlays (QCursor::pos ());
@@ -1357,10 +1358,10 @@ bool CFloatingDockContainer::event(QEvent *e)
13571358 switch (e->type ())
13581359 {
13591360 case QEvent::WindowActivate:
1360- s_mousePressed = false ;
1361+ d-> MousePressed = false ;
13611362 break ;
13621363 case QEvent::WindowDeactivate:
1363- s_mousePressed = true ;
1364+ d-> MousePressed = true ;
13641365 break ;
13651366 default :
13661367 break ;
You can’t perform that action at this time.
0 commit comments