-
Notifications
You must be signed in to change notification settings - Fork 663
Description
Hi.
In December I created an issue about a specific problem and more information was requested on that issue. Unfortunately I was very busy at that time and didn't react in time, so that issue was understandably closed. The issue is still a problem for us though, and I hope it is OK if I add it here again - this time with more information.
The problem is, that when using the config flag "CDockManager::FocusHighlighting" and adding a new tab, that tab automatically receives the focus by ADS source code:
`
void CDockWidgetTab::setActiveTab(bool active)
{
d->updateCloseButtonVisibility(active);
// Focus related stuff
if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting) && !d->DockWidget->dockManager()->isRestoringState())
{
bool UpdateFocusStyle = false;
if (active && !hasFocus())
{
setFocus(Qt::OtherFocusReason);
UpdateFocusStyle = true;
}
`
The stack looks like this:
'
qtadvanceddockingd.dll!ads::CDockWidgetTab::setActiveTab
qtadvanceddockingd.dll!ads::DockAreaTabBarPrivate::updateTabs
qtadvanceddockingd.dll!ads::CDockAreaTabBar::setCurrentIndex
qtadvanceddockingd.dll!ads::CDockAreaTabBar::insertTab
qtadvanceddockingd.dll!ads::CDockAreaWidget::insertDockWidget
qtadvanceddockingd.dll!ads::CDockAreaWidget::addDockWidget
'
The problem is as follows:
In our software we have a selection tree view which displays a list of files in which you can select a file by clicking on it or by using the arrow keys (like in Visual Studio if the "Preview selected files" option is active). When focussing a file the software opens a new tab in the dock manager in which the contents are displayed (again like Visual Studio). When the user changes the focus in the file list, another tab is opened and so on. With the current behavior of the dock manager, if "FocusHighlighting" is active, the focus is "transferred" to the newly created dock. So imagine a user trying to use the arrow keys to open some files - this is not possible, because the first created dock will "steal" the focus away.
A simple solution would be to add another config flag like "AutoFocusOnSetActiveTab" or something similar.
Thanks.