File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,13 @@ CDockWidget* CDockFocusController::focusedDockWidget() const
423423}
424424
425425
426+ // ==========================================================================
427+ CDockAreaWidget* CDockFocusController::focusedDockArea () const
428+ {
429+ return d->FocusedArea .data ();
430+ }
431+
432+
426433// ==========================================================================
427434void CDockFocusController::setDockWidgetTabPressed (bool Value)
428435{
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ private Q_SLOTS:
6969 */
7070 CDockWidget* focusedDockWidget () const ;
7171
72+ /* *
73+ * Returns the dock area that contains the focusedDockWidget() or nullptr if
74+ * the focused dock widget is not in this area.
75+ */
76+ CDockAreaWidget* focusedDockArea () const ;
77+
7278 /* *
7379 * Request focus highlighting for the given dock widget assigned to the tab
7480 * given in Tab parameter
Original file line number Diff line number Diff line change @@ -599,9 +599,9 @@ void CDockWidgetTab::setActiveTab(bool active)
599599 if (CDockManager::testConfigFlag (CDockManager::FocusHighlighting) && !d->DockWidget ->dockManager ()->isRestoringState ())
600600 {
601601 bool UpdateFocusStyle = false ;
602- if (active && ! hasFocus ())
603- {
604- // setFocus(Qt::OtherFocusReason);
602+ // Update the focus only, if this the dock area of this tab is the focused dock area
603+ if (active && ! hasFocus () && (d-> focusController ()-> focusedDockArea () == this -> dockAreaWidget ()))
604+ {
605605 d->focusController ()->setDockWidgetTabFocused (this );
606606 UpdateFocusStyle = true ;
607607 }
You can’t perform that action at this time.
0 commit comments