From 018ce2001e93647e6af95df1033500e02f2fa1a3 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 18:06:45 +0100 Subject: [PATCH 01/12] Fixed all Qt6 build issues --- demo/MainWindow.cpp | 7 +++++++ demo/demo.pro | 6 ++++-- src/DockContainerWidget.cpp | 14 +++++++------- src/DockManager.cpp | 4 ++-- src/DockOverlay.cpp | 9 +++++++-- src/DockSplitter.cpp | 4 ++-- src/ElidingLabel.cpp | 14 ++++++++++++-- src/ElidingLabel.h | 4 ++-- src/FloatingDockContainer.cpp | 5 ++++- src/FloatingDockContainer.h | 6 +++++- src/ads_globals.h | 2 +- 11 files changed, 53 insertions(+), 22 deletions(-) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 289fba1..4223926 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -58,12 +58,15 @@ #include #include #include +#include #include #ifdef Q_OS_WIN +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #endif +#endif #include #include @@ -355,6 +358,7 @@ struct MainWindowPrivate #ifdef Q_OS_WIN +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) /** * Creates an ActiveX widget on windows */ @@ -368,6 +372,7 @@ struct MainWindowPrivate return DockWidget; } #endif +#endif }; @@ -446,10 +451,12 @@ void MainWindowPrivate::createContent() DockWidget->connect(Action, SIGNAL(triggered()), SLOT(raise())); #ifdef Q_OS_WIN +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) if (!ads::CDockManager::testConfigFlag(ads::CDockManager::OpaqueUndocking)) { DockManager->addDockWidget(ads::CenterDockWidgetArea, createActiveXWidget(), RighDockArea); } +#endif #endif for (auto DockWidget : DockManager->dockWidgetsMap()) diff --git a/demo/demo.pro b/demo/demo.pro index 24a2965..db33bbe 100644 --- a/demo/demo.pro +++ b/demo/demo.pro @@ -4,8 +4,10 @@ TARGET = AdvancedDockingSystemDemo DESTDIR = $${ADS_OUT_ROOT}/lib QT += core gui widgets -win32 { -QT += axcontainer +lessThan(QT_MAJOR_VERSION, 6) { + win32 { + QT += axcontainer + } } CONFIG += c++14 diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 0288ae9..107180c 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -917,15 +917,15 @@ bool DockContainerWidgetPrivate::restoreSplitter(CDockingStateReader& s, { QWidget* ChildNode = nullptr; bool Result = true; - if (s.name() == "Splitter") + if (s.name() == QLatin1String("Splitter")) { Result = restoreSplitter(s, ChildNode, Testing); } - else if (s.name() == "Area") + else if (s.name() == QLatin1String("Area")) { Result = restoreDockArea(s, ChildNode, Testing); } - else if (s.name() == "Sizes") + else if (s.name() == QLatin1String("Sizes")) { QString sSizes = s.readElementText().trimmed(); ADS_PRINT("Sizes: " << sSizes); @@ -1026,7 +1026,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(CDockingStateReader& s, while (s.readNextStartElement()) { - if (s.name() != "Widget") + if (s.name() != QLatin1String("Widget")) { continue; } @@ -1089,12 +1089,12 @@ bool DockContainerWidgetPrivate::restoreChildNodes(CDockingStateReader& s, bool Result = true; while (s.readNextStartElement()) { - if (s.name() == "Splitter") + if (s.name() == QLatin1String("Splitter")) { Result = restoreSplitter(s, CreatedWidget, Testing); ADS_PRINT("Splitter"); } - else if (s.name() == "Area") + else if (s.name() == QLatin1String("Area")) { Result = restoreDockArea(s, CreatedWidget, Testing); ADS_PRINT("DockAreaWidget"); @@ -1664,7 +1664,7 @@ bool CDockContainerWidget::restoreState(CDockingStateReader& s, bool Testing) if (IsFloating) { ADS_PRINT("Restore floating widget"); - if (!s.readNextStartElement() || s.name() != "Geometry") + if (!s.readNextStartElement() || s.name() != QLatin1String("Geometry")) { return false; } diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 67cf210..9ef4a08 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -250,7 +250,7 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi } CDockingStateReader s(state); s.readNextStartElement(); - if (s.name() != "QtAdvancedDockingSystem") + if (s.name() != QLatin1String("QtAdvancedDockingSystem")) { return false; } @@ -304,7 +304,7 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi int DockContainerCount = 0; while (s.readNextStartElement()) { - if (s.name() == "Container") + if (s.name() == QLatin1String("Container")) { Result = restoreContainer(DockContainerCount, s, Testing); if (!Result) diff --git a/src/DockOverlay.cpp b/src/DockOverlay.cpp index f23a834..5fd92b3 100644 --- a/src/DockOverlay.cpp +++ b/src/DockOverlay.cpp @@ -806,10 +806,15 @@ void CDockOverlayCross::setIconColors(const QString& Colors) {"Arrow", CDockOverlayCross::ArrowColor}, {"Shadow", CDockOverlayCross::ShadowColor}}; - auto ColorList = Colors.split(' ', QString::SkipEmptyParts); +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + auto SkipEmptyParts = QString::SkipEmptyParts; +#else + auto SkipEmptyParts = Qt::SkipEmptyParts; +#endif + auto ColorList = Colors.split(' ', SkipEmptyParts); for (const auto& ColorListEntry : ColorList) { - auto ComponentColor = ColorListEntry.split('=', QString::SkipEmptyParts); + auto ComponentColor = ColorListEntry.split('=', SkipEmptyParts); int Component = ColorCompenentStringMap.value(ComponentColor[0], -1); if (Component < 0) { diff --git a/src/DockSplitter.cpp b/src/DockSplitter.cpp index 047f0f4..33f6172 100644 --- a/src/DockSplitter.cpp +++ b/src/DockSplitter.cpp @@ -31,7 +31,7 @@ #include #include - +#include #include "DockAreaWidget.h" namespace ads @@ -52,7 +52,7 @@ CDockSplitter::CDockSplitter(QWidget *parent) : QSplitter(parent), d(new DockSplitterPrivate(this)) { - setProperty("ads-splitter", true); + setProperty("ads-splitter", QVariant(true)); setChildrenCollapsible(false); } diff --git a/src/ElidingLabel.cpp b/src/ElidingLabel.cpp index 7725b9b..b95a7f6 100644 --- a/src/ElidingLabel.cpp +++ b/src/ElidingLabel.cpp @@ -163,7 +163,12 @@ void CElidingLabel::resizeEvent(QResizeEvent *event) //============================================================================ QSize CElidingLabel::minimumSizeHint() const { - if (pixmap() != nullptr || d->isModeElideNone()) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + bool NoPixmap = pixmap().isNull(); +#else + bool NoPixmap = (pixmap() == nullptr); +#endif + if (NoPixmap || d->isModeElideNone()) { return QLabel::minimumSizeHint(); } @@ -180,7 +185,12 @@ QSize CElidingLabel::minimumSizeHint() const //============================================================================ QSize CElidingLabel::sizeHint() const { - if (pixmap() != nullptr || d->isModeElideNone()) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + bool NoPixmap = pixmap().isNull(); +#else + bool NoPixmap = (pixmap() == nullptr); +#endif + if (NoPixmap || d->isModeElideNone()) { return QLabel::sizeHint(); } diff --git a/src/ElidingLabel.h b/src/ElidingLabel.h index 89a31e7..7db7de5 100644 --- a/src/ElidingLabel.h +++ b/src/ElidingLabel.h @@ -58,8 +58,8 @@ protected: public: using Super = QLabel; - CElidingLabel(QWidget* parent = 0, Qt::WindowFlags f = 0); - CElidingLabel(const QString& text, QWidget* parent = 0, Qt::WindowFlags f = 0); + CElidingLabel(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags ()); + CElidingLabel(const QString& text, QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags ()); virtual ~CElidingLabel(); /** diff --git a/src/FloatingDockContainer.cpp b/src/FloatingDockContainer.cpp index 55979f3..a60f1e2 100644 --- a/src/FloatingDockContainer.cpp +++ b/src/FloatingDockContainer.cpp @@ -733,8 +733,11 @@ void CFloatingDockContainer::changeEvent(QEvent *event) #ifdef Q_OS_WIN -//============================================================================ +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) bool CFloatingDockContainer::nativeEvent(const QByteArray &eventType, void *message, long *result) +#else +bool CFloatingDockContainer::nativeEvent(const QByteArray &eventType, void *message, qintptr *result) +#endif { QWidget::nativeEvent(eventType, message, result); MSG *msg = static_cast(message); diff --git a/src/FloatingDockContainer.h b/src/FloatingDockContainer.h index a22d394..1265332 100644 --- a/src/FloatingDockContainer.h +++ b/src/FloatingDockContainer.h @@ -194,7 +194,11 @@ protected: // reimplements QWidget /** * Native event filter for handling WM_MOVING messages on Windows */ - virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; +#else + virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; +#endif #endif diff --git a/src/ads_globals.h b/src/ads_globals.h index c5fe28d..2a22c0e 100644 --- a/src/ads_globals.h +++ b/src/ads_globals.h @@ -179,7 +179,7 @@ void hideEmptyParentSplitters(CDockSplitter* FirstParentSplitter); class CDockInsertParam : public QPair { public: - using QPair::QPair; + using QPair::QPair; Qt::Orientation orientation() const {return this->first;} bool append() const {return this->second;} int insertOffset() const {return append() ? 1 : 0;} From e55ad49db8903b2ca1425ae6c25b275ebfca8e95 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 19:48:34 +0100 Subject: [PATCH 02/12] Created ads.pri to ease linking of ads library --- demo/demo.pro | 23 ++--------------------- examples/centralwidget/centralwidget.pro | 23 +---------------------- examples/deleteonclose/deleteonclose.pro | 23 +---------------------- examples/sidebar/sidebar.pro | 23 +---------------------- examples/simple/simple.pro | 23 +---------------------- 5 files changed, 6 insertions(+), 109 deletions(-) diff --git a/demo/demo.pro b/demo/demo.pro index db33bbe..80ad866 100644 --- a/demo/demo.pro +++ b/demo/demo.pro @@ -4,6 +4,8 @@ TARGET = AdvancedDockingSystemDemo DESTDIR = $${ADS_OUT_ROOT}/lib QT += core gui widgets +include(../ads.pri) + lessThan(QT_MAJOR_VERSION, 6) { win32 { QT += axcontainer @@ -37,26 +39,5 @@ RESOURCES += demo.qrc LIBS += -L$${ADS_OUT_ROOT}/lib -# Dependency: AdvancedDockingSystem (shared) -CONFIG(debug, debug|release){ - win32 { - LIBS += -lqtadvanceddockingd - } - else:mac { - LIBS += -lqtadvanceddocking_debug - } - else { - LIBS += -lqtadvanceddocking - } -} -else{ - LIBS += -lqtadvanceddocking -} - -unix:!macx { - LIBS += -lxcb - QT += x11extras -} - INCLUDEPATH += ../src DEPENDPATH += ../src diff --git a/examples/centralwidget/centralwidget.pro b/examples/centralwidget/centralwidget.pro index f5bb92b..738ae78 100644 --- a/examples/centralwidget/centralwidget.pro +++ b/examples/centralwidget/centralwidget.pro @@ -28,28 +28,7 @@ FORMS += \ mainwindow.ui LIBS += -L$${ADS_OUT_ROOT}/lib - -# Dependency: AdvancedDockingSystem (shared) -CONFIG(debug, debug|release){ - win32 { - LIBS += -lqtadvanceddockingd - } - else:mac { - LIBS += -lqtadvanceddocking_debug - } - else { - LIBS += -lqtadvanceddocking - } -} -else{ - LIBS += -lqtadvanceddocking -} - -unix:!macx { - LIBS += -lxcb - QT += x11extras -} - +include(../../ads.pri) INCLUDEPATH += ../../src DEPENDPATH += ../../src diff --git a/examples/deleteonclose/deleteonclose.pro b/examples/deleteonclose/deleteonclose.pro index 8e835ee..95d1db0 100644 --- a/examples/deleteonclose/deleteonclose.pro +++ b/examples/deleteonclose/deleteonclose.pro @@ -17,28 +17,7 @@ SOURCES += main.cpp LIBS += -L$${ADS_OUT_ROOT}/lib - -# Dependency: AdvancedDockingSystem (shared) -CONFIG(debug, debug|release){ - win32 { - LIBS += -lqtadvanceddockingd - } - else:mac { - LIBS += -lqtadvanceddocking_debug - } - else { - LIBS += -lqtadvanceddocking - } -} -else{ - LIBS += -lqtadvanceddocking -} - -unix:!macx { - LIBS += -lxcb - QT += x11extras -} - +include(../../ads.pri) INCLUDEPATH += ../../src DEPENDPATH += ../../src diff --git a/examples/sidebar/sidebar.pro b/examples/sidebar/sidebar.pro index 659bce5..6d7b445 100644 --- a/examples/sidebar/sidebar.pro +++ b/examples/sidebar/sidebar.pro @@ -25,28 +25,7 @@ FORMS += \ LIBS += -L$${ADS_OUT_ROOT}/lib - -# Dependency: AdvancedDockingSystem (shared) -CONFIG(debug, debug|release){ - win32 { - LIBS += -lqtadvanceddockingd - } - else:mac { - LIBS += -lqtadvanceddocking_debug - } - else { - LIBS += -lqtadvanceddocking - } -} -else{ - LIBS += -lqtadvanceddocking -} - -unix:!macx { - LIBS += -lxcb - QT += x11extras -} - +include(../../ads.pri) INCLUDEPATH += ../../src DEPENDPATH += ../../src diff --git a/examples/simple/simple.pro b/examples/simple/simple.pro index cb76cea..92a166b 100644 --- a/examples/simple/simple.pro +++ b/examples/simple/simple.pro @@ -25,28 +25,7 @@ FORMS += \ LIBS += -L$${ADS_OUT_ROOT}/lib - -# Dependency: AdvancedDockingSystem (shared) -CONFIG(debug, debug|release){ - win32 { - LIBS += -lqtadvanceddockingd - } - else:mac { - LIBS += -lqtadvanceddocking_debug - } - else { - LIBS += -lqtadvanceddocking - } -} -else{ - LIBS += -lqtadvanceddocking -} - -unix:!macx { - LIBS += -lxcb - QT += x11extras -} - +include(../../ads.pri) INCLUDEPATH += ../../src DEPENDPATH += ../../src From fe1d9a493fdee620d2a1231da659710d7db41d01 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 19:51:50 +0100 Subject: [PATCH 03/12] Fixed warning in centralwidget example because of missing svg file --- examples/centralwidget/mainwindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/centralwidget/mainwindow.cpp b/examples/centralwidget/mainwindow.cpp index c5d49b5..7243a5c 100644 --- a/examples/centralwidget/mainwindow.cpp +++ b/examples/centralwidget/mainwindow.cpp @@ -103,7 +103,6 @@ CMainWindow::~CMainWindow() void CMainWindow::createPerspectiveUi() { SavePerspectiveAction = new QAction("Create Perspective", this); - SavePerspectiveAction->setIcon(svgIcon(":/adsdemo/images/picture_in_picture.svg")); connect(SavePerspectiveAction, SIGNAL(triggered()), SLOT(savePerspective())); PerspectiveListAction = new QWidgetAction(this); PerspectiveComboBox = new QComboBox(this); From 8d14068df71c1b9d8eb8910516fa602139cf6d94 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 20:29:59 +0100 Subject: [PATCH 04/12] Fixed QMouseEvent::globalPos() warning --- demo/main.cpp | 2 ++ examples/centralwidget/mainwindow.cpp | 11 ----------- src/DockWidgetTab.cpp | 12 ++++++------ src/ads_globals.h | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/demo/main.cpp b/demo/main.cpp index 48c725a..a948786 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -35,9 +35,11 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS int main(int argc, char *argv[]) { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #if QT_VERSION >= 0x050600 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif #endif std::shared_ptr b; QApplication a(argc, argv); diff --git a/examples/centralwidget/mainwindow.cpp b/examples/centralwidget/mainwindow.cpp index 7243a5c..eb964f4 100644 --- a/examples/centralwidget/mainwindow.cpp +++ b/examples/centralwidget/mainwindow.cpp @@ -26,17 +26,6 @@ using namespace ads; -/** - * Helper function to create an SVG icon - */ -static QIcon svgIcon(const QString& File) -{ - // This is a workaround, because in item views SVG icons are not - // properly scaled and look blurry or pixelate - QIcon SvgIcon(File); - SvgIcon.addPixmap(SvgIcon.pixmap(92)); - return SvgIcon; -} CMainWindow::CMainWindow(QWidget *parent) : QMainWindow(parent) diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index ca299fe..8bea5d2 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -259,7 +259,7 @@ void DockWidgetTabPrivate::createLayout() void DockWidgetTabPrivate::moveTab(QMouseEvent* ev) { ev->accept(); - QPoint Distance = ev->globalPos() - GlobalDragStartMousePosition; + QPoint Distance = internal::globalPositionOf(ev) - GlobalDragStartMousePosition; Distance.setY(0); auto TargetPos = Distance + TabDragStartPosition; TargetPos.rx() = qMax(TargetPos.x(), 0); @@ -351,7 +351,7 @@ void CDockWidgetTab::mousePressEvent(QMouseEvent* ev) if (ev->button() == Qt::LeftButton) { ev->accept(); - d->saveDragStartMousePosition(ev->globalPos()); + d->saveDragStartMousePosition(internal::globalPositionOf(ev)); d->DragState = DraggingMousePressed; emit clicked(); return; @@ -377,7 +377,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev) // End of tab moving, emit signal if (d->DockArea) { - emit moved(ev->globalPos()); + emit moved(internal::globalPositionOf(ev)); } break; @@ -422,7 +422,7 @@ void CDockWidgetTab::mouseMoveEvent(QMouseEvent* ev) auto MappedPos = mapToParent(ev->pos()); bool MouseOutsideBar = (MappedPos.x() < 0) || (MappedPos.x() > parentWidget()->rect().right()); // Maybe a fixed drag distance is better here ? - int DragDistanceY = qAbs(d->GlobalDragStartMousePosition.y() - ev->globalPos().y()); + int DragDistanceY = qAbs(d->GlobalDragStartMousePosition.y() - internal::globalPositionOf(ev).y()); if (DragDistanceY >= CDockManager::startDragDistance() || MouseOutsideBar) { // If this is the last dock area in a dock container with only @@ -454,7 +454,7 @@ void CDockWidgetTab::mouseMoveEvent(QMouseEvent* ev) return; } else if (d->DockArea->openDockWidgetsCount() > 1 - && (ev->globalPos() - d->GlobalDragStartMousePosition).manhattanLength() >= QApplication::startDragDistance()) // Wait a few pixels before start moving + && (internal::globalPositionOf(ev) - d->GlobalDragStartMousePosition).manhattanLength() >= QApplication::startDragDistance()) // Wait a few pixels before start moving { // If we start dragging the tab, we save its inital position to // restore it later @@ -618,7 +618,7 @@ void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event) if ((!d->DockArea->dockContainer()->isFloating() || d->DockArea->dockWidgetsCount() > 1) && d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable)) { - d->saveDragStartMousePosition(event->globalPos()); + d->saveDragStartMousePosition(internal::globalPositionOf(event)); d->startFloating(DraggingInactive); } diff --git a/src/ads_globals.h b/src/ads_globals.h index 2a22c0e..9705544 100644 --- a/src/ads_globals.h +++ b/src/ads_globals.h @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef Q_OS_LINUX #include @@ -260,6 +261,19 @@ void setToolTip(QObjectPtr obj, const QString &tip) } +/** + * Helper function for access to mouse event global position in Qt5 and + */ +inline QPoint globalPositionOf(QMouseEvent* ev) +{ +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + return ev->globalPosition().toPoint(); +#else + return ev->globalPos(); +#endif +} + + /** * Helper function to set the icon of a certain button. * Use this function to set the icons for the dock area and dock widget buttons. From 0312682e070065e0c7aa70fc29d5c96a8119e40c Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 20:50:26 +0100 Subject: [PATCH 05/12] Fixed wrong pixmap is null test in ElidingLabel --- src/ElidingLabel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ElidingLabel.cpp b/src/ElidingLabel.cpp index b95a7f6..75dc289 100644 --- a/src/ElidingLabel.cpp +++ b/src/ElidingLabel.cpp @@ -164,11 +164,11 @@ void CElidingLabel::resizeEvent(QResizeEvent *event) QSize CElidingLabel::minimumSizeHint() const { #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) - bool NoPixmap = pixmap().isNull(); + bool HasPixmap = !pixmap().isNull(); #else - bool NoPixmap = (pixmap() == nullptr); + bool HasPixmap = (pixmap() != nullptr); #endif - if (NoPixmap || d->isModeElideNone()) + if (HasPixmap || d->isModeElideNone()) { return QLabel::minimumSizeHint(); } @@ -186,11 +186,11 @@ QSize CElidingLabel::minimumSizeHint() const QSize CElidingLabel::sizeHint() const { #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) - bool NoPixmap = pixmap().isNull(); + bool HasPixmap = !pixmap().isNull(); #else - bool NoPixmap = (pixmap() == nullptr); + bool HasPixmap = (pixmap() != nullptr); #endif - if (NoPixmap || d->isModeElideNone()) + if (HasPixmap || d->isModeElideNone()) { return QLabel::sizeHint(); } From d8c6efaadaaee31f8b6fa0f9b205d475ebe62122 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 21:05:05 +0100 Subject: [PATCH 06/12] Fixed signal connection of perspective combobox --- demo/MainWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 4223926..63eaa45 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -617,8 +617,13 @@ CMainWindow::CMainWindow(QWidget *parent) : // Now create the dock manager and its content d->DockManager = new CDockManager(this); + #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)), d->DockManager, SLOT(openPerspective(const QString&))); + #else + connect(d->PerspectiveComboBox, SIGNAL(textActivated(const QString&)), + d->DockManager, SLOT(openPerspective(const QString&))); + #endif d->createContent(); // Default window geometry - center on screen From a4190ecbf0cc0d6b421420aa9a52e77d505a439d Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 2 Jan 2021 23:17:44 +0100 Subject: [PATCH 07/12] Added missing ads.pri fle --- ads.pri | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ads.pri diff --git a/ads.pri b/ads.pri new file mode 100644 index 0000000..e75733f --- /dev/null +++ b/ads.pri @@ -0,0 +1,28 @@ + +lessThan(QT_MAJOR_VERSION, 6) { + CONFIG(debug, debug|release){ + win32 { + LIBS += -lqtadvanceddockingd + } + else:mac { + LIBS += -lqtadvanceddocking_debug + } + else { + LIBS += -lqtadvanceddocking + } + } + else{ + LIBS += -lqtadvanceddocking + } +} +else { + # qt$$qtLibraryTarget(qtadvanceddocking) does not produce an advanceddockingd.dll file on Windows + # for Qt6 - I don't know if this is a bug and I have to investigate + LIBS += -lqtadvanceddocking +} + + +unix:!macx { + LIBS += -lxcb + QT += x11extras +} From b0c8edbd82ade8e1924936015495a98eca32ed0e Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sun, 3 Jan 2021 15:50:16 +0100 Subject: [PATCH 08/12] Added Qt6 MinGW build to .appveyor.yml --- .appveyor.yml | 59 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 9771255..8e9faf5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -10,18 +10,19 @@ environment: # Appveyor doesn't have Qt 12 yet LatestQtVersion: 5.13 matrix: + # 32 bit builds -# MSVC 2015 builds +# MSVC 2017 builds # Dynamic Library builds - # LTS version of Qt, dll, 32bit, MSVC 2015, qmake - - QT5: C:\Qt\%LatestQtVersion%\msvc2017 + # LTS version of Qt, dll, 32bit, MSVC 2017, qmake + - QT: 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 + # LTS version of Qt, dll, 32bit, MSVC 2017, cmake + - QT: C:\Qt\%LatestQtVersion%\msvc2017 COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build targetPlatform: x86 use_mingw: "false" @@ -29,33 +30,34 @@ environment: use_cmake: "true" # end Dynamic Library builds # Static Library builds - # LTS version of Qt, static, 32bit, MSVC 2015, qmake - - QT5: C:\Qt\%LatestQtVersion%\msvc2017 + # LTS version of Qt, static, 32bit, MSVC 2017, qmake + - QT: 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 + # LTS version of Qt, static, 32bit, MSVC 2017, cmake + - QT: 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 +# end MSVC 2017 builds + # MinGW builds # Dynamic Library builds # LTS version of Qt, dll, 32bit, MinGW, qmake - - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT: 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 + - QT: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" @@ -64,14 +66,14 @@ environment: # end Dynamic Library builds # Static Library builds # LTS version of Qt, static, 32bit, MinGW, qmake - - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT: 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 + - QT: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" @@ -80,18 +82,19 @@ environment: # end Static Library builds # end MinGW builds # end 32 bit builds + # 64 bit builds -# MSVC 2015 builds +# MSVC 2017 builds # Dynamic Library builds - # LTS version of Qt, dll, 64bit, MSVC 2015, qmake - - QT5: C:\Qt\%LatestQtVersion%\msvc2017_64 + # LTS version of Qt, dll, 64bit, MSVC 2017, qmake + - QT: 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 + # LTS version of Qt, dll, 64bit, MSVC 2017, cmake + - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build targetPlatform: amd64 use_mingw: "false" @@ -99,15 +102,15 @@ environment: 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 + # LTS version of Qt, static, 64bit, MSVC 2017, qmake + - QT: 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 + # LTS version of Qt, static, 64bit, MSVC 2017, cmake + - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build targetPlatform: amd64 use_mingw: "false" @@ -115,6 +118,14 @@ environment: use_cmake: "true" # end Static Library builds # end MSVC 2015 builds +# MinGW builds + - QT: C:\Qt\6.0.0\mingw81_64 + COMPILER: C:\Qt\Tools\mingw81_64 + targetPlatform: amd64 + use_mingw: "true" + use_static: "false" + use_cmake: "false" +# end MinGW builds # end 64 bit builds matrix: @@ -122,7 +133,7 @@ matrix: before_build: - set originalWD=%CD% -- call "%QT5%\bin\qtenv2.bat" +- call "%QT%\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) From a1c4812619dffaec066c063be7e44fad661850f8 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sun, 3 Jan 2021 16:38:56 +0100 Subject: [PATCH 09/12] Try to fix Qt6 build --- .appveyor.yml | 90 ++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8e9faf5..f9deb4b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,42 +11,16 @@ environment: LatestQtVersion: 5.13 matrix: -# 32 bit builds -# MSVC 2017 builds -# Dynamic Library builds - # LTS version of Qt, dll, 32bit, MSVC 2017, qmake - - QT: 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 2017, cmake - - QT: 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 2017, qmake - - QT: 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 2017, cmake - - QT: 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 2017 builds + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + QT: C:\Qt\6.0.0\msvc2019_64 + COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build + targetPlatform: amd64 + use_mingw: "false" + use_static: "false" + use_cmake: "false" + +# 32 bit builds # MinGW builds # Dynamic Library builds # LTS version of Qt, dll, 32bit, MinGW, qmake @@ -81,6 +55,40 @@ environment: use_cmake: "true" # end Static Library builds # end MinGW builds +# MSVC 2017 builds +# Dynamic Library builds + # LTS version of Qt, dll, 32bit, MSVC 2017, qmake + - QT: 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 2017, cmake + - QT: 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 2017, qmake + - QT: 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 2017, cmake + - QT: 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 2017 builds # end 32 bit builds # 64 bit builds @@ -118,16 +126,9 @@ environment: use_cmake: "true" # end Static Library builds # end MSVC 2015 builds -# MinGW builds - - QT: C:\Qt\6.0.0\mingw81_64 - COMPILER: C:\Qt\Tools\mingw81_64 - targetPlatform: amd64 - use_mingw: "true" - use_static: "false" - use_cmake: "false" -# end MinGW builds # end 64 bit builds + matrix: fast_finish: true @@ -139,9 +140,10 @@ before_build: - 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;=% +- if %use_mingw%==true set PATH=%PATH%:C:\Program Files\Git\usr\bin;=% build_script: +- echo %PATH% - if %use_cmake%==true mkdir build - if %use_cmake%==true cd build - if %use_cmake%==true cmake --version From 6ee97e64d7fa0918794f62b1fc448e3e0ef68681 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sun, 3 Jan 2021 17:14:39 +0100 Subject: [PATCH 10/12] Disabled Qt6 build in appveyor - it does not work properly yet --- .appveyor.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f9deb4b..970333f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,15 +11,6 @@ environment: LatestQtVersion: 5.13 matrix: - - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - QT: C:\Qt\6.0.0\msvc2019_64 - COMPILER: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build - targetPlatform: amd64 - use_mingw: "false" - use_static: "false" - use_cmake: "false" - # 32 bit builds # MinGW builds # Dynamic Library builds @@ -125,7 +116,7 @@ environment: use_static: "true" use_cmake: "true" # end Static Library builds -# end MSVC 2015 builds +# end MSVC 2017 builds # end 64 bit builds From 97215705f5054ae8f08ba1f0d4f643d5a9fb2da1 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sun, 3 Jan 2021 17:15:39 +0100 Subject: [PATCH 11/12] Improved documentation for Linux support --- .appveyor.yml | 104 ++++++++++++++++++++++++-------------------------- README.md | 42 +++++++++++++------- 2 files changed, 79 insertions(+), 67 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 970333f..9771255 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -10,19 +10,52 @@ environment: # 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 - - QT: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" use_static: "false" use_cmake: "false" # LTS version of Qt, dll, 32bit, MinGW, cmake - - QT: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" @@ -31,14 +64,14 @@ environment: # end Dynamic Library builds # Static Library builds # LTS version of Qt, static, 32bit, MinGW, qmake - - QT: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" use_static: "true" use_cmake: "false" # LTS version of Qt, static, 32bit, MinGW, cmake - - QT: C:\Qt\%LatestQtVersion%\mingw73_32 + - QT5: C:\Qt\%LatestQtVersion%\mingw73_32 COMPILER: C:\Qt\Tools\mingw730_32 targetPlatform: x86 use_mingw: "true" @@ -46,54 +79,19 @@ environment: use_cmake: "true" # end Static Library builds # end MinGW builds -# MSVC 2017 builds -# Dynamic Library builds - # LTS version of Qt, dll, 32bit, MSVC 2017, qmake - - QT: 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 2017, cmake - - QT: 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 2017, qmake - - QT: 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 2017, cmake - - QT: 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 2017 builds # end 32 bit builds - # 64 bit builds -# MSVC 2017 builds +# MSVC 2015 builds # Dynamic Library builds - # LTS version of Qt, dll, 64bit, MSVC 2017, qmake - - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 + # 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 2017, cmake - - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 + # 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" @@ -101,40 +99,38 @@ environment: use_cmake: "true" # end Dynamic Library builds # Static Library builds - # LTS version of Qt, static, 64bit, MSVC 2017, qmake - - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 + # 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 2017, cmake - - QT: C:\Qt\%LatestQtVersion%\msvc2017_64 + # 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 2017 builds +# end MSVC 2015 builds # end 64 bit builds - matrix: fast_finish: true before_build: - set originalWD=%CD% -- call "%QT%\bin\qtenv2.bat" +- 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;=% +- if %use_mingw%==true set PATH=%PATH:C:\Program Files\Git\usr\bin;=% build_script: -- echo %PATH% - if %use_cmake%==true mkdir build - if %use_cmake%==true cd build - if %use_cmake%==true cmake --version diff --git a/README.md b/README.md index 86ab5a0..513e9ac 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ integrated development environments (IDEs) such as Visual Studio. ## New and Noteworthy +The [release 3.7.0](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.7.0) +adds support for Qt6. + The [release 3.6.0](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.6.0) adds some nice new features: @@ -56,6 +59,7 @@ know it from Visual Studio. - [Supports deletion of dynamically created dock widgets](#supports-deletion-of-dynamically-created-dock-widgets) - [Python PyQt5 Bindings](#python-pyqt5-bindings) - [Tested Compatible Environments](#tested-compatible-environments) + - [Supported Qt Versions](#supported-qt-versions) - [Windows](#windows) - [macOS](#macos) - [Linux](#linux) @@ -81,8 +85,8 @@ There is no central widget like in the Qt docking system. You can dock on every border of the main window or you can dock into each dock area - so you are free to dock almost everywhere. -![Dropping widgets](doc/preview-dragndrop.png)\ -\ +![Dropping widgets](doc/preview-dragndrop.png) + ![Dropping widgets](doc/preview-dragndrop_dark.png) ### Docking inside floating windows @@ -90,8 +94,8 @@ free to dock almost everywhere. There is no difference between the main window and a floating window. Docking into floating windows is supported. -![Docking inside floating windows](doc/floating-widget-dragndrop.png)\ -\ +![Docking inside floating windows](doc/floating-widget-dragndrop.png) + ![Docking inside floating windows](doc/floating-widget-dragndrop_dark.png) ### Grouped dragging @@ -100,8 +104,8 @@ When dragging the titlebar of a dock, all the tabs that are tabbed with it are going to be dragged. So you can move complete groups of tabbed widgets into a floating widget or from one dock area to another one. -![Grouped dragging](doc/grouped-dragging.gif)\ -\ +![Grouped dragging](doc/grouped-dragging.gif) + ![Grouped dragging](doc/grouped-dragging_dark.png) ### Perspectives for fast switching of the complete main window layout @@ -112,13 +116,13 @@ perspective to make your own custom perspective. Later you can simply select a perspective from the perspective list to quickly switch the complete main window layout. -![Perspective](doc/perspectives.gif)\ -\ +![Perspective](doc/perspectives.gif) + ![Perspective](doc/perspectives_dark.png) ### Opaque and non-opaque splitter resizing -The advanced docking system uses standard QSplitters as resize separators and thus supports opaque and non-opaque resizing functionality of QSplitter. In some rare cases, for very complex widgets or on slow machines resizing via separator on the fly may cause flicking and glaring of rendered content inside a widget. The global dock manager flag `OpaqueSplitterResize` configures the resizing behaviour of the splitters. If this flag is set, then widgets are resized dynamically (opaquely) while interactively moving the splitters. +The advanced docking system uses standard QSplitters as resize separators and thus supports opaque and non-opaque resizing functionality of QSplitter. In some rare cases, for very complex widgets or on slow machines resizing via separator on the fly may cause flicking and glaring of rendered content inside a widget. The global dock manager flag `OpaqueSplitterResize` configures the resizing behaviour of the splitters. If this flag is set, then widgets are resized dynamically (opaquely) while interactively moving the splitters. ![Opaque resizing](doc/opaque_resizing.gif) @@ -171,6 +175,10 @@ Latest working version: [3.5.2](https://github.com/githubuser0xFFFF/Qt-Advanced- ## Tested Compatible Environments +### Supported Qt Versions + +The library supports **Qt5** and **Qt6**. + ### Windows Windows 10 [![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master) @@ -187,15 +195,23 @@ The application can be compiled for macOS. A user reported, that the library wor ### Linux -Ubuntu [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System) +[![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System) [![Build status](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/workflows/linux-builds/badge.svg)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions?query=workflow%3Alinux-builds) -The application can be compiled for Linux and has been developed and tested with **Kubuntu 18.04** and **Kubuntu 19.10**. +Unfortunately, there is no such thing as a Linux operating system. Linux is a heterogeneous environment with a variety of different distributions. So it is not possible to support "Linux" like this is possible for Windows. It is only possible to support and test a small subset of Linux distributions. The library can be compiled for and has been developed and tested with the following Linux distributions: +- **Kubuntu 18.04 and 19.10** +- **Ubuntu 18.04, 19.10 and 20.04** + +There are some requirements for the Linux distribution that have to be met: + +- an X server that supports ARGB visuals and a compositing window manager. This is required to display the translucent dock overlays ([https://doc.qt.io/qt-5/qwidget.html#creating-translucent-windows](https://doc.qt.io/qt-5/qwidget.html#creating-translucent-windows)). If your Linux distribution does not support this, or if you disable this feature, you will very likely see issue [#95](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/95). +- Wayland is not properly supported by Qt yet. If you use Wayland, then you should set the session type to x11: `XDG_SESSION_TYPE=x11 ./AdvancedDockingSystemDemo`. You will find more details about this in issue [#288](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/288). + +Screenshot Kubuntu: ![Advanced Docking on Kubuntu Linux](doc/linux_kubuntu_1804.png) -and with **Ubuntu 19.10** - +Screenshot Ubuntu: ![Advanced Docking on Ubuntu Linux](doc/linux_ubuntu_1910.png) ## Build From f835ffd9786069c541c8601d3fb42b0abc12dcae Mon Sep 17 00:00:00 2001 From: Nicolas Elie <40382614+n-elie@users.noreply.github.com> Date: Mon, 4 Jan 2021 14:01:28 +0100 Subject: [PATCH 12/12] Update Python bindings (#289) * Update Python bindings * Add X11Extras to setup.py for Linux builds * Update Python Bindings * Update Python bindings --- demo/demo.py | 1 + examples/centralwidget/centralWidget.py | 5 +++++ sip/DockManager.sip | 4 +++- sip/DockWidgetTab.sip | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/demo/demo.py b/demo/demo.py index 5ba8d42..1254eef 100644 --- a/demo/demo.py +++ b/demo/demo.py @@ -359,6 +359,7 @@ class MainWindow(MainWindowUI, MainWindowBase): floating = sender.property("Floating") dock_widget = self.create_editor_widget() dock_widget.setFeature(QtAds.CDockWidget.DockWidgetDeleteOnClose, True) + dock_widget.setFeature(QtAds.CDockWidget.DockWidgetForceCloseWithArea, True) dock_widget.closeRequested.connect(self.on_editor_close_requested) if floating: diff --git a/examples/centralwidget/centralWidget.py b/examples/centralwidget/centralWidget.py index e3f31c6..581b00d 100644 --- a/examples/centralwidget/centralWidget.py +++ b/examples/centralwidget/centralWidget.py @@ -106,6 +106,11 @@ class MainWindow(MainWindowUI, MainWindowBase): 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) diff --git a/sip/DockManager.sip b/sip/DockManager.sip index b76ee25..941fca7 100644 --- a/sip/DockManager.sip +++ b/sip/DockManager.sip @@ -135,7 +135,6 @@ protected: ads::CDockOverlay* dockAreaOverlay() const; void notifyWidgetOrAreaRelocation(QWidget* RelocatedWidget); void notifyFloatingWidgetDrop(ads::CFloatingDockContainer* FloatingWidget); - ads::CDockWidget* focusedDockWidget() const; virtual void showEvent(QShowEvent *event); @@ -217,6 +216,9 @@ public: void setViewMenuInsertionOrder(ads::CDockManager::eViewMenuInsertionOrder Order); bool isRestoringState() const; static int startDragDistance(); + ads::CDockWidget* focusedDockWidget() const; + QList splitterSizes(ads::CDockAreaWidget *ContainedArea) const; + void setSplitterSizes(ads::CDockAreaWidget *ContainedArea, const QList& sizes); public slots: void openPerspective(const QString& PerspectiveName); diff --git a/sip/DockWidgetTab.sip b/sip/DockWidgetTab.sip index 32d819b..0bc610a 100644 --- a/sip/DockWidgetTab.sip +++ b/sip/DockWidgetTab.sip @@ -35,6 +35,8 @@ public: virtual bool event(QEvent *e); void setElideMode(Qt::TextElideMode mode); void updateStyle(); + QSize iconSize() const; + void setIconSize(const QSize& Size); public slots: virtual void setVisible(bool visible);