Compare commits

...

283 Commits

Author SHA1 Message Date
Gary Wang
985ff74ccf feat: config flag to avoid QtADS using Qt StyleSheet (#835)
Resolve: githubuser0xFFFF/Qt-Advanced-Docking-System#833
2026-04-23 22:44:23 +02:00
Michael Jackson
a9aa10f4c2 BUG: Fixes overrides a destructor but is not marked 'override' (#836)
- If compiling with flag [-Werror,-Winconsistent-missing-destructor-override]
2026-04-23 22:43:02 +02:00
Lee Jae-Jin
7b30229355 feat: add preferred auto-hide sidebar location per dock widget (#829)
Add preferredAutoHideSideBarLocation property to CDockWidget that allows
applications to specify where a widget should be pinned, overriding
geometry-based detection. When unpinning, widgets with the same preferred
location merge as tabs instead of creating new splits.

Default is SideBarNone (existing geometry-based behavior preserved).
2026-04-05 09:03:15 +02:00
Luca
4a0b636148 Make all tab text readable in dark mode (753) (#828) 2026-04-05 08:59:35 +02:00
Andreas Ringlstetter
544c624f07 Unbind containers from DockManager to prevent accidental reuse before deletion (#823) 2026-04-05 08:58:29 +02:00
ma-robox
bbde511603 Toggling visibility of floating docked windows protected against external hide/show cycle by QWebEngineView. (#821)
Co-authored-by: AlbertoM <ma-robox@users.noreply.github.com>
2026-03-10 18:34:45 +01:00
Ruben de Bruin
ee3a526adb Fixes handling of native / alien widgets when (un)docking (#820)
* Initial plan

* Fix drawing artifacts when content widgets call winId()

When a content widget (e.g. VTK/OpenGL) calls winId() to get a native
window handle, Qt propagates native-window creation up the ancestor chain.
This makes CDockWidget, CDockAreaWidget, and CDockContainerWidget all
become native OS windows unexpectedly. Reparenting these native dock
widgets during floating or resizing then causes drawing artifacts.

Fix: set Qt::WA_DontCreateNativeAncestors on the content widget in
CDockWidget::setWidget() to stop native-window creation from propagating
up into the dock hierarchy.

Co-authored-by: RubendeBruin <34062862+RubendeBruin@users.noreply.github.com>

* Fix docking system to handle mix of native and alien Qt widgets

Three targeted fixes for the native/alien widget mixing problem:

1. Revert WA_DontCreateNativeAncestors from CDockWidget::setWidget().
   Setting it on the content widget created a broken native-inside-alien
   hierarchy: the QScrollArea (alien) could not clip its native child, so
   content escaped the scrollbox bounds; and alien CAutoHideDockContainer
   could not appear above the native content widget.
   Allowing natural propagation means QScrollArea also goes native, and OS
   parent/child window clipping works correctly.

2. Fix CDockContainerWidget::removeDockArea to use internalWinId() instead
   of testAttribute(WA_NativeWindow). WA_NativeWindow is only set when a
   widget is explicitly made native; widgets that became native through
   upward propagation from a descendant calling winId() have a real native
   window handle (internalWinId() != 0) but WA_NativeWindow may be unset.
   Setting their parent to nullptr would create a free-floating invisible
   OS window and cause drawing artifacts.

3. Fix CAutoHideDockContainer::collapseView: when the parent dock container
   is native but the auto-hide panel is still alien, promote the panel to a
   native window (winId()) before raise(). The OS always renders native
   child windows above a parent window's painted alien content, so an alien
   auto-hide panel can never appear above native sibling dock areas. Once
   the panel has its own OS-level window, raise() operates on OS Z-order
   and correctly places it above native content siblings.

Co-authored-by: RubendeBruin <34062862+RubendeBruin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-03-10 18:34:08 +01:00
Alessandro de Jesus
e2c960238d Fixed Undock Button getting hidden after undocking and docking again a floating widget that contains only one single visble dock area (#816) 2026-03-08 08:11:09 +01:00
ZFail
62bc6fced7 Fixes that allows use project as submodule (#815)
* Fix ADS_VERSION support for builds without git dependency

- Move CMAKE_MODULE_PATH outside if(NOT ADS_VERSION) block so it's always available
- Parse ADS_VERSION to set PROJECT_VERSION_* variables for Versioning.cmake
- Update Versioning.cmake to use predefined version when available, fallback to git

This allows building with -DADS_VERSION=X.Y.Z without requiring git repository.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* Add ADS_PLATFORM_DIR option to customize output directory

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: ArtemNabok <nabok.artem@yandex.ru>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-08 08:10:51 +01:00
Andreas Ringlstetter
dd83812b29 Toogle visibility of custom title bar based on fullscreen state (#814) 2026-02-16 21:51:40 +01:00
André Meyer
88db64451e FloatingDockContainer uses windowIcon from parent Widgets before falling back to QApplication (#812) 2026-02-11 06:02:56 +01:00
André Vautour
1a96a06cb6 Account for the tabs height when they are at the bottom. (#811)
Thank you
2026-02-11 06:01:01 +01:00
zhulongcc
00f88d9666 fix: Fix copy-paste errors in configflags CMakeLists. (#810) 2026-02-06 05:43:37 +01:00
mborgerson
664d02edd4 Raise dialogs only if they are modal (#808) 2026-02-06 05:41:12 +01:00
vhutter
72e5c566b7 Fix label color in CDockWidgetTab in dark mode (#804) 2026-01-27 06:37:17 +01:00
André Vautour
e78133b7b2 Update title bar label when the widget's title changes. (#798) 2026-01-15 21:42:18 +01:00
André Vautour
f9ad1d7801 Use Native Windows (#797)
* Avoid changing to a top-level window when moving a native window.

* Support using native windows for the dock/area widgets.
2026-01-15 21:39:51 +01:00
Boris Barbulovski
34b68d6eab Change git command working directory to this project (#796)
If this project is used as subproject of another CMake project, then git commands will fail because git will be executed from wrong location.
2026-01-13 07:00:14 +01:00
Boris Barbulovski
f8143d5419 Conditionally add Windows version resources (#795) 2026-01-11 21:20:35 +01:00
Uwe Kindler
d01ffe3bee Removed superfluous appveyour badge 2026-01-11 18:21:54 +01:00
Uwe Kindler
87cffe5d40 Updated New and Noteworthy in README.md for new feature TabsAtBottom 2026-01-11 17:59:34 +01:00
Uwe Kindler
d47d87e4b8 Updated showcase section for PiSoWorks application 2026-01-11 17:53:19 +01:00
Uwe Kindler
3b0f6f92a9 Updated TabsAtBottom documentation 2026-01-11 17:49:13 +01:00
Uwe Kindler
12cb417682 Removed appveyor and travis CI support 2026-01-11 17:48:50 +01:00
Uwe Kindler
a674eea1cd Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2025-11-26 08:53:10 +01:00
Uwe Kindler
a2854a7740 Added cmake modules to integrate version information into Windows DLLs 2025-11-26 08:51:22 +01:00
Uwe Kindler
cd984881e5 Improved raising of dock widget application on linux. 2025-11-24 22:15:42 +01:00
Michael Jackson
eb22a9aef6 COMP: Fix warnings about override on public destructors (#788) 2025-11-12 08:22:45 +01:00
Ivan Ugryumov
d709230510 Replace qDebug with ADS_PRINT (#787) 2025-11-10 20:44:55 +01:00
hormnek
d467b21960 Fix qApp connection (#778) 2025-10-09 21:27:30 +02:00
anoy.
893af516b2 Remove GuiPrivate dependency for Windows builds (#777) 2025-10-09 21:26:38 +02:00
Uwe Kindler
9fd5002886 Added documentation for TabsAtBottom flag 2025-09-26 22:08:14 +02:00
Uwe Kindler
39c8407e0c Updated autohidedragndrop example to use new TabsAtBottom config flag 2025-09-26 21:52:49 +02:00
Vautour, André
e922a1e5bc Updated the title label styling in all of the stylesheets. 2025-09-24 13:48:26 -03:00
Vautour, André
66e10e022b Don't show title bar for floating widgets with tabs at bottom. 2025-09-24 09:36:38 -03:00
Vautour, André
3342fd6596 Support tabs at the bottom of dock widgets. 2025-09-23 16:38:44 -03:00
Uwe Kindler
c1977c51fa Added PySoWorks to showcase section 2025-09-17 22:00:47 +02:00
Jan Grulich
dc1e76d60c Introduce SOVERSION for ABI compatibility (#771)
This commit sets the library's SOVERSION to its major version number.

Setting the soname this way establishes a clear ABI promise. This allows
users to safely upgrade to minor or patch releases without needing to
recompile their applications, as long as the major version remains the
same.
2025-09-10 13:43:55 +02:00
Nicolas Elie
6c073b2833 Add gui-private include dirs for Qt5 (#768) 2025-09-03 08:50:03 +02:00
TheComet
11004ebaa0 Fix C++23 Warnings (#764)
Co-authored-by: Alexander Murray <alexander.murray@franke.com>
2025-08-25 20:09:04 +02:00
Uwe Kindler
2583408420 Removed color from release badge because orange is used for releases < 1.0 2025-08-22 10:25:20 +02:00
Uwe Kindler
dec0442007 Fixed issue #762 - Context menu entries for DockWidget tab missing for last dock widget 2025-08-22 10:07:21 +02:00
Michael Jackson
c020f82a6c BUG: Fixes Linux + Qt 6.9 cmake configuration and linker errors (#752)
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
2025-06-13 10:16:17 +02:00
Uwe Kindler
c1555c30cc Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2025-06-12 15:45:06 +02:00
Cole Beezley
d6cb127320 Fixed typo in DockContainerWidget.h (#750) 2025-06-12 15:02:41 +02:00
Uwe Kindler
c2373eb7de Updated documentation link in README.md 2025-06-12 15:01:44 +02:00
Uwe Kindler
d5843ff7d3 Documented the use of Qt::AA_ShareOpenGLContexts when using OpenGL with ADS 2025-06-12 14:55:31 +02:00
Uwe Kindler
c135782001 Updated examples and demo to use createDockWidget() function for dock manager instead of deprecated DockWidgetr constructor 2025-06-12 14:50:16 +02:00
Uwe Kindler
79c208da4f Added documentation for xfce4 focus stealing issue 2025-06-12 14:18:50 +02:00
Uwe Kindler
b67c4a0c84 Added Scrutiny Debugger to showcase section 2025-06-12 14:01:12 +02:00
Uwe Kindler
6b9105b813 Added showcase image for scrutiny 2025-06-12 13:34:30 +02:00
Uwe Kindler
6c6e0333a9 Merge branch 'ci-dev' 2025-06-11 23:14:57 +02:00
Uwe Kindler
d55387d087 Added windows-cmake.yml file 2025-06-11 23:08:33 +02:00
Uwe Kindler
bf9560f8ea Updated README.md with workflow badges 2025-06-11 23:01:33 +02:00
Uwe Kindler
949ed40006 Updated mingw tool to mingw1310 2025-06-11 22:33:21 +02:00
Uwe Kindler
f2a9dd4db4 Updated Windows workflow to use Qt MinGW 9 2025-06-01 19:53:32 +02:00
Uwe Kindler
ed67081b74 Removed caching from MinGW build 2025-06-01 18:21:41 +02:00
Uwe Kindler
705d931231 Updated MinGW build 2025-06-01 18:17:57 +02:00
Uwe Kindler
d1367c9dd4 Updated the MinGW build 2025-06-01 18:16:17 +02:00
Uwe Kindler
31402ee9f8 Updated windows-cmake.yml to use bundled Qt MinGW toolchain 2025-06-01 18:10:16 +02:00
Uwe Kindler
b7cbac88b3 Merge branch 'ci-dev' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System into ci-dev 2025-06-01 17:56:34 +02:00
Uwe Kindler
fe8c88771f Swicthed MinGW build from Ninja to MinGW 2025-06-01 17:56:23 +02:00
githubuser0xFFFF
befcd9eadf Update windows-cmake.yml 2025-06-01 17:41:30 +02:00
Uwe Kindler
46e5aea61c Updated arch 2025-06-01 17:20:26 +02:00
Uwe Kindler
103db689ff Updated CI MinGW Qt version to 6.8.2 2025-06-01 17:11:54 +02:00
Uwe Kindler
bc34470d3c Updated windows-cmake.yml 2025-06-01 17:07:17 +02:00
Uwe Kindler
646bddfea3 Workaround bug in install-qt-action 2025-06-01 16:57:59 +02:00
Uwe Kindler
ec196715e0 Removed non working windows-cmake.yml workflow 2025-06-01 13:46:33 +02:00
Uwe Kindler
cb63f0e6ea And another try 2025-06-01 12:12:23 +02:00
Uwe Kindler
c941b2dfde Updated MinGW build to work properly 2025-06-01 12:08:37 +02:00
Uwe Kindler
671b932804 An another try 2025-06-01 12:03:55 +02:00
Uwe Kindler
f76d3b4834 And another try 2025-06-01 11:59:28 +02:00
Uwe Kindler
c248f79971 And another try 2025-06-01 11:58:13 +02:00
Uwe Kindler
0566677a9d Updated workflow 2025-06-01 11:52:11 +02:00
Uwe Kindler
268998961b Updated windows-cmake.yml 2025-06-01 11:48:50 +02:00
Uwe Kindler
716d6f7f25 Updated run command in yaml for MSVC 2025-06-01 11:15:26 +02:00
Uwe Kindler
ceb7c91844 Updated workflow file to fix wrong CMake detection of MSVC 2025-06-01 11:06:38 +02:00
Uwe Kindler
0a78dcf460 Add workflow to build with CMake and MSVC / MinGW on Windows 2025-06-01 10:48:14 +02:00
Uwe Kindler
da7d23c127 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2025-06-01 10:39:10 +02:00
Michael Jackson
64d80b2c53 LIC: Move installation of license file to share/ads folder (#748)
Signed-off-by: Michael A. Jackson <mike.jackson@bluequartz.net>
2025-05-30 20:19:14 +02:00
githubuser0xFFFF
f2a029a0c6 Update linux-builds.yml 2025-05-08 22:03:21 +02:00
githubuser0xFFFF
c1b60959ae Update linux-builds.yml 2025-05-08 21:59:12 +02:00
githubuser0xFFFF
d53728c0a8 Update linux-builds.yml 2025-05-08 21:45:55 +02:00
githubuser0xFFFF
a7ad4386e4 Update linux-builds.yml 2025-05-08 21:37:14 +02:00
Pier-Yves Lessard
4e90a38c52 Remove dangling pointer to tab widget when a dock widget is removed from autohide side bar (#740) 2025-05-08 21:18:11 +02:00
Uwe Kindler
4947548224 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2025-05-08 21:06:32 +02:00
FelixBer
991b69cc51 fix compile with Qt 6.9.0 - qplatformnativeinterface.h missing (#736)
Co-authored-by: fb <f@b.com>
2025-04-23 19:10:16 +02:00
Federico Fuga
df1fa27127 Fix nasty and still unclear bug with "Close Other" not closing all tabs in certain conditions. (#725) 2025-03-17 10:38:10 +01:00
Uwe Kindler
936eba01cd Bring all floating widgets to foreground on Linux if a dockwidget is
dragged
2025-03-14 11:45:50 +01:00
Uwe Kindler
9f8dd99cac Improved fix #722 - it now works always even if focus highlighting is
disabled
2025-03-13 14:19:47 +01:00
Uwe Kindler
90e5adde29 Fixed #722 - Ensure that application is in front of other application what dragging floating windows 2025-03-07 09:59:24 +01:00
André Meyer
ddbed9ea14 Always show TitleBar if it contains any explicit actions (#720) 2025-03-07 08:55:42 +01:00
Josiah Bills
c305432ab2 Fixed crash caused by unparented widgets after restoring layout. (#724)
This is essentially due to `setDockArea` undoing the earlier
`setParent`.
2025-03-07 08:52:48 +01:00
Uwe Kindler
e836b154eb Fixed #711 - Focus loss when closing other dock widgets 2025-03-06 14:59:36 +01:00
githubuser0xFFFF
782589523e Update linux-builds.yml
Updated actions/cache@v1 to actions/cache@v3
2025-03-06 13:24:13 +01:00
Talley Lambert
bb105d2ef6 Mention pyqt6 bindings in readme (#723) 2025-03-03 21:38:40 +01:00
Michael Jackson
483bb7354a DOC: Update DREAM3D-NX information and screen shot (#712)
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
2025-02-07 10:03:16 +01:00
anoy.
7d9f9b43a7 update minimum CMake version to 3.16 (#710) 2025-02-05 11:52:17 +01:00
Uwe Kindler
7fd5cbe9d7 Improved user-guide.md 2025-01-16 08:07:08 +01:00
luzpaz
a16d17a8bf Fix various typos (#692)
* Fix various typos
Found via `codespell -q 3 -L te,ridiculus,varius`

* Add another typo fix
2025-01-15 09:00:47 +01:00
Uwe Kindler
faf24cd531 Implemented issue #694 - added auto hide configuration flag AutoHideCloseOnOutsideMouseClick 2025-01-15 08:37:43 +01:00
Uwe Kindler
979d76aa47 Imporved user guide - added documentation for some undocumented flags. 2024-12-20 11:09:11 +01:00
Uwe Kindler
0a55bcd586 Updated README.md to use the new factory function CDockManager::createDockWidget() 2024-12-20 10:35:22 +01:00
Uwe Kindler
f41a6f06fe Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2024-12-20 10:27:35 +01:00
Uwe Kindler
349d584228 Adjusted MyDockAreaTitleBar source code style 2024-12-20 10:26:59 +01:00
Uwe Kindler
fcad7763ff Add factory method to Dock manager as an alternative method to create DockWidget, supporting custom factory 2024-12-20 10:21:57 +01:00
Uwe Kindler
1bec4234c3 Added support for componentsFactory per dock manager 2024-12-20 10:12:46 +01:00
Nolan Kramer
0be5ba8cf6 Fix issue with windeployqt (#683)
* Fix issue with windeployqt

* Rename library to requested format
2024-12-13 21:57:00 +01:00
Uwe Kindler
7245dced84 Added new config flag DoubleClickUndocksWidget to configure if double clicking a DockWidget tab or titlebar undocks the widget 2024-12-12 15:38:29 +01:00
Uwe Kindler
e2f611ea9a CDockAreaTitleBar::resizeEvent function to fix issue #656 2024-12-12 14:53:24 +01:00
Ivan Ugryumov
1f21eb0200 Improved tab bar scrolling (#678)
* Improved tab bar scrolling

* Fix: tab bar scroll for mouse
2024-12-12 13:13:01 +01:00
Federico Fuga
f2378636e2 Add ability to customize the DockArea Title Bar and DockWidget Tab context menu 2024-11-20 15:38:39 +01:00
Federico Fuga
509b2356d1 Fix missing declarations 2024-11-20 15:38:21 +01:00
Uwe Kindler
30b802bd10 Fixed Qt5 build issues 2024-11-20 15:31:31 +01:00
Uwe Kindler
e857421fdf Added all build* subfolders to .gitignore 2024-10-28 15:41:46 +01:00
Uwe Kindler
8dcdc8fad2 Improved autohidedragndrop example to check, if it also works when dragging with multiple auto hide tabs 2024-10-28 15:40:32 +01:00
Uwe Kindler
f964ce2c68 Refactored, fixed and improved drag hover functionality 2024-10-28 15:39:29 +01:00
Uwe Kindler
eb9b439d11 Added support for setting config parameters to CDockManager 2024-10-28 15:30:29 +01:00
TheBoje
a13ed7e4d6 Add AutoHideDragNDrop example 2024-10-22 22:36:53 +02:00
TheBoje
8cfa5c8e0e Fix formatting#2 (#663) 2024-10-04 22:27:15 +02:00
TheBoje
2878559ee6 Fix formatting (#663) 2024-10-04 22:23:40 +02:00
TheBoje
6ff39bccf8 Add open auto-hide dock on hover from drag and drop (#663) 2024-10-04 22:17:42 +02:00
gavininfinity
952131a1e9 Make startDragging public (#658) 2024-08-19 07:37:51 +02:00
Uwe Kindler
5edbcc1970 Fixed issue #654 - Wheel event on DockAreaTabBar 2024-07-25 08:42:30 +02:00
Uwe Kindler
04f6d9168e Fixed #642 - The floating window can not back to normal size after maximizing it 2024-07-08 14:32:33 +02:00
Uwe Kindler
cea1327dac Fixed #653 - DisablingTabTextEliding not letting DockAreaDynamicTabsMenuButtonVisibility to function and program crashes 2024-07-08 12:15:00 +02:00
Uwe Kindler
1c41cbff82 Fixed issue #641 - Unexpected behaviour with tab drag on scrollable tab bar 2024-07-08 10:43:02 +02:00
invisibleGG
06e8451fc0 Update DockAreaTabBar.cpp (#640)
This fix seems to have introduced a regression when _this is deleted before the lambda slot occurred, for example deleting the DockManager (and consequently _this) immediately after the execution of updateTabs function (we encountered this problem in linux)
2024-06-03 08:29:59 +02:00
Uwe Kindler
3ff6918b1f Added configflags example to test use of CDockManager config flags 2024-05-21 08:37:35 +02:00
Uwe Kindler
ac3af4c6cd Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2024-05-08 14:44:44 +02:00
Uwe Kindler
41bb861417 Fixed problem in AutoHideSideBar that prevented the dock container, that contained a vertical sidebar with many tabs, from shrinking vertically 2024-05-08 14:43:53 +02:00
Stefan Gerlach
6e63418798 Fix "extra ;" warning (#624) 2024-04-08 11:40:06 +02:00
Nicolas Elie
65781b7cac Include GNUInstallDirs for CMAKE_INSTALL_* vars to be defined (#621) 2024-04-03 23:49:37 +02:00
Nicolas Elie
d7e6c613c6 Update PyQt bindings to 4.3.0 (#622) 2024-04-03 23:49:08 +02:00
UnlimitedStack
8da0713bf0 Ensure that TabWidget was not deleted by using it as context object (#612)
Co-authored-by: Marcus Venturi <marcus.venturi@visu-it.de>
2024-03-16 01:23:42 +01:00
NeroBurner
08da925fde readme: small wording improvements (#610)
Removes an extra `the` in the Readme about the tested Linux versions
2024-02-28 20:45:32 +01:00
Dominik Nussbaumer
fb58c435ef Fix ODR violations when using CMake unity builds. (#609) 2024-02-28 13:25:20 +01:00
Dominik Nussbaumer
6bf593ef4b fix forward declarations of QXmlStreamWriter (#608) 2024-02-27 17:34:42 +01:00
Uwe Kindler
6b3b7750cb Fixed #604 - AutoHide widgets disapears when last open DockWidget is closed 2024-02-12 08:18:33 +01:00
Uwe Kindler
541db8e214 Fixed wrong hiding/showing of dock area title bar buttons when DockAreaHideDisabledButtons flag is enabled 2024-02-12 08:11:56 +01:00
Uwe Kindler
644c828f00 Fixed crash caused by changes related to issue #594 - deletion of CFloatingWidget caused crash when loading a state from XML 2024-01-26 16:31:04 +01:00
Uwe Kindler
ed6636ae26 Added CDockManager::lockDockWidgetFeaturesGlobally functionality to globally "freeze" the current docking layout 2024-01-23 13:29:41 +01:00
Stefan Gerlach
1a543e946d Fix 'zero as null pointer constant' warning (#598) 2024-01-16 14:05:42 +01:00
Uwe Kindler
9bdefd6055 Fixed issue #597 - Crashes when the floating widget moves to the dock manager and then tries to drag it back 2024-01-16 14:03:53 +01:00
Uwe Kindler
8fd691968c Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2024-01-04 08:31:57 +01:00
Uwe Kindler
7abc698d09 Fixed #594 - Destruction of CDockWidget inside a CFloatingDockContainer 2024-01-04 08:31:18 +01:00
Uwe Kindler
5b23248fb8 Fixed debug output issues and improved debug output for CDockWidget destructor 2024-01-04 08:30:17 +01:00
Uwe Kindler
46a5cee9c9 Added .clang-format file 2024-01-02 09:11:36 +01:00
Benjamin Buch
6c2c9888be respect customized CMake install locations (#593) 2023-12-12 13:54:51 +01:00
Uwe Kindler
44ff9e9956 Fixed some compiler warnings on Ubuntu 22.04 2023-12-08 07:58:36 +01:00
tmartsum
f848df74c3 Improve safety in code (#588)
Delete areas later so that that they can be accessed by
(inherited) dock widgets in dtor. Add some QPointer to
prevent crashes.

Hence allow users to do more while dock widgets etc
are being destroyed.
2023-12-08 06:47:02 +01:00
tmartsum
6c98c29855 Update documentation regarding central widget (#589) 2023-12-07 10:00:30 +01:00
tmartsum
c34d479d5c Avoid dock manager double delete (crashes) (#587)
If a dockwidget has been manually deleted, the dockmanager
would delete it again when deleting the area in its dtor.
The 'optimal' solution would likely have been changing
CDockWidget::~CDockWidget to add
if (d->DockArea) d->DockArea->removeDockWidget(this);
(before delete d).
However, it is not trivial (for me) to conclude that such
a change would be safe on program shutdown.

Co-authored-by: Thorbjørn Lund Martsum <thorbjorn@luxion.com>
2023-12-06 15:12:48 +01:00
jporcher
a7a97e6978 Fix https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/585 (#586) 2023-12-05 14:44:31 +01:00
Uwe Kindler
ec018a4c70 Added documentation for new "ShowTabTextOnlyForActiveTab" config flag 2023-12-04 09:24:59 +01:00
Uwe Kindler
0fabebb0fe Merge branch 'master' of https://github.com/nitramr/Qt-Advanced-Docking-System into nitramr-master 2023-12-04 09:10:34 +01:00
Uwe Kindler
521e1fbe39 Updated default AutoHide config to use Minimize button 2023-12-04 09:10:02 +01:00
Uwe Kindler
5f2aeaef00 Updated gitignore 2023-12-04 09:09:37 +01:00
nitramr
818e568f4a new configuration of icon only tabs 2023-12-02 14:48:43 +01:00
tmartsum
5d6831d179 Fix DockWidget crach when area is a nullptr. (#582)
When requesting hide on a dockwidget that has been added
to a dockmanager, but isn't yet visible, there was a creash.
The crash has been fixed by moving the code to the existing
guard check for the area.

Co-authored-by: Thorbjørn Lund Martsum <thorbjorn@luxion.com>
2023-12-01 15:13:45 +01:00
Uwe Kindler
a2c94c16b5 Fixed bug in focus_highlighting.css stylesheet 2023-11-27 22:04:45 +01:00
Uwe Kindler
68f1084bf0 Added parentSplitter() fucntion to DockArea and removed dead code from DockContainerWidget 2023-11-27 21:48:14 +01:00
Uwe Kindler
761bfc50d6 Fixed #581 - FocusHighlighting is broken after detaching a dock widget 2023-11-24 13:54:19 +01:00
Uwe Kindler
59b4dfb89c Updated documentation 2023-11-07 12:23:01 +01:00
Uwe Kindler
bfa5124999 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-11-06 12:18:40 +01:00
Uwe Kindler
234cf9ac58 Improved disabled pin button 2023-11-06 12:17:39 +01:00
Uwe Kindler
8f77f4b42a Added documentation for new Auto Hide Minimize button 2023-11-06 12:08:31 +01:00
Uwe Kindler
fa94da00d4 Added optional Minimize button to AutoHide dock widget title bar 2023-11-06 11:06:12 +01:00
gafusss
40beef964b Fix memory leak in CDockContainerWidget::restoreState (#576)
delete old root splitter layout item
2023-11-04 06:49:01 +01:00
Uwe Kindler
420baeedfe Added support for global dock manager toolbar style and custom dock widget toolbar style for dock widgets 2023-10-19 10:25:23 +02:00
Uwe Kindler
0f8096e314 Added minimize and close action to Auto Hide context menu 2023-10-19 09:10:26 +02:00
uggas
9ec97a8867 Add ability to set user defined toggle view action (#562)
Co-authored-by: Harbinder Saggu <harbinder.saggu@safe.com>
2023-10-19 08:07:55 +02:00
Nate Skulic
55ef6ef863 Improve Python Support (#567)
- Reduce requirements for the python build.
- Fix version number.
- Generate type hints for *.pyi files.
- Make functional for sip-build
- Reduced the unnecessary depth of the package.

NOTE: This is a breaking change for python users, where, `from PyQtAds import QtAds` is changed to `import PyQtAds as QtAds`( or simply `import PyQtAds`)
2023-10-05 07:23:54 +02:00
Henning
c0985f6497 Fix empty floating widget on linux (#563) 2023-09-22 20:03:02 +02:00
Uwe Kindler
2f1ef61f82 Fixed documentation issue - wrong location of picture 2023-09-19 08:53:04 +02:00
Uwe Kindler
62d2dd213d Implemented #554 - Add a configuration that avoid tab label eliding 2023-09-19 08:44:31 +02:00
vhutter
3c941a2312 Enabled modifying MSVC runtime in cmake (#559) 2023-09-11 14:57:09 +02:00
603185423
4634b5617c CMake Script - Add debug postfix "d" (#406) (#558)
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/406
2023-09-11 12:56:32 +02:00
André Meyer
2178b52621 Delete implicit ScrollArea when content Widget is deleted in hideDockWidget() (#551) 2023-08-24 11:20:32 +02:00
Ahmad Syarifuddin
61573cba16 Fix crash in auto hide tab (#552)
- Crash is caused by dragging an autohide tab out when it is an icon only.
- The crash can actually happen with non icon only tabs, but is masked by the orientation check.
- Soln: Check if auto hide container exists first on mouse finish dragging event.
2023-08-24 11:15:43 +02:00
Joel Bodenmann
2d2de53dcd Fix CMake scripts for FreeBSD (#550)
This fixes linking of the XCB library on FreeBSD.
2023-08-17 17:57:16 +02:00
luzpaz
0d10c6e2d9 Fix various typos (#547)
Typos found via `codespell -q 3 -L te,ridiculus,varius`
2023-08-08 19:46:12 +02:00
Uwe Kindler
767933d0cb Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-08-03 15:58:07 +02:00
Uwe Kindler
7a362b7ee3 Fixed issue #544 - crash in CDockAreaTabBar::currentTab() 2023-08-03 15:57:57 +02:00
Nicolas Elie
77ed9b0661 Update PyQt bindings to 4.1.1 (#542) 2023-08-02 20:23:49 +02:00
Uwe Kindler
65600a4dcd Removed unimolemented superfluous function definitions 2023-07-14 08:07:37 +02:00
Uwe Kindler
ac1879d5cb Added missing README images 2023-07-13 13:59:48 +02:00
Uwe Kindler
f00ef60fb3 Merge remote-tracking branch 'remotes/origin/autohide_drag' 2023-07-13 13:58:08 +02:00
Uwe Kindler
1a1352e456 Updated README.md for 4.1 release 2023-07-13 13:53:29 +02:00
Uwe Kindler
65ae86a46d Removed debug output 2023-07-13 07:25:09 +02:00
Uwe Kindler
e239cdb354 Improved sizing of AutoHideWidgets when dragging between side bars 2023-07-12 14:37:45 +02:00
Uwe Kindler
7140e5e32a Properly handle dragging of dock widget into DockWidgetTabBar and AutoHideSideBar 2023-07-12 14:22:05 +02:00
Uwe Kindler
f5cfe9e05a Fixed tab insertion when dragging side tab 2023-07-12 14:01:39 +02:00
Uwe Kindler
be727c5890 Added initial support for inserting dropped dock widgets at a certain sidebar position 2023-07-12 10:42:24 +02:00
Uwe Kindler
f4fc0dab29 Added support for dropping dock widget to a certain tab postion of a dock area 2023-07-12 09:39:20 +02:00
Uwe Kindler
39bc7f1780 Properly consider pinnable flag of dock widget when painting the drop overlays - no auto hide overlay for non pinnable dock widgets 2023-07-11 10:28:17 +02:00
Uwe Kindler
364ee33f9c Removed some std::cout debug output 2023-07-11 10:27:08 +02:00
Uwe Kindler
cb5e9f60a1 Changed default auto hide config - added flag AutoHideCloseButtonCollapsesDock 2023-07-11 08:26:03 +02:00
Uwe Kindler
2760fb1fe9 AutoHide dock area now always shows pin button independently from DockAreaHasAutoHideButton flag 2023-07-11 08:25:34 +02:00
Uwe Kindler
8a82e4cf57 Removed debug output and fixed painting of SideBar drag overlays 2023-07-10 12:07:44 +02:00
Uwe Kindler
0627b3183f Added "Close" action to AutoHideTab context menu 2023-07-10 10:38:21 +02:00
Uwe Kindler
df1bc94d9e Added Auto-Hide tab unpin context menu entry 2023-07-10 10:18:09 +02:00
Uwe Kindler
6924e69b6b Fixed detaching of auto hide widgets in a floating widget 2023-07-10 10:10:37 +02:00
Uwe Kindler
0a6c58fd66 Properly implemented drag and drop of auto hide tabs 2023-07-10 09:34:11 +02:00
Uwe Kindler
bf22e54fc3 Improved support for AutoHideTab drag and drop 2023-07-07 15:20:43 +02:00
Uwe Kindler
4307f48d99 Implemented initial support for dragging auto hide tabs 2023-07-07 14:42:13 +02:00
Uwe Kindler
4bdc04e9d8 Implemented Pin To functionality for Auto Hide Tabs 2023-07-07 13:35:55 +02:00
Uwe Kindler
1c6d86e70f Added support for make auto hide widget floating via double click or context menu 2023-07-07 11:21:54 +02:00
Nicolas Elie
6e642ec423 Update PyQt bindings to 4.0.4 (#532) 2023-07-03 14:09:48 +02:00
Uwe Kindler
0b3c3f0123 Merge branch 'master' into autohide_drag 2023-07-01 21:28:07 +02:00
Uwe Kindler
957afe3a07 Updated cmake build for demo to use quick and quickwidgets 2023-06-30 14:01:56 +02:00
Uwe Kindler
4ab726fee3 Updated Linux install requirements in README.md for building the demo application with QQuickWidget 2023-06-30 13:07:42 +02:00
Uwe Kindler
8d4507e9d8 Fixed mouse pressed state for Linux (use memeber variable instead of static) 2023-06-30 11:28:11 +02:00
Uwe Kindler
5a00eece87 Added QQuickWidget to demo application for testing OpenGl QtQuick on Linux 2023-06-30 08:27:51 +02:00
Uwe Kindler
e2929ade14 Fixed DockContainerWidget.cpp contentRect() function to work properly even if no dock widget is visible in container 2023-06-28 15:59:26 +02:00
Uwe Kindler
b801f0655d Improved dragging of widgets into AutoHideArea 2023-06-28 14:01:08 +02:00
Uwe Kindler
f6ccaba6aa Added dropIntoAutoHideSideBar() function 2023-06-28 10:19:59 +02:00
Uwe Kindler
21189759dd Removed drop icons for sidebar drops 2023-06-28 07:32:49 +02:00
Uwe Kindler
047ea3c494 Implemented new dock overlay icons for sidebar areas 2023-06-27 20:43:44 +02:00
Uwe Kindler
f71c8ffe5d Tested various pin buttons 2023-06-27 12:43:12 +02:00
Uwe Kindler
381acb2449 Merge branch 'master' into autohide_drag 2023-06-27 10:20:00 +02:00
Uwe Kindler
09e4e6fa5a Fixed nullptr access in DockWidgetTab 2023-06-27 10:18:38 +02:00
Uwe Kindler
b9479dbd3d Started implementing autohide drag functionality 2023-06-27 10:12:51 +02:00
Uwe Kindler
34cc91a9af Fixed #527 - updateDockWidgetFocusStyle() function error 2023-06-23 21:06:52 +02:00
Uwe Kindler
36cdf4a252 Fixed warnings on MacOS: replaced QApplication::setActiveWindow(this); with QWidget::activateWindow 2023-06-23 10:28:55 +02:00
Uwe Kindler
85f65b3f1a Avoid multiple function calls of parentWidget() function in CAutoHideSideBar::visibleTabCount() and CAutoHideSideBar::hasVisibleTabs() 2023-06-23 10:21:08 +02:00
Ahmad Syarifuddin
92da2eb8bd Bug fix sidebar state during restore (#526)
* fix side bar state being incorrect during restore

* isVisible is invalid during restore state

* Make visibleTabCount function consistent with hasVisibleTabs. Add a bit of documentation.

---------

Co-authored-by: Syarif Fakhri <fakhri.s@duerr-ndt.com>
2023-06-23 09:15:24 +02:00
Uwe Kindler
27edfe63ee Fixed issue #524: Sometimes sidebar visibility state is incorrect 2023-06-22 14:45:29 +02:00
Uwe Kindler
5517822008 Updated README.md with information about filing PySide related issues 2023-06-19 10:25:32 +02:00
Uwe Kindler
702702cbfd Merge branch '7c0o-master' 2023-06-19 10:03:56 +02:00
Uwe Kindler
c552fef134 Added documentation for the queued _this->ensureWidgetVisible(TabWidget) call 2023-06-19 10:02:19 +02:00
Eric Wong
916df28fcd Update FloatingDockContainer.cpp
remove dock container
2023-06-16 17:37:31 +08:00
Eric Wong
c08d91687a Update FloatingDockContainer.cpp
saveState() may use the floatingDockContainer to be deleted
2023-06-14 12:07:45 +08:00
Eric Wong
ccbde05fb7 Update DockAreaWidget.cpp
memory leak
2023-06-14 09:42:47 +08:00
Eric Wong
1049576349 Update DockAreaTabBar.cpp
Sometimes the synchronous calculation of the rectangular area fails
2023-06-08 09:13:41 +08:00
Uwe Kindler
0bfee09b17 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-06-06 15:26:21 +02:00
Uwe Kindler
87954e4459 Merged #518 - Add more options to determine the minimum size of a dock widget 2023-06-06 15:25:49 +02:00
githubuser0xFFFF
0301e345b4 Update linux-builds.yml 2023-05-12 19:32:39 +02:00
Uwe Kindler
f9b5ef8d89 Remove Ubuntu 18.04 from linux-builds 2023-05-09 13:36:42 +02:00
Uwe Kindler
0ed1f8f429 Fixed linux-builds.yml file 2023-05-08 10:32:58 +02:00
Uwe Kindler
659537916e Added documentation of new AutoHideCloseButtonCollapsesDock flag 2023-04-28 12:24:12 +02:00
Uwe Kindler
0cac9ac507 Merge branch 'close_button_collapse_dock' of https://github.com/duerr-ndt/Qt-Advanced-Docking-System into duerr-ndt-close_button_collapse_dock 2023-04-28 11:49:17 +02:00
Uwe Kindler
7a79ecab8a Fixed #511 - CDockWidget::toggleView now properly shows auto hide widgets 2023-04-28 11:47:01 +02:00
Uwe Kindler
1186d2b78c Fixed #509 - Implemented support for restoring maximized state of floating widgets on Windows 2023-04-28 11:12:22 +02:00
Syarif Fakhri
b46768537a Add config to make close button collapse auto hide dock 2023-04-28 15:27:22 +08:00
Uwe Kindler
44115d4bd9 Added support for printing events to diagnose window state ploblem 2023-04-28 08:33:45 +02:00
Uwe Kindler
f2d8e17981 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-04-27 23:38:19 +02:00
Uwe Kindler
7890a408f4 Added KDE LabPlot to the showcase section 2023-04-27 23:38:05 +02:00
Murmele
a940fc29c6 Use code also for other unix systems like BSD (#507) 2023-04-18 19:17:10 +02:00
Murmele
c6595563af if QT_VERSION_MAJOR is defined, use this version instead of searching again. Labplot does not support Qt6 yet and therefore the version is set manually in the project. If Qt5 and Qt6 are installed, QAd overwrites the Qt5 requirement and then the configuration of the project does not work (#504) 2023-04-16 11:32:45 +02:00
Uwe Kindler
cb24317010 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-04-11 08:31:26 +02:00
Uwe Kindler
fb1e427ab7 Added DREAM.3D NX to showcase section 2023-04-11 08:30:25 +02:00
Nicolas Elie
9d28a4d0d5 Fix typo in pyproject.toml (#501) 2023-04-08 09:08:01 +02:00
Uwe Kindler
df34b0eb2b An additional fix for #496 Nonfloatable hidden window disappears on drop in empty area 2023-03-22 18:22:34 +01:00
Uwe Kindler
db3dc80170 Fixed #496 Nonfloatable hidden window disappears on drop in empty area 2023-03-21 08:31:55 +01:00
Nicolas Elie
db16c5f1b5 Update python bindings to 4.0.2 (#495)
* start adaption of PyQt5 bindings to Qt-ADS 4.0

* Update PyQt bindings

* Fix Python bindings build on Linux

---------

Co-authored-by: Mira Weller <mweller@seemoo.tu-darmstadt.de>
2023-03-21 06:04:19 +01:00
Nicolas Elie
d28ca1e7a1 Add options to project.py to specify include and library directories (#493) 2023-03-11 08:34:23 +01:00
Nicolas Elie
e84b4a8146 Add namespace to default argument for python bindings (#492) 2023-03-06 14:53:43 +01:00
Nicolas Elie
46e0d832f8 Fix wrong include path in CMake install (#491) 2023-03-06 14:52:57 +01:00
Uwe Kindler
7e63919c08 Updated ads icons 2023-03-01 08:54:27 +01:00
Uwe Kindler
1873dde358 Added ADTF to showcase section and added video link for Resinsight to showcase section 2023-03-01 08:49:19 +01:00
Uwe Kindler
6362d14da6 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2023-02-27 08:03:08 +01:00
Uwe Kindler
1f48f0f3ad Updated linux-builds.yml to fix broken Ubuntu 22.04 workflow 2023-02-27 07:51:39 +01:00
Nicolas Elie
82695d1b3d Remove setup.py and related files (#490) 2023-02-23 18:42:47 +01:00
Nicolas Elie
08b0f8ad54 Change targets name based on Qt version (#489) 2023-02-23 15:50:50 +01:00
githubuser0xFFFF
54c2bd0c30 Update linux-builds.yml 2023-02-10 14:55:18 +01:00
githubuser0xFFFF
d8784a22b7 Update linux-builds.yml 2023-02-10 14:09:02 +01:00
githubuser0xFFFF
bc9f136f20 Update linux-builds.yml 2023-02-10 13:58:03 +01:00
githubuser0xFFFF
7192a06eb8 Update linux-builds.yml 2023-02-10 13:42:31 +01:00
githubuser0xFFFF
a4c6f1d16c Update linux-builds.yml 2023-02-10 13:30:41 +01:00
githubuser0xFFFF
009af32e61 Update linux-builds.yml
added Ubuntu 22.04 build with Qt6
2023-02-10 13:25:58 +01:00
Uwe Kindler
fab41828ab Updated the build documentation for Ubuntu 22.04 2023-02-10 12:02:42 +01:00
Uwe Kindler
cae42939c8 Disable native windows on Linux if wayland is used 2023-02-10 11:36:40 +01:00
Uwe Kindler
7b30322946 Added ResInsight to showcase section 2023-01-24 16:07:00 +01:00
Uwe Kindler
2730c135ea Removed OpaqueUndocking documentation 2023-01-20 11:58:58 +01:00
Uwe Kindler
9c30169c42 Removed support for opaque undocking 2023-01-20 11:50:34 +01:00
Uwe Kindler
624d21d001 Added RDE to showcase section 2023-01-20 10:25:21 +01:00
Uwe Kindler
378c647952 Fixed #481 issue Undocking an autohide dock widget does not close the AutoHideTab from the sidebar 2023-01-20 09:44:18 +01:00
Uwe Kindler
bbfe99ce7d Added image for showcase section 2023-01-19 13:34:32 +01:00
Uwe Kindler
97d675cb24 Updated README.md 2022-12-27 15:21:51 +01:00
Uwe Kindler
bbfad308e5 Added some pictures to show AutoHide and ImageViewer functionality 2022-12-27 15:19:51 +01:00
Uwe Kindler
858cdb2d66 Added some pictures to show AutoHide and ImageViewer functionality 2022-12-27 15:18:09 +01:00
githubuser0xFFFF
9f5e06ae13 Update linux-builds.yml
Removed ubuntu-latest because there seems to be build issues for ubuntu-22.04
2022-12-09 15:04:03 +01:00
170 changed files with 6203 additions and 4216 deletions

View File

@@ -1,151 +0,0 @@
version: '{build}'
branches:
only:
- master
image: Visual Studio 2017
environment:
global:
# Appveyor doesn't have Qt 12 yet
LatestQtVersion: 5.13
matrix:
# 32 bit builds
# MSVC 2015 builds
# Dynamic Library builds
# LTS version of Qt, dll, 32bit, MSVC 2015, qmake
- 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\%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: "true"
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 32bit, MSVC 2015, qmake
- 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\%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: "true"
# end Static Library builds
# end MSVC 2015 builds
# MinGW builds
# Dynamic Library builds
# LTS version of Qt, dll, 32bit, MinGW, qmake
- 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\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "false"
use_cmake: "true"
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 32bit, MinGW, qmake
- 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\%LatestQtVersion%\mingw73_32
COMPILER: C:\Qt\Tools\mingw730_32
targetPlatform: x86
use_mingw: "true"
use_static: "true"
use_cmake: "true"
# end Static Library builds
# end MinGW builds
# end 32 bit builds
# 64 bit builds
# MSVC 2015 builds
# Dynamic Library builds
# LTS version of Qt, dll, 64bit, MSVC 2015, qmake
- 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\%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: "true"
# end Dynamic Library builds
# Static Library builds
# LTS version of Qt, static, 64bit, MSVC 2015, qmake
- 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\%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: "true"
# end Static Library builds
# end MSVC 2015 builds
# end 64 bit builds
matrix:
fast_finish: true
before_build:
- set originalWD=%CD%
- call "%QT5%\bin\qtenv2.bat"
- 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")
- if %use_mingw%==true (set MAKEENGINE=mingw32-make) else (set MAKEENGINE=nmake)
- 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 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 .
- if %use_cmake%==true cmake --build . --target install
- if %use_cmake%==true cmake -G %CMAKEGENERATOR% -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_EXAMPLES=ON -DBUILD_STATIC=%USESTATIC% -DCMAKE_INSTALL_PREFIX="./installed" ../
- if %use_cmake%==true cmake --build .
- if %use_cmake%==true cmake --build . --target install
- if %use_cmake%==false if %use_static%==true qmake "CONFIG+=adsBuildStatic"
- if %use_cmake%==false if %use_static%==false qmake
- if %use_cmake%==false %MAKEENGINE% debug
- if %use_cmake%==false %MAKEENGINE% install
- if %use_cmake%==false %MAKEENGINE% release
- if %use_cmake%==false %MAKEENGINE% install
after_build:
- if %use_mingw%==true set PATH=C:\Program Files\Git\usr\bin;%PATH%

146
.clang-format Normal file
View File

@@ -0,0 +1,146 @@
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 82
CommentPragmas: '^(!.*|@c)'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<windows(\.h)?>' # windows headers
Priority: -1
- Regex: '^<labbcan[[:alnum:]._/]+' # labbcan headers
Priority: 1
- Regex: '^<diag[[:alnum:]._/]+' # usl headers
Priority: 1
- Regex: '^<usl[[:alnum:]._/]+' # usl headers
Priority: 1
- Regex: '^<qt5compat[[:alnum:]._/]+' # qtlabb headers
Priority: 2
- Regex: '^<qtcoreaddons[[:alnum:]._/]+' # qtlabb headers
Priority: 2
- Regex: '^<qtlabb[[:alnum:]._/]+' # qtlabb headers
Priority: 2
- Regex: '<Q[[:alnum:].]+>' # Qt headers
Priority: 3
- Regex: '^<sila_cpp[[:alnum:]._/]+' # sila_cpp headers
Priority: 4
- Regex: '<[[:alnum:]._/]+\.h>' # other headers
Priority: 5
- Regex: '<[[:alnum:]._/]+>' # system headers
Priority: 6
- Regex: '.*'
Priority: 7
IncludeIsMainRegex: '(_p)?$'
IndentCaseBlocks: false
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 20
PenaltyBreakBeforeFirstCallParameter: 15
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 5
# PenaltyBreakOpenParenthesis: 30
PenaltyBreakString: 150
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 100
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 150
PointerAlignment: Left
ReflowComments: true
SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
StatementMacros: [ 'Q_UNUSED', 'PIMPL_D', 'PIMPL_Q', 'OD_ENTRY', 'OD_ENTRY_PROCIMG' ]
TabWidth: 4
UseTab: Never

View File

@@ -1,23 +1,84 @@
name: linux-builds
on: [push]
on:
push:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, ubuntu-18.04]
build_ubuntu_2204_cmake:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
env:
QT_VERSION: 6.4.2
QT_DIR: ${{ github.workspace }}/Qt
steps:
- uses: actions/checkout@v1
- name: install qt
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history and tags
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install qt5-default
sudo apt-get install qtbase5-private-dev
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build libgl1-mesa-dev libxkbcommon-x11-0 libx11-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
target: desktop
host: linux
arch: gcc_64
dir: ${{ env.QT_DIR }}
setup-python: false
- name: Configure with CMake
run: |
cmake -S . -B build \
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}/Qt/${{ env.QT_VERSION }}/gcc_64" \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
-DCMAKE_BUILD_TYPE=Release \
-G Ninja
- name: Build
run: cmake --build build
- name: Run CMake install (optional)
run: cmake --install build
build_ubuntu_2204:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt-6-4
uses: actions/cache@v3
with:
path: ../Qt/6.4.2
key: ${{ runner.os }}-QtCache-Qt6-4
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '6.4.2'
host: 'linux'
target: 'desktop'
install-deps: true
cached: ${{ steps.cache-qt-6-4.outputs.cache-hit }}
setup-python: true
tools: ''
tools-only: false
- name: Install needed xkbcommon symlink
run: sudo apt-get install libxkbcommon-dev -y
- name: Ubuntu and Qt version
run: |
cat /etc/issue
echo number of processors: $(nproc)
qmake -v
- name: qmake
run: qmake
- name: make
run: make -j4
run: make -j$(nproc)

102
.github/workflows/windows-cmake.yml vendored Normal file
View File

@@ -0,0 +1,102 @@
name: windows-builds
on:
push:
workflow_dispatch:
jobs:
build_windows_msvc:
name: Build with MSVC and Ninja
runs-on: windows-2022
env:
QT_VERSION: 6.4.2
QT_DIR: ${{ github.workspace }}\Qt
steps:
- name: 📦 Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⚙️ Install Ninja build system
run: choco install ninja --no-progress
- name: 📥 Install Qt for MSVC
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
target: desktop
host: windows
arch: win64_msvc2019_64
dir: ${{ env.QT_DIR }}
setup-python: false
- name: 🏗️ Setup MSVC Developer Environment
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: 🛠️ Configure CMake with Ninja + MSVC
run: |
cmake -S . -B build -G Ninja `
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\msvc2019_64" `
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" `
-DCMAKE_BUILD_TYPE=Release
shell: powershell
- name: 🔨 Build with Ninja + MSVC
run: cmake --build build
shell: powershell
- name: 📦 Install built files
run: cmake --install build
shell: powershell
build_windows_mingw:
name: Build with Qt's MinGW and CMake (no Ninja)
runs-on: windows-2022
env:
QT_VERSION: 6.8.3
QT_DIR: ${{ github.workspace }}\Qt
steps:
- name: 📦 Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📥 Install Qt + MinGW
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.19'
version: ${{ env.QT_VERSION }}
target: desktop
host: windows
arch: win64_mingw
dir: ${{ env.QT_DIR }}
tools: 'tools_mingw1310'
setup-python: false
- name: Add Qt-bundled MinGW to PATH
shell: powershell
run: |
echo "${{ env.QT_DIR }}\Tools\mingw1310_64\bin" >> $env:GITHUB_PATH
- name: 🛠️ Configure CMake (MinGW)
shell: powershell
run: |
cmake -S . -B build-mingw `
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\mingw_64" `
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
-DCMAKE_BUILD_TYPE=Release `
-G "MinGW Makefiles"
- name: 🔨 Build with CMake (MinGW)
shell: powershell
run: cmake --build build-mingw -- -j2
- name: 📦 Install built files (MinGW)
shell: powershell
run: cmake --install build-mingw

5
.gitignore vendored
View File

@@ -1,4 +1,4 @@
*.pro.user
*.pro.user*
/build
*.o
*.dylib
@@ -7,6 +7,9 @@ qrc_*
moc_*
ui_*
Makefile
*.dll
*.a
build*
# IDEs
.idea

View File

@@ -1,233 +0,0 @@
language: cpp
# gcc is clang on mac
compiler: gcc
matrix:
fast_finish: true
include:
- name: Ubuntu qmake Qt5.5.1
os: linux
dist: trusty
group: stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt551-trusty'
update: true
packages:
- qt55base
- qt55tools
- gcc-9
- g++-9
script:
- PATH="/opt/qt55/bin:$PATH"
- CXX="g++-9"
- CC="gcc-9"
- qt55-env.sh
- qmake
- make
- make install
- name: Ubuntu qmake 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
- qmake
- make
- make install
- name: Ubuntu qmake 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
- 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: xcode11.3
compiler: clang
addons:
homebrew:
packages:
- qt
update: true
script:
- PATH="/usr/local/opt/qt5/bin:$PATH"
- mkdir -p build
- cd build
- cmake --version
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_DEBUG_POSTFIX=_debug -DBUILD_EXAMPLES=ON -DBUILD_STATIC=OFF -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_EXAMPLES=ON -DBUILD_STATIC=OFF -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- name: macOS CMake static
os: osx
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
- qt
update: true
script:
- PATH="/usr/local/opt/qt5/bin:$PATH"
- mkdir -p build
- cd build
- cmake --version
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_DEBUG_POSTFIX=_debug -DBUILD_EXAMPLES=ON -DBUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_EXAMPLES=ON -DBUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX="./installed" ../
- cmake --build .
- cmake --build . --target install
- name: macOS qmake dll
os: osx
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
- qt
update: true
script:
- PATH="/usr/local/opt/qt5/bin:$PATH"
- qmake
- make
- make install
- name: macOS qmake static
os: osx
osx_image: xcode11.3
compiler: clang
addons:
homebrew:
packages:
- qt
update: true
script:
- PATH="/usr/local/opt/qt5/bin:$PATH"
- qmake "CONFIG+=adsBuildStatic"
- make
- make install
notifications:
email: false

View File

@@ -1,22 +1,35 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif (POLICY CMP0091)
# Add cmake modules path (required for Versioning.cmake and git revision description)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
# 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}")
set(VERSION_SONAME "${VERSION_MAJOR}")
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})
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_SONAME "${ADS_VERSION}")
# Set PROJECT_VERSION_* variables for Versioning.cmake
string(REGEX MATCHALL "[0-9]+" VERSION_PARTS "${ADS_VERSION}")
list(GET VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
list(GET VERSION_PARTS 1 PROJECT_VERSION_MINOR)
list(GET VERSION_PARTS 2 PROJECT_VERSION_PATCH)
else()
message(FATAL_ERROR "ADS_VERSION must be in major.minor.patch format, e.g. 3.8.1. Got ${ADS_VERSION}")
endif()
@@ -28,10 +41,15 @@ project(QtADS LANGUAGES CXX VERSION ${VERSION_SHORT})
option(BUILD_STATIC "Build the static library" OFF)
option(BUILD_EXAMPLES "Build the examples" ON)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(ads_PlatformDir "x86")
# Platform directory: auto-detected based on pointer size, or manually set
if(NOT ADS_PLATFORM_DIR)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(ads_PlatformDir "x86")
else()
set(ads_PlatformDir "x64")
endif()
else()
set(ads_PlatformDir "x64")
set(ads_PlatformDir "${ADS_PLATFORM_DIR}")
endif()
add_subdirectory(src)

285
README.md
View File

@@ -4,10 +4,10 @@
------------------
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/githubuser0xFFFF/Qt-Advanced-Docking-System?color=%23ff9833)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
[![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)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/githubuser0xFFFF/Qt-Advanced-Docking-System)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
[![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md)
[![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)
[![windows-builds](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions/workflows/windows-cmake.yml/badge.svg?branch=master)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions/workflows/windows-cmake.yml)
[![GitHub contributors](https://img.shields.io/github/contributors/githubuser0xFFFF/Qt-Advanced-Docking-System?color=ffdf00)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/graphs/contributors)
Qt Advanced Docking System lets you create customizable layouts using a full
@@ -15,18 +15,100 @@ 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)
- Original Repository: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
- [Documentation](https://githubuser0xffff.github.io/Qt-Advanced-Docking-System/doc/user-guide.html)
- Original Repository: [https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System)
[![Video Advanced Docking](doc/advanced-docking_video.png)](https://www.youtube.com/watch?v=7pdNfafg3Qc)
## New and Noteworthy
### Release 4.5
#### Tabs at Bottom
A new global dock manager flag `TabsAtBottom` has been added to configuration flags. This flag allows to configure if the tabs of dock areas are shown at the top (default) or at the bottom of the respective container.
If the flag is set, tabs will be shown at the bottom instead of in the title bar.
![TabsAtBottom true](doc/cfg_flag_TabsAtBottom_true.png)
### Release 4.1
Release [4.1](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest) significantly improves the Auto-Hide functionality and also brings improvements
for Drag and Drop of dock widgets into dock area tabs. These are the highlights of the new version:
#### Drag & Drop to Auto-Hide
Now you can easily drag any dock widget or any floating widget to the
borders of a window to pin it as a auto-hide tab in one of the 4 sidebars.
If you drag a dock widget close the one of the four window borders, special
drop overlays will be shown to indicate the drop area for auto-hide widgets:
![Auo-Hide drag to Sidebar](doc/AutoHide_Drag_to_Sidebar.gif)
Of course, this also works with dock areas:
![Auo-Hide drag Dock Area](doc/AutoHide_Drag_DockArea.gif)
If you drag a dock widget or dock area into a sidebar, then you even have
control over where tabs are inserted. Simply drag your mouse over a specific
auto-hide tab, and your dragged dock widget will be inserted before this tab.
Drag to the sidebar area behind the last tab, and the dragged widget will be
appended as last tab. In the following screen capture, the **Image Viewer 1** will
be inserted before the **Table 0** Auto-Hide tab and the **Image Viewer 2**
is appende behind the last tab:
![Auo-Hide tab insert order](doc/AutoHide_Tab_Insert_Order.gif)
#### Auto-Hide Tab Insertion Order
It is also possible to drag Auto-Hide tabs to a new auto-hide position.
That means, you can drag them to a different border or sidebar:
![Auto-Hide change sidebar](doc/AutoHide_Change_Sidebar.gif)
#### Auto-Hide Tab Sorting
You can drag Auto-Hide tabs to a new position in the current sidebar
to sort them:
![Auo-Hide sort tabs](doc/AutoHide_Sort_Tabs.gif)
#### Auto-Hide Drag to Float / Dock
But that is not all. You can also simply move Auto-Hide tabs to another
floating widget or dock them via drag and drop:
![Auo-Hide drag to float or dock](doc/AutoHide_Drag_to_Float_or_Dock.gif)
#### Auto-Hide Context Menu
All Auto-Hide tabs now have a context menu, that provides all the functionality
that you know from Dock widget tabs. With the **Pin To...** item from the
context menu it is very easy to move an Auto-Hide tab to a different Auto-Hide
sidebar:
![Auo-Hide context menu](doc/AutoHide_Context_Menu.png)
#### Dock Area Tab Insert Order
And last but not least the new version also improves the docking of widgets
into the tabs of a Dock area. Just as with Auto-Hide tabs, you can now determine the position at which a tab is inserted by moving the mouse over an already existing tab (insertion before the tab) or behind the last tab
(appending):
![Dock area tab insert order](doc/DockArea_Tab_Insertion_Order.gif)
The [release 4.0](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
adds the following features:
- Auto-Hide functionality ([read more...](#auto-hide-functionality))
![Auto Hide Functionality](doc/AutoHide_Animation.gif)
- improved demo application with new image viewer dock widgets
![Auto Hide Functionality](doc/Feature_ImageViewer.png)
- Visual Studio like CSS theme in demo application
The [release 3.8](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/3.8.3)
@@ -71,6 +153,15 @@ know it from Visual Studio.
### Overview
- [New and Noteworthy](#new-and-noteworthy)
- [Release 4.5](#release-45)
- [Tabs at Bottom](#tabs-at-bottom)
- [Release 4.1](#release-41)
- [Drag \& Drop to Auto-Hide](#drag--drop-to-auto-hide)
- [Auto-Hide Tab Insertion Order](#auto-hide-tab-insertion-order)
- [Auto-Hide Tab Sorting](#auto-hide-tab-sorting)
- [Auto-Hide Drag to Float / Dock](#auto-hide-drag-to-float--dock)
- [Auto-Hide Context Menu](#auto-hide-context-menu)
- [Dock Area Tab Insert Order](#dock-area-tab-insert-order)
- [Features](#features)
- [Overview](#overview)
- [Docking everywhere - no central widget](#docking-everywhere---no-central-widget)
@@ -78,13 +169,14 @@ know it from Visual Studio.
- [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)
- [Cancelable docking process](#cancelable-docking-process)
- [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)
- [Auto-Hide Functionality](#auto-hide-functionality)
- [Python Bindings](#python-bindings)
- [PySide6](#pyside6)
- [PyQt6](#pyqt6)
- [PyQt5](#pyqt5)
- [Tested Compatible Environments](#tested-compatible-environments)
- [Supported Qt Versions](#supported-qt-versions)
@@ -92,6 +184,9 @@ know it from Visual Studio.
- [macOS](#macos)
- [Linux](#linux)
- [Build](#build)
- [Qt5 on Ubuntu 18.04 or 20.04](#qt5-on-ubuntu-1804-or-2004)
- [Qt5 on Ubuntu 22.04](#qt5-on-ubuntu-2204)
- [Qt6 on Ubuntu 22.04](#qt6-on-ubuntu-2204)
- [Getting started / Example](#getting-started--example)
- [License information](#license-information)
- [Donation](#donation)
@@ -107,6 +202,13 @@ know it from Visual Studio.
- [Notepad Next](#notepad-next)
- [MetGem](#metgem)
- [PRE Workbench](#pre-workbench)
- [RDE Robox Development Environment](#rde--robox-development-environment)
- [ResInsight](#resinsight)
- [ADTF 3](#adtf-3)
- [DREAM3D-NX](#dream3d-nx)
- [LabPlot](#labplot)
- [Scrutiny Debugger](#scrutiny-debugger)
- [PiSoWorks](#pisoworks)
- [Alternative Docking System Implementations](#alternative-docking-system-implementations)
- [KDDockWidgets](#kddockwidgets)
- [QtitanDocking](#qtitandocking)
@@ -163,17 +265,16 @@ If this flag is cleared, the widget resizing is deferred until the mouse button
![Non-opaque resizing](doc/non_opaque_resizing.gif)
### Opaque and non-opaque undocking
### Cancelable docking process
By default, 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 immediately. You can compare this with opaque splitter resizing. If the flag `OpaqueUndocking` is cleared, 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 immediately. 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.
In contrast to the standard Qt docking system, docking with the ADS works more like a drag & drop operation. That means, the dragged dock widget or dock area is not undocked immediately. 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.
The drag preview widget can be configured by a number of global dock manager flags:
- `DragPreviewIsDynamic`: if this flag is enabled, the preview will be adjusted dynamically to the drop area
- `DragPreviewShowsContentPixmap`: the created drag preview window shows a static copy of the content of the dock widget / dock are that is dragged
- `DragPreviewHasWindowFrame`: this flag configures if the drag preview is frameless like a QRubberBand or looks like a real window
The best way to test non-opaque undocking is to set the standard flags: `CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig)`.
### Tab-menu for easy handling of many tabbed dock widgets
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.
@@ -226,7 +327,7 @@ More about the auto hide configuration options in the [online documentation...](
![Python Logo](doc/python_logo.png)
Thanks to the contribution of several users, the Advanced Docking System comes
with a complete Python integration. Python bindings are available for **PyQt5** and
with a complete Python integration. Python bindings are available for **PyQt5**, **PyQt6**, and
**PySide6**.
### PySide6
@@ -239,12 +340,29 @@ pip install PySide6-QtAds
```
Sample code is available [here](https://github.com/mborgerson/Qt-Advanced-Docking-System/tree/pyside6/examples). To run the samples, you'll also need to install latest qtpy
from source (pip install https://github.com/spyder-ide/qtpy/archive/refs/heads/master.zip).
from source (pip install <https://github.com/spyder-ide/qtpy/archive/refs/heads/master.zip>).
The PySide6 bindings were contributed by:
- [mborgerson](https://github.com/mborgerson)
For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
Please file PySide6-QtAds-specific issues on its [pyside6_qtads](https://github.com/mborgerson/pyside6_qtads) fork for tracking. For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
### PyQt6
A PyQt6 ADS package is available via PyPi and can be installed on Windows,
macOS, and Linux with:
```bash
pip install PyQt6Ads
```
Sample code is available [here](https://github.com/pyapp-kit/PyQt6Ads/tree/main/examples).
The PyQt6 bindings were contributed by:
- [tlambert03](https://github.com/tlambert03)
Please file PyQt6Ads-specific issues at [pyapp-kit/PyQt6Ads](https://github.com/pyapp-kit/PyQt6Ads).
### PyQt5
@@ -269,27 +387,28 @@ 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)
Windows 10 / 11
[![windows-builds](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions/workflows/windows-cmake.yml/badge.svg?branch=master)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions/workflows/windows-cmake.yml)
The library was developed on and for Windows. It is used in a commercial Windows application and is therefore constantly tested.
### macOS
macOS [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
The application can be compiled for macOS. A user reported, that the library works on macOS. If have not tested it.
![Advanced Docking on macOS](doc/macos.png)
### Linux
[![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)
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:
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 it 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 some Linux distributions. Depending on the used window manager or compositor, dock widgets
with native title bars are supported or not. If native title bars are not supported,
the library switches to `QWidget` based title bars.
- **Kubuntu 18.04 and 19.10**
- **Ubuntu 18.04, 19.10 and 20.04**
- **Kubuntu 18.04 and 19.10** - uses KWin - no native title bars
- **Ubuntu 18.04, 19.10 and 20.04** - native title bars are supported
- **Ubuntu 22.04** - uses Wayland -> no native title bars
There are some requirements for the Linux distribution that have to be met:
@@ -304,10 +423,27 @@ Screenshot Ubuntu:
## Build
The Linux build requires private header files. Make sure that they are installed:
The Linux build requires private header files. Make sure that they are installed.
The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
application creates a `QQuickWidget` for testing, so ensure that the required
libraries are installed.
### Qt5 on Ubuntu 18.04 or 20.04
```bash
sudo apt install qtbase5-private-dev
sudo apt install qt5-default qtbase5-private-dev
```
### Qt5 on Ubuntu 22.04
```bash
sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
```
### Qt6 on Ubuntu 22.04
```bash
sudo apt install qt6-default qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
```
Open the `ads.pro` file with QtCreator and start the build, that's it.
@@ -360,7 +496,7 @@ MainWindow::MainWindow(QWidget *parent) :
// 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);
DockManager = new ads::CDockManager(this);
// Create example content label - this can be any application specific
// widget
@@ -371,7 +507,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Create a dock widget with the title Label 1 and set the created label
// as the dock widget content
ads::CDockWidget* DockWidget = new ads::CDockWidget("Label 1");
ads::CDockWidget* DockWidget = DockManager->createDockWidget("Label 1");
DockWidget->setWidget(l);
// Add the toggleViewAction of the dock widget to the menu to give
@@ -379,7 +515,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->menuView->addAction(DockWidget->toggleViewAction());
// Add the dock widget to the top dock widget area
m_DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget);
DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget);
}
MainWindow::~MainWindow()
@@ -480,7 +616,7 @@ 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.
- Save the visualization layout and configurations to reuse 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…
@@ -520,6 +656,103 @@ PRE Workbench is a Python software and uses the ADS PyQt integration.
[![PRE Workbench](doc/showcase_pre_workbench.png)](https://youtu.be/U3op5UreV1Q)
### [RDE Robox Development Environment](https://www.robox.it/en/product/rde-robox-development-environment/)
This software is a development environment for PAC (Programmable Automation Controllers)
from ROBOX. It offers a lot of tools to write, compile and debug machine control
and application software. The Advanced Docking System helps to organize all the tools and
windows (Project window, Shell window, Monitor windows, Oscilloscope window...)
on the screen to provide a easy to use, highly configurable and visual pleasing
development experience.
[read more...](https://www.robox.it/en/product/rde-robox-development-environment/)
![RDE](doc/showcase_robox_ide.png)
### [ResInsight](https://www.ceetronsolutions.com/projects/resinsight)
ResInsight as a software from Ceetron Solutions for visualization of oil and
gas reservoir simulation data. It allows reservoir models, simulation results,
and measurements to be visualized with very high performance. Optimized use of
graphics technology and simultaneous processing on multiple CPU cores have been
vital to enhance the performance and capacity of ResInsight for large data sets.
The Advanced Docking System has empowered Ceetron to build a much more intuitive
user interface for its ResInsight users.
[read more...](https://resinsight.org/)
[![ResInsight](doc/showcase_resinsight.png)](https://www.youtube.com/watch?v=HzLaQ1p6AUc)
### [ADTF 3](https://www.digitalwerk.net/adtf/)
The Automotive Data and Time-Triggered Framework was designed as a Rapid Prototyping Toolset, Simulation Framework and Test- and Measurement Tool. It is meant for:
- Developing and testing ADAS and HAD components
- Recording of vehicle data for visualisation
- Simulation of complex scenarios in SIL/HIL test environments
The software features time-based processing of multiple data streams and graphical editing of dynamic filter graphs. It also includes an SDK for custom plug-ins and reusable components, as well as components for data visualization in both 2D and 3D. This is was the
[manual](https://support.digitalwerk.net/adtf/v3/adtf_html/page_adtf_xsystem_plugin.html)
says about the switch to Qt Advanced Docking:
> After several minor improvements the Qt5 ADTF XSystem uses the Advanced Docking System for Qt since ADTF 3.10.0 for more convenience and usability regarding layouting, docking and embedding several widgets.
[read more...](https://support.digitalwerk.net/adtf/v3/adtf_html/index.html)
![ADTF](doc/showcase_adtf.png)
### [DREAM3D-NX](https://www.dream3d.io)
DREAM3D-NX *(Digital Representation Environment for Analysis of Materials in 3D)* is a cross-platform and modular, software suite that allows users to prepare, reconstruct, quantify, instantiate, and mesh, multidimensional, multimodal microstructural data, as well as many other applications.
[BlueQuartz Software](http://www.bluequartz.net/) has completely rewritten the old DREAM.3D version 6.5 application
taking advantage of the Advanced Docking System to present a highly customizable user interface
for DREAM3D-NX Version 7.
![DREAM.3D NX](doc/showcase_dream3d_nx.png)
[read more...](http://www.dream3d.io/)
### [LabPlot](https://labplot.kde.org/)
KDE LabPlot is the ultimate free, open source and cross-platform tool for scientists, engineers, and students who need to analyze and visualize data. With its intuitive interface and powerful features, you can create stunning plots and diagrams with ease. Whether you're working with CSV, FITS, or HDF5 data, KDE LabPlot makes it simple to import and analyze your data.
The LabPlot project recently switched to the Qt Advanced Docking System for their user interface. This switch represents a significant improvement to the LabPlot software, allowing users to create and manage complex data visualization layouts with ease.
![LabPlot](doc/showcase_labplot.png)
[read more...](https://labplot.kde.org/)
### [Scrutiny Debugger](https://scrutinydebugger.com/)
Scrutiny is an [open source](https://github.com/scrutinydebugger/) non-intrusive, real-time debugger for embedded systems, built for fast introspection, memory access, and signal visualization—without stopping your application. It uses the Qt Advanced Docking System (ADS) to provide fully customizable dashboards for monitoring and control.
Some of the highlights are:
- **Debug without interfering** — Inspect C++ memory live without disrupting execution flow.
- **HIL testing made easy** — Write to variables through the GUI or SDK to simulate conditions.
- **Configure during production** — Access and tweak variables anytime via GUI or Python.
- **Catch fast events** — Embedded graphs sample at task-level frequency, even with multithreading.
- **Build your dashboard** — Use ADS to create and save custom layouts for your debug sessions.
- **No JTAG needed** — Communicates over serial, CAN, or network interfaces.
- **Compact C++11 library** — Lightweight and easy to integrate into your firmware.
- **Live graphs and runtime values** — Visualize variables, RPVs, and aliases in real time.
ADS powers Scrutinys flexible interface, letting users organize views and data panels to suit their workflow — ideal for real-time monitoring, testing, and debugging.
[read more...](https://scrutinydebugger.com/)
[![Scrutiny Debugger UI](doc/showcase_scrutiny-dark.png)](https://www.youtube.com/watch?v=Dd3osxW-Clo)
### [PiSoWorks](https://pypi.org/project/pisoworks/)
PiSoWorks is an application for controlling the piezo amplifiers, such as the [NV200/D](https://www.piezosystem.com/product/nv-200-d-compact-amplifier/), from [piezosystem jena](https://www.piezosystem.com/) GmbH.
![LabPlot](doc/showcase_pysoworks.png)
[read more...](https://piezosystemjena.github.io/PiSoWorks/)
## Alternative Docking System Implementations
If this Qt Advanced Docking System does not fit to your needs you may consider some of the alternative docking system solutions for Qt.

View File

@@ -0,0 +1,29 @@
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "My Company\0"
VALUE "FileDescription", "@PROJECT_NAME@\0"
VALUE "FileVersion", "@PROJECT_VERSION_STRING@\0"
VALUE "ProductVersion", "@PROJECT_VERSION_STRING@\0"
VALUE "GitCommitFull", "@PROJECT_GIT_HASH@\0"
VALUE "GitCommitShort", "@PROJECT_GIT_HASH_SHORT@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1200
END
END

View File

@@ -0,0 +1,100 @@
# ============================================================
# Versioning.cmake (Reusable Version + Resource Generator)
# ============================================================
# Freeze the directory where this module lives
# This is critical — it prevents paths from breaking when the
# function is invoked from other CMakeLists.txt files.
set(_VERSIONING_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "Versioning module directory")
# ------------------------------------------------------------
# Extract version information from Git or use predefined version
# ------------------------------------------------------------
if(NOT DEFINED PROJECT_VERSION_MAJOR OR NOT DEFINED PROJECT_VERSION_MINOR OR NOT DEFINED PROJECT_VERSION_PATCH)
# Get tag (expected: v1.2.3 or 1.2.3 or 1.2.3-12-gHASH)
execute_process(
COMMAND git describe --tags --dirty
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESC_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Remove leading "v" if present
string(REGEX REPLACE "^v" "" GIT_DESC "${GIT_DESC_RAW}")
# Extract major.minor.patch
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${GIT_DESC}")
set(PROJECT_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(PROJECT_VERSION_MINOR "${CMAKE_MATCH_2}")
set(PROJECT_VERSION_PATCH "${CMAKE_MATCH_3}")
# Commit hash (full + short)
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_GIT_HASH_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
set(PROJECT_VERSION_STRING
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
)
# Export variables to parent scope
set(PROJECT_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}" PARENT_SCOPE)
set(PROJECT_VERSION_MINOR "${PROJECT_VERSION_MINOR}" PARENT_SCOPE)
set(PROJECT_VERSION_PATCH "${PROJECT_VERSION_PATCH}" PARENT_SCOPE)
set(PROJECT_VERSION_STRING "${PROJECT_VERSION_STRING}" PARENT_SCOPE)
set(PROJECT_GIT_HASH "${PROJECT_GIT_HASH}" PARENT_SCOPE)
set(PROJECT_GIT_HASH_SHORT "${PROJECT_GIT_HASH_SHORT}" PARENT_SCOPE)
# Public variable for users
set(PROJECT_AUTO_VERSION "${PROJECT_VERSION_STRING}" PARENT_SCOPE)
# ------------------------------------------------------------
# Reusable function: Attach Windows version resources to target
# ------------------------------------------------------------
function(add_windows_version_resources target)
if(NOT WIN32)
return()
endif()
if(NOT TARGET "${target}")
message(FATAL_ERROR "add_windows_version_resources: target '${target}' not found.")
endif()
# Absolute path to the template (never changes)
get_filename_component(_rc_in
"${_VERSIONING_MODULE_DIR}/FileVersionInfo.rc.in"
ABSOLUTE
)
if(NOT EXISTS "${_rc_in}")
message(FATAL_ERROR
"FileVersionInfo.rc.in missing at: ${_rc_in}"
)
endif()
# Output in the caller's binary dir
set(_rc_out "${CMAKE_CURRENT_BINARY_DIR}/${target}_version.rc")
get_filename_component(_rc_out "${_rc_out}" ABSOLUTE)
# Ensure directory exists
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
# Configure the template
configure_file("${_rc_in}" "${_rc_out}" @ONLY)
# Add to the target
target_sources(${target} PRIVATE "${_rc_out}")
endfunction()

View File

@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
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)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets Quick QuickWidgets REQUIRED)
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS AxContainer REQUIRED)
endif()
@@ -21,11 +21,13 @@ add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
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)
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::QuickWidgets)
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
target_link_libraries(AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::AxContainer)
endif()
target_link_libraries(AdvancedDockingSystemDemo PRIVATE qtadvanceddocking)
target_link_libraries(AdvancedDockingSystemDemo PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
set_target_properties(AdvancedDockingSystemDemo PROPERTIES
AUTOMOC ON
AUTORCC ON

View File

@@ -62,6 +62,7 @@
#include <QPointer>
#include <QMap>
#include <QElapsedTimer>
#include <QQuickWidget>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
@@ -74,18 +75,17 @@
#endif
#endif
#include "DockManager.h"
#include "DockWidget.h"
#include "DockAreaWidget.h"
#include "DockAreaTitleBar.h"
#include "DockAreaTabBar.h"
#include "FloatingDockContainer.h"
#include "DockAreaTitleBar.h"
#include "DockAreaWidget.h"
#include "DockComponentsFactory.h"
#include "StatusDialog.h"
#include "DockManager.h"
#include "DockSplitter.h"
#include "DockWidget.h"
#include "FloatingDockContainer.h"
#include "ImageViewer.h"
#include "MyDockAreaTitleBar.h"
#include "StatusDialog.h"
/**
* Returns a random number from 0 to highest - 1
@@ -146,7 +146,7 @@ public:
using Super = ads::CDockComponentsFactory;
ads::CDockAreaTitleBar* createDockAreaTitleBar(ads::CDockAreaWidget* DockArea) const override
{
auto TitleBar = new ads::CDockAreaTitleBar(DockArea);
auto TitleBar = new MyDockAreaTitleBar(DockArea);
auto CustomButton = new QToolButton(DockArea);
CustomButton->setToolTip(QObject::tr("Help"));
CustomButton->setIcon(svgIcon(":/adsdemo/images/help_outline.svg"));
@@ -236,7 +236,7 @@ struct MainWindowPrivate
m->setRootPath(QDir::currentPath());
w->setModel(m);
w->setRootIndex(m->index(QDir::currentPath()));
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Filesystem %1")
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Filesystem %1")
.arg(FileSystemCount++));
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/folder_open.svg"));
@@ -257,7 +257,7 @@ struct MainWindowPrivate
{
static int CalendarCount = 0;
QCalendarWidget* w = new QCalendarWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Calendar %1").arg(CalendarCount++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Calendar %1").arg(CalendarCount++));
// The following lines are for testing the setWidget() and takeWidget()
// functionality
DockWidget->setWidget(w);
@@ -270,6 +270,10 @@ struct MainWindowPrivate
auto ToolBar = DockWidget->createDefaultToolBar();
ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState);
// For testing all calendar dock widgets have a the tool button style
// Qt::ToolButtonTextUnderIcon
DockWidget->setToolBarStyleSource(ads::CDockWidget::ToolBarStyleFromDockWidget);
DockWidget->setToolBarStyle(Qt::ToolButtonTextUnderIcon, ads::CDockWidget::StateFloating);
return DockWidget;
}
@@ -298,7 +302,7 @@ struct MainWindowPrivate
.arg(LabelCount)
.arg(QTime::currentTime().toString("hh:mm:ss:zzz")));
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Label %1").arg(LabelCount++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Label %1").arg(LabelCount++));
DockWidget->setWidget(l);
DockWidget->setIcon(svgIcon(":/adsdemo/images/font_download.svg"));
ui.menuView->addAction(DockWidget->toggleViewAction());
@@ -316,7 +320,7 @@ struct MainWindowPrivate
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++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Editor %1").arg(EditorCount++));
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/edit.svg"));
DockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
@@ -359,7 +363,7 @@ struct MainWindowPrivate
auto Result = w->loadFile(FileName);
qDebug() << "loadFile result: " << Result;
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Image Viewer %1").arg(ImageViewerCount++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Image Viewer %1").arg(ImageViewerCount++));
DockWidget->setIcon(svgIcon(":/adsdemo/images/photo.svg"));
DockWidget->setWidget(w,ads:: CDockWidget::ForceNoScrollArea);
auto ToolBar = DockWidget->createDefaultToolBar();
@@ -374,7 +378,7 @@ struct MainWindowPrivate
{
static int TableCount = 0;
auto w = new CMinSizeTableWidget();
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Table %1").arg(TableCount++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Table %1").arg(TableCount++));
static int colCount = 5;
static int rowCount = 30;
w->setColumnCount(colCount);
@@ -392,7 +396,7 @@ struct MainWindowPrivate
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, [=]()
QObject::connect(Action, &QAction::triggered, [DockWidget]()
{
if (DockWidget->isFullScreen())
{
@@ -407,6 +411,17 @@ struct MainWindowPrivate
return DockWidget;
}
/**
* Create QQuickWidget for test for OpenGL and QQuick
*/
ads::CDockWidget *createQQuickWidget()
{
QQuickWidget *widget = new QQuickWidget();
ads::CDockWidget *dockWidget = DockManager->createDockWidget("Quick");
dockWidget->setWidget(widget);
return dockWidget;
}
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
@@ -417,14 +432,13 @@ struct MainWindowPrivate
{
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++));
ads::CDockWidget* DockWidget = DockManager->createDockWidget(QString("Active X %1").arg(ActiveXCount++));
DockWidget->setWidget(w);
ui.menuView->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
#endif
#endif
};
//============================================================================
@@ -437,8 +451,8 @@ void MainWindowPrivate::createContent()
// 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):
{
SpecialDockArea->setAllowedAreas(ads::OuterDockAreas);
//SpecialDockArea->setAllowedAreas({ads::LeftDockWidgetArea, ads::RightDockWidgetArea}); // just for testing
//SpecialDockArea->setAllowedAreas(ads::OuterDockAreas);
SpecialDockArea->setAllowedAreas({ads::LeftDockWidgetArea, ads::RightDockWidgetArea, ads::TopDockWidgetArea}); // just for testing
}
DockWidget = createLongTextLabelDockWidget();
@@ -456,12 +470,12 @@ void MainWindowPrivate::createContent()
appendFeaturStringToWindowTitle(FileSystemWidget);
// Test custom factory - we inject a help button into the title bar
ads::CDockComponentsFactory::setFactory(new CCustomComponentsFactory());
DockManager->setComponentsFactory(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();
DockManager->setComponentsFactory(ads::CDockComponentsFactory::factory());
// We create a calendar widget and clear all flags to prevent the dock area
// from closing
@@ -496,7 +510,7 @@ void MainWindowPrivate::createContent()
auto TitleBar = DockArea->titleBar();
int Index = TitleBar->indexOf(TitleBar->tabBar());
TitleBar->insertWidget(Index + 1, CustomButton);
QObject::connect(CustomButton, &QToolButton::clicked, [=]()
QObject::connect(CustomButton, &QToolButton::clicked, [DockArea, this]()
{
auto DockWidget = createEditorWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
@@ -506,7 +520,9 @@ void MainWindowPrivate::createContent()
// Test dock area docking
auto RighDockArea = DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(), TopDockArea);
DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
DockWidget = createLongTextLabelDockWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetPinnable, false);
DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget, RighDockArea);
auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
auto LabelDockWidget = createLongTextLabelDockWidget();
@@ -514,6 +530,7 @@ void MainWindowPrivate::createContent()
// Tests CustomCloseHandling without DeleteOnClose
LabelDockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
LabelDockWidget->setWindowTitle(LabelDockWidget->windowTitle() + " [Custom Close]");
QObject::connect(LabelDockWidget, &ads::CDockWidget::closeRequested, [LabelDockWidget, this]()
{
int Result = QMessageBox::question(_this, "Custom Close Request",
@@ -544,13 +561,7 @@ void MainWindowPrivate::createContent()
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
// If opaque undocking is active, then undocking of widgets while
// active x widget is visible causes jerking while dragging a floating
// widget
if (!ads::CDockManager::testConfigFlag(ads::CDockManager::OpaqueUndocking))
{
DockManager->addDockWidget(ads::CenterDockWidgetArea, createActiveXWidget(), RighDockArea);
}
DockManager->addDockWidget(ads::CenterDockWidgetArea, createActiveXWidget(), RighDockArea);
#endif
#endif
@@ -563,6 +574,11 @@ void MainWindowPrivate::createContent()
// Create image viewer
DockWidget = createImageViewer();
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
// Create quick widget
DockWidget = createQQuickWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, true);
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
}
@@ -575,19 +591,29 @@ void MainWindowPrivate::createActions()
ui.toolBar->addAction(ui.actionRestoreState);
ui.actionRestoreState->setIcon(svgIcon(":/adsdemo/images/restore.svg"));
SavePerspectiveAction = new QAction("Create Perspective", _this);
SavePerspectiveAction->setIcon(svgIcon(":/adsdemo/images/picture_in_picture.svg"));
_this->connect(SavePerspectiveAction, SIGNAL(triggered()), SLOT(savePerspective()));
ui.toolBar->addSeparator();
QAction* a = ui.toolBar->addAction("Lock Workspace");
a->setIcon(svgIcon(":/adsdemo/images/lock_outline.svg"));
a->setCheckable(true);
a->setChecked(false);
QObject::connect(a, &QAction::triggered, _this, &CMainWindow::lockWorkspace);
PerspectiveListAction = new QWidgetAction(_this);
PerspectiveComboBox = new QComboBox(_this);
PerspectiveComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
PerspectiveComboBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
PerspectiveComboBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
PerspectiveListAction->setDefaultWidget(PerspectiveComboBox);
ui.toolBar->addSeparator();
ui.toolBar->addAction(PerspectiveListAction);
a = SavePerspectiveAction = ui.toolBar->addAction("Create Perspective");
a->setIcon(svgIcon(":/adsdemo/images/picture_in_picture.svg"));
QObject::connect(a, &QAction::triggered, _this, &CMainWindow::savePerspective);
ui.toolBar->addAction(SavePerspectiveAction);
QAction* a = ui.toolBar->addAction("Create Floating Editor");
ui.toolBar->addSeparator();
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"));
@@ -609,6 +635,7 @@ void MainWindowPrivate::createActions()
_this->connect(a, SIGNAL(triggered()), SLOT(createEditor()));
ui.menuTests->addAction(a);
ui.toolBar->addSeparator();
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"));
@@ -740,7 +767,10 @@ CMainWindow::CMainWindow(QWidget *parent) :
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
// uncomment if you would like to enable dock widget auto hiding
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
CDockManager::setAutoHideConfigFlags({CDockManager::DefaultAutoHideConfig});
// uncomment if you would like to disable closing auto hide widget with mouse click outside of auto hide container
//CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseOnOutsideMouseClick, false);
// uncomment if you would like to enable an equal distribution of the
// available size of a splitter to all contained dock widgets
@@ -749,8 +779,12 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment if you would like to close tabs with the middle mouse button, web browser style
// CDockManager::setConfigFlag(CDockManager::MiddleMouseButtonClosesTab, true);
// uncomment if you would like to avoid using the built-in QSS stylesheet
// CDockManager::setConfigFlag(CDockManager::DisableStylesheet, true);
// Now create the dock manager and its content
d->DockManager = new CDockManager(this);
d->DockManager->setDockWidgetToolBarStyle(Qt::ToolButtonIconOnly, ads::CDockWidget::StateFloating);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
connect(d->PerspectiveComboBox, SIGNAL(activated(QString)),
@@ -1012,3 +1046,17 @@ void CMainWindow::createImageViewer()
}
}
//============================================================================
void CMainWindow::lockWorkspace(bool Value)
{
if (Value)
{
d->DockManager->lockDockWidgetFeaturesGlobally();
}
else
{
d->DockManager->lockDockWidgetFeaturesGlobally(ads::CDockWidget::NoDockWidgetFeatures);
}
}

View File

@@ -68,6 +68,7 @@ private slots:
void toggleDockWidgetWindowTitle();
void applyVsStyle();
void createImageViewer();
void lockWorkspace(bool Value);
};
#endif // MAINWINDOW_H

58
demo/MyDockAreaTitleBar.h Normal file
View File

@@ -0,0 +1,58 @@
#ifndef QTADS_MYDOCKAREATITLEBAR_H
#define QTADS_MYDOCKAREATITLEBAR_H
/*******************************************************************************
** Qt Advanced Docking System
** Copyright (C) 2017 Uwe Kindler
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
//============================================================================
// INCLUDES
//============================================================================
#include <DockAreaTitleBar.h>
/**
* Custom DockAreaTitleBar that adds a custom context menu
*/
class MyDockAreaTitleBar : public ads::CDockAreaTitleBar
{
public:
explicit MyDockAreaTitleBar(ads::CDockAreaWidget *parent) :
CDockAreaTitleBar(parent)
{
}
QMenu* buildContextMenu(QMenu*) override
{
auto menu = ads::CDockAreaTitleBar::buildContextMenu(nullptr);
menu->addSeparator();
auto action = menu->addAction(tr("Format HardDrive"));
connect(action, &QAction::triggered, this, [this]()
{
QMessageBox msgBox;
msgBox.setText("No, just kidding");
msgBox.setStandardButtons(QMessageBox::Abort);
msgBox.setDefaultButton(QMessageBox::Abort);
msgBox.exec();
});
return menu;
}
};
#endif // QTADS_MYDOCKAREATITLEBAR_H

View File

@@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
TARGET = AdvancedDockingSystemDemo
DESTDIR = $${ADS_OUT_ROOT}/lib
QT += core gui widgets
QT += core gui widgets quick quickwidgets
include(../ads.pri)

View File

@@ -36,5 +36,8 @@
<file>images/panorama.svg</file>
<file>images/ads_icon2.svg</file>
<file>images/font_download.svg</file>
<file>images/lock_outline.svg</file>
<file>images/lock.svg</file>
<file>images/lock_open.svg</file>
</qresource>
</RCC>

6
demo/images/lock.svg Normal file
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>lock 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="M853.33,426.67v426.66c0,46.93 -38.4,85.34 -85.33,85.34h-512c-46.93,0 -85.33,-38.41 -85.33,-85.34v-426.66c0,-46.93 38.4,-85.34 85.33,-85.34h42.67v-85.33c0,-117.76 95.57,-213.33 213.33,-213.33c117.76,0 213.33,95.57 213.33,213.33v85.33h42.67c46.93,0 85.33,38.41 85.33,85.34zM644.27,256c0,-72.96 -59.31,-132.27 -132.27,-132.27c-72.96,0 -132.27,59.31 -132.27,132.27v85.33h264.54zM597.33,640c0,-46.93 -38.4,-85.33 -85.33,-85.33c-46.93,0 -85.33,38.4 -85.33,85.33c0,46.93 38.4,85.33 85.33,85.33c46.93,0 85.33,-38.4 85.33,-85.33z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 932 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>lock_open 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="M853.33,426.67v426.66c0,46.93 -38.4,85.34 -85.33,85.34h-512c-46.93,0 -85.33,-38.41 -85.33,-85.34v-426.66c0,-46.93 38.4,-85.34 85.33,-85.34h388.27v-85.33c0,-72.96 -59.31,-132.27 -132.27,-132.27c-72.96,0 -132.27,59.31 -132.27,132.27h-81.06c0,-117.76 95.57,-213.33 213.33,-213.33c117.76,0 213.33,95.57 213.33,213.33v85.33h42.67c46.93,0 85.33,38.41 85.33,85.34zM768,426.67h-512v426.66h512zM426.67,640c0,-46.93 38.4,-85.33 85.33,-85.33c46.93,0 85.33,38.4 85.33,85.33c0,46.93 -38.4,85.33 -85.33,85.33c-46.93,0 -85.33,-38.4 -85.33,-85.33z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 948 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>lock_outline 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="M853.33,426.67v426.66c0,46.93 -38.4,85.34 -85.33,85.34h-512c-46.93,0 -85.33,-38.41 -85.33,-85.34v-426.66c0,-46.93 38.4,-85.34 85.33,-85.34h42.67v-85.33c0,-117.76 95.57,-213.33 213.33,-213.33c117.76,0 213.33,95.57 213.33,213.33v85.33h42.67c46.93,0 85.33,38.41 85.33,85.34zM768,426.67h-512v426.66h512zM379.73,341.33h264.54v-85.33c0,-72.96 -59.31,-132.27 -132.27,-132.27c-72.96,0 -132.27,59.31 -132.27,132.27zM426.67,640c0,-46.93 38.4,-85.33 85.33,-85.33c46.93,0 85.33,38.4 85.33,85.33c0,46.93 -38.4,85.33 -85.33,85.33c-46.93,0 -85.33,-38.4 -85.33,-85.33z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 972 B

View File

@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#endif
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
std::shared_ptr<int> b;
QApplication a(argc, argv);
a.setApplicationName("Advanced Docking System Demo");

View File

@@ -2,7 +2,7 @@ import os
import sys
from PyQt5 import uic
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'StatusDialog.ui')
StatusDialogUI, StatusDialogBase = uic.loadUiType(UI_FILE)

BIN
doc/AutoHide_Animation.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 KiB

BIN
doc/AutoHide_Sort_Tabs.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

BIN
doc/Feature_ImageViewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -12,10 +12,10 @@ styles as much as possible.
## Features
### Docking everywhere - no central widget
### Docking everywhere - with or without a 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
The Advanced Docking System works with or without a central widget.
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)
@@ -65,7 +65,7 @@ If this flag is cleared, the widget resizing is deferred until the mouse button
### Opaque and non-opaque undocking
By default, 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. If the flag `OpaqueUndocking` is cleared, 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.
By default, 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 immediately. You can compare this with opaque splitter resizing. If the flag `OpaqueUndocking` is cleared, 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 immediately. 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.
The drag preview widget can be configured by a number of global dock manager flags:

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
doc/showcase_adtf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
doc/showcase_dream3d_nx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

BIN
doc/showcase_labplot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

BIN
doc/showcase_pysoworks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

BIN
doc/showcase_resinsight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

BIN
doc/showcase_robox_ide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

View File

@@ -1,60 +1,81 @@
# 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)
- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags)
- [User Guide](#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)
- [`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)
- [`DisableTabTextEliding`](#disabletabtexteliding)
- [`ShowTabTextOnlyForActiveTab`](#showtabtextonlyforactivetab)
- [`DoubleClickUndocksWidget`](#doubleclickundockswidget)
- [`TabsAtBottom`](#tabsatbottom)
- [Auto Hide Dock Widgets](#auto-hide-dock-widgets)
- [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
- [Show / Hide Auto-Hide Widgets via Mouse Over](#show--hide-auto-hide-widgets-via-mouse-over)
- [Adding Auto Hide Widgets](#adding-auto-hide-widgets)
- [Setting Auto-Hide Flags](#setting-auto-hide-flags)
- [`AutoHideFeatureEnabled`](#autohidefeatureenabled)
- [`DockAreaHasAutoHideButton`](#dockareahasautohidebutton)
- [`AutoHideButtonTogglesArea`](#autohidebuttontogglesarea)
- [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
- [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
- [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
- [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)
- [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
- [Show / Hide Auto-Hide Widgets via Mouse Over](#show--hide-auto-hide-widgets-via-mouse-over)
- [Drag \& Drop to Auto-Hide](#drag--drop-to-auto-hide)
- [Auto-Hide Tab Insertion Order](#auto-hide-tab-insertion-order)
- [Auto-Hide Tab Sorting](#auto-hide-tab-sorting)
- [Auto-Hide Drag to Float / Dock](#auto-hide-drag-to-float--dock)
- [Auto-Hide Context Menu](#auto-hide-context-menu)
- [Adding Auto Hide Widgets](#adding-auto-hide-widgets)
- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags)
- [Setting Auto-Hide Flags](#setting-auto-hide-flags)
- [`AutoHideFeatureEnabled`](#autohidefeatureenabled)
- [`DockAreaHasAutoHideButton`](#dockareahasautohidebutton)
- [`AutoHideButtonTogglesArea`](#autohidebuttontogglesarea)
- [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
- [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
- [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
- [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
- [`AutoHideHasCloseButton`](#autohidehasclosebutton)
- [`AutoHideHasMinimizeButton`](#autohidehasminimizebutton)
- [`AutoHideOpenOnDragHover`](#autohideopenondraghover)
- [`AutoHideCloseOnOutsideMouseClick`](#autohidecloseonoutsidemouseclick)
- [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)
- [Globally Lock Docking Features](#globally-lock-docking-features)
- [Dock Widget Size / Minimum Size Handling](#dock-widget-size--minimum-size-handling)
- [Styling](#styling)
- [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
- [Using ADS on Linux](#using-ads-on-linux)
- [Supported Distributions](#supported-distributions)
- [Requirements](#requirements)
- [Manjaro xfce 25.0.1 and Xubuntu 24.04.2 issues](#manjaro-xfce-2501-and-xubuntu-24042-issues)
- [OpenGl + ADS](#opengl--ads)
## Configuration Flags
@@ -170,37 +191,6 @@ 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 immediately. 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 predefined 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
@@ -325,8 +315,9 @@ 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.
Unless a central widget explicitly has been set with setCentralWidget, the
Advanced Docking System is without a static central widget and it wouldn't know
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.
@@ -498,9 +489,36 @@ possible in various web browsers.
![MiddleMouseButtonClosesTab true](cfg_flag_MiddleMouseButtonClosesTab.gif)
## Auto-Hide Configuration Flags
### `DisableTabTextEliding`
### Auto Hide Dock Widgets
Set this flag to disable eliding of tab texts in dock area tabs:
![DisableTabTextEliding true](cfg_flag_DisableTabTextEliding_true.png)
The flag is disabled by default and the text in all tabs is elided to show as
many tabs as possible even if there is not much space:
![DisableTabTextEliding false](cfg_flag_DisableTabTextEliding_false.png)
### `ShowTabTextOnlyForActiveTab`
Set this flag (default = false) to show label texts in dock area tabs only
for active tabs. Inactive tabs only show their icon:
![MShowTabTextOnlyForActiveTab true](cfg_flag_ShowTabTextOnlyForActiveTab_true.png)
### `DoubleClickUndocksWidget`
If the flag is set (default), a double click on a tab undocks the dock widget.
If you would like to disable undocking, just clear this flag.
### `TabsAtBottom`
If the flag is set, tabs will be shown at the bottom instead of in the title bar.
![TabsAtBottom true](cfg_flag_TabsAtBottom_true.png)
## Auto Hide Dock Widgets
The Advanced Docking System supports "Auto-Hide" functionality for **all**
dock containers. The "Auto Hide" feature allows to display more information
@@ -512,7 +530,7 @@ Enabling this feature adds a button with a pin icon to each dock area.
![DockAreaHasAutoHideButton true](cfg_flag_DockAreaHasAutoHideButton.png)
By clicking this button, the current dock widget (or the complete area - depending on the
configuration flags) will be pinned to a certain border. The border is choosen
configuration flags) will be pinned to a certain border. The border is chosen
depending on the location of the dock area. If you click the pin button while
holding down the **Ctrl** key, the whole dock area will be pinned to a certain
border.
@@ -534,6 +552,59 @@ the Auto-Hide widget is shown, if the user hovers over the Auto-Hide tab and is
collapsed if the mouse cursor leaves the Auto-Hide widget. Showing and hiding
by mouse click still works if this feature is enabled.
### Drag & Drop to Auto-Hide
You can easily drag any dock widget or any floating widget to the
borders of a window to pin it as a auto-hide tab in one of the 4 sidebars.
If you drag a dock widget close the one of the four window borders, special
drop overlays will be shown to indicate the drop area for auto-hide widgets:
![Auo-Hide drag to Sidebar](AutoHide_Drag_to_Sidebar.gif)
Of course, this also works with dock areas:
![Auo-Hide drag Dock Area](AutoHide_Drag_DockArea.gif)
If you drag a dock widget or dock area into a sidebar, then you even have
control over where tabs are inserted. Simply drag your mouse over a specific
auto-hide tab, and your dragged dock widget will be inserted before this tab.
Drag to the sidebar area behind the last tab, and the dragged widget will be
appended as last tab. In the following screen capture, the **Image Viewer 1** will
be inserted before the **Table 0** Auto-Hide tab and the **Image Viewer 2**
is appended behind the last tab:
![Auo-Hide tab insert order](AutoHide_Tab_Insert_Order.gif)
### Auto-Hide Tab Insertion Order
It is also possible to drag Auto-Hide tabs to a new auto-hide position.
That means, you can drag them to a different border or sidebar:
![Auto-Hide change sidebar](AutoHide_Change_Sidebar.gif)
### Auto-Hide Tab Sorting
You can drag Auto-Hide tabs to a new position in the current sidebar
to sort them:
![Auo-Hide sort tabs](AutoHide_Sort_Tabs.gif)
### Auto-Hide Drag to Float / Dock
But that is not all. You can also simply move Auto-Hide tabs to another
floating widget or dock them via drag and drop:
![Auo-Hide drag to float or dock](AutoHide_Drag_to_Float_or_Dock.gif)
### Auto-Hide Context Menu
All Auto-Hide tabs now have a context menu, that provides all the functionality
that you know from Dock widget tabs. With the **Pin To...** item from the
context menu it is very easy to move an Auto-Hide tab to a different Auto-Hide
sidebar:
![Auo-Hide context menu](AutoHide_Context_Menu.png)
### Adding Auto Hide Widgets
Adding an auto hide widget is similar to adding a dock widget, simply call
@@ -548,6 +619,8 @@ DockManager->addAutoHideDockWidget(SideBarLeft, TableDockWidget);
See `autohide` example or the demo application to learn how it works.
## Auto-Hide Configuration Flags
### Setting Auto-Hide Flags
The Advanced Docking System has a number of global configuration flags to
@@ -621,6 +694,53 @@ is shown, if the user hovers over the Auto-Hide tab or if the users moves the
mouse outside of the Auto-Hide widget. Showing and hiding my mouse click still
works if this feature is enabled.
### `AutoHideCloseButtonCollapsesDock`
Some users don't understand the distinction between closing an auto hide dock and
collapsing an auto hide dock. This may lead to situations where they press the
close button (losing the side tab widget) instead of simply clicking outside
the auto hide dock (collapsing the dock).
![AutoHideCloseButtonCollapsesDock false](cfg_flag_AutoHideCloseButtonCollapsesDock_false.gif)
If `AutoHideCloseButtonCollapsesDock` option is active, the
close button in an auto hide widget collapses the auto hide widget instead of
closing it.
![AutoHideCloseButtonCollapsesDock true](cfg_flag_AutoHideCloseButtonCollapsesDock_true.gif)
If you enable the `AutoHideHasMinimizeButton` flag, you should disable this
flag our you will have two buttons with minimize functionality.
### `AutoHideHasCloseButton`
If this flag is set (default), then each auto hide widget has a close button:
![AutoHideHasCloseButton](cfg_flag_AutoHideHasCloseButton.png)
The functionality of the close button (close or minimize) is configured by the
`AutoHideCloseButtonCollapsesDock` flag.
### `AutoHideHasMinimizeButton`
If this flag is set (disabled by default), then each auto hide widget has a minimize button.
![AutoHideHasMinimizeButton](cfg_flag_AutoHideHasMinimizeButton.png)
### `AutoHideOpenOnDragHover`
If this flag is set (disabled by default), then holding a dragging cursor hover an auto-hide collapsed dock's tab will open said dock:
![AutoHideOpenOnDragHover](cfg_flag_AutoHideOpenOnDragHover.gif)
Said dock must be set to accept drops to hide when cursor leaves its scope. See `AutoHideDragNDropExample` for more details.
### `AutoHideCloseOnOutsideMouseClick`
If this flag is set (default), the auto hide dock container will collapse if the
user clicks outside of the container. If not set, the auto hide container can be
closed only via click on auto hide sidebar tab.
## DockWidget Feature Flags
### `DockWidgetClosable`
@@ -631,10 +751,7 @@ If set, the dock widget will have a close button.
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).
via mouse.
### `DockWidgetFloatable`
@@ -745,6 +862,93 @@ Normally clicking the close button of a dock widget will just hide the widget an
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.
## Globally Lock Docking Features
It is possible to globally lock features of all dock widgets to "freeze" the
current workspace layout. That means, you can now lock your workspace
to avoid accidentally dragging a docked view. When locking wasn't possible,
users had to manually dock it back to the desired place after each accidental
undock.
You can use a combination of the following feature flags to define which features
shall get locked:
- `CDockWidget::DockWidgetClosable`
- `CDockWidget::DockWidgetMovable`
- `CDockWidget::DockWidgetFloatable`
- `CDockWidget::DockWidgetPinable`
To clear the locked features, you can use `CDockWidget::NoDockWidgetFeatures`
The following code shows how to lock and unlock all dock widget features
globally.
```c++
DockManager->lockDockWidgetFeaturesGlobally();
DockManager->lockDockWidgetFeaturesGlobally(CDockWidget::NoDockWidgetFeatures);
```
## Dock Widget Size / Minimum Size Handling
There are several `CDockWidget` mode enums to control how a `CDockWidget` is
resized and how the docking system handles the minimum size of a dockwidget.
The first one is the `eInsertMode` enum:
```c++
enum eInsertMode
{
AutoScrollArea,
ForceScrollArea,
ForceNoScrollArea
};
```
The InsertMode defines how the widget is inserted into the dock widget, when you
call the `CDockWidget::setWidget` method:
```c++
DockWidget->setWidget(widget, CDockWidget::AutoScrollArea);
```
The content of a dock widget should be resizable do a very small size to
prevent the dock widget from blocking the resizing. To ensure, that a
dock widget can be resized very well, it is better to insert the content
widget into a scroll area or to provide a widget that is already a scroll
area or that contains a scroll area (such as an `QAbstractItemView`)
If the InsertMode is `AutoScrollArea`, the DockWidget tries to automatically
detect how to insert the given widget. If the widget is derived from
`QScrollArea` (i.e. an `QAbstractItemView`), then the widget is inserted
directly. If the given widget is not a scroll area, the widget will be
inserted into a scroll area.
To force insertion into a scroll area, you can also provide the InsertMode
`ForceScrollArea`. In this case a scroll area will also be created for content
widgets that are derived from `QScrollArea` To prevent insertion into a scroll
area, you can provide the InsertMode `ForceNoScrollArea`. In this case, the
content widget is always inserted directly.
A second enum, the `eMinimumSizeHintMode` defines, which value will be returned
from the `CDockWidget::minimumSizeHint()` function:
```c++
enum eMinimumSizeHintMode
{
MinimumSizeHintFromDockWidget,
MinimumSizeHintFromContent,
MinimumSizeHintFromDockWidgetMinimumSize,
MinimumSizeHintFromContentMinimumSize,
};
```
To ensure, that a dock widget does not block resizing, the dock widget
reimplements `minimumSizeHint()` function to return a very small minimum
size hint. If you would like to adhere the `minimumSizeHint()` from the
content widget, then set the `minimumSizeHintMode()` to
`MinimumSizeHintFromContent`. If you would like to use the `minimumSize()`
value of the content widget or the dock widget, then you can use the
`MinimumSizeHintFromDockWidgetMinimumSize` or
`MinimumSizeHintFromContentMinimumSize` modes.
## 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
@@ -762,3 +966,51 @@ just call the function for settings the stylesheet with an empty string.
DockManager->setStyleSheet("");
```
## Using ADS on Linux
### Supported Distributions
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 it 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 some Linux distributions. Depending on the used window manager or compositor, dock widgets
with native title bars are supported or not. If native title bars are not supported,
the library switches to `QWidget` based title bars.
- **Kubuntu 18.04 and 19.10** - uses KWin - no native title bars
- **Ubuntu 18.04, 19.10 and 20.04** - native title bars are supported
- **Ubuntu 22.04** - uses Wayland -> no native title bars
### Requirements
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](linux_kubuntu_1804.png)
Screenshot Ubuntu:
![Advanced Docking on Ubuntu Linux](linux_ubuntu_1910.png)
### Manjaro xfce 25.0.1 and Xubuntu 24.04.2 issues
There is a known focus stealing issue with the xfce4 compositor reported in issue [#734]. This issue
can be solved by enabling the setting **Activate focus stealing prevention**. `Settings > Window Manager Tweaks` has a tab called `Focus`.
Selecting `Activate focus stealing prevention` and `Do nothing` for `When a window raises itself`, seems to mitigate the issue. Deselecting `Enable display compositing` on the `Compositor` tab, also works.
![Window Manager Tweaks](xfce4_focus_stealing_issue.png)
## OpenGl + ADS
If you would like to use OpenGL widgets with ADS such as `GLWidget`, QML or `QWebEngineView`, then you need
to set `QApplication::setAttribute(Qt::AA_ShareOpenGLContexts)` before creating your application and your
widgets (see issue [#732])
```c++
int main(int argc, char *argv[])
{
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QApplication application(argc, argv);
...
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(QtADSExamples LANGUAGES CXX VERSION ${VERSION_SHORT})
add_subdirectory(simple)
add_subdirectory(hideshow)
@@ -6,5 +6,7 @@ add_subdirectory(sidebar)
add_subdirectory(deleteonclose)
add_subdirectory(centralwidget)
add_subdirectory(autohide)
add_subdirectory(autohidedragndrop)
add_subdirectory(emptydockarea)
add_subdirectory(dockindock)
add_subdirectory(configflags)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(ads_example_autohide 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)
@@ -9,7 +9,7 @@ add_executable(AutoHideExample WIN32
mainwindow.ui
)
target_include_directories(AutoHideExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(AutoHideExample PRIVATE qtadvanceddocking)
target_link_libraries(AutoHideExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(AutoHideExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -8,7 +8,7 @@ from PyQt5.QtWidgets import (QApplication, QLabel, QCalendarWidget, QFrame, QTre
QTableWidget, QFileSystemModel, QPlainTextEdit, QToolBar,
QWidgetAction, QComboBox, QAction, QSizePolicy, QInputDialog)
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)

View File

@@ -33,7 +33,7 @@ CMainWindow::CMainWindow(QWidget *parent)
// Set central widget
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is the central editor. Enter your text here.");
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
CDockWidget* CentralDockWidget = DockManager->createDockWidget("CentralWidget");
CentralDockWidget->setWidget(w);
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
@@ -42,7 +42,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* table = new QTableWidget();
table->setColumnCount(3);
table->setRowCount(10);
CDockWidget* TableDockWidget = new CDockWidget("Table 1");
CDockWidget* TableDockWidget = DockManager->createDockWidget("Table 1");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->setMinimumSize(200,150);
@@ -53,7 +53,7 @@ CMainWindow::CMainWindow(QWidget *parent)
table = new QTableWidget();
table->setColumnCount(5);
table->setRowCount(1020);
TableDockWidget = new CDockWidget("Table 2");
TableDockWidget = DockManager->createDockWidget("Table 2");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@@ -64,7 +64,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* propertiesTable = new QTableWidget();
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = new CDockWidget("Properties");
CDockWidget* PropertiesDockWidget = DockManager->createDockWidget("Properties");
PropertiesDockWidget->setWidget(propertiesTable);
PropertiesDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
PropertiesDockWidget->resize(250, 150);

View File

@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.16)
project(ads_example_autohide_dragndrop 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(AutoHideDragNDropExample WIN32
main.cpp
mainwindow.cpp
mainwindow.ui
droppableitem.cpp
)
target_include_directories(AutoHideDragNDropExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(AutoHideDragNDropExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(AutoHideDragNDropExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(AutoHideDragNDropExample 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 Auto Hide With Drag N Drop 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,36 @@
ADS_OUT_ROOT = $${OUT_PWD}/../..
QT += core gui widgets
TARGET = AutoHideDragNDropExample
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 \
droppableitem.cpp
HEADERS += \
mainwindow.h \
droppableitem.h
FORMS += \
mainwindow.ui
LIBS += -L$${ADS_OUT_ROOT}/lib
include(../../ads.pri)
INCLUDEPATH += ../../src
DEPENDPATH += ../../src

View File

@@ -0,0 +1,38 @@
#include "droppableitem.h"
#include <QDragEnterEvent>
#include <QDragLeaveEvent>
#include <QDropEvent>
#include <QMimeData>
#include <qsizepolicy.h>
DroppableItem::DroppableItem(const QString& text, QWidget* parent)
: QPushButton(text, parent)
{
setAcceptDrops(true);
setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Expanding);
}
void DroppableItem::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasText())
{
event->acceptProposedAction();
setCursor(Qt::DragMoveCursor);
}
}
void DroppableItem::dragLeaveEvent(QDragLeaveEvent* event)
{
Q_UNUSED(event);
unsetCursor();
}
void DroppableItem::dropEvent(QDropEvent* event)
{
if (event->mimeData()->hasText())
{
event->acceptProposedAction();
setText(event->mimeData()->text());
}
}

View File

@@ -0,0 +1,19 @@
#include <QObject>
#include <QPushButton>
class QDragEnterEvent;
class QDragLeaveEvent;
class QDropEvent;
class DroppableItem : public QPushButton
{
Q_OBJECT;
public:
DroppableItem(const QString& text = QString(), QWidget* parent = nullptr);
protected:
void dragEnterEvent(QDragEnterEvent* event) override;
void dragLeaveEvent(QDragLeaveEvent* event) override;
void dropEvent(QDropEvent* event) override;
};

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,84 @@
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)
import PyQtAds as 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)
QtAds.CDockManager.setAutoHideConfigFlag(QtAds.CDockManager.AutoHideOpenOnDragHover, 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)
droppable_item = DroppableItem("Drop text here.")
drop_dock_widget = QtAds.CDockWidget("Tab")
drop_dock_widget.setWidget(droppable_item)
drop_dock_widget.setMinimumSizeHintMode(QtAds.CDockWidget.MinimumSizeHintFromDockWidget)
drop_dock_widget.setMinimumSize(200, 150)
drop_dock_widget.setAcceptDrops(True)
drop_area = self.dock_manager.addDockWidget(QtAds.DockWidgetArea.LeftDockWidgetArea, drop_dock_widget)
drop_area.setAcceptDrops(True)
self.menuView.addAction(drop_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,132 @@
#include "mainwindow.h"
#include "droppableitem.h"
#include "ui_mainwindow.h"
#include <QWidgetAction>
#include <QFileSystemModel>
#include <QTableWidget>
#include <QHBoxLayout>
#include <QInputDialog>
#include <QFileDialog>
#include <QSettings>
#include <QPlainTextEdit>
#include <QToolBar>
#include "AutoHideDockContainer.h"
#include "DockAreaWidget.h"
#include "DockAreaTitleBar.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);
CDockManager::setConfigFlag(CDockManager::TabsAtBottom, true);
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideOpenOnDragHover, true);
CDockManager::setConfigParam(CDockManager::AutoHideOpenOnDragHoverDelay_ms, 500);
DockManager = new CDockManager(this);
// Set central widget
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is the central editor. Enter your text here.");
CDockWidget* CentralDockWidget = DockManager->createDockWidget("CentralWidget");
CentralDockWidget->setWidget(w);
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
{
DroppableItem* droppableItem = new DroppableItem("Drop text here.");
CDockWidget* dropDockWidget = DockManager->createDockWidget("Tab 1");
dropDockWidget->setWidget(droppableItem);
dropDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
dropDockWidget->setMinimumSize(200,150);
dropDockWidget->setAcceptDrops(true);
const auto autoHideContainer = DockManager->addAutoHideDockWidget(SideBarLocation::SideBarLeft, dropDockWidget);
autoHideContainer->setSize(480);
autoHideContainer->setAcceptDrops(true);
ui->menuView->addAction(dropDockWidget->toggleViewAction());
}
{
DroppableItem* droppableItem = new DroppableItem("Drop text here.");
CDockWidget* dropDockWidget = DockManager->createDockWidget("Tab 2");
dropDockWidget->setWidget(droppableItem);
dropDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
dropDockWidget->setMinimumSize(200,150);
dropDockWidget->setAcceptDrops(true);
const auto autoHideContainer = DockManager->addAutoHideDockWidget(SideBarLocation::SideBarRight, dropDockWidget);
autoHideContainer->setSize(480);
autoHideContainer->setAcceptDrops(true);
ui->menuView->addAction(dropDockWidget->toggleViewAction());
}
QTableWidget* propertiesTable = new QTableWidget();
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = DockManager->createDockWidget("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(currentTextChanged(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

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
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)
@@ -9,7 +9,7 @@ add_executable(CentralWidgetExample WIN32
mainwindow.ui
)
target_include_directories(CentralWidgetExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(CentralWidgetExample PRIVATE qtadvanceddocking)
target_link_libraries(CentralWidgetExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(CentralWidgetExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -8,7 +8,7 @@ from PyQt5.QtWidgets import (QApplication, QLabel, QCalendarWidget, QFrame, QTre
QTableWidget, QFileSystemModel, QPlainTextEdit, QToolBar,
QWidgetAction, QComboBox, QAction, QSizePolicy, QInputDialog)
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)

View File

@@ -40,7 +40,7 @@ CMainWindow::CMainWindow(QWidget *parent)
// Set central widget
QPlainTextEdit* w = new QPlainTextEdit();
w->setPlaceholderText("This is the central editor. Enter your text here.");
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
CDockWidget* CentralDockWidget = DockManager->createDockWidget("CentralWidget");
CentralDockWidget->setWidget(w);
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
@@ -49,7 +49,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* table = new QTableWidget();
table->setColumnCount(3);
table->setRowCount(10);
CDockWidget* TableDockWidget = new CDockWidget("Table 1");
CDockWidget* TableDockWidget = DockManager->createDockWidget("Table 1");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@@ -60,7 +60,7 @@ CMainWindow::CMainWindow(QWidget *parent)
table = new QTableWidget();
table->setColumnCount(5);
table->setRowCount(1020);
TableDockWidget = new CDockWidget("Table 2");
TableDockWidget = DockManager->createDockWidget("Table 2");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@@ -71,7 +71,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* propertiesTable = new QTableWidget();
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = new CDockWidget("Properties");
CDockWidget* PropertiesDockWidget = DockManager->createDockWidget("Properties");
PropertiesDockWidget->setWidget(propertiesTable);
PropertiesDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
PropertiesDockWidget->resize(250, 150);

View File

@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.16)
project(ads_example_configflags 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(ConfigFlagsExample WIN32
main.cpp
mainwindow.cpp
mainwindow.ui
)
target_include_directories(ConfigFlagsExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(ConfigFlagsExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(ConfigFlagsExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(ConfigFlagsExample 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 Config Flags"
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 = ConfigFlagsExample
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,64 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QLabel>
#include <QToolBar>
#include "DockAreaWidget.h"
using namespace ads;
CMainWindow::CMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::CMainWindow)
{
ui->setupUi(this);
// Add the toolbar
auto toolbar_ = addToolBar("Top Toolbar");
// Create the dock manager
ads::CDockManager::setConfigFlags(ads::CDockManager::DefaultOpaqueConfig);
ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton,
false);
ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton,
false);
ads::CDockManager::setConfigFlag(
ads::CDockManager::DockAreaHasTabsMenuButton, false);
auto DockManager = new ads::CDockManager(this);
// Create a dockable widget
QLabel *l1 = new QLabel();
l1->setWordWrap(true);
l1->setAlignment(Qt::AlignTop | Qt::AlignLeft);
l1->setText("Docking widget 1");
ads::CDockWidget *dockWidget1 = DockManager->createDockWidget("Dock 1");
dockWidget1->setWidget(l1);
DockManager->addDockWidget(ads::LeftDockWidgetArea, dockWidget1);
QLabel *l2 = new QLabel();
l2->setWordWrap(true);
l2->setAlignment(Qt::AlignTop | Qt::AlignLeft);
l2->setText("Docking widget 2");
ads::CDockWidget *dockWidget2 = DockManager->createDockWidget("Dock 2");
dockWidget2->setWidget(l2);
DockManager->addDockWidget(ads::RightDockWidgetArea, dockWidget2);
// Add menu actions
ui->menuView->addAction(dockWidget1->toggleViewAction());
ui->menuView->addAction(dockWidget2->toggleViewAction());
toolbar_->addAction(dockWidget1->toggleViewAction());
toolbar_->addAction(dockWidget2->toggleViewAction());
}
CMainWindow::~CMainWindow()
{
delete ui;
}

View File

@@ -0,0 +1,27 @@
#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();
private:
Ui::CMainWindow *ui;
};
#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

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
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)
@@ -7,7 +7,7 @@ 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 PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(DeleteOnCloseTest PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
int i = 0;
QObject::connect(action, &QAction::triggered, [&]() {
auto dw = new ads::CDockWidget(QStringLiteral("test %1 [DockWidgetDeleteOnClose]").arg(i++), &w);
auto dw = dockManager->createDockWidget(QStringLiteral("test %1 [DockWidgetDeleteOnClose]").arg(i++), &w);
auto editor = new QTextEdit(QStringLiteral("lorem ipsum..."), dw);
dw->setWidget(editor);
dw->setFeature(ads::CDockWidget::DockWidgetDeleteOnClose, true);
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
qDebug() << "doc dock widget created!" << dw << area;
});
auto dw = new ads::CDockWidget(QStringLiteral("test %1 [DeleteContentOnClose]").arg(i++), &w);
auto dw = dockManager->createDockWidget(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);
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
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 dw = dockManager->createDockWidget(QStringLiteral("test %1").arg(i++), &w);
auto editor = new QTextEdit(QStringLiteral("lorem ipsum..."), dw);
dw->setWidget(editor);
auto area = dockManager->addDockWidgetTab(ads::CenterDockWidgetArea, dw);

View File

@@ -1,6 +1,6 @@
import sys
from PyQtAds import QtAds
import PyQtAds as QtAds
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtCore import (qDebug, pyqtSlot, QObject, pyqtSignal)
from PyQt5.QtWidgets import (QMainWindow, QAction, QTextEdit, QApplication,

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
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)
@@ -12,7 +12,7 @@ add_executable(DockInDockExample WIN32
mainframe.cpp
)
target_include_directories(DockInDockExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(DockInDockExample PRIVATE qtadvanceddocking)
target_link_libraries(DockInDockExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(DockInDockExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -54,7 +54,7 @@ ads::CDockAreaWidget* DockInDockWidget::addTabWidget( QWidget* widget, const QSt
}
}
ads::CDockWidget* DockWidget = new ads::CDockWidget(name);
ads::CDockWidget* DockWidget = m_mgr->createDockWidget(name);
DockWidget->setWidget(widget);
DockWidget->setIcon( icon );
@@ -101,7 +101,7 @@ DockInDockWidget* DockInDockWidget::createGroup( const QString& groupName, QIcon
DockInDockWidget* child = new DockInDockWidget( this, m_topLevelDockWidget, m_perspectivesManager );
child->setObjectName( groupName );
ads::CDockWidget* DockWidget = new ads::CDockWidget(groupName);
ads::CDockWidget* DockWidget = m_mgr->createDockWidget(groupName);
DockWidget->setWidget(child);
DockWidget->setIcon(icon);

View File

@@ -3,7 +3,7 @@ import sys
from PyQt5.QtWidgets import (QApplication, QWidget, QVBoxLayout, QMessageBox,
QInputDialog, QMenu, QLineEdit)
from PyQt5.QtGui import QIcon
from PyQtAds import QtAds
import PyQtAds as QtAds
from dockindockmanager import DockInDockManager
from perspectiveactions import LoadPerspectiveAction, RemovePerspectiveAction

View File

@@ -1,7 +1,7 @@
from PyQt5.QtWidgets import QAction, QMenu, QInputDialog, QLineEdit
from PyQt5.QtCore import QSettings
from PyQtAds import QtAds
import PyQtAds as QtAds
CHILD_PREFIX = "Child-"

View File

@@ -1,5 +1,5 @@
#include <QApplication>
#include "../../examples/simple/MainWindow.h"
#include "mainframe.h"
int main(int argc, char *argv[])
{

View File

@@ -4,7 +4,7 @@ import atexit
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtCore import Qt
from PyQtAds import QtAds
import PyQtAds as QtAds
from perspectives import PerspectivesManager
from dockindock import DockInDockWidget

View File

@@ -4,7 +4,7 @@ import shutil
import atexit
from PyQt5.QtCore import pyqtSignal, QSettings, QObject
from PyQtAds import QtAds
import PyQtAds as QtAds
from dockindockmanager import DockInDockManager
from dockindock import DockInDockWidget

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
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)
@@ -9,7 +9,7 @@ add_executable(EmptyDockAreaExample WIN32
mainwindow.ui
)
target_include_directories(EmptyDockAreaExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(EmptyDockAreaExample PRIVATE qtadvanceddocking)
target_link_libraries(EmptyDockAreaExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(EmptyDockAreaExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QSignalBlocker
from PyQt5.QtWidgets import (QApplication, QMainWindow, QLabel, QComboBox, QTableWidget,
QAction, QWidgetAction, QSizePolicy, QInputDialog)
from PyQt5.QtGui import QCloseEvent
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui')

View File

@@ -19,8 +19,6 @@
#include <QToolBar>
#include "DockAreaWidget.h"
#include "DockAreaTitleBar.h"
#include "DockAreaTabBar.h"
#include "FloatingDockContainer.h"
#include "DockComponentsFactory.h"
@@ -32,16 +30,19 @@ CMainWindow::CMainWindow(QWidget *parent)
, ui(new Ui::CMainWindow)
{
ui->setupUi(this);
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaHasCloseButton, false );
ads::CDockManager::setConfigFlag( ads::CDockManager::AllTabsHaveCloseButton, true );
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaHasUndockButton, false );
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true );
ads::CDockManager::setConfigFlag( ads::CDockManager::DisableTabTextEliding, true );
ads::CDockManager::setConfigFlag( ads::CDockManager::DoubleClickUndocksWidget, false );
DockManager = new CDockManager(this);
// Set central widget
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");
CDockWidget* CentralDockWidget = DockManager->createDockWidget("CentralWidget");
CentralDockWidget->setWidget(label);
CentralDockWidget->setFeature(ads::CDockWidget::NoTab, true);
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
@@ -50,7 +51,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* table = new QTableWidget();
table->setColumnCount(3);
table->setRowCount(10);
CDockWidget* TableDockWidget = new CDockWidget("Table 1");
CDockWidget* TableDockWidget = DockManager->createDockWidget("Table 1");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@@ -62,7 +63,7 @@ CMainWindow::CMainWindow(QWidget *parent)
table = new QTableWidget();
table->setColumnCount(5);
table->setRowCount(1020);
TableDockWidget = new CDockWidget("Table 2");
TableDockWidget = DockManager->createDockWidget("Table 2");
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@@ -73,7 +74,7 @@ CMainWindow::CMainWindow(QWidget *parent)
QTableWidget* propertiesTable = new QTableWidget();
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = new CDockWidget("Properties");
CDockWidget* PropertiesDockWidget = DockManager->createDockWidget("Properties");
PropertiesDockWidget->setWidget(propertiesTable);
PropertiesDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
PropertiesDockWidget->resize(250, 150);
@@ -98,8 +99,13 @@ void CMainWindow::createPerspectiveUi()
PerspectiveComboBox = new QComboBox(this);
PerspectiveComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
PerspectiveComboBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(PerspectiveComboBox, &QComboBox::textActivated,
DockManager, &CDockManager::openPerspective);
#else
connect(PerspectiveComboBox, SIGNAL(activated(const QString&)),
DockManager, SLOT(openPerspective(const QString&)));
#endif
PerspectiveListAction->setDefaultWidget(PerspectiveComboBox);
ui->toolBar->addSeparator();
ui->toolBar->addAction(PerspectiveListAction);

View File

@@ -2,10 +2,12 @@ TEMPLATE = subdirs
SUBDIRS = \
autohide \
autohidedragndrop \
centralwidget \
simple \
hideshow \
sidebar \
deleteonclose \
emptydockarea \
dockindock
dockindock \
configflags

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(ads_example_hideshow 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)
@@ -9,7 +9,7 @@ add_executable(HideShowExample WIN32
MainWindow.ui
)
target_include_directories(HideShowExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(HideShowExample PRIVATE qtadvanceddocking)
target_link_libraries(HideShowExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(HideShowExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -35,7 +35,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Create a dock widget with the title Label 1 and set the created label
// as the dock widget content
ads::CDockWidget* DockWidget = new ads::CDockWidget("Label 1");
ads::CDockWidget* DockWidget = m_DockManager->createDockWidget("Label 1");
DockWidget->setWidget(l);
// Add the toggleViewAction of the dock widget to the menu to give

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(ads_example_sidebar 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)
@@ -9,7 +9,7 @@ add_executable(SidebarExample WIN32
MainWindow.ui
)
target_include_directories(SidebarExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(SidebarExample PRIVATE qtadvanceddocking)
target_link_libraries(SidebarExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(SidebarExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -28,7 +28,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Create a dock widget with the title Label 1 and set the created label
// as the dock widget content
ads::CDockWidget* DockWidget = new ads::CDockWidget("Label 1");
ads::CDockWidget* DockWidget = m_DockManager->createDockWidget("Label 1");
DockWidget->setWidget(l);
// Add the toggleViewAction of the dock widget to the menu to give
@@ -42,7 +42,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Create an example editor
QPlainTextEdit* te = new QPlainTextEdit();
te->setPlaceholderText("Please enter your text here into this QPlainTextEdit...");
DockWidget = new ads::CDockWidget("Editor 1");
DockWidget = m_DockManager->createDockWidget("Editor 1");
DockWidget->setWidget(te);
ui->menuView->addAction(DockWidget->toggleViewAction());
m_DockManager->addDockWidget(ads::BottomDockWidgetArea, DockWidget);

View File

@@ -5,7 +5,7 @@ from PyQt5 import uic
from PyQt5.QtCore import Qt, QMargins
from PyQt5.QtWidgets import QApplication, QLabel, QVBoxLayout, QPlainTextEdit
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'MainWindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(ads_example_simple 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)
@@ -9,7 +9,7 @@ add_executable(SimpleExample WIN32
MainWindow.ui
)
target_include_directories(SimpleExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(SimpleExample PRIVATE qtadvanceddocking)
target_link_libraries(SimpleExample PRIVATE qtadvanceddocking-qt${QT_VERSION_MAJOR})
target_link_libraries(SimpleExample PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)

View File

@@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Create a dock widget with the title Label 1 and set the created label
// as the dock widget content
ads::CDockWidget* DockWidget = new ads::CDockWidget("Label 1");
ads::CDockWidget* DockWidget = m_DockManager->createDockWidget("Label 1");
DockWidget->setWidget(l);
// Add the toggleViewAction of the dock widget to the menu to give

View File

@@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtWidgets import QApplication, QLabel
from PyQtAds import QtAds
import PyQtAds as QtAds
UI_FILE = os.path.join(os.path.dirname(__file__), 'MainWindow.ui')
MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE)

View File

@@ -1,4 +1,5 @@
import os
import sys
from pyqtbuild import PyQtBindings, PyQtProject
from sipbuild import Option
@@ -17,6 +18,22 @@ class ads(PyQtBindings):
super().__init__(project, 'ads')
def get_options(self):
"""Our custom options that a user can pass to sip-build."""
options = super().get_options()
options += [
Option('ads_incdir',
help='the directory containing the ads header file',
metavar='DIR'),
Option('ads_libdir',
help='the directory containing the ads library',
metavar='DIR'),
Option('ads_lib',
help='the ads library',
metavar='LIB'),
]
return options
def apply_user_defaults(self, tool):
""" Set default values for user options that haven't been set yet. """
@@ -24,4 +41,13 @@ class ads(PyQtBindings):
print("Adding resource file to qmake project: ", resource_file)
self.builder_settings.append('RESOURCES += '+resource_file)
if self.ads_lib is not None:
self.libraries.append(self.ads_lib)
if self.ads_incdir is not None:
self.include_dirs.append(self.ads_incdir)
if self.ads_libdir is not None:
self.library_dirs.append(self.ads_libdir)
super().apply_user_defaults(tool)

View File

@@ -1,12 +1,12 @@
# Specify the build system.
[build-system]
requires = ["sip >=6.0.2, <6.6", "PyQt-builder >=1.6, <2", "PyQt5>=5.15.4", "PyQt5-sip<13,>=12.8"]
requires = ["sip >=6.0.2", "PyQt-builder >=1.6", "PyQt5>=5.15", "PyQt5-sip>=12.8"]
build-backend = "sipbuild.api"
# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "PyQtAds"
version = "3.8.2"
version = "4.4.1"
summary = "Python bindings for Qt Advanced Docking System"
home-page = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/"
license = "LGPL v2.1"
@@ -16,13 +16,18 @@ description-content-type = "text/markdown"
[tool.sip.project]
tag-prefix = "QtAds"
dunder-init = true
[tool.sip.bindings.ads]
pep484-pyi = true
define-macros = ["ADS_SHARED_EXPORT"]
sip-file = "ads.sip"
include-dirs = ["src"]
qmake-QT = ["widgets"]
qmake-QT = ["widgets", "gui-private; platform_system == 'Linux'"]
headers = [
"src/AutoHideDockContainer.h",
"src/AutoHideSideBar.h",
"src/AutoHideTab.h",
"src/DockAreaTabBar.h",
"src/DockAreaTitleBar.h",
"src/DockAreaTitleBar_p.h",
@@ -40,10 +45,15 @@ headers = [
"src/FloatingDockContainer.h",
"src/FloatingDragPreview.h",
"src/IconProvider.h",
"src/PushButton.h",
"src/ResizeHandle.h",
"src/ads_globals.h",
# "src/linux/FloatingWidgetTitleBar.h",
"src/linux/FloatingWidgetTitleBar.h; platform_system == 'Linux'",
]
sources = [
"src/AutoHideTab.cpp",
"src/AutoHideDockContainer.cpp",
"src/AutoHideSideBar.cpp",
"src/DockAreaTabBar.cpp",
"src/DockAreaTitleBar.cpp",
"src/DockAreaWidget.cpp",
@@ -60,6 +70,8 @@ sources = [
"src/FloatingDockContainer.cpp",
"src/FloatingDragPreview.cpp",
"src/IconProvider.cpp",
"src/PushButton.cpp",
"src/ResizeHandle.cpp",
"src/ads_globals.cpp",
# "src/linux/FloatingWidgetTitleBar.cpp",
"src/linux/FloatingWidgetTitleBar.cpp; platform_system == 'Linux'",
]

View File

@@ -1,7 +0,0 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = PyQtAds/_version.py
versionfile_build = PyQtAds/_version.py
tag_prefix =

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