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 16
16
run : |
17
17
sudo apt-get update --fix-missing
18
18
sudo apt-get install qt5-default
19
- sudo apt-get install qtbase5-private-dev
19
+ sudo apt-get install qtbase5-private-dev qtdeclarative5-dev
20
20
- name : qmake
21
21
run : qmake
22
22
- name : make
Original file line number Diff line number Diff line change @@ -320,7 +320,9 @@ Screenshot Ubuntu:
320
320
## Build
321
321
322
322
The 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.
324
326
325
327
### Qt5 on Ubuntu 18.04 or 20.04
326
328
@@ -331,13 +333,13 @@ sudo apt install qt5-default qtbase5-private-dev
331
333
### Qt5 on Ubuntu 22.04
332
334
333
335
``` 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
335
337
```
336
338
337
339
### Qt6 on Ubuntu 22.04
338
340
339
341
``` 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
341
343
```
342
344
343
345
Open 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)
2
2
project (ads_demo VERSION ${VERSION_SHORT} )
3
3
4
4
find_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 )
6
6
if (WIN32 AND QT_VERSION_MAJOR LESS 6 )
7
7
find_package (Qt${QT_VERSION_MAJOR} COMPONENTS AxContainer REQUIRED )
8
8
endif ()
@@ -21,7 +21,9 @@ add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
21
21
target_include_directories (AdvancedDockingSystemDemo PRIVATE "${CMAKE_CURRENT_SOURCE_DIR} /../src" )
22
22
target_link_libraries (AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::Core
23
23
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 )
25
27
if (WIN32 AND QT_VERSION_MAJOR LESS 6 )
26
28
target_link_libraries (AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::AxContainer )
27
29
endif ()
Original file line number Diff line number Diff line change 62
62
#include < QPointer>
63
63
#include < QMap>
64
64
#include < QElapsedTimer>
65
+ #include < QQuickWidget>
65
66
66
67
67
68
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
@@ -407,6 +408,17 @@ struct MainWindowPrivate
407
408
return DockWidget;
408
409
}
409
410
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
+
410
422
411
423
#ifdef Q_OS_WIN
412
424
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
@@ -424,7 +436,6 @@ struct MainWindowPrivate
424
436
}
425
437
#endif
426
438
#endif
427
-
428
439
};
429
440
430
441
// ============================================================================
@@ -559,6 +570,11 @@ void MainWindowPrivate::createContent()
559
570
// Create image viewer
560
571
DockWidget = createImageViewer ();
561
572
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);
562
578
}
563
579
564
580
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
2
2
3
3
TARGET = AdvancedDockingSystemDemo
4
4
DESTDIR = $${ADS_OUT_ROOT }/lib
5
- QT += core gui widgets
5
+ QT += core gui widgets quick quickwidgets
6
6
7
7
include (../ads.pri )
8
8
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ struct FloatingDockContainerPrivate
378
378
QWidget* MouseEventHandler = nullptr ;
379
379
CFloatingWidgetTitleBar* TitleBar = nullptr ;
380
380
bool IsResizing = false ;
381
+ bool MousePressed = false ;
381
382
#endif
382
383
383
384
/* *
@@ -1336,12 +1337,12 @@ void CFloatingDockContainer::resizeEvent(QResizeEvent *event)
1336
1337
Super::resizeEvent (event);
1337
1338
}
1338
1339
1339
- static bool s_mousePressed = false ;
1340
+
1340
1341
// ============================================================================
1341
1342
void CFloatingDockContainer::moveEvent (QMoveEvent *event)
1342
1343
{
1343
1344
Super::moveEvent (event);
1344
- if (!d->IsResizing && event->spontaneous () && s_mousePressed )
1345
+ if (!d->IsResizing && event->spontaneous () && d-> MousePressed )
1345
1346
{
1346
1347
d->setState (DraggingFloatingWidget);
1347
1348
d->updateDropOverlays (QCursor::pos ());
@@ -1357,10 +1358,10 @@ bool CFloatingDockContainer::event(QEvent *e)
1357
1358
switch (e->type ())
1358
1359
{
1359
1360
case QEvent::WindowActivate:
1360
- s_mousePressed = false ;
1361
+ d-> MousePressed = false ;
1361
1362
break ;
1362
1363
case QEvent::WindowDeactivate:
1363
- s_mousePressed = true ;
1364
+ d-> MousePressed = true ;
1364
1365
break ;
1365
1366
default :
1366
1367
break ;
You can’t perform that action at this time.
0 commit comments