diff --git a/examples/emptydockarea/mainwindow.cpp b/examples/emptydockarea/mainwindow.cpp index 2dbe99c..37994e6 100644 --- a/examples/emptydockarea/mainwindow.cpp +++ b/examples/emptydockarea/mainwindow.cpp @@ -32,9 +32,11 @@ 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 ); DockManager = new CDockManager(this); // Set central widget @@ -98,8 +100,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); diff --git a/src/DockAreaTitleBar.cpp b/src/DockAreaTitleBar.cpp index 8c19cfd..141c920 100644 --- a/src/DockAreaTitleBar.cpp +++ b/src/DockAreaTitleBar.cpp @@ -385,7 +385,10 @@ void CDockAreaTitleBar::resizeEvent(QResizeEvent *event) if (CDockManager::testConfigFlag(CDockManager::DockAreaDynamicTabsMenuButtonVisibility) && CDockManager::testConfigFlag(CDockManager::DisableTabTextEliding)) { - markTabsMenuOutdated(); + // Use queued connection to ensure that the resizing and relayouting has + // finished to ensure that the d->TabBar->areTabsOverflowing() function + // returns the correct value + QMetaObject::invokeMethod(this, "markTabsMenuOutdated", Qt::QueuedConnection); } }