@@ -165,6 +165,7 @@ struct MainWindowPrivate
165165 QWidgetAction* PerspectiveListAction = nullptr ;
166166 QComboBox* PerspectiveComboBox = nullptr ;
167167 ads::CDockManager* DockManager = nullptr ;
168+ ads::CDockWidget* WindowTitleTestDockWidget = nullptr ;
168169
169170 MainWindowPrivate (CMainWindow* _public) : _this(_public) {}
170171
@@ -382,6 +383,7 @@ void MainWindowPrivate::createContent()
382383 }
383384
384385 DockWidget = createLongTextLabelDockWidget ();
386+ WindowTitleTestDockWidget = DockWidget;
385387 DockWidget->setFeature (ads::CDockWidget::DockWidgetFocusable, false );
386388 DockManager->addDockWidget (ads::LeftDockWidgetArea, DockWidget);
387389 auto FileSystemWidget = createFileSystemTreeDockWidget ();
@@ -496,6 +498,9 @@ void MainWindowPrivate::createActions()
496498 ui.menuTests ->addSeparator ();
497499 a = ui.menuTests ->addAction (" Show Status Dialog" );
498500 _this->connect (a, SIGNAL (triggered ()), SLOT (showStatusDialog ()));
501+
502+ a = ui.menuTests ->addAction (" Toggle Label 0 Window Title" );
503+ _this->connect (a, SIGNAL (triggered ()), SLOT (toggleDockWidgetWindowTitle ()));
499504 ui.menuTests ->addSeparator ();
500505}
501506
@@ -745,3 +750,20 @@ void CMainWindow::showStatusDialog()
745750 Dialog.exec ();
746751}
747752
753+
754+ // ============================================================================
755+ void CMainWindow::toggleDockWidgetWindowTitle ()
756+ {
757+ QString Title = d->WindowTitleTestDockWidget ->windowTitle ();
758+ int i = Title.indexOf (" (Test)" );
759+ if (-1 == i)
760+ {
761+ Title += " (Test)" ;
762+ }
763+ else
764+ {
765+ Title = Title.left (i);
766+ }
767+ d->WindowTitleTestDockWidget ->setWindowTitle (Title);
768+ }
769+
0 commit comments