Compare commits

...

392 Commits
3.2.5 ... 3.8.3

Author SHA1 Message Date
Uwe Kindler
89ff0ad311 Added PRE Workbench to Showcase section 2022-07-29 13:57:08 +02:00
Uwe Kindler
6caeac2cb4 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2022-07-29 13:26:23 +02:00
Uwe Kindler
a0f0640c9f Fixed CustomCloseHandling for floating widgets 2022-07-29 13:25:14 +02:00
Mira Weller
d3f5879119 upgrade PyQt build (#404)
* Add new flags from 3.7 and 3.8

* remove unnecessarily deep namespace for Python module

* Update PyQt5 bindings build to new build system

* fix opening tabbed dockWidgets

* fix RESOURCES configuration for sip build

* increment build version

* remove leftovers

* add file names explicitly

* Update pyproject.toml
2022-07-19 13:17:45 +02:00
bjb-work
df74686287 call CDockWidget::closeDockWidgetInternal when close attempt and CustomCloseHandling (#438)
Co-authored-by: bjb-work <N/A>
2022-07-15 14:47:20 +02:00
Uwe Kindler
75d58b3ea3 Fixed #433 - Link issue of debug library with MSVC19 2022-07-04 07:41:26 +02:00
Uwe Kindler
bedd25021c Fixed issue #429 - Raise floating widget on toggleView() request 2022-06-17 08:31:24 +02:00
Uwe Kindler
0e566cb8a3 Fixed #420 - Floating docks title doesn't update
added tests for DockWidget->setWindowTitle() in demo application
2022-05-10 13:41:19 +02:00
Mira Weller
23f80334f6 Fix issue #415 (#416) 2022-05-03 08:47:31 +02:00
Uwe Kindler
7063909cee Added MetGem to showcase section 2022-04-21 16:29:55 +02:00
Igor Sirotin
a284e3bd65 CMake bugfixes [target alias, license install] (#412)
* Added alias to cmake library target

* Fixed CMake license install

Co-authored-by: Igor Sirotin <i.sirotin@1440.space>
2022-04-18 23:07:48 +02:00
ARSanderson
823887daf8 Tidy/doc updates (#410)
* minor updates to clarify when the dock manager should be created

* fixed typos
2022-04-12 07:58:18 +02:00
Uwe Kindler
78a4166e42 Updated CFloatingDockContainer::closeEvent() function to delete all dock widgets with DockWidgetDeleteOnClose flag set 2022-03-25 13:31:40 +01:00
tytan652
3d3b694040 Avoid calling XCB functions under non-XCB Linux platform (#405) 2022-03-24 19:43:39 +01:00
ruffianhy
ad06241c9d fix(issue-350): on RedHat/CentOS, sometimes there will be one more move event after user release their mouse which will cause the floating overlay can not be hide. Here we use the WindowActivate and WindowDeactivate event to check whether user release their mouse. (#401) 2022-03-13 21:22:07 +01:00
Uwe Kindler
6a1ea6c7de Fixed examples/sidebar bug 2022-03-04 13:43:21 +01:00
Uwe Kindler
931719c474 Updated README.md 2022-03-04 08:04:21 +01:00
Uwe Kindler
70ef00932a Updated marketplace description 2022-03-02 11:52:38 +01:00
Uwe Kindler
a1bc4a063b Updated qt_markectplace files 2022-03-02 11:48:51 +01:00
Uwe Kindler
abf7224582 Updated ads logo and icon 2022-03-02 11:31:25 +01:00
Uwe Kindler
7ab4c9af2e Handle StyleChange event in DockWidgetTab to update icon 2022-02-25 21:41:46 +01:00
kzl
d5fefaa35f while dockManager.removeDockWidget , the dockManager() returns null (#399) 2022-02-18 19:33:55 +01:00
Ben Hetherington
3c4af9c6af Add method to add dock widget to dock container (#398)
This adds a `addDockWidgetToContainer()` method to `CDockManager`, which allows a dock widget to be registered with the dock manager, and added to a specific container, even if that container doesn't currently have any `DockAreaWidget`s.

This is pretty much just a clone of `addDockWidget()`, but with the ability to specify a container widget instead of a dock area.
2022-02-06 08:21:43 +01:00
githubuser0xFFFF
12ec819aeb Update README.md
Updated CETONI Elements showcase
2022-01-02 21:55:00 +01:00
Uwe Kindler
e6fc1c14bd Added NotepadNext to the showcase section 2021-12-22 07:47:24 +01:00
SleepProgger
6fb45c055c Removed ContentMargin in DockContainer (#387) 2021-12-20 07:46:26 +01:00
Ralph Minderhoud
535b926095 CMake: Allow version to be explicitly set without requiring git (#384)
The main CMakeLists.txt was updated to allow explicitly setting the
version for the project by setting the `ADS_VERSION` variable (e.g.
cmake .. -DADS_VERSION=1.0.0).

The default behavior is to determine the version by reading the
information from git. Adding the option to override this variable at
configure time allows the library to be built outside of its git
repository, such as when the code is vendored directly into another
project and added using `add_subdirectory`.
2021-12-13 08:36:53 +01:00
Uwe Kindler
b15bc26a63 Some small coding style fixes 2021-12-12 17:28:11 +01:00
Uwe Kindler
1d90e8e823 Merge branch 'fix_issue_380' of https://github.com/jporcher/Qt-Advanced-Docking-System into jporcher-fix_issue_380 2021-12-12 17:19:27 +01:00
Jean Porcherot
6b3027401d Fix issue #380 and add example 2021-12-09 10:11:05 +01:00
githubuser0xFFFF
e35bd65a91 Update README.md 2021-12-07 11:01:26 +01:00
githubuser0xFFFF
8888f6800b Update README.md 2021-12-07 11:00:52 +01:00
Uwe Kindler
2afe62ec77 Fixed issue #378 - Don't show empty floating containers on startup 2021-12-06 09:42:12 +01:00
jporcher
4b27af959b Merge branch 'githubuser0xFFFF:master' into master 2021-12-06 07:57:29 +01:00
Ben Hetherington
0df1a41a1d Fix potential crash when restoring container state (#381)
This fixes a crash which could occur when restoring the state of a floating container to a non-floating container.

This was because `ads::CDockContainerWidget::RestoreState()` will unconditionally assume this is floating if the XML has the `Floating` boolean set, and will dereference `floatingWidget()`. If this isn't floating, `floatingWidget()` will return `nullptr`, leading to a crash when it's subsequently used.

Fixes #379.
2021-12-03 17:01:16 +01:00
anoy
21badd592e add QFlag operators (#376) 2021-11-26 19:09:09 +01:00
Uwe Kindler
a110d53a53 Fixed crash in DockFocusController
DockWidget pointers are now wrapped into QPointer to detect deleted
DockWidgets
2021-11-18 22:10:11 +01:00
Uwe Kindler
0270993782 Fixed error caused by broken merge request 2021-11-17 07:51:14 +01:00
Uwe Kindler
2c0d899b2a Fixed pixmap warning in ElidingLabel 2021-11-17 07:50:46 +01:00
Ben Hetherington
1abe101ef7 Prevent middle-click from closing unclosable tabs (#372)
This fixes a bug whereby you could close a dock widget by middle-clicking its tab, even if its `CDockWidget::DockWidgetClosable` flag is set to `false`.
2021-11-16 06:24:39 +01:00
Uwe Kindler
0ebc170cfa Fixed doc link to issue 365 2021-10-29 10:36:09 +02:00
Uwe Kindler
ee6ddfadc3 Documented DockWidget feature flags 2021-10-29 10:32:58 +02:00
Uwe Kindler
720b5f0c72 Added Plot Juggler to the showcase section 2021-10-29 10:02:09 +02:00
Uwe Kindler
aceabd8455 Added new and noteworthy for 3.8 release 2021-10-28 10:30:49 +02:00
Uwe Kindler
ab4869a0e1 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2021-10-22 11:47:44 +02:00
Uwe Kindler
adf5793ccd Fixed Windows Qt 5.15 build 2021-10-22 11:47:27 +02:00
Rodrigo Oliva
31e26c2c1c Fix crash when adding closed dock widgets to the manager. (#366)
Co-authored-by: Rodrigo Oliva <Rodrigo.Oliva@king.com>
2021-10-20 16:54:47 +02:00
Uwe Kindler
de05ddd203 Renamed RecreateContentsWidgetOnCloseAndOpen into DeleteContentOnClose 2021-10-14 13:57:06 +02:00
Uwe Kindler
03a8eaa44f Merge branch 'ff/editor/dev/widget_factory' of https://github.com/rolivav/Qt-Advanced-Docking-System into rolivav-ff/editor/dev/widget_factory 2021-10-14 13:18:54 +02:00
Uwe Kindler
48e79f12a7 Fixed Linux bug in DockFocusController.cpp 2021-10-11 22:05:37 +02:00
Uwe Kindler
89aa3d5251 Fixed null pointer bug in DockFocusController.cpp 2021-10-11 21:20:21 +02:00
Rodrigo Oliva
87b0596ebc Add feature to close tabs with the middle mouse button. (#360)
Co-authored-by: Rodrigo Oliva <Rodrigo.Oliva@king.com>
2021-10-11 20:33:56 +02:00
Rodrigo Oliva
a08857804a Add new flag that will delete the contained widget and recreate it from a factory when closing and opening the dock widget. 2021-10-10 21:37:16 +02:00
nmiglio
dbca6d79cf Update DockWidget.h (#364) 2021-10-08 19:40:57 +02:00
Francis Hart
a24221c002 Fix MSVC compiler warning C4275 (#361)
The CFloatingDockContainer is exported, but inherits from a base
class that is not exported. This triggers a compiler warning under
MSVC toolchain. This patch fixes the issue by exporting the
IFloatingWidget class.
2021-10-08 19:40:30 +02:00
githubuser0xFFFF
5f89dd0465 Update linux-builds.yml
Removed ubuntu 16.04 from GitHub workflow because it is not supported by GitHUb any longer
2021-10-05 06:56:51 +02:00
Lucas
0b82ff30fe Fix issue #351: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/351 (#357) 2021-10-01 15:30:33 +02:00
Nicolas Elie
130b0de646 Python Bindings: Fix findParent that was not working as expected (#349) 2021-09-06 20:48:17 +02:00
Nicolas Elie
b5b251dffb Update Python Bindings (#348)
* Update Python bindings

* Add X11Extras to setup.py for Linux builds

* Update Python Bindings

* Update Python bindings

* Update Python Bindings
2021-08-26 13:51:09 +02:00
Rodrigo Oliva
0c44accb44 Remove deprecation warning while building with Qt 5.15. (#344)
Co-authored-by: Rodrigo Oliva <Rodrigo.Oliva@king.com>
2021-08-23 19:47:15 +02:00
Uwe Kindler
bbdf0ef29d Added test for resizing of DockAera 2021-08-03 14:59:28 +02:00
Uwe Kindler
401e8cf492 Improved initial size of floating dock widget 2021-07-30 13:50:17 +02:00
Uwe Kindler
83cdc69fc8 Merge branch 'improve_focus_highlighting' 2021-07-28 14:14:25 +02:00
Uwe Kindler
1e3af06bb0 Fixed notifyFloatingWidgetDrop() function 2021-07-28 13:44:34 +02:00
Uwe Kindler
2c8abee668 Added some build instructions for Linux about required private header files 2021-07-28 12:14:37 +02:00
Uwe Kindler
5af7492b67 Changed DockFocusController to properly handle window activation 2021-07-27 12:22:31 +02:00
Uwe Kindler
8d1465a81f Added initial support for setting focus highlighting without uisng setFocus 2021-07-25 18:12:27 +02:00
githubuser0xFFFF
5ead4684f5 Update linux-builds.yml
Added qtbase-private-dev
2021-07-17 14:52:09 +02:00
Charles Cross
fc91502162 Removes dependency on QtX11Extras for Qt6.2-beta (#331)
* Removes dependency on QtX11Extras and implements placeholder solution with QtGUI private API

* Fixes CMakeLists.txt to work with Qt5 and Qt6

* Removes all other uses of X11extras

* Renames and moves x11 methods into ads::internal

* Fixes typo

* Adds gui-private to src.pro
2021-07-17 14:49:20 +02:00
Uwe Kindler
3a99bdcfb4 Added showcase for Ramses Composer 2021-07-14 11:05:04 +02:00
Uwe Kindler
487e23e190 Fixed MSVC build 2021-06-19 14:47:17 +02:00
Uwe Kindler
511132ee4f Fixxed issue #294 - Tab refresh problem with a QGLWidget 2021-06-17 20:32:45 +02:00
Uwe Kindler
edc89555bc Removed eclipse specific file 2021-06-17 20:32:12 +02:00
Rodrigo Oliva
ad30211dae Update icon label tooltip when the tab tooltip changes (#322)
Co-authored-by: Rodrigo Oliva <Rodrigo.Oliva@king.com>
2021-05-26 06:59:36 +02:00
Nick D'Ademo
48406da6ea fix building. (#323) 2021-05-25 18:12:24 +02:00
Rui Oliveira
aff0bd6e25 Add Qt6 support on CMake (#319) 2021-04-28 22:52:45 +02:00
jporcher
3969d28d92 Fix crash in dockindock (#317)
* Add dockdepth1 example

* Fix compilation (include assert.h)

* Replace dockdepth1 by dockindock

* Fix crash when dockindock example is closed. Due to code in dockindock supposed to fix memory leaks: now leaks were fixed in CDockManager (https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/307), the code from dockindock ends up deleting objects already deleted by parent.
2021-04-27 11:16:09 +02:00
Jean Porcherot
d0c100995e Fix crash when dockindock example is closed. Due to code in dockindock supposed to fix memory leaks: now leaks were fixed in CDockManager (https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/307), the code from dockindock ends up deleting objects already deleted by parent. 2021-04-27 10:05:07 +02:00
Jean Porcherot
f54e4c8ac2 Merge remote-tracking branch 'upstream/master' 2021-04-27 09:12:56 +02:00
Uwe Kindler
b39cd2d81b Fixed emptydockarea example 2021-04-27 07:47:03 +02:00
jporcher
0e8e563654 Add dockindock example (#308)
* Add dockdepth1 example

* Fix compilation (include assert.h)

* Replace dockdepth1 by dockindock
2021-04-21 06:37:19 +02:00
jporcher
2f041a0eed Fix memory leaks (#314) 2021-04-20 14:25:30 +02:00
Jean Porcherot
2c7b5982b5 Replace dockdepth1 by dockindock 2021-04-14 15:36:00 +02:00
Uwe Kindler
ffa0105d3e Fixed emission perspectiveListChanged signal after loading of perspective list and added perspectiveListLoaded signal 2021-04-13 07:05:17 +02:00
Jean Porcherot
bac0698581 Fix compilation (include assert.h) 2021-04-09 13:36:51 +02:00
Jean Porcherot
be3180df6f Add dockdepth1 example 2021-04-07 16:51:46 +02:00
Uwe Kindler
6179832a2b Updated Qt DesignStudio showcase image and video link 2021-03-03 22:51:58 +01:00
Walter Bormans
13853573ea Additional Qt keyword conversion. (#299)
This comit is an addtion to pull request #295. Not all Qt keywords were included.

Co-authored-by: Walter Bormans <walter.bormans@paradoxcat.com>
2021-01-22 06:18:34 +01:00
Uwe Kindler
b6b4c626e8 Fixed user-guide.md emptydockarea code to match the real example 2021-01-16 15:06:32 +01:00
Uwe Kindler
bd41ec1627 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2021-01-16 15:01:02 +01:00
Uwe Kindler
b54dab7df2 Fixed the empty dock area example to test procramatic docking with empty dock area 2021-01-16 15:00:44 +01:00
Walter Bormans
e66ef604a7 Removes reliance on special Qt keywords. (#295)
This allows Qt Advanced Docking system to be compiled with the QT_NO_KEYWORDS definition.
This can help avoid conflicts with other dependancies for a project.

Co-authored-by: Walter Bormans <walter.bormans@paradoxcat.com>
2021-01-15 09:08:27 +01:00
Uwe Kindler
e03674fd4b Fixed a typo in user-guide.md 2021-01-11 13:50:47 +01:00
Uwe Kindler
3f69fedd1f Added documentation for emptx dock area feature 2021-01-11 13:46:26 +01:00
Uwe Kindler
a614e3cc3d Fixed CDockAreaWidget::nextOpenDockWidget() function to properly return a DockWidget with tab if this is possible
Added new emptydockarea example
2021-01-11 11:07:03 +01:00
Uwe Kindler
ebde50b492 Fixed FloatingDockContainer Linux build for Qt6 2021-01-10 10:22:54 +01:00
Uwe Kindler
2a6bd306cb Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2021-01-09 19:03:14 +01:00
Uwe Kindler
8a27a5596b Added new CDockWidget flag CDockWidget::NoTab to hide the tab from the dock area title bar 2021-01-09 19:02:25 +01:00
Nicolas Elie
f835ffd978 Update Python bindings (#289)
* Update Python bindings

* Add X11Extras to setup.py for Linux builds

* Update Python Bindings

* Update Python bindings
2021-01-04 14:01:28 +01:00
Uwe Kindler
97215705f5 Improved documentation for Linux support 2021-01-03 18:16:38 +01:00
Uwe Kindler
6ee97e64d7 Disabled Qt6 build in appveyor - it does not work properly yet 2021-01-03 17:14:39 +01:00
Uwe Kindler
a1c4812619 Try to fix Qt6 build 2021-01-03 17:09:06 +01:00
Uwe Kindler
b0c8edbd82 Added Qt6 MinGW build to .appveyor.yml 2021-01-03 15:50:16 +01:00
Uwe Kindler
a4190ecbf0 Added missing ads.pri fle 2021-01-02 23:17:44 +01:00
Uwe Kindler
d8c6efaada Fixed signal connection of perspective combobox 2021-01-02 21:05:05 +01:00
Uwe Kindler
0312682e07 Fixed wrong pixmap is null test in ElidingLabel 2021-01-02 20:50:26 +01:00
Uwe Kindler
8d14068df7 Fixed QMouseEvent::globalPos() warning 2021-01-02 20:29:59 +01:00
Uwe Kindler
fe1d9a493f Fixed warning in centralwidget example because of missing svg file 2021-01-02 19:51:50 +01:00
Uwe Kindler
e55ad49db8 Created ads.pri to ease linking of ads library 2021-01-02 19:48:34 +01:00
Uwe Kindler
018ce2001e Fixed all Qt6 build issues 2021-01-02 18:06:45 +01:00
Uwe Kindler
c8fe4c46dd Fixed DockAreaWidget minimumSizeHint 2020-12-23 16:16:13 +01:00
Uwe Kindler
1781fa671d Updated build settings 2020-12-23 16:15:47 +01:00
Uwe Kindler
75910e910e Fixed centralwidget example to properly close all floating widgets on main window close 2020-11-26 08:07:31 +01:00
Uwe Kindler
899e06be1c Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-11-23 12:57:23 +01:00
spking11
66687dc8b6 Add utf-8 support for msvc within cmake. (#280)
Co-authored-by: spking11 <spking11@foxmail.com>
2020-11-23 12:55:19 +01:00
Uwe Kindler
b8fe620276 Merge branch 'master' into adddockwidget_fix 2020-11-23 08:04:11 +01:00
spking11
1a50ea9892 Add utf-8 support for msvc to resolve building error in some windows systems. (#277) 2020-11-21 17:29:36 +01:00
Uwe Kindler
0a096869fe Fixed adding of dock widgets to floating widget 2020-11-21 15:08:30 +01:00
Uwe Kindler
44dc76bd19 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-10-31 13:56:30 +01:00
Uwe Kindler
aedbaec497 Addes support for setting DockWidgetTab icon size via stylesheet 2020-10-31 13:56:16 +01:00
Uwe
04aa622111 Fixed static qmake build 2020-10-30 21:49:28 +01:00
Uwe
3564229482 Fixed CMake static build 2020-10-30 21:13:19 +01:00
githubuser0xFFFF
637db7f4f9 Update CMakeLists.txt 2020-10-27 18:50:54 +01:00
Uwe Kindler
f6d3d6d34a Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-10-27 15:07:37 +01:00
Uwe Kindler
92369bdb26 Fixed static CMake build for Linux 2020-10-27 15:04:54 +01:00
Nick D'Ademo
8f95447108 Fix. (#264) 2020-10-23 21:00:33 +02:00
Christian Seiler
0e3c3bab45 DockManager: add the ability to programmatically update splitter sizes (#266)
Add the ability to programmatically update splitter sizes. The user must
specify the dock area that is contained in a splitter and a list of
sizes. The list of sizes will be passed to the splitter that immediately
contains the specified dock area. If the dock area is not part of a
splitter the method will have no effect.

Co-authored-by: Christian Seiler <c.seiler@luxflux.de>
2020-10-23 20:59:50 +02:00
Christian Seiler
3a5c965306 Ensure that the stylesheet doesn't affect all QSplitter instances (#265)
The stylesheet should only change the style of ads::CDockSplitter
instances, but not all QSplitter instances. Otherwise all splitters
within any dock widget will also be affected and look different from
the default Qt style.

Co-authored-by: Christian Seiler <c.seiler@luxflux.de>
2020-10-21 22:07:41 +02:00
Christian Seiler
0c88457037 Fix CMake build on macOS (don't try to link against Qt's X11Extras) (#267)
macOS is identified as UNIX by CMake, but Qt doesn't actually use X11
there (and X11 support is not available by default anyway). Change the
condition that includes X11Extras to if (UNIX AND NOT APPLE) instead of
just if (UNIX) to mitigate that. This makes the build on macOS work
with CMake.

Co-authored-by: Christian Seiler <c.seiler@luxflux.de>
2020-10-21 22:05:36 +02:00
Uwe Kindler
46fa22dc6a Documented custom close handling 2020-10-13 21:24:04 +02:00
Uwe Kindler
f3d32399e5 Added ads::CDockWidget::DockWidgetForceCloseWithArea test to demo/MainWindow.cpp 2020-10-13 20:55:09 +02:00
Nicolas ELIE
b320bb17d1 Merge remote-tracking branch 'upstream/master' into forceclose 2020-10-02 11:04:18 +02:00
Nicolas Elie
81afe2d3cb Update Python Bindings again (#262)
* Update Python bindings

* Add X11Extras to setup.py for Linux builds

* Update Python Bindings
2020-10-01 19:14:48 +02:00
Uwe Kindler
5fad43377b Fixed a bug in restoreStateFromXml function
The function accessed the objectName from the CentralWidget even if there is no cental widget
2020-09-25 14:40:28 +02:00
Uwe Kindler
f543318232 Updated user-guide.md 2020-09-21 11:07:00 +02:00
Uwe Kindler
ab385a782a Updated user-guid 2020-09-21 11:02:38 +02:00
Uwe Kindler
c370875128 Properly implemented save and restore with central widget 2020-09-21 10:51:02 +02:00
Uwe Kindler
1c261515db Improved debug output in DockContainerWidget 2020-09-21 09:39:42 +02:00
Uwe Kindler
37cbae84ca Fixed debug output in FloatingDockContainer.cpp 2020-09-21 09:39:03 +02:00
Uwe Kindler
f5759716b4 Added support for perspectives to centralwidget example to test save and restore state functionality with central widget 2020-09-21 08:39:39 +02:00
Uwe Kindler
f645fe725a Added dockWidgetAdded signal to CDockManager 2020-09-18 08:25:47 +02:00
Uwe Kindler
fdedd7d92a Added focusedDockWidget() function to DockManager 2020-09-07 08:17:07 +02:00
Uwe Kindler
044a43d793 Updated user-guide.md 2020-09-07 08:16:30 +02:00
Uwe Kindler
6846c96146 Fixed some documentation typos 2020-09-03 15:31:11 +02:00
Uwe Kindler
8fe9461872 Removed stylesheet code from centralwidget/mainwindow.cpp 2020-09-03 15:25:44 +02:00
Uwe Kindler
fbde4edcd2 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-09-03 15:24:27 +02:00
Uwe Kindler
68742681f7 Added missing documentation images 2020-09-03 15:24:12 +02:00
Uwe Kindler
bbb3f99bc3 Added documentation for new features (central widget and native floating widgets on linux) to user-guide.md 2020-09-03 15:23:39 +02:00
Uwe Kindler
e0f6f3013f Updated centralwidget example 2020-09-03 15:23:05 +02:00
Uwe Kindler
6eb497fb64 Added test for dock manager flag EqualSplitOnInsertion to demo aplication 2020-09-03 15:22:43 +02:00
githubuser0xFFFF
ae15757765 Update .travis.yml
Fixex travis.yml parse error
2020-09-02 22:02:21 +02:00
githubuser0xFFFF
be294b4867 Update .travis.yml
Added libqt5x11extras5-dev to travis yml file
2020-09-02 21:25:54 +02:00
Uwe Kindler
70738f7549 Fixed Linux CMake build 2020-09-02 11:48:12 +02:00
Uwe Kindler
42dc529ce1 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-09-02 09:05:13 +02:00
Uwe Kindler
65058d3a48 Fixed issue #251 - Window momentarily flashes as floating widget 2020-09-02 09:04:59 +02:00
Nicolas Elie
48c4106b7f Update Python Bindings (#249)
* Update Python bindings

* Add X11Extras to setup.py for Linux builds
2020-09-01 16:06:43 +02:00
Uwe Kindler
175b48569f Removed Linux stuff from Mac build 2020-08-31 23:46:42 +02:00
Uwe Kindler
89c6abb5ce Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-08-31 23:29:52 +02:00
Uwe Kindler
55f23799bc Fixed CMake Windows build 2020-08-31 23:29:33 +02:00
Nicolas Elie
646211cc4c Merge branch 'master' into forceclose 2020-08-31 16:38:16 +02:00
githubuser0xFFFF
423bab9954 Update README.md
Some small changes in README.md
2020-08-31 16:30:29 +02:00
Uwe Kindler
831d90ebf5 Added X11Etras package to CMakeLists.txt 2020-08-31 16:20:36 +02:00
githubuser0xFFFF
abdc0dc0dd Update .travis.yml
Added  libqt5x11extras5-dev to travis build
2020-08-31 16:10:53 +02:00
Uwe Kindler
175c836c93 Added Qt5x11extras to CMake build 2020-08-31 13:04:15 +02:00
githubuser0xFFFF
76304172ab Update linux-builds.yml
Added x11extras to workflow
2020-08-31 13:00:27 +02:00
githubuser0xFFFF
0eb3978aee Update .travis.yml
Added x11extras
2020-08-31 12:51:42 +02:00
Uwe Kindler
73f42d55ca Updated linux stylesheets to fix titlebar issue on KDE 2020-08-31 11:57:30 +02:00
Uwe Kindler
059a055483 Renamed FloatingContainerForceCustomTitleBar to
FloatingWidgetForceQWidgetTitleBar
2020-08-31 09:48:32 +02:00
Uwe Kindler
dcf1ee393e Added support for CSS styling of custom widget titlebar close button 2020-08-31 09:38:18 +02:00
Uwe Kindler
04aecb3693 Some code cleanup, adjustments to match ADS coding style 2020-08-31 08:32:56 +02:00
helywin
533d174abc Finished implementing maximize for linux.
Added FloatingContainerForc*TitleBar to switch between native and custom titlebar.

Co-authored-by: SleepProgger <SleepProgger@users.noreply.github.com>
2020-08-29 05:03:21 +02:00
Uwe Kindler
48fb999bd0 Fix static build of centralwidget example 2020-08-24 15:46:51 +02:00
Uwe Kindler
5443e5f998 Merge branch 'centralwidget' 2020-08-24 13:44:19 +02:00
Uwe Kindler
543d226ba3 Fixed memory leak 2020-08-24 13:32:50 +02:00
Uwe Kindler
03b1848b43 Reverted changed 2020-08-24 13:25:20 +02:00
Uwe Kindler
05ab8d2067 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-08-24 13:23:40 +02:00
Uwe Kindler
c28a27c81c Reverted changes that cause application crash 2020-08-24 13:22:34 +02:00
Uwe Kindler
1b42048135 Fixed pure virtual function call 2020-08-24 11:33:40 +02:00
Uwe Kindler
bfe6b9bd26 Merge branch 'FixesPack_Parenting_Memory_leaks_etc' of https://github.com/ymiroshnyk/Qt-Advanced-Docking-System into ymiroshnyk-FixesPack_Parenting_Memory_leaks_etc 2020-08-24 11:22:50 +02:00
Uwe Kindler
08a8cee1c6 Updated centralwidget test 2020-08-24 11:14:58 +02:00
Uwe Kindler
835a532e75 Corrected constness of some functions, changed signatur of setCentralWidget function 2020-08-24 10:22:12 +02:00
Uwe Kindler
d383ade03c Merge branch 'Central-Widget' of https://github.com/hulswit/Qt-Advanced-Docking-System into hulswit-Central-Widget 2020-08-24 09:50:12 +02:00
Uwe Kindler
6d9c4cee02 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-08-24 09:47:34 +02:00
Yurii Miroshnyk
a565239c4a Fixes pack. Parenting, memory leaks, floating widgets deleting.
* DockWidget always has DockAreaWidget as parent. It's not necessary to make it nullptr. This fixes many bugs related to restoring inactive tabbed DockWidgets.

* Fixed memory leaks related to QBoxLayout::takeAt().

* Fixed algorithm of deleting remaining floating widgets after restore.
2020-08-21 19:24:55 +03:00
hulswit
ba69f3e6b9 CMake Fix 2020-08-21 13:42:52 +02:00
hulswit
14c29f695c Central widget update
Updated the setting of central widget with option to set where the possible old central widget will be placed. Fixed option of "unsetting" central widget by setting it to nullptr.
2020-08-21 13:30:59 +02:00
shelomentsev
703a9b3e12 Update the state of close button on titlebar and tabbar when CDockWidget::DockWidgetClosable changed. (#240) 2020-08-21 08:09:13 +02:00
shelomentsev
0eca1b0433 Memory leak (#242)
* Delete widgets without parents in CDockAreaLayout.

* Fixed the place where dock widgets witout parents are destroyed.
2020-08-21 08:08:33 +02:00
hulswit
691c9683ce Merge branch 'master' into Central-Widget 2020-08-20 16:37:05 +02:00
hulswit
1a11e5ddcd Central Widget concept added
Adde option to set a dock widget as central widget. It influences resizing behavior of the splitters. The central widget will be stretched with the main window and remaing dock widgets and threir respective areas will be resized only vertically if docked left or right  and horizontaly if docked top or bottom
2020-08-20 16:36:02 +02:00
shelomentsev
a4d281dbb6 Floating window fixes. (#239)
* Don't show a CFloatingDockContainer if all its CDockWidget were hidden before its first shown.

* Destroy empty CFloatingDockContainer when removing CDockWidget via removeDockWidget function.
2020-08-20 12:58:15 +02:00
shelomentsev
8361f90dce Delete widgets without parents in CDockAreaLayout. (#241) 2020-08-20 12:56:37 +02:00
Uwe Kindler
04b4ff8b4b Fixed typo in DockWidget documentation 2020-08-19 15:16:13 +02:00
Uwe Kindler
121248c3c5 Improved documentation 2020-08-19 13:49:20 +02:00
Uwe Kindler
c44d0c87e3 Fixed broken SimpleExample application 2020-08-19 13:38:53 +02:00
Uwe Kindler
c6cf9487ba Added maximize button svg icon 2020-08-18 20:36:02 +02:00
Uwe Kindler
c78cc17730 Properly persist dock area HideSingleWidgetTitleBar flag (and all other dock area flags) 2020-08-18 10:48:35 +02:00
Uwe Kindler
81a0234b05 Added HiveWE editor to showcase applications 2020-08-18 08:01:45 +02:00
Uwe Kindler
f72a8568c5 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-08-17 23:51:14 +02:00
Uwe Kindler
11aec65967 Properly persist the AllowedAreas state of CDockAreaWidget 2020-08-17 23:50:37 +02:00
Nicolas ELIE
40636d1e05 Add flag to DockWidget to force dw to be closed with the area that contains it 2020-08-04 11:50:32 +02:00
Nicolas Elie
75841415a3 Update Python bindings (#231)
* Update Python bindings to reflect changes in 8443414

* [Python] Fix no such signal error for signals with a reference to an object in ads namespace

* [Python] Update examples
2020-07-30 13:44:05 +02:00
Uwe Kindler
edc799bc54 Added D-Tect X software to showcase 2020-07-29 08:09:00 +02:00
githubuser0xFFFF
1d0b20337f Update README.md 2020-07-23 18:06:57 +02:00
Uwe Kindler
4a6d2d3514 Changed demos to delete the dock manager when the main window is closes to ensure that all floating widgets als "closed" (destroyed) 2020-07-22 11:28:41 +02:00
Some Guy
8443414ae3 Added setHideSingleWidgetTitleBar to DockWidgetArea 2020-07-21 08:20:17 +02:00
Uwe Kindler
81c99745d4 Fixed a bug when dragging a FloatingDragPreview from another floating widget over an empty MainWindow 2020-07-13 09:08:39 +02:00
Uwe Kindler
d6831caea4 Some refatoring in DockFocusController to improve code 2020-07-13 08:43:51 +02:00
Uwe Kindler
aa25e1fd56 Improved emission of focusedDockWidgetChanged signal to ensure, that the application can restore the focus of the focused application dock widget content 2020-07-13 08:41:30 +02:00
Uwe Kindler
0459aff34f Cleanup of debug messages in DockFocusController 2020-07-10 22:08:28 +02:00
Uwe Kindler
aeb0a27401 Improved code documentation 2020-07-08 08:10:27 +02:00
Uwe Kindler
50e3ef3dd8 Fixed stealing of focus by tab close button 2020-07-08 08:08:50 +02:00
Uwe Kindler
9974256d71 Fixed double emission of focusedDockWidgetChanged() signal 2020-07-07 14:38:03 +02:00
Uwe Kindler
8cf4134125 Some changes to ensure emission of focusedDockWidgetChanged signal 2020-07-06 08:22:48 +02:00
Uwe Kindler
ef5b22c616 Merge branch 'master' into focus_changed_fix 2020-07-06 07:35:08 +02:00
Uwe Kindler
42161c807a Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-07-05 22:29:38 +02:00
Uwe Kindler
acfc96f57c Properly update DockAreaTabBar geometry if tab text changed 2020-07-05 22:29:13 +02:00
Uwe Kindler
e6e83d5775 Added test for CDockWidget::setWindowTitle function 2020-07-05 21:48:48 +02:00
Nicolas Elie
5b2bc2297b Update Python bindings and demo to reflect recent changes (#218)
* Generate Python stubs file for linters

* Sort members of ads namespace in generated __init__.py

* Fix pyi generatation in setup.py if building inplace

* Update sip files and demo
2020-07-04 17:07:48 +02:00
Uwe Kindler
2de3e7e3be Deferred focusedDockWidgetChanged signal until dock widget becomes visible 2020-07-03 23:24:20 +02:00
Uwe Kindler
0d242297ff Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-07-03 22:22:52 +02:00
Uwe Kindler
e2080b5cfc Restored default dock manager config flag settings 2020-07-03 22:22:00 +02:00
Uwe Kindler
679fa81f6d Added new CDockWidget feature flag focusable 2020-07-03 14:55:33 +02:00
Nicolas Elie
6d0f14e1a5 Generate Python stubs file for linters (#214)
* Generate Python stubs file for linters

* Sort members of ads namespace in generated __init__.py
2020-07-02 07:47:18 +02:00
Uwe Kindler
281127c2c3 Merge remote-tracking branch 'remotes/origin/issue212' 2020-07-01 07:48:36 +02:00
Uwe Kindler
8e621f1f20 Properly reparent TabWidget to DockWidget if TabWidget is removed from TabBar 2020-06-30 16:34:59 +02:00
Uwe Kindler
0948f73bf8 Properly reset DockManager pointer when removing DockWidget from DockManager 2020-06-30 11:45:23 +02:00
Uwe Kindler
4bc1a18db2 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-06-30 10:00:03 +02:00
Uwe Kindler
80eb628ea3 Fixed naming of the dock area titlebar actions to be consistent 2020-06-30 09:59:42 +02:00
Uwe Kindler
d811915a0c Reset DockArea pointer of DockWidget when removing DockWidget from DockArea 2020-06-29 22:11:37 +02:00
Hannes Schulze
0225563b46 Fix Undefined Behavior in LastAddedAreaCache (#211) 2020-06-28 21:07:17 +02:00
Uwe Kindler
da20405a6a Fixed a compiler warning 2020-06-26 11:34:17 +02:00
Uwe Kindler
ace6d69695 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-06-26 11:19:58 +02:00
Uwe Kindler
7baf0f90e8 Converted dock content creation functions to member functions to allow ui access 2020-06-26 11:19:37 +02:00
Uwe Kindler
2ad92ce958 Removed superfluous code to fix issue #209 2020-06-26 11:18:46 +02:00
Nick D'Ademo
50c4a8ed48 Update CMakeLists.txt (#204)
Pass header files to add_library() so they appear in the 'qtadvanceddocking' Visual Studio project.
Add path to header files in PUBLIC include build interface so the 'qtadvanceddocking' target can be built in-source in a CMake project.
2020-06-19 20:01:48 +02:00
githubuser0xFFFF
59d6a64098 Update README.md 2020-06-18 09:31:14 +02:00
Uwe Kindler
3de877fe56 Updated linux stylesheet
Default linux style uses now the provided SVG buttons for the floating widget title bar close button
2020-06-18 09:21:46 +02:00
Uwe Kindler
e2cebd9dcf Updated stylesheet to provide uniform look of icons for all platforms
added detach-button icon
2020-06-18 08:29:41 +02:00
Uwe Kindler
58744408f0 Switched dock area close button icon to ads specific svg icon 2020-06-14 16:25:18 +02:00
Uwe Kindler
e36655a7ab Fixed wrong current index when removing a widget from CDockAreaLayout 2020-06-14 16:12:56 +02:00
Uwe Kindler
ffed6a9c5f Merged pull request #201 but made it configurable via config flag 2020-06-14 10:39:07 +02:00
Davide Faconti
38d8e6aa25 fix 2020-06-13 17:22:25 +02:00
Davide Faconti
c109ef836a use equal splitter size for widget added programmatically 2020-06-13 16:59:13 +02:00
Uwe Kindler
caa1a9f330 Stylesheet update
Updated stylesheet to use svg icon for close button instead of system icon
2020-06-11 08:36:01 +02:00
Uwe Kindler
e71884b23d Replaced configFlags().testFlag() with testConfigFlag() to improve code readibility 2020-06-11 08:06:37 +02:00
Uwe Kindler
d04c386948 Splitted stylesheets into default and focus_highlighting to properly support both use cases 2020-06-11 07:43:06 +02:00
Uwe Kindler
6a25de327c Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-06-10 16:20:22 +02:00
Uwe Kindler
e63d1b1683 Fixed a bug that caused invisible TabWidget for dock widgets that are not part of a restored state 2020-06-10 16:07:42 +02:00
Nicolas Elie
fa2ab356e1 Update PyQt bindings for 3.5.0 (#198) 2020-06-10 15:08:31 +02:00
Uwe Kindler
80f92e5697 Added note about the new focus highlighting feature on the project page 2020-06-10 07:41:14 +02:00
Uwe Kindler
0c13402516 Added documentation for FocusHighlighting flag 2020-06-10 07:16:35 +02:00
Uwe Kindler
97e3d72566 Disabled focus highliighting in demo application 2020-06-09 22:00:46 +02:00
Uwe Kindler
682aaf66eb Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-06-09 21:58:12 +02:00
Uwe Kindler
c939df73fa Merge branch 'focused_dockwidget' 2020-06-09 21:57:23 +02:00
Uwe Kindler
fdf169ce9a Fixed docking of floating widgets for MacOS 2020-06-09 20:29:19 +02:00
githubuser0xFFFF
4b730a4949 Update README.md 2020-06-09 15:39:16 +02:00
Uwe Kindler
788c357cc0 Added missing README.md changes 2020-06-09 15:35:02 +02:00
Uwe Kindler
e3844b8d6c Added Python section to README.md 2020-06-09 15:32:00 +02:00
Uwe Kindler
ff3fcdcacd Removed debug output 2020-06-09 14:40:13 +02:00
Uwe Kindler
a9268e6bf7 Fixed build issues and improved styling
Improved styling of close buttons and focused close buttons
2020-06-07 17:28:23 +02:00
Uwe Kindler
0227bd1786 Added icon for proper styling of focused close icon 2020-06-07 17:19:07 +02:00
Uwe Kindler
227037e42a Added new close button SVG icon 2020-06-07 15:20:24 +02:00
Uwe Kindler
cd495a14ec Fixed MSVC compiler warning 2020-06-07 15:20:08 +02:00
Uwe Kindler
312a8cf500 Enabled ClickFocus for CDockWidget to support focussing in case the content does not support it
Renamed FocusStyling to FocusHighlighting
2020-06-06 14:59:03 +02:00
Uwe Kindler
2fc8bbe9c9 Added mising DockFocusController files 2020-06-05 21:03:47 +02:00
Uwe Kindler
f5c4b26aab Moved focus related functionality into CDockFocusController class to keep the dock manager code clean 2020-06-05 20:42:43 +02:00
Uwe Kindler
c4d2d72e92 Added activateWindow() call in CFloatingDockCiontainer::showEvent
This is required to properly style the floating widget that contains the currently focused widget
2020-06-05 13:40:36 +02:00
Uwe Kindler
f90f0b0427 Properly implemented focusedDockWidgetChanged() signal 2020-06-05 12:14:26 +02:00
Uwe Kindler
d360b4ced2 Merge branch 'master' into focused_dockwidget 2020-06-05 07:40:39 +02:00
Uwe Kindler
f074ea9d67 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-06-05 07:40:10 +02:00
Uwe Kindler
2e8137ad85 Fixed setting of CDockingStateReader file version - use internal file version instead of user file version 2020-06-05 07:39:51 +02:00
Uwe Kindler
a65b1bdcaf Removed new dropped signals 2020-06-05 07:27:44 +02:00
Uwe Kindler
4041aa72cc Implemented proper support for setting floating widget focused widget 2020-06-05 06:55:43 +02:00
Hugo Slepicka
4d2de7bb2a FIX: Update Python bindings for 3.4.2 and current master. (#193)
* FIX: Update python bindings for 3.4.2.

* FIX: Try to fix windows build.

* FIX: Add const at nativeEvent argument.

* FIX: Adjusting sip bindings for changes from 8b6df4aaa5.
2020-06-04 23:55:02 +02:00
Uwe Kindler
bcb7118710 Fixed typos 2020-06-04 20:48:59 +02:00
Uwe Kindler
45390506dd Continued implementation 2020-06-04 20:40:23 +02:00
Uwe Kindler
f58a3d4401 Change to support loading of older files without UserVersion atribute 2020-06-03 19:53:17 +02:00
Uwe Kindler
a3e979a8ad Disabled setFocus in CDockWidget::setActiveTab 2020-06-03 19:49:57 +02:00
Uwe Kindler
adb72737e8 Merge branch 'version_fix' into focused_dockwidget 2020-06-03 17:53:05 +02:00
Uwe Kindler
e626a7e302 Merge branch 'master' into focused_dockwidget 2020-06-03 17:52:46 +02:00
Uwe Kindler
8b6df4aaa5 Fixed saveState() and restoreState() version handling to work like the function from QMainWindow 2020-06-03 07:25:09 +02:00
Uwe Kindler
ccf8ea9d1e Try to fix appveyour build problem 2020-05-27 15:26:36 +02:00
Uwe Kindler
dfb8543aee Properly handle Escape key in native Window event handling function if event WM_EXITSIZEMOVE occurs 2020-05-27 13:28:29 +02:00
Uwe Kindler
277e06627b Removed eclipe project file, Added VisualStudio.gitignore to .gitignore 2020-05-27 12:42:59 +02:00
Uwe Kindler
ea9b39a9dd Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-05-26 06:41:58 +02:00
Uwe Kindler
1848ffa35a Properly reset widget pointer to nullptr in takeWidget() 2020-05-26 06:41:40 +02:00
Luca
c53be0e97d Modernised CMake build files and CI configs (#185)
* Modernised CMake build files and CI configs

Fixed include formats

* Fixed build errors and warnings

* Fixes to allow CMake find_package
2020-05-24 09:14:33 +02:00
Uwe Kindler
ae999f132e Improved focus styling 2020-05-23 14:45:49 +02:00
Uwe Kindler
9aa958e8b0 Made all focus related code optional - only if FocusStyling flag is enabled 2020-05-23 11:17:31 +02:00
Uwe Kindler
5652c8440e Added new CDockManger config flag FocusStyling 2020-05-23 11:10:03 +02:00
Uwe Kindler
26f4c9b049 Merge branch 'focused_dockwidget' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System into focused_dockwidget 2020-05-22 21:30:10 +02:00
Uwe Kindler
ce11fa9d10 Merge branch 'master' into focused_dockwidget 2020-05-22 21:28:02 +02:00
Uwe Kindler
6a393955cd Removed debug output 2020-05-22 21:18:59 +02:00
Uwe Kindler
6b5f364864 Fixed issue #179 - appearance of drop indicators then Windows option "Show window contents while dragging" is
FloatingDragPreview.cpp: moved code from moveEvent into moveFloating function to remove indirection and to simplify code
Moved code from moveEvent() function into moveFloating() to remove indirection and to simplify code
Implemented Windows drag handling with native WM_ nonclient area messages
2020-05-22 19:43:50 +02:00
Uwe Kindler
333d2920db Merge remote-tracking branch 'origin/focused_dockwidget' into focused_dockwidget 2020-05-22 19:26:54 +02:00
Uwe Kindler
25eb02d07c Added support for focus styling of CFloatingWidgetTitleBra 2020-05-22 19:23:40 +02:00
Uwe Kindler
3b2f940efa Fixed windows build 2020-05-21 10:32:31 +02:00
Uwe Kindler
9dcbe91f02 Merge branch 'focused_dockwidget' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System into focused_dockwidget 2020-05-21 08:29:55 +02:00
Uwe Kindler
4da810ba7c Added window()->activateWindow() dropFloatingWidget() function 2020-05-20 14:20:27 +02:00
Uwe Kindler
819f1effc5 Added support for focus styling of CFloatingWidgetTitleBra 2020-05-19 22:53:52 +02:00
Uwe Kindler
ba94ef3493 Merge branch 'master' into focused_dockwidget 2020-05-19 20:51:19 +02:00
Uwe Kindler
36bcbded54 Fixed showing of dock area when inserting a dock widget into a hidden dock area
fixed setting of DockAreaTabBar index to prevent showing of tab 0 when inserting a dock widget into an area with no current index tab
2020-05-19 20:26:57 +02:00
Uwe Kindler
0127fd89a3 Merge branch 'master' into focused_dockwidget 2020-05-17 12:26:22 +02:00
Uwe Kindler
eee9ebb41d Fixed an issue that caused wrong inserten order of dock widget when dropping a floating widget to the left or top container drop area 2020-05-17 12:21:52 +02:00
Uwe Kindler
79cb889d83 Improved focus style handling 2020-05-17 08:51:58 +02:00
Patrick Stewart
cdb8926673 Add missing override (#176) 2020-05-15 19:48:19 +02:00
githubuser0xFFFF
b3307d81ca Update user-guide.md
Fixed typo
2020-05-15 12:41:58 +02:00
Uwe Kindler
40374178c9 Added Style documentation section to user-guide.md 2020-05-15 12:40:49 +02:00
Uwe Kindler
516465aefb Fixed issue #173 - tab changes position when redocking it to the same position 2020-05-15 12:25:22 +02:00
Uwe Kindler
e760d3e967 Improved focus handling when dropping a dock widget 2020-05-14 09:06:04 +02:00
Uwe Kindler
c5333a2414 Merge branch 'master' into focused_dockwidget 2020-05-14 07:34:31 +02:00
Uwe Kindler
0d406ece7c Fixed MSVC compiler warning because of using class instead of struct in a friend declaration 2020-05-14 07:31:03 +02:00
Uwe Kindler
7c03b1b936 Fixed gcc compiler warning caused by supefluous extra semi-colon by all QT_FORWARD_DECLARE_CLASS statements 2020-05-14 07:27:48 +02:00
Uwe Kindler
427b5a0be0 Added nullptr check to fix potential issue #171 - nullptr access closing a CFloatingDockContainer 2020-05-14 07:20:30 +02:00
Uwe Kindler
3011c0c030 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-05-14 06:46:47 +02:00
Uwe Kindler
b8b6db632c Added a new showcase application to README.md - ezEditor 2020-05-14 06:46:31 +02:00
Patrick Stewart
04ca4ae674 Support for Qt built with the -qtnamespace configure option (#170) 2020-05-13 23:26:05 +02:00
Uwe Kindler
3a0c2a3113 Some refactorings in onFocusChanged() to improve code readibility 2020-05-13 22:51:44 +02:00
Uwe Kindler
789f78354a Merge branch 'master' into focused_dockwidget 2020-05-13 21:27:21 +02:00
Uwe Kindler
14f5426299 Merge branch 'jankrassnigg-master' 2020-05-13 16:58:48 +02:00
Uwe Kindler
d418d92ef4 Added missing DockAreaTitleBar_p.h to src.pro 2020-05-13 16:57:36 +02:00
Jan Krassnigg
726d73b2c2 Missing cmake change 2020-05-13 16:47:43 +02:00
Jan Krassnigg
115e67edc4 Moved private classes into dedicated header 2020-05-13 16:40:43 +02:00
n-elie
4a8b5dd7ab Update PyQt bindings (#168)
* Fix include header in sidebar example

* Update SIP files and Python examples

Co-authored-by: K Lauer <klauer@users.noreply.github.com>

Co-authored-by: K Lauer <klauer@users.noreply.github.com>
2020-05-13 16:05:00 +02:00
Uwe Kindler
4c75168152 Improved focus setting when closing a dock area widget 2020-05-13 13:18:05 +02:00
Uwe Kindler
64a2024513 Removed debug output 2020-05-13 11:20:32 +02:00
Uwe Kindler
056e1ef947 Improved highlighting focused dock widget 2020-05-13 11:17:43 +02:00
Jan Krassnigg
a9965bf6dc Moved CTitleBarButton and CSpacerWidget declaration into DockAreaTitleBar.h
This gets rid of the need to MOC DockAreaTitleBar.h and DockAreaTitleBar.cpp and it means that DockAreaTitleBar.cpp does not need to #include "DockAreaTitleBar.moc" anymore, which is a file that is generated by the build system and therefore may be named differently when using a custom build system.
2020-05-13 08:04:50 +02:00
Uwe Kindler
f54869fbf7 Improved setting of CDockWidgetTab focus 2020-05-11 16:29:58 +02:00
Uwe Kindler
835a20f03f Merge branch 'master' into focused_dockwidget 2020-05-11 15:50:47 +02:00
Uwe Kindler
aa7976dac6 Fixed issue #164 - Single DockArea cannot be split 2020-05-11 09:03:28 +02:00
Uwe Kindler
067338ef23 Enable styling of focused dockwidget 2020-05-10 19:30:34 +02:00
Uwe Kindler
b7e7c0ccc3 Added new test action for adding docked editor widget to test fix for issue #148 2020-05-07 16:14:59 +02:00
Uwe Kindler
cb18bc0d91 Fixed visibility issue when adding dock widget after all other dock widgets have ben closed in the GUI - fix for GitHub issue #148 2020-05-07 16:13:59 +02:00
Uwe Kindler
07464ce05c Added new SidebarExample 2020-05-07 14:39:02 +02:00
Uwe Kindler
62ce9dca5d Fixed small bug in FloatingDragPreview that caused flashing of hidden overlay when dragging the last visible dock widget in non opaque docking mode 2020-05-07 14:20:31 +02:00
Uwe Kindler
985d164cd1 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-05-04 15:14:50 +02:00
Uwe Kindler
0c9a1ee3f2 Fixed a bug in FloatingDragPreview that prevents dock widget from floating when dragging over another dock widget 2020-05-04 15:14:35 +02:00
githubuser0xFFFF
0bd20883df Update user-guide.md 2020-04-30 19:51:35 +02:00
githubuser0xFFFF
1d8a1e9bb8 Update user-guide.md 2020-04-29 07:15:06 +02:00
Uwe Kindler
3adabaec81 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-04-29 07:13:57 +02:00
Uwe Kindler
5695d0d305 Added documentation for HideSingleCentralWidgetTitleBar configuration flag 2020-04-29 07:13:42 +02:00
farmovit
f1792820e1 Fix memory leak (#152) 2020-04-28 15:17:02 +02:00
Uwe Kindler
e091be0b76 Restored default demo application settings 2020-04-28 07:19:06 +02:00
Uwe Kindler
e4c5eac146 Added FloatingContainerHasWidgetIcon documentation to user-guide.md 2020-04-28 06:51:34 +02:00
Uwe Kindler
cbd2fcb0d3 Fixed CDockWidget::setWidget function to test for QAbstractScrollArea instead of QScrollArea
Now setWidget properly supports ItemViews like QTreeView or QTableView
2020-04-27 16:51:46 +02:00
Uwe Kindler
47029190dc Fixed wrong display of center drop area when dragging over invisible dock area title bar 2020-04-27 15:27:34 +02:00
Uwe Kindler
80aee638c9 Fixed bug that drop overlay sometimes was not visible when moving the drag preview over a floating window
This bug was caused by accidentally using hide() instead of hideOverlay()
2020-04-27 15:20:27 +02:00
Uwe Kindler
cdc863e962 Fixed dropping of FloatingDragPreview into center of dock container with only one single visible dock area
If this happens the dropped dock widget needs to get tabified
2020-04-27 14:00:37 +02:00
Uwe Kindler
ef855e3843 Added documentation for FloatingContainerHasWidgetTitle flag 2020-04-27 08:58:50 +02:00
Uwe Kindler
842d417e8d Fixed crash when trying to make a CDockWidget floating in non-opaque mode if the CDockWidget is not floatable 2020-04-27 07:54:43 +02:00
Uwe Kindler
52a64350e6 Fixed DockWidgetTab to provide the right size when starting floating 2020-04-27 07:48:15 +02:00
Uwe Kindler
79831d482b Added QtCreator IDE to showcases 2020-04-24 10:08:18 +02:00
Uwe Kindler
a4fbaf413b Fixed source documentation of DockAreaDynamicTabsMenuButtonVisibility flag 2020-04-24 09:31:13 +02:00
Uwe Kindler
b982947cf4 Added documentation for DockAreaDynamicTabsMenuButtonVisibility to user-guide.md 2020-04-24 09:30:06 +02:00
Uwe Kindler
bc2ac48eab Fixed default elide mode in DockWidgetTab.cpp 2020-04-24 09:29:33 +02:00
Uwe Kindler
ddbdb83821 Added documentation for DockAreaHideDisabledButtons flag 2020-04-22 12:03:58 +02:00
Uwe Kindler
85626c9a21 Added Q_INIT_RESOURCE(ads) for static builds 2020-04-22 06:25:01 +02:00
Uwe Kindler
8bf8309949 Added configuration flags DockAreaHasTabsMenuButton and DockAreaHasUndockButton to user-guide.md 2020-04-20 16:25:30 +02:00
Uwe Kindler
528f48e6d1 Added documentation for AlwaysShowTabs configuration flag 2020-04-19 12:08:01 +02:00
Uwe Kindler
28dfcc2a62 Updated user-guide images 2020-04-17 10:43:28 +02:00
Uwe Kindler
0bfa2eb88e Updated documentation picture cfg_flag_DragPreviewHasWindowFrame_true.png 2020-04-17 10:28:46 +02:00
Uwe Kindler
27bbe9f7f5 Added additional configuration flags to user-guide.md 2020-04-17 10:25:32 +02:00
Uwe Kindler
92dbcec7c0 Added missing image to user-guide.md 2020-04-15 20:19:54 +02:00
Uwe Kindler
2be2f2bc6f Added DragPreviewIsDynamic section to user-guide.md 2020-04-15 20:18:20 +02:00
Uwe Kindler
a083d778bd Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2020-04-15 13:13:39 +02:00
Uwe Kindler
d4770a7d41 Continued writing of user-guide.md - added further configuration flags documentation 2020-04-15 13:10:03 +02:00
githubuser0xFFFF
37365caf8e Update user-guide.md 2020-04-14 22:55:47 +02:00
Uwe Kindler
3f5bfc3139 Added new sections to user-guide.md 2020-04-14 20:00:59 +02:00
Uwe Kindler
4ac7291831 Merge branch 'documentation' 2020-04-14 17:24:44 +02:00
Uwe Kindler
b5e9096387 Fixed cmake build 2020-04-14 17:24:34 +02:00
Uwe Kindler
19c8e9ffcc Started creation of user-guide.md 2020-04-14 17:23:01 +02:00
Uwe Kindler
6a815a836c Implemented status dialog in demo application to test several CDockWidget functions 2020-04-14 16:07:00 +02:00
Uwe Kindler
277d3fffe4 Removed unused slot 2020-04-13 22:40:14 +02:00
Uwe Kindler
9502e7bf6c Added new features to sip/DockManager.sip and DockWidget.sip for Python integration 2020-04-13 22:35:35 +02:00
Uwe Kindler
8aae6bf70b Added DockWidget functions setAsCurrentTab, raise, isCurrentTab, isTabbed 2020-04-13 22:16:47 +02:00
Uwe Kindler
a668fe2f73 Added new config flag HideSingleCentralWidgetTitleBar to enble a central single dock widget in the main dock container (dock manager) without titlebar
Added a test case for the new flag to MainWindow.cpp
2020-04-12 01:05:20 +02:00
Uwe Kindler
12bb7b73e9 Fixed CDockContainerWidget::hasTopLevelDockWidget() and CDockContainerWidget::topLevelDockArea() to work properly also for the main non floating dock container 2020-04-12 00:56:41 +02:00
Uwe Kindler
dbf90a4233 Fixed ElidingLabel to properly support Qt::ElideNone
added setElideMode function to CDockWidgetTab
2020-04-10 21:06:43 +02:00
Uwe Kindler
19331ebe2b Added comment to showFullScreen that this only works for Windows 2020-04-10 12:54:37 +02:00
Uwe Kindler
16a149b436 Fixed wrong call to base class function in DockWidget::showNormal 2020-04-10 12:35:47 +02:00
Uwe Kindler
1f995299f0 Added setFullScreen(), setNormal() and isFullScreen() function to CDockWidget to be more compatible to QDockWidget 2020-04-09 23:16:50 +02:00
Uwe Kindler
7a17aba42d Fixed takeWidget() function and fixed setWidget() function to handle case if there is already a content widget 2020-04-09 21:44:21 +02:00
Uwe Kindler
9fe1dd6a88 Updated README.md toc 2020-04-09 21:16:04 +02:00
Uwe Kindler
7c2d1891a2 Added showcase section to README.md 2020-04-01 12:31:37 +02:00
Uwe Kindler
998fe9fa11 Added Q_OS_WIN around the installation of the eventFilter in FloatingDockContainer because it is only required for Windows 2020-04-01 08:36:33 +02:00
Uwe Kindler
28dc374fc2 Added support for proper handling on non client escape key presses on Windows 2020-04-01 08:12:45 +02:00
Uwe Kindler
1b6e449b4a Merge branch 'dev' 2020-03-28 19:32:59 +01:00
Uwe Kindler
0e88467f94 DockAreaWidget now properly considers minimumSizeHint() of contained DockWidgets
Added setMinimumSizeHintMode() test in demo MainWindow
2020-03-28 19:32:07 +01:00
Uwe Kindler
d0f4ce3248 Added support to adhere the minimumSizeHint() of the content widget of a dock widget 2020-03-26 07:09:01 +01:00
Uwe Kindler
542618fd4e Removed unneeded includes from DockManager.h and fixed includes to use "" instead of <> to prvent conflicts with external libraries 2020-03-26 06:53:13 +01:00
209 changed files with 13308 additions and 2837 deletions

View File

@@ -1,36 +1,28 @@
version: '2.3.2.{build}'
version: '{build}'
branches:
only:
- master
image: Visual Studio 2015
clone_depth: 1
image: Visual Studio 2017
environment:
global:
# Appveyor doesn't have Qt 12 yet
LatestLTSQtVersion: 5.9
LatestQtVersion: 5.11
LatestQtVersion: 5.13
matrix:
# Latest version of Qt, dll, 64bit, MSVC 2015, qmake
- QT5: C:\Qt\%LatestQtVersion%\msvc2015_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
targetPlatform: amd64
use_mingw: "false"
use_static: "false"
use_cmake: "false"
# 32 bit builds
# MSVC 2015 builds
# Dynamic Library builds
# LTS version of Qt, dll, 32bit, MSVC 2015, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: x86
use_mingw: "false"
use_static: "false"
use_cmake: "false"
# LTS version of Qt, dll, 32bit, MSVC 2015, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: x86
use_mingw: "false"
use_static: "false"
@@ -38,15 +30,15 @@ environment:
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 32bit, MSVC 2015, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: x86
use_mingw: "false"
use_static: "true"
use_cmake: "false"
# LTS version of Qt, static, 32bit, MSVC 2015, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: x86
use_mingw: "false"
use_static: "true"
@@ -56,15 +48,15 @@ environment:
# MinGW builds
# Dynamic Library builds
# LTS version of Qt, dll, 32bit, MinGW, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\mingw53_32
COMPILER: C:\Qt\Tools\mingw530_32
- QT5: C:\Qt\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "false"
use_cmake: "false"
# LTS version of Qt, dll, 32bit, MinGW, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\mingw53_32
COMPILER: C:\Qt\Tools\mingw530_32
- QT5: C:\Qt\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "false"
@@ -72,15 +64,15 @@ environment:
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 32bit, MinGW, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\mingw53_32
COMPILER: C:\Qt\Tools\mingw530_32
- QT5: C:\Qt\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "true"
use_cmake: "false"
# LTS version of Qt, static, 32bit, MinGW, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\mingw53_32
COMPILER: C:\Qt\Tools\mingw530_32
- QT5: C:\Qt\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "true"
@@ -92,15 +84,15 @@ environment:
# MSVC 2015 builds
# Dynamic Library builds
# LTS version of Qt, dll, 64bit, MSVC 2015, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: amd64
use_mingw: "false"
use_static: "false"
use_cmake: "false"
# LTS version of Qt, dll, 64bit, MSVC 2015, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: amd64
use_mingw: "false"
use_static: "false"
@@ -108,15 +100,15 @@ environment:
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 64bit, MSVC 2015, qmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: amd64
use_mingw: "false"
use_static: "true"
use_cmake: "false"
# LTS version of Qt, static, 64bit, MSVC 2015, cmake
- QT5: C:\Qt\%LatestLTSQtVersion%\msvc2015_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- QT5: C:\Qt\%LatestQtVersion%\msvc2017_64
COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
targetPlatform: amd64
use_mingw: "false"
use_static: "true"
@@ -129,10 +121,9 @@ matrix:
fast_finish: true
before_build:
- set PATH=%COMPILER%\bin;%QT5%\bin;%PATH%
- set originalWD=%CD%
- call "%QT5%\bin\qtenv2.bat"
- cd %originalWD%
- cd /D %originalWD%
- if %use_mingw%==false call "%COMPILER%\vcvarsall.bat" %targetPlatform%
- if %use_static%==true (set USESTATIC=ON) else (set USESTATIC=OFF)
- if %use_mingw%==true (set CMAKEGENERATOR="MinGW Makefiles") else (set CMAKEGENERATOR="NMake Makefiles")
@@ -140,8 +131,8 @@ before_build:
- if %use_mingw%==true set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
build_script:
- if %use_cmake%==true mkdir .\build
- if %use_cmake%==true cd .\build
- if %use_cmake%==true mkdir build
- if %use_cmake%==true cd build
- if %use_cmake%==true cmake --version
- if %use_cmake%==true cmake -G %CMAKEGENERATOR% -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_EXAMPLES=ON -DCMAKE_DEBUG_POSTFIX=d -DBUILD_STATIC=%USESTATIC% -DCMAKE_INSTALL_PREFIX="./installed" ../
- if %use_cmake%==true cmake --build .

359
.cproject
View File

@@ -1,359 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base.88699815" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.base.519267520" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.mingw.base"/>
<builder id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1200539104" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.base.1438677059" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.base">
<option id="gnu.both.asm.option.include.paths.403127333" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/demo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtCore&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtWidgets&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1249325593" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.933824900" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1947822681" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base">
<option id="gnu.cpp.compiler.option.include.paths.349616932" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/demo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtCore&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtWidgets&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.56223209" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1318830536" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.389117097" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base">
<option id="gnu.c.compiler.option.include.paths.1871729602" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/demo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/QtAdvancedDockingSystem/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtCore&quot;"/>
<listOptionValue builtIn="false" value="&quot;${QTDIR}/include/QtWidgets&quot;"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.806805509" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1568363924" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1734874312" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.985493173" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.266071128" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="QtAdvancedDockingSystem.null.1346550114" name="QtAdvancedDockingSystem"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="Build all" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../ads.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../src/src.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/example" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/example" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/example" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/example" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../example/example.pro</buildArguments>
<buildTarget/>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/example" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/demo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/demo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/demo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/demo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../demo/demo.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/demo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/AdvancedDockingSystemDemo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/AdvancedDockingSystemDemo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/AdvancedDockingSystemDemo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/AdvancedDockingSystemDemo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../AdvancedDockingSystemDemo/AdvancedDockingSystemDemo.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/AdvancedDockingSystemDemo" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/AdvancedDockingSystemDemo_v2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/AdvancedDockingSystemDemo_v2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/AdvancedDockingSystemDemo_v2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/AdvancedDockingSystemDemo_v2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../AdvancedDockingSystemDemo_v2/AdvancedDockingSystemDemo_v2.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/AdvancedDockingSystemDemo_v2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Build all" path=" build/AdvancedDockingSystem" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Clean" path=" build/AdvancedDockingSystem" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Debug Build" path=" build/AdvancedDockingSystem" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j6</buildArguments>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="qmake" path=" build/AdvancedDockingSystem" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>qmake</buildCommand>
<buildArguments>-recursive ../../AdvancedDockingSystem/src.pro</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="Release Build" path=" build/AdvancedDockingSystem" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments>-j4</buildArguments>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1947822681;cdt.managedbuild.tool.gnu.cpp.compiler.input.1318830536">
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.389117097;cdt.managedbuild.tool.gnu.c.compiler.input.1568363924">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View File

@@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-18.04, ubuntu-16.04]
os: [ubuntu-latest, ubuntu-20.04, ubuntu-18.04]
runs-on: ${{ matrix.os }}
@@ -16,6 +16,7 @@ jobs:
run: |
sudo apt-get update --fix-missing
sudo apt-get install qt5-default
sudo apt-get install qtbase5-private-dev
- name: qmake
run: qmake
- name: make

367
.gitignore vendored
View File

@@ -17,3 +17,370 @@ Makefile
*.pyd
__pycache__
PyQtAds/rc.py
/.cproject
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/ build
/Settings.ini
.vscode/settings.json
/.settings

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@@ -2,9 +2,6 @@ language: cpp
# gcc is clang on mac
compiler: gcc
git:
depth: 1
matrix:
fast_finish: true
include:
@@ -21,74 +18,152 @@ matrix:
packages:
- qt55base
- qt55tools
- gcc-6
- g++-6
- libc6-i386
- gcc-9
- g++-9
script:
- PATH="/opt/qt55/bin:$PATH"
- CXX="g++-6"
- CC="gcc-6"
- CXX="g++-9"
- CC="gcc-9"
- qt55-env.sh
- qmake
- make
- make install
- name: Ubuntu qmake dll
os: linux
dist: xenial
dist: bionic
group: stable
services:
- xvfb
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt-5.12.0-xenial'
- sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
update: true
packages:
- qt512base
- qt512tools
- gcc-6
- g++-6
- qt514base
- qt514tools
- gcc-9
- g++-9
- libc6-i386
- libgl-dev
- libgl1-mesa-dev
- mesa-common-dev
script:
- PATH="/opt/qt512/bin:$PATH"
- CXX="g++-6"
- CC="gcc-6"
- qt512-env.sh
- PATH="/opt/qt514/bin:$PATH"
- CXX="g++-9"
- CC="gcc-9"
- qt514-env.sh
- qmake
- make
- make install
- name: Ubuntu qmake static
os: linux
dist: xenial
dist: bionic
group: stable
addons:
services:
- xvfb
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt-5.12.0-xenial'
- sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
update: true
packages:
- qt512base
- qt512tools
- gcc-6
- g++-6
- qt514base
- qt514tools
- gcc-9
- g++-9
- libc6-i386
- libgl-dev
- libgl1-mesa-dev
- mesa-common-dev
script:
- PATH="/opt/qt512/bin:$PATH"
- CXX="g++-6"
- CC="gcc-6"
- qt512-env.sh
- PATH="/opt/qt514/bin:$PATH"
- CXX="g++-9"
- CC="gcc-9"
- qt514-env.sh
- qmake "CONFIG+=adsBuildStatic"
- make
- make install
- name: Ubuntu CMake dll
os: linux
dist: bionic
group: stable
services:
- xvfb
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
update: true
packages:
- qt514base
- qt514tools
- gcc-9
- g++-9
- libc6-i386
- libgl-dev
- libgl1-mesa-dev
- mesa-common-dev
script:
- PATH="/opt/qt514/bin:$PATH"
- CXX="g++-9"
- CC="gcc-9"
- qt514-env.sh
- mkdir ./build
- cd ./build
- cmake --version
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_STATIC=OFF -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STATIC=OFF -DBUILD_EXAMPLES=ON -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- name: Ubuntu CMake Static
os: linux
dist: bionic
group: stable
services:
- xvfb
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
update: true
packages:
- qt514base
- qt514tools
- gcc-9
- g++-9
- libc6-i386
- libgl-dev
- libgl1-mesa-dev
- mesa-common-dev
script:
- PATH="/opt/qt514/bin:$PATH"
- CXX="g++-9"
- CC="gcc-9"
- qt514-env.sh
- mkdir ./build
- cd ./build
- cmake --version
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_STATIC=ON -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STATIC=ON -DBUILD_EXAMPLES=ON -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- name: macOS CMake dll
os: osx
osx_image: xcode10.1
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
@@ -107,7 +182,8 @@ matrix:
- cmake --build . --target install
- name: macOS CMake static
os: osx
osx_image: xcode10.1
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
@@ -126,7 +202,8 @@ matrix:
- cmake --build . --target install
- name: macOS qmake dll
os: osx
osx_image: xcode10.1
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
@@ -139,7 +216,8 @@ matrix:
- make install
- name: macOS qmake static
os: osx
osx_image: xcode10.1
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:

View File

@@ -1,129 +1,43 @@
cmake_minimum_required(VERSION 3.3)
set(ads_VERSION "2.3.2")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
project(QtAdvancedDockingSystem VERSION ${ads_VERSION})
cmake_minimum_required(VERSION 3.5)
# By default, the version information is extracted from the git index. However,
# we can override this behavior by explicitly setting ADS_VERSION and
# skipping the git checks. This is useful for cases where this project is being
# used independently of its original git repo (e.g. vendored in another project)
if(NOT ADS_VERSION)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
include(GetGitRevisionDescription)
git_describe(GitTagVersion --tags)
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${GitTagVersion}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${GitTagVersion}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${GitTagVersion}")
set(VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
else()
string(REGEX MATCHALL "[\.]" VERSION_DOT_MATCHES ${ADS_VERSION})
list(LENGTH VERSION_DOT_MATCHES VERSION_DOT_COUNT)
if(VERSION_DOT_COUNT EQUAL 2)
set(VERSION_SHORT ${ADS_VERSION})
else()
message(FATAL_ERROR "ADS_VERSION must be in major.minor.patch format, e.g. 3.8.1. Got ${ADS_VERSION}")
endif()
endif()
project(QtADS LANGUAGES CXX VERSION ${VERSION_SHORT})
option(BUILD_STATIC "Build the static library" OFF)
option(BUILD_EXAMPLES "Build the examples" ON)
set(REQUIRED_QT_VERSION 5.5.0)
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
message(STATUS "Found Qt ${Qt5Core_VERSION}")
set(ads_INCLUDE ${ads_INCLUDE} ${Qt5Core_INCLUDE_DIRS})
set(ads_INCLUDE ${ads_INCLUDE} "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(ads_LIBS ${ads_LIBS} ${Qt5Core_LIBRARIES})
set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ${Qt5Core_COMPILE_DEFINITIONS})
set(ads_LIBS ${ads_LIBS} ${Qt5Gui_LIBRARIES})
set(ads_INCLUDE ${ads_INCLUDE} ${Qt5Gui_INCLUDE_DIRS})
set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ${Qt5Gui_COMPILE_DEFINITIONS})
set(ads_LIBS ${ads_LIBS} ${Qt5Widgets_LIBRARIES})
set(ads_INCLUDE ${ads_INCLUDE} ${Qt5Widgets_INCLUDE_DIRS})
set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ${Qt5Widgets_COMPILE_DEFINITIONS})
if(BUILD_STATIC)
set(CMAKE_STATIC_LIBRARY_SUFFIX "_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
set(ads_SRCS
src/ads_globals.cpp
src/DockAreaTabBar.cpp
src/DockAreaTitleBar.cpp
src/DockAreaWidget.cpp
src/DockContainerWidget.cpp
src/DockManager.cpp
src/DockOverlay.cpp
src/DockSplitter.cpp
src/DockWidget.cpp
src/DockWidgetTab.cpp
src/DockingStateReader.cpp
src/ElidingLabel.cpp
src/FloatingDockContainer.cpp
src/FloatingDragPreview.cpp
src/IconProvider.cpp
src/DockComponentsFactory.cpp
src/ads.qrc
src/linux/FloatingWidgetTitleBar.cpp
)
set(ads_INSTALL_INCLUDE
src/ads_globals.h
src/DockAreaTabBar.h
src/DockAreaTitleBar.h
src/DockAreaWidget.h
src/DockContainerWidget.h
src/DockManager.h
src/DockOverlay.h
src/DockSplitter.h
src/DockWidget.h
src/DockWidgetTab.h
src/DockingStateReader.h
src/ElidingLabel.h
src/FloatingDockContainer.h
src/FloatingDragPreview.h
src/IconProvider.h
src/DockComponentsFactory.h
src/linux/FloatingWidgetTitleBar.h
)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(ads_PlatformDir "x86")
else()
set(ads_PlatformDir "x64")
endif()
if(BUILD_STATIC)
add_library(qtadvanceddocking STATIC ${ads_SRCS})
target_compile_definitions(qtadvanceddocking PUBLIC ADS_STATIC)
else()
add_library(qtadvanceddocking SHARED ${ads_SRCS})
set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ADS_SHARED_EXPORT)
endif()
install(FILES ${ads_INSTALL_INCLUDE}
DESTINATION include
COMPONENT headers
)
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/gnu-lgpl-v2.1.md"
DESTINATION license
COMPONENT license
)
install(TARGETS qtadvanceddocking
EXPORT adsTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
INCLUDES DESTINATION include
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("adsConfigVersion.cmake"
VERSION ${ads_VERSION}
COMPATIBILITY SameMajorVersion
)
install(EXPORT adsTargets
FILE adsTargets.cmake
NAMESPACE ads::
DESTINATION lib/cmake/ads
)
install(FILES "adsConfig.cmake" "${CMAKE_BINARY_DIR}/adsConfigVersion.cmake"
DESTINATION lib/cmake/ads
)
add_subdirectory(src)
target_include_directories(qtadvanceddocking PUBLIC
"$<BUILD_INTERFACE:${ads_INCLUDE}>"
$<INSTALL_INTERFACE:include>
)
target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS})
target_compile_definitions(qtadvanceddocking PRIVATE ${ads_COMPILE_DEFINE})
set_target_properties(qtadvanceddocking PROPERTIES
VERSION ${ads_VERSION}
EXPORT_NAME "QtAdvancedDockingSystem"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)
if(BUILD_EXAMPLES)
add_subdirectory(example)
add_subdirectory(examples)
add_subdirectory(demo)
endif()

View File

@@ -1,10 +0,0 @@
from .ads import ads
from .._version import *
import inspect
for name, member in inspect.getmembers(ads):
if not name.startswith('_'):
globals()[name] = member
del ads

View File

@@ -1,9 +0,0 @@
from .rc import *
from ._version import get_versions
__version__ = get_versions()['version']
short_version = __version__
version = __version__
full_version = __version__
git_revision = get_versions()['full-revisionid']
release = not get_versions()['dirty']
del get_versions

View File

@@ -1,520 +0,0 @@
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.18 (https://github.com/warner/python-versioneer)
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""
def get_config():
"""Create, populate and return the VersioneerConfig() object."""
# these strings are filled in when 'setup.py versioneer' creates
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "None"
cfg.versionfile_source = "PyQtAds/_version.py"
cfg.verbose = False
return cfg
class NotThisMethod(Exception):
"""Exception raised if a method is not valid for the current scenario."""
LONG_VERSION_PY = {}
HANDLERS = {}
def register_vcs_handler(vcs, method): # decorator
"""Create decorator to mark a method as the handler of a VCS."""
def decorate(f):
"""Store f in HANDLERS[vcs][method]."""
if vcs not in HANDLERS:
HANDLERS[vcs] = {}
HANDLERS[vcs][method] = f
return f
return decorate
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
env=None):
"""Call the given command(s)."""
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, env=env,
stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
break
except EnvironmentError:
e = sys.exc_info()[1]
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % dispcmd)
print(e)
return None, None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None, None
stdout = p.communicate()[0].strip()
if sys.version_info[0] >= 3:
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % dispcmd)
print("stdout was %s" % stdout)
return None, p.returncode
return stdout, p.returncode
def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an appropriately named parent directory
"""
rootdirs = []
for i in range(3):
dirname = os.path.basename(root)
if dirname.startswith(parentdir_prefix):
return {"version": dirname[len(parentdir_prefix):],
"full-revisionid": None,
"dirty": False, "error": None, "date": None}
else:
rootdirs.append(root)
root = os.path.dirname(root) # up a level
if verbose:
print("Tried directories %s but none started with prefix %s" %
(str(rootdirs), parentdir_prefix))
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs):
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
# _version.py.
keywords = {}
try:
f = open(versionfile_abs, "r")
for line in f.readlines():
if line.strip().startswith("git_refnames ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["refnames"] = mo.group(1)
if line.strip().startswith("git_full ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["full"] = mo.group(1)
if line.strip().startswith("git_date ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["date"] = mo.group(1)
f.close()
except EnvironmentError:
pass
return keywords
@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(keywords, tag_prefix, verbose):
"""Get version information from git keywords."""
if not keywords:
raise NotThisMethod("no keywords at all, weird")
date = keywords.get("date")
if date is not None:
# git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
# datestamp. However we prefer "%ci" (which expands to an "ISO-8601
# -like" string, which we must then edit to make compliant), because
# it's been around since git-1.5.3, and it's too difficult to
# discover which version we're using, or to work around using an
# older one.
date = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
refnames = keywords["refnames"].strip()
if refnames.startswith("$Format"):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set([r.strip() for r in refnames.strip("()").split(",")])
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
# expansion behaves like git log --decorate=short and strips out the
# refs/heads/ and refs/tags/ prefixes that would let us distinguish
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
print("discarding '%s', no digits" % ",".join(refs - tags))
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
# sorting will prefer e.g. "2.0" over "2.0rc1"
if ref.startswith(tag_prefix):
r = ref[len(tag_prefix):]
if verbose:
print("picking %s" % r)
return {"version": r,
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": None,
"date": date}
# no suitable tags, so version is "0+unknown", but full hex is still there
if verbose:
print("no suitable tags, using unknown + full revision id")
return {"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": "no suitable tags", "date": None}
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
"""Get version from 'git describe' in the root of the source tree.
This only gets called if the git-archive 'subst' keywords were *not*
expanded, and _version.py hasn't already been rewritten with a short
version string, meaning we're inside a checked out source tree.
"""
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
if rc != 0:
if verbose:
print("Directory %s not under git control" % root)
raise NotThisMethod("'git rev-parse --git-dir' returned error")
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match", "%s*" % tag_prefix],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
describe_out = describe_out.strip()
full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if full_out is None:
raise NotThisMethod("'git rev-parse' failed")
full_out = full_out.strip()
pieces = {}
pieces["long"] = full_out
pieces["short"] = full_out[:7] # maybe improved later
pieces["error"] = None
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
# TAG might have hyphens.
git_describe = describe_out
# look for -dirty suffix
dirty = git_describe.endswith("-dirty")
pieces["dirty"] = dirty
if dirty:
git_describe = git_describe[:git_describe.rindex("-dirty")]
# now we have TAG-NUM-gHEX or HEX
if "-" in git_describe:
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
# tag
full_tag = mo.group(1)
if not full_tag.startswith(tag_prefix):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
% (full_tag, tag_prefix))
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix):]
# distance: number of commits since tag
pieces["distance"] = int(mo.group(2))
# commit: short hex revision ID
pieces["short"] = mo.group(3)
else:
# HEX: no tags
pieces["closest-tag"] = None
count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
cwd=root)
pieces["distance"] = int(count_out) # total number of commits
# commit date: see ISO-8601 comment in git_versions_from_keywords()
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
cwd=root)[0].strip()
pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
return pieces
def plus_or_dot(pieces):
"""Return a + if we don't already have one, else return a ."""
if "+" in pieces.get("closest-tag", ""):
return "."
return "+"
def render_pep440(pieces):
"""Build up version string, with post-release "local version identifier".
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Exceptions:
1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += plus_or_dot(pieces)
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
else:
# exception #1
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
return rendered
def render_pep440_post(pieces):
"""TAG[.postDISTANCE[.dev0]+gHEX] .
The ".dev0" means dirty. Note that .dev0 sorts backwards
(a dirty tree will appear "older" than the corresponding clean one),
but you shouldn't be releasing software with -dirty anyways.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += plus_or_dot(pieces)
rendered += "g%s" % pieces["short"]
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += "+g%s" % pieces["short"]
return rendered
def render_pep440_old(pieces):
"""TAG[.postDISTANCE[.dev0]] .
The ".dev0" means dirty.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
return rendered
def render_git_describe(pieces):
"""TAG[-DISTANCE-gHEX][-dirty].
Like 'git describe --tags --dirty --always'.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render_git_describe_long(pieces):
"""TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render(pieces, style):
"""Render the given version pieces into the requested style."""
if pieces["error"]:
return {"version": "unknown",
"full-revisionid": pieces.get("long"),
"dirty": None,
"error": pieces["error"],
"date": None}
if not style or style == "default":
style = "pep440" # the default
if style == "pep440":
rendered = render_pep440(pieces)
elif style == "pep440-pre":
rendered = render_pep440_pre(pieces)
elif style == "pep440-post":
rendered = render_pep440_post(pieces)
elif style == "pep440-old":
rendered = render_pep440_old(pieces)
elif style == "git-describe":
rendered = render_git_describe(pieces)
elif style == "git-describe-long":
rendered = render_git_describe_long(pieces)
else:
raise ValueError("unknown style '%s'" % style)
return {"version": rendered, "full-revisionid": pieces["long"],
"dirty": pieces["dirty"], "error": None,
"date": pieces.get("date")}
def get_versions():
"""Get version information or return default if unable to do so."""
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
# __file__, we can work backwards from there to the root. Some
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
# case we can only use expanded keywords.
cfg = get_config()
verbose = cfg.verbose
try:
return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
verbose)
except NotThisMethod:
pass
try:
root = os.path.realpath(__file__)
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for i in cfg.versionfile_source.split('/'):
root = os.path.dirname(root)
except NameError:
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to find root of source tree",
"date": None}
try:
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
try:
if cfg.parentdir_prefix:
return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
except NotThisMethod:
pass
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to compute version", "date": None}

313
README.md
View File

@@ -1,53 +1,102 @@
# Advanced Docking System for Qt
![ukraine](doc/ukraine.jpg)
[![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
![logo](doc/ads_logo.svg)
------------------
[![Build status](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/workflows/linux-builds/badge.svg)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions?query=workflow%3Alinux-builds)
[![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
[![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md)
Qt Advanced Docking System lets you create customizable layouts using a full
featured window docking system similar to what is found in many popular
integrated development environments (IDEs) such as Visual Studio.
[What's new](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
[Documentation](doc/user-guide.md)
Qt Advanced Docking System lets you create customizable layouts using a full
featured window docking system similar to what is found in many popular
integrated development environments (IDEs) such as Visual Studio.
[![Video Advanced Docking](doc/advanced-docking_video.png)](https://www.youtube.com/watch?v=7pdNfafg3Qc)
Everything is implemented with standard Qt functionality without any
platform specific code. Basic usage of QWidgets and QLayouts and using basic
styles as much as possible.
## New and Noteworthy
This work is based on and inspired by the
[Advanced Docking System for Qt](https://github.com/mfreiholz/Qt-Advanced-Docking-System)
from Manuel Freiholz. I did an almost complete rewrite of his code to improve
code quality, readibility and to fix all issues from the issue tracker
of his docking system project.
The [release 3.8](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
adds the following features:
- option to close tabs with the middle mouse button
- `DeleteContentOnClose` flag for dynamic deletion and creation of dock widget
content
The [release 3.7](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.7.2)
adds the following features:
- support for **Qt6.**
- support for [empty dock area](doc/user-guide.md#empty-dock-area)
The [release 3.6](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.6.3)
adds some nice new features:
- support for [central widget](doc/user-guide.md#central-widget) concept
![Central Widget](doc/central_widget.gif)
- support for [native floating widgets](doc/user-guide.md#floatingcontainerforcenativetitlebar-linux-only) on Linux
![FloatingContainerForceNativeTitleBar true](doc/cfg_flag_FloatingContainerForceNativeTitleBar_true.png)
Both features are contributions from ADS users. Read the [documentation](doc/user-guide.md)
to learn more about both new features.
The [release 3.5](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.5.0)
adds the new [focus highlighting](doc/user-guide.md#focushighlighting) feature.
This optional feature enables highlighting of the focused dock widget like you
know it from Visual Studio.
![FocusHighlighting](doc/cfg_flag_FocusHighlighting.gif)
[learn more...](doc/user-guide.md#focushighlighting)
## Features
### Overview
- [Advanced Docking System for Qt](#advanced-docking-system-for-qt)
- [Features](#features)
- [Overview](#overview)
- [Docking everywhere - no central widget](#docking-everywhere---no-central-widget)
- [Docking inside floating windows](#docking-inside-floating-windows)
- [Grouped dragging](#grouped-dragging)
- [Perspectives for fast switching of the complete main window layout](#perspectives-for-fast-switching-of-the-complete-main-window-layout)
- [Opaque and non-opaque splitter resizing](#opaque-and-non-opaque-splitter-resizing)
- [Opaque and non-opaque undocking](#opaque-and-non-opaque-undocking)
- [Tab-menu for easy handling of many tabbed dock widgets](#tab-menu-for-easy-handling-of-many-tabbed-dock-widgets)
- [Many different ways to detach dock widgets](#many-different-ways-to-detach-dock-widgets)
- [Supports deletion of dynamically created dock widgets](#supports-deletion-of-dynamically-created-dock-widgets)
- [Tested Compatible Environments](#tested-compatible-environments)
- [Windows](#windows)
- [macOS](#macos)
- [Linux](#linux)
- [Build](#build)
- [Getting started / Example](#getting-started--example)
- [Developers](#developers)
- [License information](#license-information)
- [Alternative Docking System Implementations](#alternative-docking-system-implementations)
- [KDDockWidgets](#kddockwidgets)
- [QtitanDocking](#qtitandocking)
- [Donation](#donation)
- [New and Noteworthy](#new-and-noteworthy)
- [Features](#features)
- [Overview](#overview)
- [Docking everywhere - no central widget](#docking-everywhere---no-central-widget)
- [Docking inside floating windows](#docking-inside-floating-windows)
- [Grouped dragging](#grouped-dragging)
- [Perspectives for fast switching of the complete main window layout](#perspectives-for-fast-switching-of-the-complete-main-window-layout)
- [Opaque and non-opaque splitter resizing](#opaque-and-non-opaque-splitter-resizing)
- [Opaque and non-opaque undocking](#opaque-and-non-opaque-undocking)
- [Tab-menu for easy handling of many tabbed dock widgets](#tab-menu-for-easy-handling-of-many-tabbed-dock-widgets)
- [Many different ways to detach dock widgets](#many-different-ways-to-detach-dock-widgets)
- [Supports deletion of dynamically created dock widgets](#supports-deletion-of-dynamically-created-dock-widgets)
- [Python PyQt5 Bindings](#python-pyqt5-bindings)
- [Tested Compatible Environments](#tested-compatible-environments)
- [Supported Qt Versions](#supported-qt-versions)
- [Windows](#windows)
- [macOS](#macos)
- [Linux](#linux)
- [Build](#build)
- [Getting started / Example](#getting-started--example)
- [Developers](#developers)
- [License information](#license-information)
- [Alternative Docking System Implementations](#alternative-docking-system-implementations)
- [KDDockWidgets](#kddockwidgets)
- [QtitanDocking](#qtitandocking)
- [Donation](#donation)
- [Showcase](#showcase)
- [Qt Creator IDE](#qt-creator-ide)
- [Qt Design Studio](#qt-design-studio)
- [CETONI Elements](#cetoni-elements)
- [ezEditor](#ezeditor)
- [D-Tect X](#d-tect-x)
- [HiveWE](#hivewe)
- [Ramses Composer](#ramses-composer)
- [Plot Juggler](#plot-juggler)
- [Notepad Next](#notepad-next)
- [MetGem](#metgem)
- [PRE Workbench](#pre-workbench)
### Docking everywhere - no central widget
@@ -55,8 +104,8 @@ There is no central widget like in the Qt docking system. You can dock on every
border of the main window or you can dock into each dock area - so you are
free to dock almost everywhere.
![Dropping widgets](doc/preview-dragndrop.png)\
\
![Dropping widgets](doc/preview-dragndrop.png)
![Dropping widgets](doc/preview-dragndrop_dark.png)
### Docking inside floating windows
@@ -64,8 +113,8 @@ free to dock almost everywhere.
There is no difference between the main window and a floating window. Docking
into floating windows is supported.
![Docking inside floating windows](doc/floating-widget-dragndrop.png)\
\
![Docking inside floating windows](doc/floating-widget-dragndrop.png)
![Docking inside floating windows](doc/floating-widget-dragndrop_dark.png)
### Grouped dragging
@@ -74,8 +123,8 @@ When dragging the titlebar of a dock, all the tabs that are tabbed with it are
going to be dragged. So you can move complete groups of tabbed widgets into
a floating widget or from one dock area to another one.
![Grouped dragging](doc/grouped-dragging.gif)\
\
![Grouped dragging](doc/grouped-dragging.gif)
![Grouped dragging](doc/grouped-dragging_dark.png)
### Perspectives for fast switching of the complete main window layout
@@ -86,13 +135,13 @@ perspective to make your own custom perspective. Later you can simply
select a perspective from the perspective list to quickly switch the complete
main window layout.
![Perspective](doc/perspectives.gif)\
\
![Perspective](doc/perspectives.gif)
![Perspective](doc/perspectives_dark.png)
### Opaque and non-opaque splitter resizing
The advanced docking system uses standard QSplitters as resize separators and thus supports opaque and non-opaque resizing functionality of QSplitter. In some rare cases, for very complex widgets or on slow machines resizing via separator on the fly may cause flicking and glaring of rendered content inside a widget. The global dock manager flag `OpaqueSplitterResize` configures the resizing behaviour of the splitters. If this flag is set, then widgets are resized dynamically (opaquely) while interactively moving the splitters.
The advanced docking system uses standard QSplitters as resize separators and thus supports opaque and non-opaque resizing functionality of QSplitter. In some rare cases, for very complex widgets or on slow machines resizing via separator on the fly may cause flicking and glaring of rendered content inside a widget. The global dock manager flag `OpaqueSplitterResize` configures the resizing behaviour of the splitters. If this flag is set, then widgets are resized dynamically (opaquely) while interactively moving the splitters.
![Opaque resizing](doc/opaque_resizing.gif)
@@ -129,8 +178,26 @@ You can detach dock widgets and also dock areas in the following ways:
Normally clicking the close button of a dock widget will just hide the widget and the user can show it again using the toggleView() action of the dock widget. This is meant for user interfaces with a static amount of widgets. But the advanced docking system also supports dynamic dock widgets that will get deleted on close. If you set the dock widget flag `DockWidgetDeleteOnClose` for a certain dock widget, then it will be deleted as soon as you close this dock widget. This enables the implementation of user interfaces with dynamically created editors, like in word processing applications or source code development tools.
### Python PyQt5 Bindings
![Python Logo](doc/python_logo.png)
The Advanced Docking System comes with a complete Python integration based on
PyQt5 bindings. The package is available via [conda-forge](https://github.com/conda-forge/pyqtads-feedstock). The python integration has been contributed to this project
by the following people:
- [n-elie](https://github.com/n-elie)
- [Hugo Slepicka](https://github.com/hhslepicka)
- [K Lauer](https://github.com/klauer)
Latest working version: [3.5.2](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.5.2)
## Tested Compatible Environments
### Supported Qt Versions
The library supports **Qt5** and **Qt6**.
### Windows
Windows 10 [![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
@@ -147,20 +214,34 @@ The application can be compiled for macOS. A user reported, that the library wor
### Linux
Ubuntu [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
[![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
[![Build status](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/workflows/linux-builds/badge.svg)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions?query=workflow%3Alinux-builds)
The application can be compiled for Linux and has been developed and tested with **Kubuntu 18.04** and **Kubuntu 19.10**.
Unfortunately, there is no such thing as a Linux operating system. Linux is a heterogeneous environment with a variety of different distributions. So it is not possible to support "Linux" like this is possible for Windows. It is only possible to support and test a small subset of Linux distributions. The library can be compiled for and has been developed and tested with the following Linux distributions:
- **Kubuntu 18.04 and 19.10**
- **Ubuntu 18.04, 19.10 and 20.04**
There are some requirements for the Linux distribution that have to be met:
- an X server that supports ARGB visuals and a compositing window manager. This is required to display the translucent dock overlays ([https://doc.qt.io/qt-5/qwidget.html#creating-translucent-windows](https://doc.qt.io/qt-5/qwidget.html#creating-translucent-windows)). If your Linux distribution does not support this, or if you disable this feature, you will very likely see issue [#95](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/95).
- Wayland is not properly supported by Qt yet. If you use Wayland, then you should set the session type to x11: `XDG_SESSION_TYPE=x11 ./AdvancedDockingSystemDemo`. You will find more details about this in issue [#288](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/288).
Screenshot Kubuntu:
![Advanced Docking on Kubuntu Linux](doc/linux_kubuntu_1804.png)
and with **Ubuntu 19.10**
Screenshot Ubuntu:
![Advanced Docking on Ubuntu Linux](doc/linux_ubuntu_1910.png)
## Build
Open the `ads.pro` with QtCreator and start the build, that's it.
The Linux build requires private header files. Make sure that they are installed:
```bash
sudo apt install qtbase5-private-dev
```
Open the `ads.pro` file with QtCreator and start the build, that's it.
You can run the demo project and test it yourself.
## Getting started / Example
@@ -207,8 +288,9 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
// Create the dock manager. Because the parent parameter is a QMainWindow
// the dock manager registers itself as the central widget.
// Create the dock manager after the ui is setup. Because the
// parent parameter is a QMainWindow the dock manager registers
// itself as the central widget as such the ui must be set up first.
m_DockManager = new ads::CDockManager(this);
// Create example content label - this can be any application specific
@@ -240,7 +322,13 @@ MainWindow::~MainWindow()
## Developers
- Uwe Kindler, Project Maintainer
- Manuel Freiholz
- Manuel Freiholz
This work is based on and inspired by the
[Advanced Docking System for Qt](https://github.com/mfreiholz/Qt-Advanced-Docking-System)
from Manuel Freiholz. I did an almost complete rewrite of his code to improve
code quality, readibility and to fix all issues from the issue tracker
of his docking system project.
## License information
@@ -273,3 +361,120 @@ If this project help you reduce time to develop or if you just like it, you can
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=85R64TMMSY9T6">
<img src="doc/donate.png" alt="Donate with PayPal" width="160"/>
</a>
## Showcase
### [Qt Creator IDE](https://www.qt.io/development-tools)
From version 4.12 on, Qt Creator uses the Advanced Docking Framework for its
Qt Quick Designer. This improves the usability when using multiple screens.
![Qt Creator](doc/showcase_qtcreator.png)
### [Qt Design Studio](https://www.qt.io/ui-design-tools)
Taken from the [Qt Blog](https://www.qt.io/blog/qt-design-studio-1.5-beta-released):
> The most obvious change in [Qt Design Studio 1.5](https://www.qt.io/blog/qt-design-studio-1.5-beta-released) is the integration of dock widgets using the Qt Advanced Docking System. This allows the user to fully customize the workspace and also to undock any view into its own top level window. This especially improves the usability when using multiple screens.
[![Qt Design Studio](doc/showcase_qt_design_studio_video.png)](https://youtu.be/za9KBWcFXEw?t=84)
### [CETONI Elements](https://www.cetoni.com/products/qmixelements/)
The CETONI Elements software from [CETONI](https://www.cetoni.com) is a comprehensive,
plugin-based and modular laboratory automation software for controlling CETONI devices using a joint graphical user interface. The software features a powerful script system to automate processes. The software uses the advanced docking system to give the user the freedom to arrange all the views and windows that are provided by the various plugins.
![CETONI_Elements](doc/showcase_qmix_elements.png)
### [ezEditor](https://github.com/ezEngine/ezEngine)
The ezEditor is a full blown graphical editor used for editing scenes and
importing and authoring assets for the [ezEngine](https://github.com/ezEngine/ezEngine) -
an open source C++ game engine in active development.
![ezEditor](doc/showcase_ezEngine_editor.png)
### [D-Tect X](https://www.duerr-ndt.com/products/ndt-software/d-tect-xray-inspection-software.html)
D-Tect X is a X-ray inspection software for industrial radiography. It is a state-of-the-art 64-bit application which supports GPU (Graphics Processing Unit) acceleration and takes full advantage of computers with multiple CPU cores. A large set of tools assist the user in image analysis and evaluation. Thanks to the Qt Advanced Docking System the flexible and intuitive user interface can be completely customized to each users preference.
[learn more...](https://www.duerr-ndt.com/products/ndt-software/d-tect-xray-inspection-software.html)
![D-TectX](doc/showcase_d-tect-x.jpg)
### [HiveWE](https://github.com/stijnherfst/HiveWE)
HiveWE is a Warcraft III world editor. It focusses on speed and ease of use,
especially for large maps where the regular World Editor is often too slow and clunky.
It has a JASS editor with syntax hightlighting, tabs, code completion and more.
The JASS editor uses the Qt Advanced Docking System for the management and layout
of the open editor windows.
[learn more...](https://github.com/stijnherfst/HiveWE)
![HiveWE](doc/showcase_hivewe.png)
### [Ramses Composer](https://github.com/GENIVI/ramses-composer)
Ramses Composer is the authoring tool for the open source [RAMSES](https://github.com/GENIVI/ramses)
rendering ecosystem.
Ramses is a low-level rendering engine which is optimized for embedded hardware
mobile devices, automotive ECUs, IoT electronics. Ramses was initially developed
at the BMW Group and open-sourced in 2018 as part of a collaboration initiative
with the Genivi Alliance. It is an important part of the BMW infotainment cluster
and digital portfolio.
[learn more...](https://github.com/GENIVI/ramses-composer)
![RamsesComposer](doc/showcase_ramses_composer.png)
### [Plot Juggler](https://github.com/facontidavide/PlotJuggler)
PlotJuggler is a fast, powerful and intuitive tool to visualize time series.
It makes it easy to visualize data but also to analyze it. You can manipulate
your time series using a simple and extendable Transform Editor. Some of the
highlights are:
- Simple Drag & Drop user interface.
- Load data from file.
- Connect to live streaming of data.
- Save the visualization layout and configurations to re-use them later.
- Fast OpenGL visualization.
- Can handle thousands of timeseries and millions of data points.
- Transform your data using a simple editor: derivative, moving average, integral, etc…
- PlotJuggler can be easily extended using plugins.
[read more...](https://github.com/facontidavide/PlotJuggler)
[![Plot Juggler](doc/showcase_plot_juggler.png)](https://vimeo.com/480588113#t=46s)
### [Notepad Next](https://github.com/dail8859/NotepadNext)
Notepad Next is a cross-platform reimplementation of Notepad++ that uses the
Advanced Docking System to arrange the open source files on the screen.
[read more...](https://github.com/dail8859/NotepadNext)
![NotepadNext](doc/showcase_notepad_next.png)
### [MetGem](https://metgem.github.io/)
MetGem is an open-source software for tandem mass-spectrometry data visualization.
It's key features are standalone molecular networking and t-SNE based projections.
MetGem uses the Qt-Advanced-Docking-System to manage docks and to create independent
molecular network views.
[read more...](https://metgem.github.io/)
![MetGem](doc/showcase_metgem.png)
### [PRE Workbench](https://luelista.github.io/pre_workbench/)
Protocol Reverse Engineering Workbench is a software to support researchers in reverse engineering protocols and documenting the results. It supports various sources to import protocol traffic from, helps the discovery process by displaying different views and heuristic-based highlighting on data, and aids in documenting and sharing findings.
PRE Workbench is a Python software and uses the ADS PyQt integration.
[read more...](https://luelista.github.io/pre_workbench/)
[![PRE Workbench](doc/showcase_pre_workbench.png)](https://youtu.be/U3op5UreV1Q)

28
ads.pri Normal file
View File

@@ -0,0 +1,28 @@
CONFIG(debug, debug|release){
win32-g++ {
versionAtLeast(QT_VERSION, 5.15.0) {
LIBS += -lqtadvanceddocking
}
else {
LIBS += -lqtadvanceddockingd
}
}
else:msvc {
LIBS += -lqtadvanceddockingd
}
else:mac {
LIBS += -lqtadvanceddocking_debug
}
else {
LIBS += -lqtadvanceddocking
}
}
else{
LIBS += -lqtadvanceddocking
}
unix:!macx {
LIBS += -lxcb
}

View File

@@ -3,7 +3,7 @@ TEMPLATE = subdirs
SUBDIRS = \
src \
demo \
example
examples
demo.depends = src
example.depends = src
examples.depends = src

View File

@@ -0,0 +1,172 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
# Uses the return code of "git diff-index --quiet HEAD --".
# Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
if(NOT IS_DIRECTORY "${GIT_DIR}")
file(READ ${GIT_DIR} worktree)
string(REGEX REPLACE "gitdir: (.*)worktrees(.*)\n$" "\\1" GIT_DIR ${worktree})
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
execute_process(COMMAND
"${GIT_EXECUTABLE}"
diff-index --quiet HEAD --
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var} "CLEAN" PARENT_SCOPE)
else()
set(${_var} "DIRTY" PARENT_SCOPE)
endif()
endfunction()

View File

@@ -0,0 +1,41 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View File

@@ -1,54 +1,43 @@
cmake_minimum_required(VERSION 3.3)
set (CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
project(ads_demo VERSION "1.0")
set(REQUIRED_QT_VERSION 5.5.0)
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
set(ads_demo_LIBS ${ads_demo_LIBS} ${Qt5Core_LIBRARIES})
set(ads_demo_INCLUDE ${ads_demo_INCLUDE} ${Qt5Core_INCLUDE_DIRS})
set(ads_demo_COMPILE_DEFINE ${ads_demo_COMPILE_DEFINE} ${Qt5Core_COMPILE_DEFINITIONS} )
set(ads_demo_LIBS ${ads_demo_LIBS} ${Qt5Gui_LIBRARIES})
set(ads_demo_INCLUDE ${ads_demo_INCLUDE} ${Qt5Gui_INCLUDE_DIRS})
set(ads_demo_COMPILE_DEFINE ${ads_demo_COMPILE_DEFINE} ${Qt5Gui_COMPILE_DEFINITIONS})
set(ads_demo_LIBS ${ads_demo_LIBS} ${Qt5Widgets_LIBRARIES})
set(ads_demo_INCLUDE ${ads_demo_INCLUDE} ${Qt5Widgets_INCLUDE_DIRS})
set(ads_demo_COMPILE_DEFINE ${ads_demo_COMPILE_DEFINE} ${Qt5Widgets_COMPILE_DEFINITIONS})
if(WIN32)
find_package(Qt5AxContainer ${REQUIRED_QT_VERSION} REQUIRED)
set(ads_demo_LIBS ${ads_demo_LIBS} ${Qt5AxContainer_LIBRARIES})
set(ads_demo_INCLUDE ${ads_demo_INCLUDE} ${Qt5AxContainer_INCLUDE_DIRS})
set(ads_demo_COMPILE_DEFINE ${ads_demo_COMPILE_DEFINE} ${Qt5AxContainer_COMPILE_DEFINITIONS})
cmake_minimum_required(VERSION 3.5)
project(ads_demo VERSION ${VERSION_SHORT})
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS AxContainer REQUIRED)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(ads_demo_SRCS
main.cpp
MainWindow.cpp
mainwindow.ui
StatusDialog.cpp
StatusDialog.ui
demo.qrc
)
add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
if(BUILD_STATIC)
set(ads_demo_DEFINE ${ads_demo_DEFINE} ADS_STATIC)
target_include_directories(AdvancedDockingSystemDemo PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../src")
target_link_libraries(AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
target_link_libraries(AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::AxContainer)
endif()
add_dependencies(AdvancedDockingSystemDemo qtadvanceddocking)
target_include_directories(AdvancedDockingSystemDemo PUBLIC
$<BUILD_INTERFACE:${ads_demo_INCLUDE}>
$<INSTALL_INTERFACE:include>
)
target_include_directories(AdvancedDockingSystemDemo PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../src" ${ads_demo_INCLUDE})
target_link_libraries(AdvancedDockingSystemDemo PRIVATE qtadvanceddocking ${ads_demo_LIBS})
target_compile_definitions(AdvancedDockingSystemDemo PRIVATE ${ads_demo_DEFINE})
target_link_libraries(AdvancedDockingSystemDemo PRIVATE qtadvanceddocking)
set_target_properties(AdvancedDockingSystemDemo PROPERTIES
VERSION "1.0"
SOVERSION 1
AUTOMOC ON
AUTORCC ON
AUTOUIC ON
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
VERSION ${VERSION_SHORT}
EXPORT_NAME "Qt Advanced Docking System Demo"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)
#if(BUILD_STATIC)
# target_compile_definitions(AdvancedDockingSystemDemo PRIVATE ADS_STATIC)
#endif()

View File

@@ -58,11 +58,15 @@
#include <QMessageBox>
#include <QMenu>
#include <QToolButton>
#include <QToolBar>
#include <QPointer>
#ifdef Q_OS_WIN
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QAxWidget>
#endif
#endif
#include <QMap>
#include <QElapsedTimer>
@@ -74,36 +78,8 @@
#include "DockAreaTabBar.h"
#include "FloatingDockContainer.h"
#include "DockComponentsFactory.h"
//============================================================================
static ads::CDockWidget* createLongTextLabelDockWidget(QMenu* ViewMenu)
{
static int LabelCount = 0;
QLabel* l = new QLabel();
l->setWordWrap(true);
l->setAlignment(Qt::AlignTop | Qt::AlignLeft);
l->setText(QString("Label %1 %2 - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
"Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque "
"penatibus et magnis dis parturient montes, nascetur ridiculus mus. "
"Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. "
"Nulla consequat massa quis enim. Donec pede justo, fringilla vel, "
"aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, "
"imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede "
"mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum "
"semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, "
"porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, "
"dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla "
"ut metus varius laoreet.")
.arg(LabelCount)
.arg(QTime::currentTime().toString("hh:mm:ss:zzz")));
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Label %1").arg(LabelCount++));
DockWidget->setWidget(l);
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
#include "StatusDialog.h"
#include "DockSplitter.h"
/**
@@ -137,7 +113,7 @@ static void appendFeaturStringToWindowTitle(ads::CDockWidget* DockWidget)
static QIcon svgIcon(const QString& File)
{
// This is a workaround, because in item views SVG icons are not
// properly scaled an look blurry or pixelate
// properly scaled and look blurry or pixelate
QIcon SvgIcon(File);
SvgIcon.addPixmap(SvgIcon.pixmap(92));
return SvgIcon;
@@ -163,105 +139,23 @@ public:
};
//============================================================================
static ads::CDockWidget* createCalendarDockWidget(QMenu* ViewMenu)
//===========================================================================
/**
* Custom QTableWidget with a minimum size hint to test CDockWidget
* setMinimumSizeHintMode() function of CDockWidget
*/
class CMinSizeTableWidget : public QTableWidget
{
static int CalendarCount = 0;
QCalendarWidget* w = new QCalendarWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Calendar %1").arg(CalendarCount++));
DockWidget->setWidget(w);
DockWidget->setToggleViewActionMode(ads::CDockWidget::ActionModeShow);
DockWidget->setIcon(svgIcon(":/adsdemo/images/date_range.svg"));
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
//============================================================================
static ads::CDockWidget* createFileSystemTreeDockWidget(QMenu* ViewMenu)
{
static int FileSystemCount = 0;
QTreeView* w = new QTreeView();
w->setFrameShape(QFrame::NoFrame);
QFileSystemModel* m = new QFileSystemModel(w);
m->setRootPath(QDir::currentPath());
w->setModel(m);
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Filesystem %1")
.arg(FileSystemCount++));
DockWidget->setWidget(w);
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
//============================================================================
static ads::CDockWidget* createEditorWidget(QMenu* ViewMenu)
{
static int EditorCount = 0;
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is an editor. If you close the editor, it will be "
"deleted. Enter your text here.");
w->setStyleSheet("border: none");
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Editor %1").arg(EditorCount++));
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/edit.svg"));
DockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
ViewMenu->addAction(DockWidget->toggleViewAction());
QMenu* OptionsMenu = new QMenu(DockWidget);
OptionsMenu->setTitle(QObject::tr("Options"));
OptionsMenu->setToolTip(OptionsMenu->title());
OptionsMenu->setIcon(svgIcon(":/adsdemo/images/custom-menu-button.svg"));
auto MenuAction = OptionsMenu->menuAction();
// The object name of the action will be set for the QToolButton that
// is created in the dock area title bar. You can use this name for CSS
// styling
MenuAction->setObjectName("optionsMenu");
DockWidget->setTitleBarActions({OptionsMenu->menuAction()});
auto a = OptionsMenu->addAction(QObject::tr("Clear Editor"));
w->connect(a, SIGNAL(triggered()), SLOT(clear()));
return DockWidget;
}
//============================================================================
static ads::CDockWidget* createTableWidget(QMenu* ViewMenu)
{
static int TableCount = 0;
QTableWidget* w = new QTableWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Table %1").arg(TableCount++));
static int colCount = 5;
static int rowCount = 30;
w->setColumnCount(colCount);
w->setRowCount(rowCount);
for (int col = 0; col < colCount; ++col)
public:
using QTableWidget::QTableWidget;
virtual QSize minimumSizeHint() const override
{
w->setHorizontalHeaderItem(col, new QTableWidgetItem(QString("Col %1").arg(col+1)));
for (int row = 0; row < rowCount; ++row)
{
w->setItem(row, col, new QTableWidgetItem(QString("T %1-%2").arg(row + 1).arg(col+1)));
}
return QSize(300, 100);
}
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/grid_on.svg"));
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
};
#ifdef Q_OS_WIN
//============================================================================
static ads::CDockWidget* createActiveXWidget(QMenu* ViewMenu, QWidget* parent = nullptr)
{
static int ActiveXCount = 0;
QAxWidget* w = new QAxWidget("{6bf52a52-394a-11d3-b153-00c04f79faa6}", parent);
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Active X %1").arg(ActiveXCount++));
DockWidget->setWidget(w);
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
#endif
//============================================================================
/**
@@ -275,6 +169,9 @@ struct MainWindowPrivate
QWidgetAction* PerspectiveListAction = nullptr;
QComboBox* PerspectiveComboBox = nullptr;
ads::CDockManager* DockManager = nullptr;
ads::CDockWidget* WindowTitleTestDockWidget = nullptr;
QPointer<ads::CDockWidget> LastDockedEditor;
QPointer<ads::CDockWidget> LastCreatedFloatingEditor;
MainWindowPrivate(CMainWindow* _public) : _this(_public) {}
@@ -307,17 +204,184 @@ struct MainWindowPrivate
* Restore the perspective listo of the dock manager
*/
void restorePerspectives();
/**
* Creates a dock widget with a file system tree view
*/
ads::CDockWidget* createFileSystemTreeDockWidget()
{
static int FileSystemCount = 0;
QTreeView* w = new QTreeView();
w->setFrameShape(QFrame::NoFrame);
QFileSystemModel* m = new QFileSystemModel(w);
m->setRootPath(QDir::currentPath());
w->setModel(m);
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Filesystem %1")
.arg(FileSystemCount++));
DockWidget->setWidget(w);
ui.menuView->addAction(DockWidget->toggleViewAction());
// We disable focus to test focus highlighting if the dock widget content
// does not support focus
w->setFocusPolicy(Qt::NoFocus);
auto ToolBar = DockWidget->createDefaultToolBar();
ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState);
return DockWidget;
}
/**
* Create a dock widget with a QCalendarWidget
*/
ads::CDockWidget* createCalendarDockWidget()
{
static int CalendarCount = 0;
QCalendarWidget* w = new QCalendarWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Calendar %1").arg(CalendarCount++));
// The following lines are for testing the setWidget() and takeWidget()
// functionality
DockWidget->setWidget(w);
DockWidget->setWidget(w); // what happens if we set a widget if a widget is already set
DockWidget->takeWidget(); // we remove the widget
DockWidget->setWidget(w); // and set the widget again - there should be no error
DockWidget->setToggleViewActionMode(ads::CDockWidget::ActionModeShow);
DockWidget->setIcon(svgIcon(":/adsdemo/images/date_range.svg"));
ui.menuView->addAction(DockWidget->toggleViewAction());
auto ToolBar = DockWidget->createDefaultToolBar();
ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState);
return DockWidget;
}
/**
* Create dock widget with a text label
*/
ads::CDockWidget* createLongTextLabelDockWidget()
{
static int LabelCount = 0;
QLabel* l = new QLabel();
l->setWordWrap(true);
l->setAlignment(Qt::AlignTop | Qt::AlignLeft);
l->setText(QString("Label %1 %2 - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
"Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque "
"penatibus et magnis dis parturient montes, nascetur ridiculus mus. "
"Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. "
"Nulla consequat massa quis enim. Donec pede justo, fringilla vel, "
"aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, "
"imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede "
"mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum "
"semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, "
"porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, "
"dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla "
"ut metus varius laoreet.")
.arg(LabelCount)
.arg(QTime::currentTime().toString("hh:mm:ss:zzz")));
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Label %1").arg(LabelCount++));
DockWidget->setWidget(l);
ui.menuView->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
/**
* Creates as imple editor widget
*/
ads::CDockWidget* createEditorWidget()
{
static int EditorCount = 0;
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is an editor. If you close the editor, it will be "
"deleted. Enter your text here.");
w->setStyleSheet("border: none");
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Editor %1").arg(EditorCount++));
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/edit.svg"));
DockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
ui.menuView->addAction(DockWidget->toggleViewAction());
QMenu* OptionsMenu = new QMenu(DockWidget);
OptionsMenu->setTitle(QObject::tr("Options"));
OptionsMenu->setToolTip(OptionsMenu->title());
OptionsMenu->setIcon(svgIcon(":/adsdemo/images/custom-menu-button.svg"));
auto MenuAction = OptionsMenu->menuAction();
// The object name of the action will be set for the QToolButton that
// is created in the dock area title bar. You can use this name for CSS
// styling
MenuAction->setObjectName("optionsMenu");
DockWidget->setTitleBarActions({OptionsMenu->menuAction()});
auto a = OptionsMenu->addAction(QObject::tr("Clear Editor"));
w->connect(a, SIGNAL(triggered()), SLOT(clear()));
return DockWidget;
}
/**
* Create a table widget
*/
ads::CDockWidget* createTableWidget()
{
static int TableCount = 0;
auto w = new CMinSizeTableWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Table %1").arg(TableCount++));
static int colCount = 5;
static int rowCount = 30;
w->setColumnCount(colCount);
w->setRowCount(rowCount);
for (int col = 0; col < colCount; ++col)
{
w->setHorizontalHeaderItem(col, new QTableWidgetItem(QString("Col %1").arg(col+1)));
for (int row = 0; row < rowCount; ++row)
{
w->setItem(row, col, new QTableWidgetItem(QString("T %1-%2").arg(row + 1).arg(col+1)));
}
}
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/grid_on.svg"));
DockWidget->setMinimumSizeHintMode(ads::CDockWidget::MinimumSizeHintFromContent);
auto ToolBar = DockWidget->createDefaultToolBar();
auto Action = ToolBar->addAction(svgIcon(":/adsdemo/images/fullscreen.svg"), "Toggle Fullscreen");
QObject::connect(Action, &QAction::triggered, [=]()
{
if (DockWidget->isFullScreen())
{
DockWidget->showNormal();
}
else
{
DockWidget->showFullScreen();
}
});
ui.menuView->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
/**
* Creates an ActiveX widget on windows
*/
ads::CDockWidget* createActiveXWidget(QWidget* parent = nullptr)
{
static int ActiveXCount = 0;
QAxWidget* w = new QAxWidget("{6bf52a52-394a-11d3-b153-00c04f79faa6}", parent);
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Active X %1").arg(ActiveXCount++));
DockWidget->setWidget(w);
ui.menuView->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
#endif
#endif
};
//============================================================================
void MainWindowPrivate::createContent()
{
// Test container docking
QMenu* ViewMenu = ui.menuView;
auto DockWidget = createCalendarDockWidget(ViewMenu);
auto DockWidget = createCalendarDockWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false);
DockWidget->setFeature(ads::CDockWidget::DockWidgetMovable, false);
DockWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
auto SpecialDockArea = DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
// For this Special Dock Area we want to avoid dropping on the center of it (i.e. we don't want this widget to be ever tabbified):
@@ -326,19 +390,16 @@ void MainWindowPrivate::createContent()
//SpecialDockArea->setAllowedAreas({ads::LeftDockWidgetArea, ads::RightDockWidgetArea}); // just for testing
}
DockManager->addDockWidget(ads::LeftDockWidgetArea, createLongTextLabelDockWidget(ViewMenu));
auto FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
auto ToolBar = FileSystemWidget->createDefaultToolBar();
ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState);
DockWidget = createLongTextLabelDockWidget();
WindowTitleTestDockWidget = DockWidget;
DockWidget->setFeature(ads::CDockWidget::DockWidgetFocusable, false);
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
auto FileSystemWidget = createFileSystemTreeDockWidget();
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
appendFeaturStringToWindowTitle(FileSystemWidget);
DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget);
FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
ToolBar = FileSystemWidget->createDefaultToolBar();
ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState);
FileSystemWidget = createFileSystemTreeDockWidget();
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetMovable, false);
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
appendFeaturStringToWindowTitle(FileSystemWidget);
@@ -346,16 +407,33 @@ void MainWindowPrivate::createContent()
// Test custom factory - we inject a help button into the title bar
ads::CDockComponentsFactory::setFactory(new CCustomComponentsFactory());
auto TopDockArea = DockManager->addDockWidget(ads::TopDockWidgetArea, FileSystemWidget);
// Uncomment the next line if you would like to test the
// HideSingleWidgetTitleBar functionality
// TopDockArea->setDockAreaFlag(ads::CDockAreaWidget::HideSingleWidgetTitleBar, true);
ads::CDockComponentsFactory::resetDefaultFactory();
// We create a calendar widget and clear all flags to prevent the dock area
// from closing
DockWidget = createCalendarDockWidget(ViewMenu);
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false);
DockWidget->setFeature(ads::CDockWidget::DockWidgetMovable, false);
DockWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
DockWidget = createCalendarDockWidget();
DockWidget->setTabToolTip(QString("Tab ToolTip\nHodie est dies magna"));
auto DockArea = DockManager->addDockWidget(ads::CenterDockWidgetArea, DockWidget, TopDockArea);
// Now we create a action to test resizing of DockArea widget
auto Action = ui.menuTests->addAction(QString("Resize %1").arg(DockWidget->windowTitle()));
QObject::connect(Action, &QAction::triggered, [DockArea]()
{
// Resizing only works, if the Splitter is visible and has a valid
// sizes
auto Splitter = ads::internal::findParent<ads::CDockSplitter*>(DockArea);
if (!Splitter)
{
return;
}
// We change the sizes of the splitter that contains the Calendar 1 widget
// to resize the dock widget
int Width = Splitter->width();
Splitter->setSizes({Width * 2/3, Width * 1/3});
});
DockWidget->setWindowTitle(QString("My " + DockWidget->windowTitle()));
// Now we add a custom button to the dock area title bar that will create
// new editor widgets when clicked
@@ -363,32 +441,64 @@ void MainWindowPrivate::createContent()
CustomButton->setToolTip(QObject::tr("Create Editor"));
CustomButton->setIcon(svgIcon(":/adsdemo/images/plus.svg"));
CustomButton->setAutoRaise(true);
auto TitleBar = DockArea->titleBar();
int Index = TitleBar->indexOf(TitleBar->tabBar());
TitleBar->insertWidget(Index + 1, CustomButton);
QObject::connect(CustomButton, &QToolButton::clicked, [=]()
{
auto DockWidget = createEditorWidget(ui.menuView);
auto DockWidget = createEditorWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
DockManager->addDockWidgetTabToArea(DockWidget, DockArea);
_this->connect(DockWidget, SIGNAL(closeRequested()), SLOT(onEditorCloseRequested()));
});
// Test dock area docking
auto RighDockArea = DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), TopDockArea);
DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), BottomDockArea);
auto RighDockArea = DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(), TopDockArea);
DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
auto LabelDockWidget = createLongTextLabelDockWidget();
std::cout << "DockWidget " << LabelDockWidget->objectName().toStdString() << std::endl;
DockManager->addDockWidget(ads::CenterDockWidgetArea, LabelDockWidget, BottomDockArea);
auto Action = ui.menuView->addAction(QString("Set %1 floating").arg(DockWidget->windowTitle()));
// Tests CustomCloseHandling without DeleteOnClose
LabelDockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
QObject::connect(LabelDockWidget, &ads::CDockWidget::closeRequested, [LabelDockWidget, this]()
{
int Result = QMessageBox::question(_this, "Custom Close Request",
"Do you really want to close this dock widget?");
if (QMessageBox::Yes == Result)
{
LabelDockWidget->closeDockWidget();
}
});
Action = ui.menuTests->addAction(QString("Set %1 Floating").arg(DockWidget->windowTitle()));
DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setFloating()));
Action = ui.menuTests->addAction(QString("Set %1 As Current Tab").arg(DockWidget->windowTitle()));
DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setAsCurrentTab()));
Action = ui.menuTests->addAction(QString("Raise %1").arg(DockWidget->windowTitle()));
DockWidget->connect(Action, SIGNAL(triggered()), SLOT(raise()));
// Test hidden floating dock widget
DockWidget = createLongTextLabelDockWidget();
DockManager->addDockWidgetFloating(DockWidget);
DockWidget->toggleView(false);
// Test visible floating dock widget
DockWidget = createCalendarDockWidget();
DockManager->addDockWidgetFloating(DockWidget);
DockWidget->setWindowTitle(QString("My " + DockWidget->windowTitle()));
#ifdef Q_OS_WIN
if (!DockManager->configFlags().testFlag(ads::CDockManager::OpaqueUndocking))
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
if (!ads::CDockManager::testConfigFlag(ads::CDockManager::OpaqueUndocking))
{
DockManager->addDockWidget(ads::CenterDockWidgetArea, createActiveXWidget(ViewMenu), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createActiveXWidget(), RighDockArea);
}
#endif
#endif
for (auto DockWidget : DockManager->dockWidgetsMap())
@@ -420,15 +530,33 @@ void MainWindowPrivate::createActions()
ui.toolBar->addAction(PerspectiveListAction);
ui.toolBar->addAction(SavePerspectiveAction);
QAction* a = ui.toolBar->addAction("Create Editor");
QAction* a = ui.toolBar->addAction("Create Floating Editor");
a->setProperty("Floating", true);
a->setToolTip("Creates floating dynamic dockable editor windows that are deleted on close");
a->setIcon(svgIcon(":/adsdemo/images/note_add.svg"));
_this->connect(a, SIGNAL(triggered()), SLOT(createEditor()));
ui.menuTests->addAction(a);
a = ui.toolBar->addAction("Create Table");
a = ui.toolBar->addAction("Create Docked Editor");
a->setProperty("Floating", false);
a->setToolTip("Creates a docked editor windows that are deleted on close");
a->setIcon(svgIcon(":/adsdemo/images/docked_editor.svg"));
_this->connect(a, SIGNAL(triggered()), SLOT(createEditor()));
ui.menuTests->addAction(a);
a = ui.toolBar->addAction("Create Floating Table");
a->setToolTip("Creates floating dynamic dockable table with millions of entries");
a->setIcon(svgIcon(":/adsdemo/images/grid_on.svg"));
_this->connect(a, SIGNAL(triggered()), SLOT(createTable()));
ui.menuTests->addAction(a);
ui.menuTests->addSeparator();
a = ui.menuTests->addAction("Show Status Dialog");
_this->connect(a, SIGNAL(triggered()), SLOT(showStatusDialog()));
a = ui.menuTests->addAction("Toggle Label 0 Window Title");
_this->connect(a, SIGNAL(triggered()), SLOT(toggleDockWidgetWindowTitle()));
ui.menuTests->addSeparator();
}
@@ -479,7 +607,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
{
using namespace ads;
d->ui.setupUi(this);
setWindowTitle(QApplication::instance()->applicationName());
d->createActions();
// uncomment the following line if the tab close button should be
@@ -488,7 +616,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the following line if you want to use opaque undocking and
// opaque splitter resizing
//CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
// CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
// uncomment the following line if you want a fixed tab width that does
// not change if the visibility of the close button changes
@@ -515,15 +643,32 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the following line if you want floating container to show active dock widget's icon instead of always showing application icon
//CDockManager::setConfigFlag(CDockManager::FloatingContainerHasWidgetIcon, true);
// uncomment the following line if you want a central widget in the main dock container (the dock manager) without a titlebar
// If you enable this code, you can test it in the demo with the Calendar 0
// dock widget.
// CDockManager::setConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar, true);
// uncomment the following line to enable focus highlighting of the dock
// widget that has the focus
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
// uncomment if you would like to enable an equal distribution of the
// available size of a splitter to all contained dock widgets
// CDockManager::setConfigFlag(CDockManager::EqualSplitOnInsertion, true);
// uncomment if you would like to close tabs with the middle mouse button, web browser style
// CDockManager::setConfigFlag(CDockManager::MiddleMouseButtonClosesTab, true);
// Now create the dock manager and its content
d->DockManager = new CDockManager(this);
// uncomment the following line to have the old style where the dock
// area close button closes the active tab
// CDockManager::setConfigFlags({CDockManager::DockAreaHasCloseButton
// | CDockManager::DockAreaCloseButtonClosesTab});
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)),
d->DockManager, SLOT(openPerspective(const QString&)));
#else
connect(d->PerspectiveComboBox, SIGNAL(textActivated(const QString&)),
d->DockManager, SLOT(openPerspective(const QString&)));
#endif
d->createContent();
// Default window geometry - center on screen
@@ -549,6 +694,9 @@ CMainWindow::~CMainWindow()
void CMainWindow::closeEvent(QCloseEvent* event)
{
d->saveState();
// Delete dock manager here to delete all floating widgets. This ensures
// that all top level windows of the dock manager are properly closed
d->DockManager->deleteLater();
QMainWindow::closeEvent(event);
}
@@ -604,24 +752,59 @@ void CMainWindow::onViewToggled(bool Open)
//============================================================================
void CMainWindow::onViewVisibilityChanged(bool Visible)
{
Q_UNUSED(Visible);
auto DockWidget = qobject_cast<ads::CDockWidget*>(sender());
if (!DockWidget)
{
return;
}
qDebug() << DockWidget->objectName() << " visibilityChanged(" << Visible << ")";
//qDebug() << DockWidget->objectName() << " visibilityChanged(" << Visible << ")";
}
//============================================================================
void CMainWindow::createEditor()
{
auto DockWidget = createEditorWidget(d->ui.menuView);
QObject* Sender = sender();
QVariant vFloating = Sender->property("Floating");
bool Floating = vFloating.isValid() ? vFloating.toBool() : true;
auto DockWidget = d->createEditorWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
auto FloatingWidget = d->DockManager->addDockWidgetFloating(DockWidget);
FloatingWidget->move(QPoint(20, 20));
DockWidget->setFeature(ads::CDockWidget::DockWidgetForceCloseWithArea, true);
connect(DockWidget, SIGNAL(closeRequested()), SLOT(onEditorCloseRequested()));
if (Floating)
{
auto FloatingWidget = d->DockManager->addDockWidgetFloating(DockWidget);
FloatingWidget->move(QPoint(20, 20));
d->LastCreatedFloatingEditor = DockWidget;
d->LastDockedEditor.clear();
}
else
{
ads::CDockAreaWidget* EditorArea = d->LastDockedEditor ? d->LastDockedEditor->dockAreaWidget() : nullptr;
if (EditorArea)
{
std::cout << "DockAreaCount before: " << EditorArea->dockContainer()->dockAreaCount() << std::endl;
d->DockManager->setConfigFlag(ads::CDockManager::EqualSplitOnInsertion, true);
d->DockManager->addDockWidget(ads::RightDockWidgetArea, DockWidget, EditorArea);
std::cout << "DockAreaCount after: " << DockWidget->dockContainer()->dockAreaCount() << std::endl;
}
else
{
if (d->LastCreatedFloatingEditor)
{
std::cout << "LastCreated" << std::endl;
d->DockManager->addDockWidget(ads::RightDockWidgetArea, DockWidget, d->LastCreatedFloatingEditor->dockAreaWidget());
}
else
{
d->DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget);
}
}
d->LastDockedEditor = DockWidget;
}
}
@@ -642,9 +825,34 @@ void CMainWindow::onEditorCloseRequested()
//============================================================================
void CMainWindow::createTable()
{
auto DockWidget = createTableWidget(d->ui.menuView);
auto DockWidget = d->createTableWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
auto FloatingWidget = d->DockManager->addDockWidgetFloating(DockWidget);
FloatingWidget->move(QPoint(40, 40));
}
//============================================================================
void CMainWindow::showStatusDialog()
{
CStatusDialog Dialog(d->DockManager);
Dialog.exec();
}
//============================================================================
void CMainWindow::toggleDockWidgetWindowTitle()
{
QString Title = d->WindowTitleTestDockWidget->windowTitle();
int i = Title.indexOf(" (Test)");
if (-1 == i)
{
Title += " (Test)";
}
else
{
Title = Title.left(i);
}
d->WindowTitleTestDockWidget->setWindowTitle(Title);
}

View File

@@ -63,6 +63,8 @@ private slots:
void createEditor();
void createTable();
void onEditorCloseRequested();
void showStatusDialog();
void toggleDockWidgetWindowTitle();
};
#endif // MAINWINDOW_H

88
demo/StatusDialog.cpp Normal file
View File

@@ -0,0 +1,88 @@
//============================================================================
/// \file StatusDialog.cpp
/// \author Uwe Kindler
/// \date 13.04.2020
/// \brief Implementation of CStatusDialog class
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include "StatusDialog.h"
#include <iostream>
#include "DockManager.h"
#include "DockWidget.h"
#include "ui_StatusDialog.h"
/**
* Private data class of CStatusDialog class (pimpl)
*/
struct StatusDialogPrivate
{
CStatusDialog *_this;
Ui::CStatusDialogClass ui;
ads::CDockManager* DockManager;
QMap<QString, ads::CDockWidget*> DockWidgets;
/**
* Private data constructor
*/
StatusDialogPrivate(CStatusDialog *_public);
};
// struct StatusDialogPrivate
//============================================================================
StatusDialogPrivate::StatusDialogPrivate(CStatusDialog *_public) :
_this(_public)
{
}
//============================================================================
CStatusDialog::CStatusDialog(ads::CDockManager* DockManager) :
QDialog(DockManager),
d(new StatusDialogPrivate(this))
{
d->ui.setupUi(this);
d->DockManager = DockManager;
d->DockWidgets = DockManager->dockWidgetsMap();
for (auto it = d->DockWidgets.begin(); it != d->DockWidgets.end(); ++it)
{
QVariant vDockWidget = QVariant::fromValue(it.value());
d->ui.dockWidgetsComboBox->addItem(it.key(), vDockWidget);
}
}
//============================================================================
CStatusDialog::~CStatusDialog()
{
delete d;
}
//============================================================================
void CStatusDialog::on_dockWidgetsComboBox_currentIndexChanged(int index)
{
if (index < 0)
{
return;
}
auto vDockWidget = d->ui.dockWidgetsComboBox->currentData();
auto DockWidget = vDockWidget.value<ads::CDockWidget*>();
d->ui.isClosedCheckBox->setChecked(DockWidget->isClosed());
d->ui.isFloatingCheckBox->setChecked(DockWidget->isFloating());
d->ui.tabbedCheckBox->setChecked(DockWidget->isTabbed());
d->ui.isCurrentTabCheckBox->setChecked(DockWidget->isCurrentTab());
d->ui.closableCheckBox->setChecked(DockWidget->features().testFlag(ads::CDockWidget::DockWidgetClosable));
d->ui.movableCheckBox->setChecked(DockWidget->features().testFlag(ads::CDockWidget::DockWidgetMovable));
d->ui.floatableCheckBox->setChecked(DockWidget->features().testFlag(ads::CDockWidget::DockWidgetFloatable));
d->ui.deleteOnCloseCheckBox->setChecked(DockWidget->features().testFlag(ads::CDockWidget::DockWidgetDeleteOnClose));
d->ui.customCloseHandlingCheckBox->setChecked(DockWidget->features().testFlag(ads::CDockWidget::CustomCloseHandling));
}
//---------------------------------------------------------------------------
// EOF StatusDialog.cpp

47
demo/StatusDialog.h Normal file
View File

@@ -0,0 +1,47 @@
#ifndef StatusDialogH
#define StatusDialogH
//============================================================================
/// \file StatusDialog.h
/// \author Uwe Kindler
/// \date 13.04.2020
/// \brief Declaration of CStatusDialog class
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include <QDialog>
namespace ads {class CDockManager;}
struct StatusDialogPrivate;
/**
* Displays status info about dock widgets
*/
class CStatusDialog : public QDialog
{
Q_OBJECT
private:
StatusDialogPrivate* d; ///< private data (pimpl)
friend struct StatusDialogPrivate;
private slots:
void on_dockWidgetsComboBox_currentIndexChanged(int index);
protected:
public:
using Super = QDialog;
/**
* Default Constructor
*/
CStatusDialog(ads::CDockManager* parent);
/**
* Virtual Destructor
*/
virtual ~CStatusDialog();
}; // class StatusDialog
// namespace namespace_name
//-----------------------------------------------------------------------------
#endif // StatusDialogH

146
demo/StatusDialog.ui Normal file
View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CStatusDialogClass</class>
<widget class="QDialog" name="CStatusDialogClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>357</width>
<height>331</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dock Widget Status</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QLabel" name="dockWidgetLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Dock Widget:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="dockWidgetsComboBox">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="statusGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Status</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="isClosedCheckBox">
<property name="text">
<string>closed</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="isFloatingCheckBox">
<property name="text">
<string>floating</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="tabbedCheckBox">
<property name="text">
<string>tabbed</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="isCurrentTabCheckBox">
<property name="text">
<string>is current tab</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="flagsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Feature Flags</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="closableCheckBox">
<property name="text">
<string>DockWidgetClosable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="movableCheckBox">
<property name="text">
<string>DockWidgetMovable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="floatableCheckBox">
<property name="text">
<string>DockWidgetFloatable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="deleteOnCloseCheckBox">
<property name="text">
<string>DockWidgetDeleteOnClose</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="customCloseHandlingCheckBox">
<property name="text">
<string>CustomCloseHandling</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -4,8 +4,12 @@ TARGET = AdvancedDockingSystemDemo
DESTDIR = $${ADS_OUT_ROOT}/lib
QT += core gui widgets
win32 {
QT += axcontainer
include(../ads.pri)
lessThan(QT_MAJOR_VERSION, 6) {
win32 {
QT += axcontainer
}
}
CONFIG += c++14
@@ -18,34 +22,22 @@ adsBuildStatic {
SOURCES += \
main.cpp \
MainWindow.cpp
MainWindow.cpp \
StatusDialog.cpp
HEADERS += \
MainWindow.h
MainWindow.h \
StatusDialog.h
FORMS += \
mainwindow.ui
mainwindow.ui \
StatusDialog.ui
RESOURCES += demo.qrc
LIBS += -L$${ADS_OUT_ROOT}/lib
# Dependency: AdvancedDockingSystem (shared)
CONFIG(debug, debug|release){
win32 {
LIBS += -lqtadvanceddockingd
}
else:mac {
LIBS += -lqtadvanceddocking_debug
}
else {
LIBS += -lqtadvanceddocking
}
}
else{
LIBS += -lqtadvanceddocking
}
INCLUDEPATH += ../src
DEPENDPATH += ../src

View File

@@ -13,5 +13,9 @@
<file>app.css</file>
<file>images/plus.svg</file>
<file>images/help_outline.svg</file>
<file>images/fullscreen.svg</file>
<file>images/create_floating_editor.svg</file>
<file>images/create_floating_table.svg</file>
<file>images/docked_editor.svg</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
viewBox="0,0,1024,1024"
id="svg2562"
sodipodi:docname="create_floating_editor.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata2568">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs2566" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview2564"
showgrid="false"
inkscape:zoom="0.23046875"
inkscape:cx="512"
inkscape:cy="512"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2562" />
<desc
id="desc2556">note_add icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
id="g2560"
transform="matrix(0.73242903,0,0,0.73242903,136.99634,136.99634)">
<path
d="m 853.33,341.33 v 512 c 0,46.93 -38.4,85.34 -85.33,85.34 H 255.57 c -46.93,0 -84.9,-38.41 -84.9,-85.34 l 0.42,-682.66 c 0,-46.93 37.98,-85.34 84.91,-85.34 h 341.33 z m -170.66,256 h -128 v -128 h -85.34 v 128 h -128 v 85.34 h 128 v 128 h 85.34 v -128 h 128 z M 789.33,384 554.67,149.33 V 384 Z"
id="path2558"
inkscape:connector-curvature="0" />
</g>
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 426.6699,917.33988 512.4297,1024 597.3301,917.33988 Z"
id="path3115"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 426.6699,106.66012 512.4297,0 597.3301,106.66012 Z"
id="path3115-7"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 917.33988,426.6699 1024,512.4297 917.33988,597.3301 Z"
id="path3115-7-9"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 106.66016,426.6699 0,512.4297 106.66016,597.3301 Z"
id="path3115-7-9-4"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
viewBox="0,0,1024,1024"
id="svg2562"
sodipodi:docname="create_floating_table.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata2568">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs2566" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview2564"
showgrid="false"
inkscape:zoom="0.23046875"
inkscape:cx="512"
inkscape:cy="512"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2562" />
<desc
id="desc2556">note_add icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 426.6699,917.33988 512.4297,1024 597.3301,917.33988 Z"
id="path3115"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 426.6699,106.66012 512.4297,0 597.3301,106.66012 Z"
id="path3115-7"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 917.33988,426.6699 1024,512.4297 917.33988,597.3301 Z"
id="path3115-7-9"
inkscape:connector-curvature="0" />
<path
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
d="M 106.66016,426.6699 0,512.4297 106.66016,597.3301 Z"
id="path3115-7-9-4"
inkscape:connector-curvature="0" />
<g
id="g3198"
style="mix-blend-mode:normal;fill:#03b8e5;fill-rule:nonzero"
transform="matrix(0.73241615,0,0,0.73241615,137.00293,137.00293)">
<path
id="path3196"
d="m 938.67,170.67 v 682.66 c 0,46.93 -38.41,85.34 -85.34,85.34 H 170.67 c -46.93,0 -85.34,-38.41 -85.34,-85.34 V 170.67 c 0,-46.93 38.41,-85.34 85.34,-85.34 h 682.66 c 46.93,0 85.34,38.41 85.34,85.34 z m -597.34,0 H 170.67 v 170.66 h 170.66 z m 0,512 H 170.67 v 170.66 h 170.66 z m 0,-256 H 170.67 v 170.66 h 170.66 z m 256,-256 H 426.67 v 170.66 h 170.66 z m 256,0 H 682.67 v 170.66 h 170.66 z m -256,512 H 426.67 v 170.66 h 170.66 z m 0,-256 H 426.67 v 170.66 h 170.66 z m 256,256 H 682.67 v 170.66 h 170.66 z m 0,-256 H 682.67 v 170.66 h 170.66 z"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>chrome_reader_mode icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M981.33,256v554.67c0,46.93 -38.4,85.33 -85.33,85.33h-768c-46.93,0 -85.33,-38.4 -85.33,-85.33v-554.67c0,-46.93 38.4,-85.33 85.33,-85.33h768c46.93,0 85.33,38.4 85.33,85.33zM896,256h-384v554.67h384zM554.67,512h298.66v64h-298.66zM554.67,405.33h298.66v64h-298.66zM554.67,618.67h298.66v64h-298.66z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 717 B

View File

@@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>settings_overscan icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M981.33,213.33v597.34c0,46.93 -38.4,85.33 -85.33,85.33h-768c-46.93,0 -85.33,-38.4 -85.33,-85.33v-597.34c0,-46.93 38.4,-85.33 85.33,-85.33h768c46.93,0 85.33,38.4 85.33,85.33zM896,212.91h-768v598.18h768zM256,597.33l-106.67,-84.9l106.67,-85.76zM597.33,341.33h-170.66l85.76,-106.66zM874.67,512.43l-106.67,84.9v-170.66zM512.43,789.33l-85.76,-106.66h170.66z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 776 B

View File

@@ -35,12 +35,15 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS
int main(int argc, char *argv[])
{
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#if QT_VERSION >= 0x050600
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#endif
std::shared_ptr<int> b;
QApplication a(argc, argv);
a.setApplicationName("Advanced Docking System Demo");
a.setQuitOnLastWindowClosed(true);
QFile StyleSheetFile(":/adsdemo/app.css");

View File

@@ -7,14 +7,14 @@ from PyQt5 import uic
from PyQt5.QtCore import (QCoreApplication, QDir, Qt, QSettings, QSignalBlocker,
QRect, QPoint, qDebug, qInstallMessageHandler,
QtDebugMsg, QtInfoMsg, QtWarningMsg,
QtCriticalMsg, QtFatalMsg)
QtCriticalMsg, QtFatalMsg, QSize)
from PyQt5.QtGui import (QGuiApplication, QIcon, QCloseEvent)
from PyQt5.QtWidgets import (QCalendarWidget, QFileSystemModel, QFrame, QLabel,
QMenu, QTreeView, QAction, QWidgetAction,
QComboBox, QStyle, QSizePolicy, QInputDialog, QMenu,
QToolButton, QWidget, QPlainTextEdit,
QTableWidget, QTableWidgetItem, QApplication,
QMessageBox)
QMenu, QTreeView, QAction, QWidgetAction,
QComboBox, QStyle, QSizePolicy, QInputDialog, QMenu,
QToolButton, QWidget, QPlainTextEdit,
QTableWidget, QTableWidgetItem, QApplication,
QMessageBox)
try:
from PyQt5.QAxContainer import QAxWidget
except ImportError:
@@ -25,6 +25,7 @@ else:
from PyQtAds import QtAds
import rc # pyrcc5 demo.qrc -o rc.py
from status_dialog import CStatusDialog
UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)
@@ -47,7 +48,7 @@ def features_string(dock_widget: QtAds.CDockWidget) -> str:
f = dock_widget.features()
closable = f & QtAds.CDockWidget.DockWidgetClosable
movable = f & QtAds.CDockWidget.DockWidgetMovable
floatable = f &QtAds.CDockWidget.DockWidgetFloatable
floatable = f & QtAds.CDockWidget.DockWidgetFloatable
return "c{} m{} f{}".format("+" if closable else "-",
"+" if movable else "-",
@@ -64,122 +65,21 @@ def append_feature_string_to_window_title(dock_widget: QtAds.CDockWidget):
def svg_icon(filename: str):
'''Helper function to create an SVG icon'''
# This is a workaround, because because in item views SVG icons are not
# properly scaled an look blurry or pixelate
# properly scaled and look blurry or pixelate
icon = QIcon(filename)
icon.addPixmap(icon.pixmap(92))
return icon
class CMinSizeTableWidget(QTableWidget):
"""Custom QTableWidget with a minimum size hint to test CDockWidget
setMinimumSizeHintMode() function of CDockWidget"""
def minimumSizeHint(self) -> QSize:
return QSize(300, 100)
def create_long_text_label_dock_widget(view_menu: QMenu) -> QtAds.CDockWidget:
label = QLabel()
label.setWordWrap(True)
label.setAlignment(Qt.AlignTop | Qt.AlignLeft)
label.setText('''\
Label {} {} - Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum
sociis natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium
quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla
vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut,
imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis
pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu,
consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra
quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.
'''.format(_State.label_count, datetime.datetime.now().strftime("%H:%M:%S:%f")))
dock_widget = QtAds.CDockWidget("Label {}".format(_State.label_count))
_State.label_count += 1
dock_widget.setWidget(label)
view_menu.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_calendar_dock_widget(view_menu: QMenu) -> QtAds.CDockWidget:
widget = QCalendarWidget()
dock_widget = QtAds.CDockWidget("Calendar {}".format(_State.calendar_count))
_State.calendar_count += 1
dock_widget.setWidget(widget)
dock_widget.setToggleViewActionMode(QtAds.CDockWidget.ActionModeShow)
dock_widget.setIcon(svg_icon(":/adsdemo/images/date_range.svg"))
view_menu.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_file_system_tree_dock_widget(view_menu: QMenu) -> QtAds.CDockWidget:
widget = QTreeView()
widget.setFrameShape(QFrame.NoFrame)
m = QFileSystemModel(widget)
m.setRootPath(QDir.currentPath())
widget.setModel(m)
dock_widget = QtAds.CDockWidget("Filesystem {}".format(_State.file_system_count))
_State.file_system_count += 1
dock_widget.setWidget(widget)
view_menu.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_editor_widget(view_menu: QMenu) -> QtAds.CDockWidget:
widget = QPlainTextEdit()
widget.setPlaceholderText("This is an editor. If you close the editor, it will be "
"deleted. Enter your text here.")
widget.setStyleSheet("border: none")
dock_widget = QtAds.CDockWidget("Editor {}".format(_State.editor_count))
_State.editor_count += 1
dock_widget.setWidget(widget)
dock_widget.setIcon(svg_icon(":/adsdemo/images/edit.svg"))
dock_widget.setFeature(QtAds.CDockWidget.CustomCloseHandling, True)
view_menu.addAction(dock_widget.toggleViewAction())
options_menu = QMenu(dock_widget)
options_menu.setTitle("Options")
options_menu.setToolTip(options_menu.title())
options_menu.setIcon(svg_icon(":/adsdemo/images/custom-menu-button.svg"))
menu_action = options_menu.menuAction()
# The object name of the action will be set for the QToolButton that
# is created in the dock area title bar. You can use this name for CSS
# styling
menu_action.setObjectName("options_menu")
dock_widget.setTitleBarActions([options_menu.menuAction()])
a = options_menu.addAction("Clear Editor")
a.triggered.connect(widget.clear)
return dock_widget
def create_table_widget(view_menu: QMenu) -> QtAds.CDockWidget:
widget = QTableWidget()
dock_widget = QtAds.CDockWidget("Table {}".format(_State.table_count))
_State.table_count += 1
COLCOUNT = 5
ROWCOUNT = 30
widget.setColumnCount(COLCOUNT)
widget.setRowCount(ROWCOUNT)
for col in range(ROWCOUNT):
widget.setHorizontalHeaderItem(col, QTableWidgetItem("Col {}".format(col+1)))
for row in range(ROWCOUNT):
widget.setItem(row, col, QTableWidgetItem("T {:}-{:}".format(row+1, col+1)))
dock_widget.setWidget(widget)
dock_widget.setIcon(svg_icon(":/adsdemo/images/grid_on.svg"))
view_menu.addAction(dock_widget.toggleViewAction())
return dock_widget
if ACTIVEX_AVAILABLE:
def create_activex_widget(view_menu: QMenu, parent: QWidget = None) -> QtAds.CDockWidget:
widget = QAxWidget("{6bf52a52-394a-11d3-b153-00c04f79faa6}", parent)
dock_widget = QtAds.CDockWidget("Active X {}".format(_State.activex_count))
_State.activex_count += 1
dock_widget.setWidget(widget)
view_menu.addAction(dock_widget.toggleViewAction())
return dock_widget
class CustomComponentsFactory(QtAds.CDockComponentsFactory):
class CCustomComponentsFactory(QtAds.CDockComponentsFactory):
def createDockAreaTitleBar(self, dock_area: QtAds.CDockAreaWidget) -> QtAds.CDockAreaTitleBar:
title_bar = QtAds.CDockAreaTitleBar(dock_area)
@@ -192,7 +92,6 @@ class CustomComponentsFactory(QtAds.CDockComponentsFactory):
return title_bar
class MainWindow(MainWindowUI, MainWindowBase):
save_perspective_action: QAction
perspective_list_action: QWidgetAction
@@ -205,6 +104,8 @@ class MainWindow(MainWindowUI, MainWindowBase):
self.perspective_list_action = None
self.perspective_combo_box = None
self.dock_manager = None
self.window_title_test_dock_widget = None
self.last_docked_editor = None
self.setupUi(self)
self.create_actions()
@@ -213,13 +114,47 @@ class MainWindow(MainWindowUI, MainWindowBase):
# a QToolButton instead of a QPushButton
# QtAds.CDockManager.setConfigFlags(QtAds.CDockManager.configFlags() | QtAds.CDockManager.TabCloseButtonIsToolButton)
# uncomment the following line if you want to use opaque undocking and
# opaque splitter resizing
#QtAds.CDockManager.setConfigFlags(QtAds.CDockManager.DefaultOpaqueConfig)
# uncomment the following line if you want a fixed tab width that does
# not change if the visibility of the close button changes
# QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.RetainTabSizeWhenCloseButtonHidden, True)
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.RetainTabSizeWhenCloseButtonHidden, True)
# uncomment the follwing line if you want to use non opaque undocking and splitter
# movements
# QtAds.CDockManager.setConfigFlags(QtAds.CDockManager.DefaultNonOpaqueConfig)
# uncomment the following line if you don't want close button on DockArea's title bar
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.DockAreaHasCloseButton, False)
# uncomment the following line if you don't want undock button on DockArea's title bar
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.DockAreaHasUndockButton, False)
# uncomment the following line if you don't want tabs menu button on DockArea's title bar
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.DockAreaHasTabsMenuButton, False)
# uncomment the following line if you don't want disabled buttons to appear on DockArea's title bar
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.DockAreaHideDisabledButtons, True)
# uncomment the following line if you want to show tabs menu button on DockArea's title bar only when there are more than one tab and at least of them has elided title
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.DockAreaDynamicTabsMenuButtonVisibility, True)
# uncomment the following line if you want floating container to always show application title instead of active dock widget's title
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.FloatingContainerHasWidgetTitle, False)
# uncomment the following line if you want floating container to show active dock widget's icon instead of always showing application icon
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.FloatingContainerHasWidgetIcon, True)
# uncomment the following line if you want a central widget in the main dock container (the dock manager) without a titlebar
# If you enable this code, you can test it in the demo with the Calendar 0
# dock widget.
#QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.HideSingleCentralWidgetTitleBar, True)
# uncomment the following line to enable focus highlighting of the dock
# widget that has the focus
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.FocusHighlighting, True)
# uncomment if you would like to enable an equal distribution of the
# available size of a splitter to all contained dock widgets
# QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.EqualSplitOnInsertion, True)
# Now create the dock manager and its content
self.dock_manager = QtAds.CDockManager(self)
@@ -242,19 +177,19 @@ class MainWindow(MainWindowUI, MainWindowBase):
def create_content(self):
# Test container docking
view_menu = self.menuView
dock_widget = create_calendar_dock_widget(view_menu)
dock_widget = self.create_calendar_dock_widget()
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetClosable, False)
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetMovable, False)
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetFloatable, False)
special_dock_area = self.dock_manager.addDockWidget(QtAds.LeftDockWidgetArea, dock_widget)
# For this Special Dock Area we want to avoid dropping on the center of it (i.e. we don't want this widget to be ever tabbified):
special_dock_area.setAllowedAreas(QtAds.OuterDockAreas)
# special_dock_area.setAllowedAreas(QtAds.LeftDockWidgetArea | QtAds.RightDockWidgetArea) # just for testing
self.dock_manager.addDockWidget(QtAds.LeftDockWidgetArea, create_long_text_label_dock_widget(view_menu))
file_system_widget = create_file_system_tree_dock_widget(view_menu)
dock_widget = self.create_long_text_label_dock_widget()
self.window_title_test_dock_widget = dock_widget
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetFocusable, False)
self.dock_manager.addDockWidget(QtAds.LeftDockWidgetArea, dock_widget)
file_system_widget = self.create_file_system_tree_dock_widget()
tool_bar = file_system_widget.createDefaultToolBar()
tool_bar.addAction(self.actionSaveState)
tool_bar.addAction(self.actionRestoreState)
@@ -262,29 +197,35 @@ class MainWindow(MainWindowUI, MainWindowBase):
append_feature_string_to_window_title(file_system_widget)
self.dock_manager.addDockWidget(QtAds.BottomDockWidgetArea, file_system_widget)
file_system_widget = create_file_system_tree_dock_widget(view_menu)
tool_bar = file_system_widget.createDefaultToolBar()
tool_bar.addAction(self.actionSaveState)
tool_bar.addAction(self.actionRestoreState)
file_system_widget = self.create_file_system_tree_dock_widget()
file_system_widget.setFeature(QtAds.CDockWidget.DockWidgetMovable, False)
file_system_widget.setFeature(QtAds.CDockWidget.DockWidgetFloatable, False)
append_feature_string_to_window_title(file_system_widget)
# Test custom factory - we inject a help button into the title bar
self.factory = CustomComponentsFactory()
QtAds.CDockComponentsFactory.setFactory(self.factory)
QtAds.CDockComponentsFactory.setFactory(CCustomComponentsFactory())
top_dock_area = self.dock_manager.addDockWidget(QtAds.TopDockWidgetArea, file_system_widget)
# Uncomment the next line if you would like to test the
# HideSingleWidgetTitleBar functionality
# top_dock_area.setDockAreaFlag(QtAds.CDockAreaWidget.HideSingleWidgetTitleBar, True)
QtAds.CDockComponentsFactory.resetDefaultFactory()
# We create a calendar widget and clear all flags to prevent the dock area
# from closing
dock_widget = create_calendar_dock_widget(view_menu)
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetClosable, False)
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetMovable, False)
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetFloatable, False)
dock_widget = self.create_calendar_dock_widget()
dock_widget.setTabToolTip("Tab ToolTip\nHodie est dies magna")
dock_area = self.dock_manager.addDockWidget(QtAds.CenterDockWidgetArea, dock_widget, top_dock_area)
# Now we create a action to test resizing of DockArea widget
action = self.menuTests.addAction("Resize {}".format(dock_widget.windowTitle()))
def action_triggered():
splitter = QtAds.internal.findParent(QtAds.CDockSplitter, dock_area)
if not splitter:
return
# We change the sizes of the splitter that contains the Calendar 1 widget
# to resize the dock widget
width = splitter.width()
splitter.setSizes([width * 2/3, width * 1/3])
action.triggered.connect(action_triggered)
# Now we add a custom button to the dock area title bar that will create
# new editor widgets when clicked
@@ -292,11 +233,12 @@ class MainWindow(MainWindowUI, MainWindowBase):
custom_button.setToolTip("Create Editor")
custom_button.setIcon(svg_icon(":/adsdemo/images/plus.svg"))
custom_button.setAutoRaise(True)
title_bar = dock_area.titleBar()
index = title_bar.indexOf(title_bar.tabBar())
title_bar.insertWidget(index + 1, custom_button)
def on_button_clicked():
dock_widget = create_editor_widget(self.menuView)
dock_widget = self.create_editor_widget()
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetDeleteOnClose, True)
self.dock_manager.addDockWidgetTabToArea(dock_widget, dock_area)
dock_widget.closeRequested.connect(self.on_editor_close_requested)
@@ -305,30 +247,35 @@ class MainWindow(MainWindowUI, MainWindowBase):
# Test dock area docking
right_dock_area = self.dock_manager.addDockWidget(
QtAds.RightDockWidgetArea,
create_long_text_label_dock_widget(view_menu), top_dock_area)
self.create_long_text_label_dock_widget(), top_dock_area)
self.dock_manager.addDockWidget(
QtAds.TopDockWidgetArea,
create_long_text_label_dock_widget(view_menu), right_dock_area)
self.create_long_text_label_dock_widget(), right_dock_area)
bottom_dock_area = self.dock_manager.addDockWidget(
QtAds.BottomDockWidgetArea,
create_long_text_label_dock_widget(view_menu), right_dock_area)
self.create_long_text_label_dock_widget(), right_dock_area)
self.dock_manager.addDockWidget(
QtAds.CenterDockWidgetArea,
create_long_text_label_dock_widget(view_menu), right_dock_area)
self.create_long_text_label_dock_widget(), right_dock_area)
self.dock_manager.addDockWidget(
QtAds.CenterDockWidgetArea,
create_long_text_label_dock_widget(view_menu), bottom_dock_area)
action = self.menuView.addAction("Set {} floating".format(dock_widget.windowTitle()))
self.create_long_text_label_dock_widget(), bottom_dock_area)
action = self.menuTests.addAction("Set {} Floating".format(dock_widget.windowTitle()))
action.triggered.connect(dock_widget.setFloating)
action = self.menuTests.addAction("Set {} As Current Tab".format(dock_widget.windowTitle()))
action.triggered.connect(dock_widget.setAsCurrentTab)
action = self.menuTests.addAction("Raise {}".format(dock_widget.windowTitle()))
action.triggered.connect(dock_widget.raise_)
if ACTIVEX_AVAILABLE:
flags = self.dock_manager.configFlags()
if flags & QtAds.CDockManager.OpaqueUndocking:
self.dock_manager.addDockWidget(QtAds.CenterDockWidgetArea,
create_activex_widget(view_menu), right_dock_area)
self.create_activex_widget(), right_dock_area)
for dock_widget in self.dock_manager.dockWidgetsMap().values():
dock_widget.viewToggled.connect(self.on_view_toggled)
@@ -353,25 +300,41 @@ class MainWindow(MainWindowUI, MainWindowBase):
self.toolBar.addAction(self.perspective_list_action)
self.toolBar.addAction(self.save_perspective_action)
a = self.toolBar.addAction("Create Editor")
a = self.toolBar.addAction("Create Floating Editor")
a.setProperty("Floating", True)
a.setToolTip("Creates floating dynamic dockable editor windows that are deleted on close")
a.setIcon(svg_icon(":/adsdemo/images/note_add.svg"))
a.triggered.connect(self.create_editor)
self.menuTests.addAction(a)
a = self.toolBar.addAction("Create Docked Editor")
a.setProperty("Floating", False)
a.setToolTip("Creates a docked editor windows that are deleted on close")
a.setIcon(svg_icon(":/adsdemo/images/docked_editor.svg"))
a.triggered.connect(self.create_editor)
self.menuTests.addAction(a)
a = self.toolBar.addAction("Create Table")
a = self.toolBar.addAction("Create Floating Table")
a.setToolTip("Creates floating dynamic dockable table with millions of entries")
a.setIcon(svg_icon(":/adsdemo/images/grid_on.svg"))
a.triggered.connect(self.create_table)
self.menuTests.addAction(a)
self.menuTests.addSeparator()
a = self.menuTests.addAction("Show Status Dialog")
a.triggered.connect(self.show_status_dialog)
self.menuTests.addSeparator()
def closeEvent(self, event: QCloseEvent):
self.save_state()
self.dock_manager.deleteLater()
super().closeEvent(event)
def on_action_save_state_triggered(state: bool):
def on_actionSaveState_triggered(self, state: bool):
qDebug("MainWindow::on_action_save_state_triggered")
self.save_state()
def on_action_restore_state_triggered(state: bool):
def on_actionRestoreState_triggered(self, state: bool):
qDebug("MainWindow::on_action_restore_state_triggered")
self.restore_state()
@@ -400,14 +363,27 @@ class MainWindow(MainWindowUI, MainWindowBase):
if dock_widget is None:
return
qDebug("{} visibility_changed({})".format(dock_widget.objectName(), visible))
# qDebug("{} visibility_changed({})".format(dock_widget.objectName(), visible))
def create_editor(self):
dock_widget = create_editor_widget(self.menuView)
sender = self.sender()
floating = sender.property("Floating")
dock_widget = self.create_editor_widget()
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetDeleteOnClose, True)
floating_widget = self.dock_manager.addDockWidgetFloating(dock_widget)
floating_widget.move(QPoint(20, 20))
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetForceCloseWithArea, True)
dock_widget.closeRequested.connect(self.on_editor_close_requested)
if floating:
floating_widget = self.dock_manager.addDockWidgetFloating(dock_widget)
floating_widget.move(QPoint(20, 20))
else:
editor_area = self.last_docked_editor.dockAreaWidget() if self.last_docked_editor is not None else None
if editor_area is not None:
self.dock_manager.setConfigFlag(QtAds.CDockManager.EqualSplitOnInsertion, True)
self.dock_manager.addDockWidget(QtAds.RightDockWidgetArea, dock_widget, editor_area)
else:
self.dock_manager.addDockWidget(QtAds.TopDockWidgetArea, dock_widget)
self.last_docked_editor = dock_widget
def on_editor_close_requested(self):
dock_widget = self.sender()
@@ -417,10 +393,24 @@ class MainWindow(MainWindowUI, MainWindowBase):
dock_widget.closeDockWidget()
def create_table(self):
dock_widget = create_table_widget(self.menuView)
dock_widget = self.create_table_widget()
dock_widget.setFeature(QtAds.CDockWidget.DockWidgetDeleteOnClose, True)
floating_widget = self.dock_manager.addDockWidgetFloating(dock_widget)
floating_widget.move(QPoint(40, 40))
def show_status_dialog(self):
dialog = CStatusDialog(self.dock_manager)
dialog.exec_()
def toggle_dock_widget_window_title(self):
title = self.window_title_test_dock_widget.windowTitle()
i = title.find(" (Test) ")
if i == -1:
title += " (Test) "
else:
title = title[i]
self.window_title_test_dock_widget.setWindowTitle(title)
def save_state(self):
'''
@@ -474,6 +464,124 @@ class MainWindow(MainWindowUI, MainWindowBase):
self.perspective_combo_box.setCurrentText(perspective_name)
self.save_perspectives()
def create_long_text_label_dock_widget(self) -> QtAds.CDockWidget:
label = QLabel()
label.setWordWrap(True)
label.setAlignment(Qt.AlignTop | Qt.AlignLeft)
label.setText('''Label {} {} - Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum
sociis natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium
quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla
vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut,
imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis
pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu,
consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra
quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.
'''.format(_State.label_count, datetime.datetime.now().strftime("%H:%M:%S:%f")))
dock_widget = QtAds.CDockWidget("Label {}".format(_State.label_count))
_State.label_count += 1
dock_widget.setWidget(label)
self.menuView.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_calendar_dock_widget(self) -> QtAds.CDockWidget:
widget = QCalendarWidget()
dock_widget = QtAds.CDockWidget("Calendar {}".format(_State.calendar_count))
_State.calendar_count += 1
# The following lines are for testing the setWidget() and takeWidget()
# functionality
dock_widget.setWidget(widget)
dock_widget.setWidget(widget) # what happens if we set a widget if a widget is already set
dock_widget.takeWidget() # we remove the widget
dock_widget.setWidget(widget) # and set the widget again - there should be no error
dock_widget.setToggleViewActionMode(QtAds.CDockWidget.ActionModeShow)
dock_widget.setIcon(svg_icon(":/adsdemo/images/date_range.svg"))
self.menuView.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_file_system_tree_dock_widget(self) -> QtAds.CDockWidget:
widget = QTreeView()
widget.setFrameShape(QFrame.NoFrame)
m = QFileSystemModel(widget)
m.setRootPath(QDir.currentPath())
widget.setModel(m)
dock_widget = QtAds.CDockWidget("Filesystem {}".format(_State.file_system_count))
_State.file_system_count += 1
dock_widget.setWidget(widget)
self.menuView.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_editor_widget(self) -> QtAds.CDockWidget:
widget = QPlainTextEdit()
widget.setPlaceholderText("This is an editor. If you close the editor, it will be "
"deleted. Enter your text here.")
widget.setStyleSheet("border: none")
dock_widget = QtAds.CDockWidget("Editor {}".format(_State.editor_count))
_State.editor_count += 1
dock_widget.setWidget(widget)
dock_widget.setIcon(svg_icon(":/adsdemo/images/edit.svg"))
dock_widget.setFeature(QtAds.CDockWidget.CustomCloseHandling, True)
self.menuView.addAction(dock_widget.toggleViewAction())
options_menu = QMenu(dock_widget)
options_menu.setTitle("Options")
options_menu.setToolTip(options_menu.title())
options_menu.setIcon(svg_icon(":/adsdemo/images/custom-menu-button.svg"))
menu_action = options_menu.menuAction()
# The object name of the action will be set for the QToolButton that
# is created in the dock area title bar. You can use this name for CSS
# styling
menu_action.setObjectName("options_menu")
dock_widget.setTitleBarActions([options_menu.menuAction()])
a = options_menu.addAction("Clear Editor")
a.triggered.connect(widget.clear)
return dock_widget
def create_table_widget(self) -> QtAds.CDockWidget:
widget = CMinSizeTableWidget()
dock_widget = QtAds.CDockWidget("Table {}".format(_State.table_count))
_State.table_count += 1
COLCOUNT = 5
ROWCOUNT = 30
widget.setColumnCount(COLCOUNT)
widget.setRowCount(ROWCOUNT)
for col in range(ROWCOUNT):
widget.setHorizontalHeaderItem(col, QTableWidgetItem("Col {}".format(col + 1)))
for row in range(ROWCOUNT):
widget.setItem(row, col, QTableWidgetItem("T {:}-{:}".format(row + 1, col + 1)))
dock_widget.setWidget(widget)
dock_widget.setIcon(svg_icon(":/adsdemo/images/grid_on.svg"))
dock_widget.setMinimumSizeHintMode(QtAds.CDockWidget.MinimumSizeHintFromContent)
toolbar = dock_widget.createDefaultToolBar()
action = toolbar.addAction(svg_icon(":/adsdemo/images/fullscreen.svg"), "Toggle Fullscreen")
def on_toggle_fullscreen():
if dock_widget.isFullScreen():
dock_widget.showNormal()
else:
dock_widget.showFullScreen()
action.triggered.connect(on_toggle_fullscreen)
self.menuView.addAction(dock_widget.toggleViewAction())
return dock_widget
def create_activex_widget(self, parent: QWidget = None) -> QtAds.CDockWidget:
widget = QAxWidget("{6bf52a52-394a-11d3-b153-00c04f79faa6}", parent)
dock_widget = QtAds.CDockWidget("Active X {}".format(_State.activex_count))
_State.activex_count += 1
dock_widget.setWidget(widget)
self.menuView.addAction(dock_widget.toggleViewAction())
return dock_widget
def my_message_output(type, context, msg):
if type == QtDebugMsg:

View File

@@ -31,7 +31,6 @@
<property name="title">
<string>File</string>
</property>
<addaction name="actionExit"/>
<addaction name="actionSaveState"/>
<addaction name="actionRestoreState"/>
</widget>
@@ -45,8 +44,14 @@
<string>About</string>
</property>
</widget>
<widget class="QMenu" name="menuTests">
<property name="title">
<string>Tests</string>
</property>
</widget>
<addaction name="menuFile"/>
<addaction name="menuView"/>
<addaction name="menuTests"/>
<addaction name="menuAbout"/>
</widget>
<widget class="QToolBar" name="toolBar">

38
demo/status_dialog.py Normal file
View File

@@ -0,0 +1,38 @@
import os
import sys
from PyQt5 import uic
from PyQtAds import QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'StatusDialog.ui')
StatusDialogUI, StatusDialogBase = uic.loadUiType(UI_FILE)
class CStatusDialog(StatusDialogUI, StatusDialogBase):
def __init__(self, dock_manager: QtAds.CDockManager, parent=None):
super().__init__(parent)
self.setupUi(self)
self.dock_manager = dock_manager
self.dock_widgets = self.dock_manager.dockWidgetsMap()
for key, widget in self.dock_widgets.items():
self.dockWidgetsComboBox.addItem(key, widget)
def on_dockWidgetsComboBox_currentIndexChanged(self, index: int):
if not isinstance(index, int):
return
if index < 0:
return
dock_widget = self.dockWidgetsComboBox.currentData()
self.isClosedCheckBox.setChecked(dock_widget.isClosed())
self.isFloatingCheckBox.setChecked(dock_widget.isFloating())
self.tabbedCheckBox.setChecked(dock_widget.isTabbed())
self.isCurrentTabCheckBox.setChecked(dock_widget.isCurrentTab())
self.closableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetClosable)
self.movableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetMovable)
self.floatableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetFloatable)
self.deleteOnCloseCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetDeleteOnClose)
self.customCloseHandlingCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.CustomCloseHandling)

View File

@@ -1,123 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
viewBox="0,0,1024,1024"
id="svg1145"
viewBox="0 0 1023.99 1023.99"
id="svg26"
sodipodi:docname="ads_icon.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
inkscape:export-filename="C:\CodingXP\cetoni_projects\QtAdvancedDockingSystem\doc\ads_icon_256.png"
inkscape:export-xdpi="24"
inkscape:export-ydpi="24">
<metadata
id="metadata1151">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
width="1023.99"
height="1023.99"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1149" />
id="defs30" />
<sodipodi:namedview
id="namedview28"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview1147"
showgrid="false"
inkscape:zoom="0.32593202"
inkscape:cx="256.13402"
inkscape:cy="235.82602"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg1145" />
inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc
id="desc1129">window_size icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<path
id="path1797-1"
visibility="hidden"
d="M 71.53142,291.89723 H 950.1828 l 0.6743,0.6742 v 586.08 l -0.6743,0.6743 H 71.53142 l -0.6743,-0.6743 v -586.08 z"
inkscape:connector-curvature="0"
style="visibility:hidden;mix-blend-mode:normal;fill:#ffffff;fill-rule:nonzero;stroke-width:0.99999988;fill-opacity:1" />
<rect
transform="rotate(-90)"
y="412.13489"
x="-911.34436"
height="560.90375"
width="327.70862"
id="rect1739-8"
style="opacity:1;fill:#ffd292;fill-opacity:1;stroke:none;stroke-width:37.79526901;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<path
id="path1799"
d="M 988.40121,578.11175 V 651.2546 H 409.96541 V 578.11175 Z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" />
<rect
style="opacity:1;fill:#b3c3cb;fill-opacity:1;stroke:none;stroke-width:37.79526901;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect1739-6-1"
width="655.41724"
height="338.99207"
x="-914.85529"
y="38.243896"
transform="rotate(-90)" />
<path
id="path1801-7"
d="m 73.1429,73.14287 h 877.7142 c 40.2857,0 73.1429,32.86857 73.1429,73.14285 V 914.2857 c 0,20.12571 -16.4458,36.57142 -36.5715,36.57142 H 36.5714 C 16.4343,950.85712 0,934.42284 0,914.2857 V 146.28572 C 0,106.00001 32.8571,73.14287 73.1429,73.14287 Z m 0,219.42856 V 877.71427 H 950.8571 V 292.57143 Z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" />
<path
id="path1799-6"
d="M 359.8801,276.79402 H 433.023 V 886.78767 H 359.8801 Z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" />
<circle
r="36.81749"
cy="169.78555"
cx="920.66248"
id="path1917-42"
style="opacity:1;fill:#ffa726;fill-opacity:1;stroke:none;stroke-width:63.79999924;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
<circle
r="36.81749"
cy="169.78555"
cx="817.22302"
id="path1917-4-6"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:63.79999924;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
<path
id="path1799-8"
d="m 615.67076,292.13464 v 73.14285 H 433.023 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#95abb6;fill-rule:nonzero;stroke-width:0.99999994;fill-opacity:1" />
<path
id="path1799-8-1"
d="m 798.31852,292.13464 v 73.14285 H 615.67076 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#c7d4d9;fill-rule:nonzero;stroke-width:0.99999994;fill-opacity:1" />
<path
id="path1799-8-7"
d="m 255.79066,292.57143 v 73.14285 H 73.1429 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#dfe5e9;fill-opacity:1;fill-rule:nonzero;stroke-width:0.99999994" />
<path
id="path1799-8-7-6"
d="m 616.34083,651.15739 v 73.14285 H 433.69307 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#ffba56;fill-opacity:1;fill-rule:nonzero;stroke-width:0.99999994" />
id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
x="1251.1022"
y="1305.4956"
id="text9788"><tspan
sodipodi:role="line"
id="tspan9786"
x="1251.1022"
y="1305.4956" /></text>
<g
id="g94691"
transform="translate(581.23034,1750.5233)">
<path
d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
fill="#707070"
id="path4-5"
style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
<path
id="path927"
style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
<path
id="path16513"
style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
<path
id="path16513-5"
style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
<path
id="path24788"
style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

88
doc/ads_logo.svg Normal file
View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 6907.3028 1023.99"
id="svg26"
sodipodi:docname="ads_logo.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
width="6907.3027"
height="1023.99"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs30" />
<sodipodi:namedview
id="namedview28"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc
id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
x="1251.1022"
y="1305.4956"
id="text9788"><tspan
sodipodi:role="line"
id="tspan9786"
x="1251.1022"
y="1305.4956" /></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:628.003px;line-height:1.25;font-family:sans-serif;fill:#8f918f;fill-opacity:1;stroke:none;stroke-width:1"
x="1178.9221"
y="718.37329"
id="text15608"><tspan
sodipodi:role="line"
id="tspan15606"
x="1178.9221"
y="718.37329"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:628.003px;font-family:'Segoe UI';-inkscape-font-specification:'Segoe UI Light';fill:#8f918f;fill-opacity:1;stroke-width:1">Qt Advanced Docking</tspan></text>
<g
id="g94691"
transform="translate(581.23034,1750.5233)">
<path
d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
fill="#707070"
id="path4-5"
style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
<path
id="path927"
style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
<path
id="path16513"
style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
<path
id="path16513-5"
style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
<path
id="path24788"
style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -12,29 +12,14 @@ styles as much as possible.
## Features
### Overview
- [Advanced Docking System for Qt](#advanced-docking-system-for-qt)
- [Features](#features)
- [Overview](#overview)
- [Docking everywhere - no central widget](#docking-everywhere---no-central-widget)
- [Docking inside floating windows](#docking-inside-floating-windows)
- [Grouped dragging](#grouped-dragging)
- [Perspectives for fast switching of the complete main window layout](#perspectives-for-fast-switching-of-the-complete-main-window-layout)
- [Opaque and non-opaque splitter resizing](#opaque-and-non-opaque-splitter-resizing)
- [Opaque and non-opaque undocking](#opaque-and-non-opaque-undocking)
- [Tab-menu for easy handling of many tabbed dock widgets](#tab-menu-for-easy-handling-of-many-tabbed-dock-widgets)
- [Many different ways to detach dock widgets](#many-different-ways-to-detach-dock-widgets)
- [Supports deletion of dynamically created dock widgets](#supports-deletion-of-dynamically-created-dock-widgets)
### Docking everywhere - no central widget
There is no central widget like in the Qt docking system. You can dock on every
border of the main window or you can dock into each dock area - so you are
free to dock almost everywhere.
![Dropping widgets](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/preview-dragndrop.png)\
\
![Dropping widgets](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/preview-dragndrop.png)
![Dropping widgets](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/preview-dragndrop_dark.png)
### Docking inside floating windows
@@ -42,8 +27,8 @@ free to dock almost everywhere.
There is no difference between the main window and a floating window. Docking
into floating windows is supported.
![Docking inside floating windows](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/floating-widget-dragndrop.png)\
\
![Docking inside floating windows](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/floating-widget-dragndrop.png)
![Docking inside floating windows](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/floating-widget-dragndrop_dark.png)
### Grouped dragging
@@ -52,8 +37,8 @@ When dragging the titlebar of a dock, all the tabs that are tabbed with it are
going to be dragged. So you can move complete groups of tabbed widgets into
a floating widget or from one dock area to another one.
![Grouped dragging](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/grouped-dragging.gif)\
\
![Grouped dragging](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/grouped-dragging.gif)
![Grouped dragging](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/grouped-dragging_dark.png)
### Perspectives for fast switching of the complete main window layout
@@ -64,8 +49,8 @@ perspective to make your own custom perspective. Later you can simply
select a perspective from the perspective list to quickly switch the complete
main window layout.
![Perspective](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/perspectives.gif)\
\
![Perspective](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/perspectives.gif)
![Perspective](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/perspectives_dark.png)
### Opaque and non-opaque splitter resizing
@@ -107,3 +92,10 @@ You can detach dock widgets and also dock areas in the following ways:
### Supports deletion of dynamically created dock widgets
Normally clicking the close button of a dock widget will just hide the widget and the user can show it again using the toggleView() action of the dock widget. This is meant for user interfaces with a static amount of widgets. But the advanced docking system also supports dynamic dock widgets that will get deleted on close. If you set the dock widget flag `DockWidgetDeleteOnClose` for a certain dock widget, then it will be deleted as soon as you close this dock widget. This enables the implementation of user interfaces with dynamically created editors, like in word processing applications or source code development tools.
### Python PyQt5 Bindings
![Python Logo](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/python_logo.png)
The Advanced Docking System comes with a complete Python integration based on
PyQt5 bindings. The package is available via [conda-forge](https://github.com/conda-forge/pyqtads-feedstock).

View File

@@ -4,21 +4,21 @@
"extensionType": [
"library"
],
"version": "3.0.0",
"version": "3.8.2",
"vendor": {
"name": "githubuser0xFFFF",
"url": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System"
},
"contact": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues",
"icon": "https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/ads_icon_512.png",
"icon": "https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/ads_icon.svg",
"licenses": [
{ "licenseType": "LGPLv2.1",
{ "licenseType": "LGPL-2.1-only",
"licenseUrl": "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" }
],
"created": "2017-03-30",
"lastUpdate": "2020-01-16",
"lastUpdate": "2022-03-02",
"platforms": [
"Windows 7-10", "Kubuntu 18.04", "Kubuntu 19.10", "Ubuntu 19.10"
"Windows 7-11", "Kubuntu 18.04", "Kubuntu 19.10", "Ubuntu 19.10", "Ubuntu 20.04"
],
"qtVersions": [
"5.5.1 or newer"

BIN
doc/central_widget.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

BIN
doc/opaque_undocking.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

BIN
doc/python_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
doc/showcase_d-tect-x.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

BIN
doc/showcase_hivewe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

BIN
doc/showcase_metgem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

BIN
doc/showcase_qtcreator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

BIN
doc/ukraine.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

627
doc/user-guide.md Normal file
View File

@@ -0,0 +1,627 @@
# User Guide
- [Configuration Flags](#configuration-flags)
- [Setting Configuration Flags](#setting-configuration-flags)
- [`ActiveTabHasCloseButton`](#activetabhasclosebutton)
- [`DockAreaHasCloseButton`](#dockareahasclosebutton)
- [`DockAreaCloseButtonClosesTab`](#dockareaclosebuttonclosestab)
- [`OpaqueSplitterResize`](#opaquesplitterresize)
- [`XmlAutoFormattingEnabled`](#xmlautoformattingenabled)
- [`XmlCompressionEnabled`](#xmlcompressionenabled)
- [`TabCloseButtonIsToolButton`](#tabclosebuttonistoolbutton)
- [`AllTabsHaveCloseButton`](#alltabshaveclosebutton)
- [`RetainTabSizeWhenCloseButtonHidden`](#retaintabsizewhenclosebuttonhidden)
- [`OpaqueUndocking`](#opaqueundocking)
- [`DragPreviewIsDynamic`](#dragpreviewisdynamic)
- [`DragPreviewShowsContentPixmap`](#dragpreviewshowscontentpixmap)
- [`DragPreviewHasWindowFrame`](#dragpreviewhaswindowframe)
- [`AlwaysShowTabs`](#alwaysshowtabs)
- [`DockAreaHasUndockButton`](#dockareahasundockbutton)
- [`DockAreaHasTabsMenuButton`](#dockareahastabsmenubutton)
- [`DockAreaHideDisabledButtons`](#dockareahidedisabledbuttons)
- [`DockAreaDynamicTabsMenuButtonVisibility`](#dockareadynamictabsmenubuttonvisibility)
- [`FloatingContainerHasWidgetTitle`](#floatingcontainerhaswidgettitle)
- [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon)
- [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar)
- [`FocusHighlighting`](#focushighlighting)
- [`EqualSplitOnInsertion`](#equalsplitoninsertion)
- [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only)
- [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only)
- [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab)
- [DockWidget Feature Flags](#dockwidget-feature-flags)
- [`DockWidgetClosable`](#dockwidgetclosable)
- [`DockWidgetMovable`](#dockwidgetmovable)
- [`DockWidgetFloatable`](#dockwidgetfloatable)
- [`DockWidgetDeleteOnClose`](#dockwidgetdeleteonclose)
- [`CustomCloseHandling`](#customclosehandling)
- [`DockWidgetFocusable`](#dockwidgetfocusable)
- [`DockWidgetForceCloseWithArea`](#dockwidgetforceclosewitharea)
- [`NoTab`](#notab)
- [`DeleteContentOnClose`](#deletecontentonclose)
- [Central Widget](#central-widget)
- [Empty Dock Area](#empty-dock-area)
- [Custom Close Handling](#custom-close-handling)
- [Styling](#styling)
- [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
## Configuration Flags
The Advanced Docking System has a number of global configuration options to
configure the design and the functionality of the docking system. Eachs
configuration will be explained in detail in the following sections.
### Setting Configuration Flags
You must set the configuration flags before creating the dock manager
instance otherwise the manager will not be created correctly and will
crash upon being created. That means, setting the configurations flags
is the first thing you must do, if you use the library.
```c++
CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
CDockManager::setConfigFlag(CDockManager::RetainTabSizeWhenCloseButtonHidden, true);
...
d->DockManager = new CDockManager(this);
```
If you set the configurations flags, you can set individual flags using the
function `CDockManager::setConfigFlag` or you can set all flags using
the function `CDockManager::setConfigFlags`. Instead of settings all
flags individualy, it is better to pick a predefined set of configuration
flags and then modify individual flags. The following predefined
configurations are avilable
- `DefaultNonOpaqueConfig` - uses non opaque splitter resizing and non opaque docking
- `DefaultOpaqueConfig` - uses opaque splitter resizing and opaque docking
Pick one of those predefined configurations and then modify the following
configurations flags to adjust the docking system to your needs.
### `ActiveTabHasCloseButton`
If this flag is set (default configuration), the active tab in a tab area has
a close button.
![ActiveTabHasCloseButton true](cfg_flag_ActiveTabHasCloseButton_true.png)
If this flag is cleared, the active tab has no close button. You can combine
this with the flag `DockAreaCloseButtonClosesTab` to use the close button
of the dock are to close the single tabs.
![ActiveTabHasCloseButton true](cfg_flag_ActiveTabHasCloseButton_false.png)
### `DockAreaHasCloseButton`
If the flag is set (default configuration) each dock area has a close button.
![DockAreaHasCloseButton true](cfg_flag_DockAreaHasCloseButton_true.png)
If this flag is cleared, dock areas do not have a close button.
![DockAreaHasCloseButton true](cfg_flag_DockAreaHasCloseButton_false.png)
### `DockAreaCloseButtonClosesTab`
If the flag is set, the dock area close button closes the active tab,
if not set, it closes the complete dock area (default).
### `OpaqueSplitterResize`
The advanced docking system uses standard `QSplitters` as resize separators and thus supports opaque and non-opaque resizing functionality of `QSplitter`. In some rare cases, for very complex widgets or on slow machines resizing via separator on the fly may cause flicking and glaring of rendered content inside a widget. This global dock manager flag configures the resizing behaviour of the splitters. If this flag is set, then widgets are resized dynamically (opaquely) while interactively moving the splitters. If you select the predefined configuration `DefaultOpaqueConfig`, then this is the configured behaviour.
![Opaque resizing](opaque_resizing.gif)
If this flag is cleared, the widget resizing is deferred until the mouse button is released - this is some kind of lazy resizing separator. If you select the predefined
configuration `DefaultNonOpaqueConfig`, then this is the configured behaviour.
![Non-opaque resizing](non_opaque_resizing.gif)
### `XmlAutoFormattingEnabled`
If enabled, the XML writer automatically adds line-breaks and indentation to
empty sections between elements (ignorable whitespace). This is used, when
the current state or perspective is saved. It is disabled by default.
### `XmlCompressionEnabled`
If enabled, the XML output will be compressed and is not human readable anymore.
This ie enabled by default to minimize the size of the saved data.
### `TabCloseButtonIsToolButton`
If enabled the tab close buttons will be `QToolButtons` instead of `QPushButtons` -
disabled by default. Normally the default configuration should be ok but if your
application requires `QToolButtons` instead of `QPushButtons` for styling reasons
or for any other reasons, then you can enable this flag.
### `AllTabsHaveCloseButton`
If this flag is set, then all tabs that are closable show a close button. The
advantage of this setting is that the size of the tabs does not change and the
user can immediately close each tab. The disadvantage is that all tabs take up
more space.
![AllTabsHaveCloseButton true](cfg_flag_AllTabsHaveCloseButton_true.png)
If this flas is cleared, then only the active tab has a close button (default)
and therefore the tabs need less space.
![AllTabsHaveCloseButton false](cfg_flag_ActiveTabHasCloseButton_true.png)
### `RetainTabSizeWhenCloseButtonHidden`
If this flag is set, the space for the close button is reserved even if the
close button is not visible. This flag is disabled by default. If this flag
is disabled, the tab size dynamically changes if the close button is
visible / hidden in a tab. If this flag is enabled, the tab size always remains
constant, that means, if enabled, the tabs need more space.
![AllTabsHaveCloseButton false](cfg_flag_RetainTabSizeWhenCloseButtonHidden_true.png)
### `OpaqueUndocking`
If this flag is set, opaque undocking is active. That means, as soon as you drag a dock widget or a dock area with a number of dock widgets it will be undocked and moved into a floating widget and then the floating widget will be dragged around. That means undocking will take place immediatelly. You can compare this with opaque splitter resizing.
![OpaqueUndocking true](opaque_undocking.gif)
If you would like to test opaque undocking, you should set the pedefined config
flags `CDockManager::DefaultOpaqueConfig`.
```c++
CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
```
If this flag is cleared (default), then non-opaque undocking is active. In this mode, undocking is more like a standard drag and drop operation. That means, the dragged dock widget or dock area is not undocked immediatelly. Instead, a drag preview widget is created and dragged around to indicate the future position of the dock widget or dock area. The actual dock operation is only executed when the mouse button is released. That makes it possible, to cancel an active drag operation with the escape key.
![OpaqueUndocking true](non_opaque_undocking.gif)
The drag preview widget can be configured by a number of global dock manager flags:
- `DragPreviewIsDynamic`
- `DragPreviewShowsContentPixmap`
- `DragPreviewHasWindowFrame`
Non-opaque undocking is enabled by default. If you would like to enable it
explicitely, you can do this by setting the predefined configuration flags
`CDockManager::DefaultNonOpaqueConfig`.
```c++
CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
```
### `DragPreviewIsDynamic`
If non-opaque undocking is enabled, this flag defines the behavior of the drag
preview window. If this flag is enabled, then it will give the user the
impression, that the floating drag preview is dynamically adjusted to the drop
area. In order to give the perfect impression, you should disable the flags
`DragPreviewShowsContentPixmap` and `DragPreviewHasWindowFrame`.
```c++
CDockManager::setConfigFlag(CDockManager::DragPreviewIsDynamic, true);
CDockManager::setConfigFlag(CDockManager::DragPreviewShowsContentPixmap, false);
CDockManager::setConfigFlag(CDockManager::DragPreviewHasWindowFrame, false);
```
![DragPreviewIsDynamic true](dynamic_drag_preview.gif)
### `DragPreviewShowsContentPixmap`
If non-opaque undocking is enabled, the created drag preview window shows a
copy of the content of the dock widget / dock are that is dragged, if this
flag is enabled (default).
![DragPreviewShowsContentPixmap true](cfg_flag_DragPreviewShowsContentPixmap_true.png)
If this flag is disabled, the drag preview is only a transparent `QRubberBand`
like window without any content.
![DragPreviewShowsContentPixmap true](cfg_flag_DragPreviewShowsContentPixmap_false.png)
### `DragPreviewHasWindowFrame`
If non-opaque undocking is enabled, then this flag configures if the drag
preview is frameless (default) or looks like a real window. If it is enabled,
then the drag preview is a transparent window with a system window frame.
![DragPreviewHasWindowFrame true](cfg_flag_DragPreviewHasWindowFrame_true.png)
### `AlwaysShowTabs`
If this option is enabled, the tab of a dock widget is always displayed - even
if it is the only visible dock widget in a floating widget. In the image below
on the left side, the flag is disabled (default) and on the right side it is
enabled.
![AlwaysShowTabs false true](cfg_flag_AlwaysShowTabs_false_true.png)
### `DockAreaHasUndockButton`
If the flag is set (default) each dock area has an undock button (right
image). If the flag is cleared, a dock area has no undock button (left image)
![DockAreaHasUndockButton false true](cfg_flag_DockAreaHasUndockButton_false_true.png)
### `DockAreaHasTabsMenuButton`
Tabs are a good way to quickly switch between dockwidgets in a dockarea.
However, if the number of dockwidgets in a dockarea is too large, this may affect
the usability of the tab bar. To keep track in this situation, you can use the
tab menu. The menu allows you to quickly select the dockwidget you want to
activate from a drop down menu. This flag shows / hides the tabs menu button
in the dock area title bar. On the left side, the tabs menu button flag
is cleared.
![DockAreaHasTabsMenuButton false true](cfg_flag_DockAreaHasTabsMenuButton_false_true.png)
### `DockAreaHideDisabledButtons`
If certain flags of a dock widget are disabled, like `DockWidgetClosable` or
`DockWidgetFloatable`, then the corresponding dock area buttons like close
button or detach button are disabled (greyed out). This is the default
setting.
![DockAreaHideDisabledButtons false](cfg_flag_DockAreaHideDisabledButtons_false.png)
If the flag is set, disabled dock area buttons will not appear on the toolbar at
all - they are hidden.
![DockAreaHideDisabledButtons true](cfg_flag_DockAreaHideDisabledButtons_true.png)
### `DockAreaDynamicTabsMenuButtonVisibility`
If this flag is cleared, the the tabs menu button is always visible. This is
the default setting. If the flag is set, the tabs menu button will be shown
only when it is required - that means, if the tabs are elided.
![DockAreaDynamicTabsMenuButtonVisibility false](cfg_flag_DockAreaDynamicTabsMenuButtonVisibility_true_visible.png)
If the tabs are not elided, the tabs menu button is hidden.
![DockAreaDynamicTabsMenuButtonVisibility false](cfg_flag_DockAreaDynamicTabsMenuButtonVisibility_true_hidden.png)
### `FloatingContainerHasWidgetTitle`
If set (default), the floating widget window title reflects the title of the
current dock widget.
![FloatingContainerHasWidgetTitle true](cfg_flag_FloatingContainerHasWidgetTitle_true.png)
otherwise it displays application name as window title.
![FloatingContainerHasWidgetTitle false](cfg_flag_FloatingContainerHasWidgetTitle_false.png)
### `FloatingContainerHasWidgetIcon`
If set, the floating widget icon reflects the icon of the current dock widget
![FloatingContainerHasWidgetIcon true](cfg_flag_FloatingContainerHasWidgetIcon_true.png)
otherwise (default setting) it displays application icon.
![FloatingContainerHasWidgetIcon false](cfg_flag_FloatingContainerHasWidgetIcon_false.png)
### `HideSingleCentralWidgetTitleBar`
If there is only one single visible dock widget in the main dock container (the dock manager)
and if this flag is set, then the titlebar of this dock widget will be hidden.
This only makes sense for non draggable and non floatable dock widgets and enables
the creation of some kind of "central" static widget. Because the titlebar is
hidden, it is not possible to drag out the central widget to make it floating
or to close it via the close button.
![HideSingleCentralWidgetTitleBar true](cfg_flag_HideSingleCentralWidgetTitleBar_true.png)
The Advanced Docking System is meant for applications without a static central
widget and normally does not know anything about a central static widget.
Therefore this flag is disabled by default and a central single dock widget
still has a titlebar to drag it out of the main window.
![HideSingleCentralWidgetTitleBar false](cfg_flag_HideSingleCentralWidgetTitleBar_false.png)
### `FocusHighlighting`
If this is enabled, the docking system is able to highlight the tab and the
components of a dock area with a different style (i.e. a different color).
This option is disabled by default and needs to be enabled explicitely
because it adds some overhead. The dock manager needs to react on focus
changes and dock widget dragging to highlight the right dock widget. You should
enable it only, if you really need it for your application.
If the feature is enabled, you can also connect to the new dock manager
signal `focusedDockWidgetChanged(CDockWidget* old, CDockWidget* now)` to
react on focus changes and to prepare the content of the focused dock
widget.
You can click into the tab, the titlebar or the content of a dock widget
to focus it.
![FocusHighlighting](cfg_flag_FocusHighlighting.gif)
For the focused dock widget and dock widget tab, the property `focused` will
be set to true and you can use this property to style the focused dock
widget differently. The picture above uses the following styling:
```css
/* Color the tab with the nhighlight color */
ads--CDockWidgetTab[focused="true"]
{
background: palette(highlight);
border-color: palette(highlight);
}
/* Use a different colored close button icon to match the test color */
ads--CDockWidgetTab[focused="true"] > #tabCloseButton
{
qproperty-icon: url(:/ads/images/close-button-focused.svg)
}
/* Make a hovered focused close button a little bit lighter */
ads--CDockWidgetTab[focused="true"] > #tabCloseButton:hover
{
background: rgba(255, 255, 255, 48);
}
/* Make a pressed focused close button even more lighter */
ads--CDockWidgetTab[focused="true"] > #tabCloseButton:pressed
{
background: rgba(255, 255, 255, 92);
}
/* Use a different color for the tab label */
ads--CDockWidgetTab[focused="true"] QLabel
{
color: palette(light);
}
/* Paint a nice solid line for the whole title bar to create the illusion
of an active tab */
ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar
{
background: transparent;
border-bottom: 2px solid palette(highlight);
padding-bottom: 0px;
}
```
If you have a content widget that does not support focussing for some reason
(like `QVTKOpenGLStereoWidget` from the [VTK library](https://github.com/Kitware/VTK)),
then you can manually switch the focus by reacting on mouse events. The
following code shows, how to install en event filter on the `QVTKOpenGLStereoWidget`
to properly switch the focus on `QEvent::MouseButtonPress`:
```c++
static ads::CDockWidget* createVTK2DWindow(QMenu* ViewMenu, QObject* EventFilter)
{
QVTKOpenGLStereoWidget* qvtkOpenGLStereoWidget = new QVTKOpenGLStereoWidget;
ads::CDockWidget* DockWidget = new ads::CDockWidget("2D Window");
DockWidget->setWidget(qvtkOpenGLStereoWidget);
qvtkOpenGLStereoWidget->installEventFilter(EventFilter);
qvtkOpenGLStereoWidget->setProperty("DockWidget", QVariant::fromValue(DockWidget));
return DockWidget;
}
```
Now we can use the event filter function to react on mouse events and then
use the dock manager function `setDockWidgetFocused()` to switch the focus:
```c++
bool CMainWindow::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::MouseButtonPress)
{
QVTKOpenGLStereoWidget* vtkWidget = qobject_cast<QVTKOpenGLStereoWidget*>(watched);
auto vDockWidget = vtkWidget->property("DockWidget");
ads::CDockWidget* DockWidget = nullptr;
if (vDockWidget.isValid())
{
DockWidget = qvariant_cast<ads::CDockWidget*>(vDockWidget);
}
if (DockWidget)
{
d->DockManager->setDockWidgetFocused(DockWidget);
}
}
return false;
}
```
### `EqualSplitOnInsertion`
This flag configures how the space is distributed if a new dock widget is
inserted into an existing dock area. The flag is disabled by default. If 3
dock widgets are inserted with the following code
```c++
d->DockManager->addDockWidget(ads::RightDockWidgetArea, DockWidget, EditorArea);
```
then this is the result, if the flag is disabled:
![EqualSplitOnInsertion false](cfg_flag_EqualSplitOnInsertion_false.png)
If the flag is enabled, then the space is equally distributed to all widgets
in a splitter:
![EqualSplitOnInsertion true](cfg_flag_EqualSplitOnInsertion_true.png)
### `FloatingContainerForceNativeTitleBar` (Linux only)
Since release 3.6 the library supports native title bars and window decorations
for floating widgets on Linux (thanks to a user contribution).
Native title bars and window decorations are supported by most Linux window
managers, such as Compiz or Xfwm. Some window managers like KWin do not properly
support this feature. Native floating widgets look better because of the native
styling and the support all window manager features like snapping to window
borders or maximizing. The library tries to detect the window manager during
runtime and activates native window decorations if possible:
![FloatingContainerForceNativeTitleBar true](cfg_flag_FloatingContainerForceNativeTitleBar_true.png)
If you would like to overwrite this autodetection, then you can activate this
flag to force native window titlebars. You can overwrite autodetection and this
flag, if you set the environment variable `ADS_UseNativeTitle` to 0 or 1.
### `FloatingContainerForceQWidgetTitleBar` (Linux only)
If your window manager (i.e. KWin) does not properly support native floating
windows, the docking library falls back to QWidget based floating widget
title bars.
![FloatingContainerForceNativeTitleBar false](cfg_flag_FloatingContainerForceNativeTitleBar_false.png)
If you would like to overwrite autodetection, then you can activate this flag
to force QWidget based title bars. You can overwrite autodetection and this
flag, if you set the environment variable `ADS_UseNativeTitle` to 0 or 1.
### `MiddleMouseButtonClosesTab`
If the flag is set, the user can use the mouse middle button to close the tab
under the mouse. So you do not need to exactly hit the tab close button to
close tab. Just click with the middle mouse button on a tab like this is
possible in various web browsers.
![MiddleMouseButtonClosesTab true](cfg_flag_MiddleMouseButtonClosesTab.gif)
## DockWidget Feature Flags
### `DockWidgetClosable`
If set, the dock widget will have a close button.
### `DockWidgetMovable`
If a dock widget is movable, then it and can be moved to a new position in the
current dock container. Disable this flag to prevent moving of a dock widget
via mouse. If the `OpaqueUndocking` configuration flag is set, then dock widgets
are immediately undocked into floating widgets. That means, moving is only
possible in this case, if the dock widget is also floatable (feature flag
`DockWidgetFloatable` is set).
### `DockWidgetFloatable`
If set, a dock widget can be dragged into a floating window.
### `DockWidgetDeleteOnClose`
Deletes the dock widget and its content when it is closed.
### `CustomCloseHandling`
Clicking the close button will not close the dock widget but emits the
`closeRequested()` signal instead. This allows the application to implement
a custom close handling.
### `DockWidgetFocusable`
If this is enabled, a dock widget can get focus highlighting.
### `DockWidgetForceCloseWithArea`
A dock widget will be closed when the dock area hosting it is closed. If the
`DockWidgetDeleteOnClose` feature is enabled for a dock widget, then it will
be deleted, if the user clicks the close button of this dock widget. If the
user clicks the close button of the dock area that contains this widget,
then only the visibility of the dock widget is toggled. If this feature flag
is set, the closing the dock area also closes the dock widget. That means, if
the dock widget feature `DockWidgetDeleteOnClose` is set for the dock widgets
in a dock area, then all dock widgets will be deleted if the dock area is closed.
### `NoTab`
A dock widget tab will never be shown if this flag is set.
### `DeleteContentOnClose`
Deletes only the contained widget on close, keeping the dock widget intact and
in place. Attempts to rebuild the contents widget on show if there is a widget
factory set. See [issue #365](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/pull/365) for more details.
## Central Widget
The Advanced Docking System has been developed to overcome the limitations of
the native Qt docking system with its central widget concept. This was the
reason that until version 3.6 of the library, there was no support for such
thing like a central widget. Thanks to the contribution of a user the library
now supports a central widget.
In the Advanced Docking System a central widget is a docking widget that is
neither closable nor movable or floatable. A central widget has no title bar
and so it is not possible for the user to hide, close or drag the central
widget. If there is a central widget, then also the distribution of the sizes
for the dock widgets around the central widget is different:
- **no central widget (default)** - on resizing the available space is
distributed to all dock widgets - the size of all dock widgets
shrinks or grows
- **with central widget** - on resizing only the central widget is resized - the
dock widgets around the central widget keep their size (see the animation below)
![Central Widget](central_widget.gif)
To set a central widget, you just need to pass your central dock widget
to the dock manager `setCentralWidget` function:
```c++
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
```
See the `centralwidget` example to learn how it works.
> ##### Note
> The central widget needs to be the first dock widget that is added to the
> dock manager. The function does not work and returns a `nullptr` if there
> are already other dock widgets registered. So `setCentralWidget` should be
> the first function that you call when adding dock widgets.
## Empty Dock Area
Some applications require a fixed DockArea that is always visible, even if it
does not contain any DockWidgets. I.e. the DockArea is in this case a kind
of central widget that is always visible (see this
[issue](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/199)).
Since version 3.7.1 the advanced docking system supports this feature. The
`emptydockarea` example shows how this can be implemented with the library. You
just need to create a dock widget and set the feature flag `CDockWidget::NoTab`.
This permanently hides the tab widget of this area and removes it from the tab
menu. For this special dock widget you should also disable all other features
(movable, closable and floatable) to prevent closing and moving of this widget.
If you use the `CDockManager::setCentralWidget` function like in the example
code below, then you don't need to disable these features because this is done
in the `setCentralWidget` function.
```c++
QLabel* label = new QLabel();
label->setText("This is a DockArea which is always visible, even if it does not contain any DockWidgets.");
label->setAlignment(Qt::AlignCenter);
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
CentralDockWidget->setWidget(label);
CentralDockWidget->setFeature(ads::CDockWidget::NoTab, true);// set the flag before adding the widget to dock manager
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
```
## Custom Close Handling
Normally clicking the close button of a dock widget will just hide the widget and the user can show it again using the `toggleView()` action of the dock widget. This is meant for user interfaces with a static amount of widgets. But the advanced docking system also supports dynamic dock widgets that will get deleted on close. If you set the dock widget flag `DockWidgetDeleteOnClose` for a certain dock widget, then it will be deleted as soon as you close this dock widget. This enables the implementation of user interfaces with dynamically created editors, like in word processing applications or source code development tools.
When an entire area is closed, the default behavior is to hide the dock widgets it contains regardless of the `DockWidgetDeleteOnClose` flag except if there is only one dock widget. In this special case, the `DockWidgetDeleteOnClose` flag is followed. This behavior can be changed by setting the `DockWidgetForceCloseWithArea` flag to all the dock widgets that needs to be closed with their area.
## Styling
The Advanced Docking System supports styling via [Qt Style Sheets](https://doc.qt.io/qt-5/stylesheet.html). All components like splitters, tabs, buttons, titlebar and
icons are styleable this way.
### Disabling the Internal Style Sheet
The dock manager uses an internal stylesheet to style its components. That
means, the style that you see in the demo application comes from the
internal stylesheets that you will find in `src/stylesheets` folder. If you want
to disable this internal stylesheet because your application uses its own,
just call the function for settings the stylesheet with an empty string.
```c++
DockManager->setStyleSheet("");
```

View File

@@ -1,46 +0,0 @@
cmake_minimum_required(VERSION 3.3)
set (CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
project(ads_example VERSION "1.0")
set(REQUIRED_QT_VERSION 5.5.0)
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
set(ads_example_LIBS ${ads_example_LIBS} ${Qt5Core_LIBRARIES})
set(ads_example_INCLUDE ${ads_example_INCLUDE} ${Qt5Core_INCLUDE_DIRS})
set(ads_example_COMPILE_DEFINE ${ads_example_COMPILE_DEFINE} ${Qt5Core_COMPILE_DEFINITIONS} )
set(ads_example_LIBS ${ads_example_LIBS} ${Qt5Gui_LIBRARIES})
set(ads_example_INCLUDE ${ads_example_INCLUDE} ${Qt5Gui_INCLUDE_DIRS})
set(ads_example_COMPILE_DEFINE ${ads_example_COMPILE_DEFINE} ${Qt5Gui_COMPILE_DEFINITIONS})
set(ads_example_LIBS ${ads_example_LIBS} ${Qt5Widgets_LIBRARIES})
set(ads_example_INCLUDE ${ads_example_INCLUDE} ${Qt5Widgets_INCLUDE_DIRS})
set(ads_example_COMPILE_DEFINE ${ads_example_COMPILE_DEFINE} ${Qt5Widgets_COMPILE_DEFINITIONS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(ads_example_SRCS
main.cpp
MainWindow.cpp
MainWindow.ui
)
add_executable(Example1 WIN32 ${ads_example_SRCS})
if(BUILD_STATIC)
set(ads_example_DEFINE ${ads_example_DEFINE} ADS_STATIC)
endif()
add_dependencies(Example1 qtadvanceddocking)
target_include_directories(Example1 PUBLIC
$<BUILD_INTERFACE:${ads_example_INCLUDE}>
$<INSTALL_INTERFACE:include>
)
target_include_directories(Example1 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../src" ${ads_example_INCLUDE})
target_link_libraries(Example1 PRIVATE qtadvanceddocking ${ads_example_LIBS})
target_compile_definitions(Example1 PRIVATE ${ads_example_DEFINE})
set_target_properties(Example1 PROPERTIES
VERSION "1.0"
SOVERSION 1
EXPORT_NAME "Qt Advanced Docking System Example"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)

View File

@@ -1,47 +0,0 @@
ADS_OUT_ROOT = $${OUT_PWD}/..
QT += core gui widgets
TARGET = Example1
DESTDIR = $${ADS_OUT_ROOT}/lib
TEMPLATE = app
CONFIG += c++14
CONFIG += debug_and_release
adsBuildStatic {
DEFINES += ADS_STATIC
}
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
MainWindow.cpp
HEADERS += \
MainWindow.h
FORMS += \
MainWindow.ui
LIBS += -L$${ADS_OUT_ROOT}/lib
# Dependency: AdvancedDockingSystem (shared)
CONFIG(debug, debug|release){
win32 {
LIBS += -lqtadvanceddockingd
}
else:mac {
LIBS += -lqtadvanceddocking_debug
}
else {
LIBS += -lqtadvanceddocking
}
}
else{
LIBS += -lqtadvanceddocking
}
INCLUDEPATH += ../src
DEPENDPATH += ../src

9
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project(QtADSExamples LANGUAGES CXX VERSION ${VERSION_SHORT})
add_subdirectory(simple)
add_subdirectory(hideshow)
add_subdirectory(sidebar)
add_subdirectory(deleteonclose)
add_subdirectory(centralwidget)
add_subdirectory(emptydockarea)
add_subdirectory(dockindock)

View File

@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.5)
project(ads_example_centralwidget VERSION ${VERSION_SHORT})
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(CentralWidgetExample WIN32
main.cpp
mainwindow.cpp
mainwindow.ui
)
target_include_directories(CentralWidgetExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(CentralWidgetExample PRIVATE qtadvanceddocking)
target_link_libraries(CentralWidgetExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(CentralWidgetExample PROPERTIES
AUTOMOC ON
AUTORCC ON
AUTOUIC ON
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
VERSION ${VERSION_SHORT}
EXPORT_NAME "Qt Advanced Docking System Central Widget Example"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)

View File

@@ -0,0 +1,34 @@
ADS_OUT_ROOT = $${OUT_PWD}/../..
QT += core gui widgets
TARGET = CentralWidgetExample
DESTDIR = $${ADS_OUT_ROOT}/lib
TEMPLATE = app
CONFIG += c++14
CONFIG += debug_and_release
adsBuildStatic {
DEFINES += ADS_STATIC
}
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
LIBS += -L$${ADS_OUT_ROOT}/lib
include(../../ads.pri)
INCLUDEPATH += ../../src
DEPENDPATH += ../../src

View File

@@ -0,0 +1,10 @@
#include <mainwindow.h>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
CMainWindow w;
w.show();
return a.exec();
}

View File

@@ -0,0 +1,106 @@
import os
import sys
from PyQt5 import uic
from PyQt5.QtCore import Qt, QTimer, QDir, QSignalBlocker
from PyQt5.QtGui import QCloseEvent, QIcon
from PyQt5.QtWidgets import (QApplication, QLabel, QCalendarWidget, QFrame, QTreeView,
QTableWidget, QFileSystemModel, QPlainTextEdit, QToolBar,
QWidgetAction, QComboBox, QAction, QSizePolicy, QInputDialog)
from PyQtAds import QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)
class MainWindow(MainWindowUI, MainWindowBase):
def __init__(self, parent=None):
super().__init__(parent)
self.setupUi(self)
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.OpaqueSplitterResize, True)
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.XmlCompressionEnabled, False)
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.FocusHighlighting, True)
self.dock_manager = QtAds.CDockManager(self)
# Set central widget
text_edit = QPlainTextEdit()
text_edit.setPlaceholderText("This is the central editor. Enter your text here.")
central_dock_widget = QtAds.CDockWidget("CentralWidget")
central_dock_widget.setWidget(text_edit)
central_dock_area = self.dock_manager.setCentralWidget(central_dock_widget)
central_dock_area.setAllowedAreas(QtAds.DockWidgetArea.OuterDockAreas)
# create other dock widgets
table = QTableWidget()
table.setColumnCount(3)
table.setRowCount(10)
table_dock_widget = QtAds.CDockWidget("Table 1")
table_dock_widget.setWidget(table)
table_dock_widget.setMinimumSizeHintMode(QtAds.CDockWidget.MinimumSizeHintFromDockWidget)
table_dock_widget.resize(250, 150)
table_dock_widget.setMinimumSize(200, 150)
table_area = self.dock_manager.addDockWidget(QtAds.DockWidgetArea.LeftDockWidgetArea, table_dock_widget)
self.menuView.addAction(table_dock_widget.toggleViewAction())
table = QTableWidget()
table.setColumnCount(5)
table.setRowCount(1020)
table_dock_widget = QtAds.CDockWidget("Table 2")
table_dock_widget.setWidget(table)
table_dock_widget.setMinimumSizeHintMode(QtAds.CDockWidget.MinimumSizeHintFromDockWidget)
table_dock_widget.resize(250, 150)
table_dock_widget.setMinimumSize(200, 150)
table_area = self.dock_manager.addDockWidget(QtAds.DockWidgetArea.BottomDockWidgetArea, table_dock_widget, table_area)
self.menuView.addAction(table_dock_widget.toggleViewAction())
properties_table = QTableWidget()
properties_table.setColumnCount(3)
properties_table.setRowCount(10)
properties_dock_widget = QtAds.CDockWidget("Properties")
properties_dock_widget.setWidget(properties_table)
properties_dock_widget.setMinimumSizeHintMode(QtAds.CDockWidget.MinimumSizeHintFromDockWidget)
properties_dock_widget.resize(250, 150)
properties_dock_widget.setMinimumSize(200, 150)
self.dock_manager.addDockWidget(QtAds.DockWidgetArea.RightDockWidgetArea, properties_dock_widget, central_dock_area)
self.menuView.addAction(properties_dock_widget.toggleViewAction())
self.create_perspective_ui()
def create_perspective_ui(self):
save_perspective_action = QAction("Create Perspective", self)
save_perspective_action.triggered.connect(self.save_perspective)
perspective_list_action = QWidgetAction(self)
self.perspective_combobox = QComboBox(self)
self.perspective_combobox.setSizeAdjustPolicy(QComboBox.AdjustToContents)
self.perspective_combobox.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
self.perspective_combobox.activated[str].connect(self.dock_manager.openPerspective)
perspective_list_action.setDefaultWidget(self.perspective_combobox)
self.toolBar.addSeparator()
self.toolBar.addAction(perspective_list_action)
self.toolBar.addAction(save_perspective_action)
def save_perspective(self):
perspective_name, ok = QInputDialog.getText(self, "Save Perspective", "Enter Unique name:")
if not ok or not perspective_name:
return
self.dock_manager.addPerspective(perspective_name)
blocker = QSignalBlocker(self.perspective_combobox)
self.perspective_combobox.clear()
self.perspective_combobox.addItems(self.dock_manager.perspectiveNames())
self.perspective_combobox.setCurrentText(perspective_name)
def closeEvent(self, event: QCloseEvent):
self.dock_manager.deleteLater()
super().closeEvent(event)
if __name__ == '__main__':
app = QApplication(sys.argv)
w = MainWindow()
w.show()
app.exec_()

View File

@@ -0,0 +1,133 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QWidgetAction>
#include <QLabel>
#include <QCalendarWidget>
#include <QTreeView>
#include <QFileSystemModel>
#include <QTableWidget>
#include <QHBoxLayout>
#include <QRadioButton>
#include <QPushButton>
#include <QInputDialog>
#include <QFileDialog>
#include <QSettings>
#include <QMessageBox>
#include <QPlainTextEdit>
#include <QToolBar>
#include "DockAreaWidget.h"
#include "DockAreaTitleBar.h"
#include "DockAreaTabBar.h"
#include "FloatingDockContainer.h"
#include "DockComponentsFactory.h"
using namespace ads;
CMainWindow::CMainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::CMainWindow)
{
ui->setupUi(this);
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
DockManager = new CDockManager(this);
// Set central widget
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is the central editor. Enter your text here.");
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
CentralDockWidget->setWidget(w);
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
// create other dock widgets
QTableWidget* table = new QTableWidget();
table->setColumnCount(3);
table->setRowCount(10);
CDockWidget* TableDockWidget = new CDockWidget("Table 1");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
TableDockWidget->setMinimumSize(200,150);
auto TableArea = DockManager->addDockWidget(DockWidgetArea::LeftDockWidgetArea, TableDockWidget);
ui->menuView->addAction(TableDockWidget->toggleViewAction());
table = new QTableWidget();
table->setColumnCount(5);
table->setRowCount(1020);
TableDockWidget = new CDockWidget("Table 2");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
TableDockWidget->setMinimumSize(200,150);
DockManager->addDockWidget(DockWidgetArea::BottomDockWidgetArea, TableDockWidget, TableArea);
ui->menuView->addAction(TableDockWidget->toggleViewAction());
QTableWidget* propertiesTable = new QTableWidget();
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = new CDockWidget("Properties");
PropertiesDockWidget->setWidget(propertiesTable);
PropertiesDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
PropertiesDockWidget->resize(250, 150);
PropertiesDockWidget->setMinimumSize(200,150);
DockManager->addDockWidget(DockWidgetArea::RightDockWidgetArea, PropertiesDockWidget, CentralDockArea);
ui->menuView->addAction(PropertiesDockWidget->toggleViewAction());
createPerspectiveUi();
}
CMainWindow::~CMainWindow()
{
delete ui;
}
void CMainWindow::createPerspectiveUi()
{
SavePerspectiveAction = new QAction("Create Perspective", this);
connect(SavePerspectiveAction, SIGNAL(triggered()), SLOT(savePerspective()));
PerspectiveListAction = new QWidgetAction(this);
PerspectiveComboBox = new QComboBox(this);
PerspectiveComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
PerspectiveComboBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
connect(PerspectiveComboBox, SIGNAL(activated(const QString&)),
DockManager, SLOT(openPerspective(const QString&)));
PerspectiveListAction->setDefaultWidget(PerspectiveComboBox);
ui->toolBar->addSeparator();
ui->toolBar->addAction(PerspectiveListAction);
ui->toolBar->addAction(SavePerspectiveAction);
}
void CMainWindow::savePerspective()
{
QString PerspectiveName = QInputDialog::getText(this, "Save Perspective", "Enter unique name:");
if (PerspectiveName.isEmpty())
{
return;
}
DockManager->addPerspective(PerspectiveName);
QSignalBlocker Blocker(PerspectiveComboBox);
PerspectiveComboBox->clear();
PerspectiveComboBox->addItems(DockManager->perspectiveNames());
PerspectiveComboBox->setCurrentText(PerspectiveName);
}
//============================================================================
void CMainWindow::closeEvent(QCloseEvent* event)
{
// Delete dock manager here to delete all floating widgets. This ensures
// that all top level windows of the dock manager are properly closed
DockManager->deleteLater();
QMainWindow::closeEvent(event);
}

View File

@@ -0,0 +1,43 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QComboBox>
#include <QWidgetAction>
#include "DockManager.h"
#include "DockAreaWidget.h"
#include "DockWidget.h"
QT_BEGIN_NAMESPACE
namespace Ui { class CMainWindow; }
QT_END_NAMESPACE
class CMainWindow : public QMainWindow
{
Q_OBJECT
public:
CMainWindow(QWidget *parent = nullptr);
~CMainWindow();
protected:
virtual void closeEvent(QCloseEvent* event) override;
private:
QAction* SavePerspectiveAction = nullptr;
QWidgetAction* PerspectiveListAction = nullptr;
QComboBox* PerspectiveComboBox = nullptr;
Ui::CMainWindow *ui;
ads::CDockManager* DockManager;
ads::CDockAreaWidget* StatusDockArea;
ads::CDockWidget* TimelineDockWidget;
void createPerspectiveUi();
private slots:
void savePerspective();
};
#endif // MAINWINDOW_H

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CMainWindow</class>
<widget class="QMainWindow" name="CMainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1284</width>
<height>757</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1284</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuView">
<property name="title">
<string>View</string>
</property>
</widget>
<addaction name="menuView"/>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.5)
project(ads_example_deleteonclose VERSION ${VERSION_SHORT})
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(DeleteOnCloseTest WIN32
main.cpp
)
target_include_directories(DeleteOnCloseTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(DeleteOnCloseTest PRIVATE qtadvanceddocking)
target_link_libraries(DeleteOnCloseTest PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(DeleteOnCloseTest PROPERTIES
AUTOMOC ON
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
VERSION ${VERSION_SHORT}
EXPORT_NAME "Qt Advanced Docking System Delete on Close Example"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)

View File

@@ -0,0 +1,23 @@
ADS_OUT_ROOT = $${OUT_PWD}/../..
QT += core gui widgets
TARGET = DeleteOnCloseTest
DESTDIR = $${ADS_OUT_ROOT}/lib
TEMPLATE = app
CONFIG += c++14
CONFIG += debug_and_release
adsBuildStatic {
DEFINES += ADS_STATIC
}
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += main.cpp
LIBS += -L$${ADS_OUT_ROOT}/lib
include(../../ads.pri)
INCLUDEPATH += ../../src
DEPENDPATH += ../../src

View File

@@ -0,0 +1,90 @@
#include <QMainWindow>
#include <QAction>
#include <QTextEdit>
#include <QApplication>
#include <QMenuBar>
#include "DockManager.h"
class MainWindow : public QMainWindow
{
private:
ads::CDockManager* m_DockManager = nullptr;
protected:
virtual void closeEvent(QCloseEvent *event) override
{
QMainWindow::closeEvent(event);
if (m_DockManager)
{
m_DockManager->deleteLater();
}
}
public:
void setDockManager(ads::CDockManager* DockManager) {m_DockManager = DockManager;}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
ads::CDockManager::setConfigFlag(ads::CDockManager::FocusHighlighting, true);
ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, true);
auto dockManager = new ads::CDockManager(&w);
w.setDockManager(dockManager);
QObject::connect(dockManager, &ads::CDockManager::focusedDockWidgetChanged, [] (ads::CDockWidget* old, ads::CDockWidget* now) {
static int Count = 0;
qDebug() << Count++ << " CDockManager::focusedDockWidgetChanged old: " << (old ? old->objectName() : "-") << " now: " << now->objectName() << " visible: " << now->isVisible();
now->widget()->setFocus();
});
QAction *action = new QAction("New [DockWidgetDeleteOnClose]", &w);
w.menuBar()->addAction(action);
int i = 0;
QObject::connect(action, &QAction::triggered, [&]() {
auto dw = new ads::CDockWidget(QStringLiteral("test %1 [DockWidgetDeleteOnClose]").arg(i++), &w);
auto editor = new QTextEdit(QStringLiteral("lorem ipsum..."), dw);
dw->setWidget(editor);
dw->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
auto area = dockManager->addDockWidgetTab(ads::CenterDockWidgetArea, dw);
qDebug() << "doc dock widget created!" << dw << area;
});
auto dw = new ads::CDockWidget(QStringLiteral("test %1 [DeleteContentOnClose]").arg(i++), &w);
auto editor = new QTextEdit(QStringLiteral("recreated lorem ipsum......"), dw);
dw->setWidget(editor);
dw->setFeature(ads::CDockWidget::DeleteContentOnClose, true);
dw->setWidgetFactory([](QWidget* dw)
{
static int timesRecreated = 0;
return new QTextEdit(QStringLiteral("recreated lorem ipsum... times %1").arg(++timesRecreated), dw);
});
auto area = dockManager->addDockWidgetTab(ads::CenterDockWidgetArea, dw);
qDebug() << "DeleteContentOnClose dock widget created!" << dw << area;
action = new QAction("Toggle [DeleteContentOnClose]", &w);
w.menuBar()->addAction(action);
QObject::connect(action, &QAction::triggered, [dw]() {
dw->toggleView(dw->isClosed());
qDebug() << QString("dock widget %1! contents widget %2!").arg(dw->isClosed() ? "closed" : "open", dw->widget() ? "created" : "deleted");
});
action = new QAction("New", &w);
w.menuBar()->addAction(action);
QObject::connect(action, &QAction::triggered, [&]() {
auto dw = new ads::CDockWidget(QStringLiteral("test %1").arg(i++), &w);
auto editor = new QTextEdit(QStringLiteral("lorem ipsum..."), dw);
dw->setWidget(editor);
auto area = dockManager->addDockWidgetTab(ads::CenterDockWidgetArea, dw);
qDebug() << "dock widget created!" << dw << area;
});
w.show();
return a.exec();
}

View File

@@ -0,0 +1,73 @@
import sys
from PyQtAds import QtAds
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtCore import (qDebug, pyqtSlot, QObject, pyqtSignal)
from PyQt5.QtWidgets import (QMainWindow, QAction, QTextEdit, QApplication,
QMenuBar)
class MainWindow(QMainWindow):
dock_manager = None
def closeEvent(self, event: QCloseEvent):
super().closeEvent(event)
if self.dock_manager is not None:
self.dock_manager.deleteLater()
def setDockManager(self, dock_manager: QtAds.CDockManager):
self.dock_manager = dock_manager
if __name__ == '__main__':
app = QApplication(sys.argv)
w = MainWindow()
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.FocusHighlighting, True)
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.AllTabsHaveCloseButton, True)
dock_manager = QtAds.CDockManager(w)
w.setDockManager(dock_manager)
count = 0
def on_focused_dock_widget_changed(old: QtAds.CDockWidget, now: QtAds.CDockWidget):
global count
qDebug( "{:d} CDockManager::focusedDockWidgetChanged old: {} now: {} visible: {}".format(
count,
old.objectName() if old else "-",
now.objectName(),
now.isVisible()))
count += 1
now.widget().setFocus()
dock_manager.focusedDockWidgetChanged.connect(on_focused_dock_widget_changed)
action = QAction("New Delete On Close", w)
w.menuBar().addAction(action)
i = 0
def on_action_triggered():
global i
dw = QtAds.CDockWidget("test doc {:d}".format(i))
i += 1
editor = QTextEdit("lorem ipsum...", dw)
dw.setWidget(editor)
dw.setFeature(QtAds.CDockWidget.DockWidgetDeleteOnClose, True)
area = dock_manager.addDockWidgetTab(QtAds.CenterDockWidgetArea, dw)
qDebug("doc dock widget created! {} {}".format(dw, area))
action.triggered.connect(on_action_triggered)
action = QAction("New", w)
w.menuBar().addAction(action)
def on_action2_triggered():
global i
dw = QtAds.CDockWidget("test {:d}".format(i))
i += 1
editor = QTextEdit("lorem ipsum...", dw)
dw.setWidget(editor)
area = dock_manager.addDockWidgetTab(QtAds.CenterDockWidgetArea, dw)
qDebug("dock widget created! {} {}".format(dw, area))
action.triggered.connect(on_action2_triggered)
w.show()
app.exec_()

View File

@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.5)
project(ads_example_dockindock VERSION ${VERSION_SHORT})
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(DockInDockExample WIN32
dockindock.cpp
dockindockmanager.cpp
perspectiveactions.cpp
perspectives.cpp
main.cpp
mainframe.cpp
)
target_include_directories(DockInDockExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(DockInDockExample PRIVATE qtadvanceddocking)
target_link_libraries(DockInDockExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(DockInDockExample PROPERTIES
AUTOMOC ON
AUTORCC ON
AUTOUIC ON
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
VERSION ${VERSION_SHORT}
EXPORT_NAME "Qt Advanced Docking System Simple Example"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"
)

View File

@@ -0,0 +1,296 @@
#include "dockindock.h"
#include "perspectives.h"
#include "dockindockmanager.h"
#include "perspectiveactions.h"
#include <QMenu>
#include <QDir>
#include <QVBoxLayout>
#include <QMainWindow>
#include <QMessageBox>
#include <QInputDialog>
#include <set>
#include <assert.h>
using namespace QtAdsUtl;
DockInDockWidget::DockInDockWidget( QWidget* parent, bool canCreateNewGroups, PerspectivesManager* perspectivesManager ) :
DockInDockWidget( parent, (DockInDockWidget*)NULL, perspectivesManager )
{
m_canCreateNewGroups = canCreateNewGroups;
m_topLevelDockWidget = this;
}
DockInDockWidget::DockInDockWidget( QWidget* parent, DockInDockWidget* topLevelDockWidget, PerspectivesManager* perspectivesManager ) :
baseClass( parent ),
m_topLevelDockWidget( topLevelDockWidget ),
m_canCreateNewGroups( (topLevelDockWidget) ? topLevelDockWidget->m_canCreateNewGroups : false ),
m_perspectivesManager( perspectivesManager )
{
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins( 0,0,0,0 );
layout->addWidget( m_mgr = new DockInDockManager(*this) );
}
DockInDockWidget::~DockInDockWidget()
{
}
ads::CDockAreaWidget* DockInDockWidget::addTabWidget( QWidget* widget, const QString& name, ads::CDockAreaWidget* after )
{
return addTabWidget( widget, name, QIcon(), after );
}
ads::CDockAreaWidget* DockInDockWidget::addTabWidget( QWidget* widget, const QString& name, QIcon icon, ads::CDockAreaWidget* after )
{
for ( auto existing : getTopLevelDockWidget()->getManager()->allDockWidgets(true,true) )
{
if ( existing.second->objectName() == name )
{
QMessageBox::critical( this, "Error", "Name '" + name + "' already in use" );
return NULL;
}
}
ads::CDockWidget* DockWidget = new ads::CDockWidget(name);
DockWidget->setWidget(widget);
DockWidget->setIcon( icon );
// Add the dock widget to the top dock widget area
return m_mgr->addDockWidget(ads::CenterDockWidgetArea, DockWidget, after);
}
bool DockInDockWidget::isTopLevel()
{
return objectName().isEmpty();
}
QString DockInDockWidget::getGroupNameError( const QString& groupName )
{
if ( groupName.isEmpty() )
{
return "Group must have a non-empty name";
}
std::vector<DockInDockManager*> dockManagers = m_mgr->allManagers( true, true );
for ( auto mgr : dockManagers )
{
if ( mgr->getGroupName() == groupName )
return "Group name '" + groupName + "' already used";
}
return "";
}
DockInDockWidget* DockInDockWidget::createGroup( const QString& groupName, ads::CDockAreaWidget*& insertPos )
{
return createGroup( groupName, QIcon(), insertPos );
}
DockInDockWidget* DockInDockWidget::createGroup( const QString& groupName, QIcon icon, ads::CDockAreaWidget*& insertPos )
{
QString error = getGroupNameError( groupName );
if ( !error.isEmpty() )
{
QMessageBox::critical( NULL, "Error", error );
return NULL;
}
DockInDockWidget* child = new DockInDockWidget( this, m_topLevelDockWidget, m_perspectivesManager );
child->setObjectName( groupName );
ads::CDockWidget* DockWidget = new ads::CDockWidget(groupName);
DockWidget->setWidget(child);
DockWidget->setIcon(icon);
insertPos = m_mgr->addDockWidget(ads::CenterDockWidgetArea, DockWidget, insertPos);
return child;
}
void DockInDockWidget::destroyGroup( DockInDockWidget* widgetToRemove )
{
auto topLevelWidget = widgetToRemove->getTopLevelDockWidget();
if ( topLevelWidget && topLevelWidget != widgetToRemove )
{
// reaffect all child docks to top-level
for ( auto dockwidget : widgetToRemove->getManager()->getWidgetsInGUIOrder() ) // don't use allDockWidgets to preserve sub-groups
{
MoveDockWidgetAction::move( dockwidget, topLevelWidget->getManager() );
}
assert( widgetToRemove->getManager()->allDockWidgets( true, true ).empty() );
// find widget's parent:
for ( auto dockwidget : topLevelWidget->getManager()->allDockWidgets( true, true ) )
{
if ( dockwidget.second->widget() == widgetToRemove )
{
dockwidget.first->removeDockWidget( dockwidget.second );
delete dockwidget.second;
//delete widgetToRemove; automatically deleted when dockWidget is deleted
widgetToRemove = NULL;
break;
}
}
assert( widgetToRemove == NULL );
}
else
{
assert( false );
}
}
void DockInDockWidget::attachViewMenu( QMenu* menu )
{
connect( menu, SIGNAL(aboutToShow()), this, SLOT(autoFillAttachedViewMenu()) );
}
void DockInDockWidget::autoFillAttachedViewMenu()
{
QMenu* menu = dynamic_cast<QMenu*>( QObject::sender() );
if ( menu )
{
menu->clear();
setupViewMenu( menu );
}
else
{
assert( false );
}
}
void DockInDockWidget::setupViewMenu( QMenu* menu )
{
std::vector<DockInDockManager*> dockManagers = m_mgr->allManagers( true, true );
bool hasPerspectivesMenu = false;
if ( getTopLevelDockWidget() == this )
hasPerspectivesMenu = (m_perspectivesManager != NULL);
else
assert( false );
QMenu* organize = menu;
if ( hasPerspectivesMenu )
organize = menu->addMenu( "Organize" );
setupMenu( organize, dockManagers );
if ( hasPerspectivesMenu )
{
QMenu* perspectives = menu->addMenu( "Perspectives" );
fillPerspectivesMenu( perspectives );
}
}
void DockInDockWidget::setupMenu( QMenu* menu, const std::vector<DockInDockManager*>& moveTo )
{
m_mgr->fillViewMenu( menu, moveTo );
menu->addSeparator();
auto moveMenu = menu->addMenu( "Move" );
m_mgr->fillMoveMenu( moveMenu, moveTo );
}
void DockInDockWidget::fillPerspectivesMenu( QMenu* menu )
{
menu->addAction( "Create perspective...", this, SLOT(createPerspective()) );
QStringList perspectiveNames;
if ( m_perspectivesManager )
perspectiveNames = m_perspectivesManager->perspectiveNames();
if ( !perspectiveNames.isEmpty() )
{
QMenu* load = menu->addMenu( "Load perspective" );
for ( auto name : perspectiveNames )
load->addAction( new LoadPerspectiveAction( load, name, *this ) );
QMenu* remove = menu->addMenu( "Remove perspective" );
for ( auto name : perspectiveNames )
remove->addAction( new RemovePerspectiveAction( remove, name, *this ) );
}
}
void DockInDockWidget::setNewPerspectiveDefaultName( const QString& defaultName )
{
m_newPerspectiveDefaultName = defaultName;
}
void DockInDockWidget::createPerspective()
{
if ( !m_perspectivesManager )
return;
QString name = m_newPerspectiveDefaultName;
if ( !m_newPerspectiveDefaultName.isEmpty() )
{
int index = 2;
while ( m_perspectivesManager->perspectiveNames().contains( name ) )
{
name = m_newPerspectiveDefaultName + " (" + QString::number(index) + ")";
++index;
}
}
while ( true )
{
bool ok = false;
name = QInputDialog::getText( NULL, "Create perspective", "Enter perspective name", QLineEdit::Normal, name, &ok );
if ( ok )
{
if ( name.isEmpty() )
{
QMessageBox::critical( NULL, "Error", "Perspective name cannot be empty" );
continue;
}
else if ( m_perspectivesManager->perspectiveNames().contains( name ) )
{
if ( QMessageBox::critical( NULL, "Error", "Perspective '" + name + "' already exists, overwrite it?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::No )
continue;
}
m_perspectivesManager->addPerspective( name, *this );
break;
}
else
{
break;
}
}
}
static void dumpStatus( std::ostream& str, ads::CDockWidget* widget, const std::string& tab, std::string suffix )
{
DockInDockManager* asMgr = DockInDockManager::dockInAManager( widget );
if ( asMgr )
{
asMgr->parent().dumpStatus( str, tab );
}
else
{
str << tab << widget->objectName().toStdString() << suffix << std::endl;
}
}
void DockInDockWidget::dumpStatus( std::ostream& str, std::string tab )
{
str << tab << "Group: " << getManager()->getGroupName().toStdString() << std::endl;
tab += " ";
std::set<ads::CDockWidget*> visibleWidgets;
for ( auto widget : getManager()->getWidgetsInGUIOrder() )
{
visibleWidgets.insert( widget );
::dumpStatus( str, widget, tab, "" );
}
for ( auto closed : getManager()->dockWidgetsMap() )
{
if ( visibleWidgets.find( closed ) == visibleWidgets.end() )
{
::dumpStatus( str, closed, tab, " (closed)" );
}
}
}

View File

@@ -0,0 +1,80 @@
#pragma once
#include <QWidget>
#include <QMap>
#include <memory>
#include <ostream>
class QMenu;
namespace ads
{
class CDockAreaWidget;
}
namespace QtAdsUtl
{
class DockInDockManager;
class PerspectivesManager;
// tab of tab example for https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/306
class DockInDockWidget : public QWidget
{
typedef QWidget baseClass;
Q_OBJECT
public:
DockInDockWidget( QWidget* parent, bool canCreateNewGroups, PerspectivesManager* perspectivesManager );
~DockInDockWidget() override;
ads::CDockAreaWidget* addTabWidget( QWidget* widget, const QString& name, ads::CDockAreaWidget* after );
DockInDockWidget* createGroup( const QString& groupName, ads::CDockAreaWidget*& insertPos );
ads::CDockAreaWidget* addTabWidget( QWidget* widget, const QString& name, QIcon icon, ads::CDockAreaWidget* after );
DockInDockWidget* createGroup( const QString& groupName, QIcon icon, ads::CDockAreaWidget*& insertPos );
QString getGroupNameError( const QString& groupName );
void destroyGroup( DockInDockWidget* widget );
/** Manually fill a given view menu */
void setupViewMenu( QMenu* menu );
/** Attach a view menu that will be automatically fill */
void attachViewMenu( QMenu* menu );
bool isTopLevel();
void setupMenu( QMenu* menu, const std::vector<DockInDockManager*>& moveTo );
inline DockInDockManager* getManager() { return m_mgr; }
inline DockInDockWidget* getTopLevelDockWidget() { return m_topLevelDockWidget; }
inline bool canCreateNewGroups() const { return m_canCreateNewGroups; }
void dumpStatus( std::ostream& str, std::string tab = "" );
inline PerspectivesManager* getPerspectivesManager() { return m_perspectivesManager; }
void setNewPerspectiveDefaultName( const QString& defaultName );
private slots:
void autoFillAttachedViewMenu();
void createPerspective();
private:
DockInDockManager* m_mgr;
DockInDockWidget* m_topLevelDockWidget;
bool m_canCreateNewGroups;
DockInDockWidget( QWidget* parent, DockInDockWidget* topLevelDockWidget, PerspectivesManager* perspectivesManager );
PerspectivesManager* m_perspectivesManager;
QString m_newPerspectiveDefaultName;
void fillPerspectivesMenu( QMenu* menu );
};
}

View File

@@ -0,0 +1,35 @@
ADS_OUT_ROOT = $${OUT_PWD}/../..
QT += core gui widgets
TARGET = DockInDock
DESTDIR = $${ADS_OUT_ROOT}/lib
TEMPLATE = app
CONFIG += c++14
CONFIG += debug_and_release
adsBuildStatic {
DEFINES += ADS_STATIC
}
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
dockindock.cpp \
dockindockmanager.cpp \
perspectiveactions.cpp \
perspectives.cpp \
main.cpp \
mainframe.cpp
HEADERS += \
dockindock.h \
dockindockmanager.h \
perspectiveactions.h \
perspectives.h \
mainframe.h
LIBS += -L$${ADS_OUT_ROOT}/lib
include(../../ads.pri)
INCLUDEPATH += ../../src
DEPENDPATH += ../../src

Some files were not shown because too many files have changed in this diff Show More