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()
433
433
int Width = Splitter->width ();
434
434
Splitter->setSizes ({Width * 2 /3 , Width * 1 /3 });
435
435
});
436
+ DockWidget->setWindowTitle (QString (" My " + DockWidget->windowTitle ()));
436
437
437
438
// Now we add a custom button to the dock area title bar that will create
438
439
// new editor widgets when clicked
@@ -474,6 +475,7 @@ void MainWindowPrivate::createContent()
474
475
// Test visible floating dock widget
475
476
DockWidget = createCalendarDockWidget ();
476
477
DockManager->addDockWidgetFloating (DockWidget);
478
+ DockWidget->setWindowTitle (QString (" My " + DockWidget->windowTitle ()));
477
479
478
480
479
481
#ifdef Q_OS_WIN
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class CFloatingDragPreview;
51
51
struct FloatingDragPreviewPrivate ;
52
52
class CDockingStateReader ;
53
53
54
+
54
55
/* *
55
56
* Container that manages a number of dock areas with single dock widgets
56
57
* 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
456
456
}
457
457
458
458
459
+ // ============================================================================
460
+ CFloatingDockContainer* CDockWidget::floatingDockContainer () const
461
+ {
462
+ auto DockContainer = dockContainer ();
463
+ return DockContainer ? DockContainer->floatingWidget () : nullptr ;
464
+ }
465
+
466
+
459
467
// ============================================================================
460
468
CDockAreaWidget* CDockWidget::dockAreaWidget () const
461
469
{
@@ -670,6 +678,12 @@ bool CDockWidget::event(QEvent *e)
670
678
{
671
679
d->DockArea ->markTitleBarMenuOutdated ();// update tabs menu
672
680
}
681
+
682
+ auto FloatingWidget = floatingDockContainer ();
683
+ if (FloatingWidget)
684
+ {
685
+ FloatingWidget->updateWindowTitle ();
686
+ }
673
687
Q_EMIT titleChanged (title);
674
688
}
675
689
break ;
Original file line number Diff line number Diff line change @@ -331,6 +331,12 @@ private Q_SLOTS:
331
331
*/
332
332
CDockContainerWidget* dockContainer () const ;
333
333
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
+
334
340
/* *
335
341
* Returns the dock area widget this dock widget belongs to or 0
336
342
* if this dock widget has not been docked yet
You can’t perform that action at this time.
0 commit comments