Skip to content

Commit 4947548

Browse files
2 parents 7fd5cbe + 991b69c commit 4947548

29 files changed

+131
-65
lines changed

.github/workflows/linux-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v2
2929
- name: Cache Qt
3030
id: cache-qt-6-4
31-
uses: actions/cache@v1 # not v2!
31+
uses: actions/cache@v3
3232
with:
3333
path: ../Qt/6.4.2
3434
key: ${{ runner.os }}-QtCache-Qt6-4

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
33
if (POLICY CMP0091)
44
cmake_policy(SET CMP0091 NEW)

README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ know it from Visual Studio.
161161
- [Auto-Hide Functionality](#auto-hide-functionality)
162162
- [Python Bindings](#python-bindings)
163163
- [PySide6](#pyside6)
164+
- [PyQt6](#pyqt6)
164165
- [PyQt5](#pyqt5)
165166
- [Tested Compatible Environments](#tested-compatible-environments)
166167
- [Supported Qt Versions](#supported-qt-versions)
@@ -189,7 +190,7 @@ know it from Visual Studio.
189190
- [RDE – Robox Development Environment](#rde--robox-development-environment)
190191
- [ResInsight](#resinsight)
191192
- [ADTF 3](#adtf-3)
192-
- [DREAM.3D NX](#dream3d-nx)
193+
- [DREAM3D-NX](#dream3d-nx)
193194
- [LabPlot](#labplot)
194195
- [Alternative Docking System Implementations](#alternative-docking-system-implementations)
195196
- [KDDockWidgets](#kddockwidgets)
@@ -308,7 +309,7 @@ More about the auto hide configuration options in the [online documentation...](
308309
![Python Logo](doc/python_logo.png)
309310

310311
Thanks to the contribution of several users, the Advanced Docking System comes
311-
with a complete Python integration. Python bindings are available for **PyQt5** and
312+
with a complete Python integration. Python bindings are available for **PyQt5**, **PyQt6**, and
312313
**PySide6**.
313314

314315
### PySide6
@@ -328,6 +329,24 @@ The PySide6 bindings were contributed by:
328329

329330
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.
330331

332+
### PyQt6
333+
334+
A PyQt6 ADS package is available via PyPi and can be installed on Windows,
335+
macOS, and Linux with:
336+
337+
```bash
338+
pip install PyQt6Ads
339+
```
340+
341+
Sample code is available [here](https://github.com/pyapp-kit/PyQt6Ads/tree/main/examples).
342+
343+
The PyQt6 bindings were contributed by:
344+
345+
- [tlambert03](https://github.com/tlambert03)
346+
347+
Please file PyQt6Ads-specific issues at [pyapp-kit/PyQt6Ads](https://github.com/pyapp-kit/PyQt6Ads).
348+
349+
331350
### PyQt5
332351

333352
A package is available via [conda-forge](https://github.com/conda-forge/pyqtads-feedstock).
@@ -582,7 +601,7 @@ highlights are:
582601
- Simple Drag & Drop user interface.
583602
- Load data from file.
584603
- Connect to live streaming of data.
585-
- Save the visualization layout and configurations to re-use them later.
604+
- Save the visualization layout and configurations to reuse them later.
586605
- Fast OpenGL visualization.
587606
- Can handle thousands of timeseries and millions of data points.
588607
- Transform your data using a simple editor: derivative, moving average, integral, etc…
@@ -667,15 +686,17 @@ says about the switch to Qt Advanced Docking:
667686
668687
![ADTF](doc/showcase_adtf.png)
669688
670-
### [DREAM.3D NX](https://github.com/BlueQuartzSoftware/DREAM3D)
689+
### [DREAM3D-NX](https://www.dream3d.io)
671690
672-
DREAM.3D *(Digital Representation Environment for Analysis of Materials in 3D)* is an open source, 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.
691+
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.
673692
674-
[BlueQuartz Software](http://www.bluequartz.net/) is currently completely rewriting the DREAM.3D application. For the upcoming version **[DREAM3D NX](http://www.dream3d.io/)** they improved the UI by using the Advanced Docking System. An [early version](http://www.dream3d.io/) of **DREAM3D NX** with ADS is already available to any user who would like to take the brand new version out for a spin.
693+
[BlueQuartz Software](http://www.bluequartz.net/) has completely rewritten the old DREAM.3D version 6.5 application
694+
taking advantage of the Advanced Docking System to present a highly customizable user interface
695+
for DREAM3D-NX Version 7.
675696
676697
![DREAM.3D NX](doc/showcase_dream3d_nx.png)
677698
678-
[read more...](http://dream3d.bluequartz.net/)
699+
[read more...](http://www.dream3d.io/)
679700
680701
### [LabPlot](https://labplot.kde.org/)
681702

demo/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_demo VERSION ${VERSION_SHORT})
33

44
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)

doc/showcase_dream3d_nx.png

17.8 KB
Loading

doc/user-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ When an entire area is closed, the default behavior is to hide the dock widgets
853853
854854
It is possible to globally lock features of all dock widgets to "freeze" the
855855
current workspace layout. That means, you can now lock your workspace
856-
to avoid accidentally dragging a docked view. When locking was't possible,
856+
to avoid accidentally dragging a docked view. When locking wasn't possible,
857857
users had to manually dock it back to the desired place after each accidental
858858
undock.
859859

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(QtADSExamples LANGUAGES CXX VERSION ${VERSION_SHORT})
33
add_subdirectory(simple)
44
add_subdirectory(hideshow)

examples/autohide/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_autohide VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/autohidedragndrop/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_autohide_dragndrop VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/centralwidget/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_centralwidget VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/configflags/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_centralwidget VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/deleteonclose/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_deleteonclose VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/dockindock/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_dockindock VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/emptydockarea/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_centralwidget VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/hideshow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_hideshow VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/sidebar/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_sidebar VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

examples/simple/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(ads_example_simple VERSION ${VERSION_SHORT})
33
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
44
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
33
include(GNUInstallDirs)
44
if (${QT_VERSION_MAJOR})
@@ -85,6 +85,11 @@ add_library(ads::${library_name} ALIAS ${library_name})
8585
target_link_libraries(${library_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core
8686
Qt${QT_VERSION_MAJOR}::Gui
8787
Qt${QT_VERSION_MAJOR}::Widgets)
88+
89+
if(QT_VERSION_MAJOR STREQUAL "6")
90+
target_link_libraries(${library_name} PRIVATE Qt6::GuiPrivate) #needed for <qpa/qplatformnativeinterface.h>
91+
endif()
92+
8893
if (UNIX AND NOT APPLE)
8994
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
9095
find_package(X11 REQUIRED)

src/DockAreaTabBar.cpp

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -334,27 +334,13 @@ void CDockAreaTabBar::onTabCloseRequested()
334334
void CDockAreaTabBar::onCloseOtherTabsRequested()
335335
{
336336
auto Sender = qobject_cast<CDockWidgetTab*>(sender());
337-
for (int i = 0; i < count(); ++i)
338-
{
339-
auto Tab = tab(i);
340-
if (Tab->isClosable() && !Tab->isHidden() && Tab != Sender)
341-
{
342-
// If the dock widget is deleted with the closeTab() call, its tab
343-
// it will no longer be in the layout, and thus the index needs to
344-
// be updated to not skip any tabs
345-
int Offset = Tab->dockWidget()->features().testFlag(
346-
CDockWidget::DockWidgetDeleteOnClose) ? 1 : 0;
347-
closeTab(i);
348-
349-
// If the dock widget blocks closing, i.e. if the flag
350-
// CustomCloseHandling is set, and the dock widget is still open,
351-
// then we do not need to correct the index
352-
if (Tab->dockWidget()->isClosed())
353-
{
354-
i -= Offset;
355-
}
356-
}
357-
}
337+
338+
for (int i = count() - 1; i >= 0; --i) {
339+
auto Tab = tab(i);
340+
if (Tab->isClosable() && !Tab->isHidden() && Tab != Sender) {
341+
closeTab(i);
342+
}
343+
}
358344
}
359345

360346

src/DockAreaWidget.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ struct DockAreaWidgetPrivate
270270
DockAreaWidgetPrivate(CDockAreaWidget* _public);
271271

272272
/**
273-
* Convencience function to ease components factory access
273+
* Convenience function to ease components factory access
274274
*/
275275
QSharedPointer<ads::CDockComponentsFactory> componentsFactory() const
276276
{
@@ -379,10 +379,10 @@ void DockAreaWidgetPrivate::updateTitleBarButtonStates()
379379

380380
if (_this->isAutoHide())
381381
{
382-
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideHasCloseButton))
383-
{
382+
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideHasCloseButton))
383+
{
384384
TitleBar->button(TitleBarButtonClose)->setEnabled(
385-
_this->features().testFlag(CDockWidget::DockWidgetClosable));
385+
_this->features().testFlag(CDockWidget::DockWidgetClosable));
386386
}
387387
}
388388
else
@@ -872,10 +872,22 @@ void CDockAreaWidget::updateTitleBarVisibility()
872872
bool IsAutoHide = isAutoHide();
873873
if (!CDockManager::testConfigFlag(CDockManager::AlwaysShowTabs))
874874
{
875-
bool Hidden = Container->hasTopLevelDockWidget() && (Container->isFloating()
876-
|| CDockManager::testConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar));
877-
Hidden |= (d->Flags.testFlag(HideSingleWidgetTitleBar) && openDockWidgetsCount() == 1);
878-
Hidden &= !IsAutoHide; // Titlebar must always be visible when auto hidden so it can be dragged
875+
bool Hidden = false;
876+
if (!IsAutoHide) // Titlebar must always be visible when auto hidden so it can be dragged
877+
{
878+
if (Container->isFloating() || CDockManager::testConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar))
879+
{
880+
// Always show title bar if it contains title bar actions
881+
if (CDockWidget* TopLevelWidget = Container->topLevelDockWidget())
882+
Hidden |= TopLevelWidget->titleBarActions().empty();
883+
}
884+
if (!Hidden && d->Flags.testFlag(HideSingleWidgetTitleBar))
885+
{
886+
// Always show title bar if it contains title bar actions
887+
auto DockWidgets = openedDockWidgets();
888+
Hidden |= (DockWidgets.size() == 1) && DockWidgets.front()->titleBarActions().empty();
889+
}
890+
}
879891
d->TitleBar->setVisible(!Hidden);
880892
}
881893

src/DockComponentsFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ADS_EXPORT CDockComponentsFactory
6767

6868
/**
6969
* This returns the default dock components factory instance.
70-
* If no components factory is assigned to a specifc dock manager, this
70+
* If no components factory is assigned to a specific dock manager, this
7171
* global factory instance will be used.
7272
*/
7373
static QSharedPointer<ads::CDockComponentsFactory> factory();

src/DockFocusController.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,13 @@ CDockWidget* CDockFocusController::focusedDockWidget() const
423423
}
424424

425425

426+
//==========================================================================
427+
CDockAreaWidget* CDockFocusController::focusedDockArea() const
428+
{
429+
return d->FocusedArea.data();
430+
}
431+
432+
426433
//==========================================================================
427434
void CDockFocusController::setDockWidgetTabPressed(bool Value)
428435
{

src/DockFocusController.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ private Q_SLOTS:
6969
*/
7070
CDockWidget* focusedDockWidget() const;
7171

72+
/**
73+
* Returns the dock area that contains the focusedDockWidget() or nullptr if
74+
* the focused dock widget is not in this area.
75+
*/
76+
CDockAreaWidget* focusedDockArea() const;
77+
7278
/**
7379
* Request focus highlighting for the given dock widget assigned to the tab
7480
* given in Tab parameter

src/DockManager.cpp

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,27 @@ CDockManager::CDockManager(QWidget *parent) :
530530
window()->installEventFilter(this);
531531

532532
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
533-
connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
533+
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
534534
{
535-
// bring modal dialogs to foreground to ensure that they are in front of any
536-
// floating dock widget
537-
if (focusWindow && focusWindow->isModal())
535+
if (!focusWindow)
538536
{
539-
focusWindow->raise();
537+
return;
540538
}
539+
540+
// bring the main application window that hosts the dock manager and all floating
541+
// widgets in front of any other application
542+
this->raise();
543+
for (auto FloatingWidget : d->FloatingWidgets)
544+
{
545+
if (FloatingWidget)
546+
{
547+
FloatingWidget->raise();
548+
}
549+
}
550+
551+
// ensure that the dragged floating window is in front of the main application window
552+
// and any other floating widget - this will also ensure that modal dialogs come to foreground
553+
focusWindow->raise();
541554
});
542555
#endif
543556
}
@@ -555,7 +568,7 @@ CDockManager::~CDockManager()
555568
{
556569
if (!area || area->dockManager() != this) continue;
557570

558-
// QPointer delete safety - just in case some dock wigdet in destruction
571+
// QPointer delete safety - just in case some dock widget in destruction
559572
// deletes another related/twin or child dock widget.
560573
std::vector<QPointer<QWidget>> deleteWidgets;
561574
for ( auto widget : area->dockWidgets() )
@@ -1523,6 +1536,16 @@ QVariant CDockManager::configParam(eConfigParam Param, QVariant Default)
15231536
}
15241537

15251538

1539+
//===========================================================================
1540+
void CDockManager::raise()
1541+
{
1542+
if (parentWidget())
1543+
{
1544+
parentWidget()->raise();
1545+
}
1546+
}
1547+
1548+
15261549
} // namespace ads
15271550

15281551
//---------------------------------------------------------------------------

src/DockManager.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,12 @@ public Q_SLOTS:
770770
*/
771771
void hideManagerAndFloatingWidgets();
772772

773+
/**
774+
* Calls raise() for the widget that hosts this dock manager.
775+
* This will bring the widget in front of any other application that is running
776+
*/
777+
void raise();
778+
773779
Q_SIGNALS:
774780
/**
775781
* This signal is emitted if the list of perspectives changed.

src/DockWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ void CDockWidget::saveState(QXmlStreamWriter& s) const
841841
void CDockWidget::flagAsUnassigned()
842842
{
843843
d->Closed = true;
844-
setParent(d->DockManager);
845844
setVisible(false);
846845
setDockArea(nullptr);
846+
setParent(d->DockManager);
847847
tabWidget()->setParent(this);
848848
}
849849

0 commit comments

Comments
 (0)