File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,7 @@ void MainWindowPrivate::createContent()
433433 int Width = Splitter->width ();
434434 Splitter->setSizes ({Width * 2 /3 , Width * 1 /3 });
435435 });
436+ DockWidget->setWindowTitle (QString (" My " + DockWidget->windowTitle ()));
436437
437438 // Now we add a custom button to the dock area title bar that will create
438439 // new editor widgets when clicked
@@ -474,6 +475,7 @@ void MainWindowPrivate::createContent()
474475 // Test visible floating dock widget
475476 DockWidget = createCalendarDockWidget ();
476477 DockManager->addDockWidgetFloating (DockWidget);
478+ DockWidget->setWindowTitle (QString (" My " + DockWidget->windowTitle ()));
477479
478480
479481#ifdef Q_OS_WIN
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class CFloatingDragPreview;
5151struct FloatingDragPreviewPrivate ;
5252class CDockingStateReader ;
5353
54+
5455/* *
5556 * Container that manages a number of dock areas with single dock widgets
5657 * or tabyfied dock widgets in each area.
Original file line number Diff line number Diff line change @@ -456,6 +456,14 @@ CDockContainerWidget* CDockWidget::dockContainer() const
456456}
457457
458458
459+ // ============================================================================
460+ CFloatingDockContainer* CDockWidget::floatingDockContainer () const
461+ {
462+ auto DockContainer = dockContainer ();
463+ return DockContainer ? DockContainer->floatingWidget () : nullptr ;
464+ }
465+
466+
459467// ============================================================================
460468CDockAreaWidget* CDockWidget::dockAreaWidget () const
461469{
@@ -670,6 +678,12 @@ bool CDockWidget::event(QEvent *e)
670678 {
671679 d->DockArea ->markTitleBarMenuOutdated ();// update tabs menu
672680 }
681+
682+ auto FloatingWidget = floatingDockContainer ();
683+ if (FloatingWidget)
684+ {
685+ FloatingWidget->updateWindowTitle ();
686+ }
673687 Q_EMIT titleChanged (title);
674688 }
675689 break ;
Original file line number Diff line number Diff line change @@ -331,6 +331,12 @@ private Q_SLOTS:
331331 */
332332 CDockContainerWidget* dockContainer () const ;
333333
334+ /* *
335+ * This function return the floating DockContainer if is isFloating() is true
336+ * and a nullptr if this dock widget is not floating.
337+ */
338+ CFloatingDockContainer* floatingDockContainer () const ;
339+
334340 /* *
335341 * Returns the dock area widget this dock widget belongs to or 0
336342 * if this dock widget has not been docked yet
You can’t perform that action at this time.
0 commit comments