Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable
-
Hi all,
I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418
The relevant problem is: A QDockWidget that is declared as non-closable but as floatable cannot be closed by clicking an "X" button (it's omitted then), but one can actually close such a floating dock nevertheless by using a keyboard shortcut (Alt+F4).
After that, there's no way to re-show that closed dock, as the menu bar's context menu containing checkboxes for all dock widgets is grayed out (it becomes enabled when adding docks with the QDockWidget::DockWidgetClosable feature set). The only way to get the dock back is to delete the window state from the rc file.
My understanding is that a QDockWidget that is marked as not closable should not only not be closable by omitting the "X"/"Close" button, but also an attempt to close it using keyboard shortcuts should be ignored, to also prevent it from closing this way.
@Axel-Spoerl Now that I know that you're the QDockWidgets expert here – is this a bug or is it a feature!? ;-) Do I have to prevent this in my code, or do you agree that Qt should take care of this?
Cheers, Tobias
-
Looks like the bug doesn't reproduce anymore.
-
Hi Tobias,
that's definitively a bug, not a feature. Non-closable is not limited to the x-button. Maybe you wanna assign it to me.
Cheers
Axel -
Hi all,
I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418
The relevant problem is: A QDockWidget that is declared as non-closable but as floatable cannot be closed by clicking an "X" button (it's omitted then), but one can actually close such a floating dock nevertheless by using a keyboard shortcut (Alt+F4).
After that, there's no way to re-show that closed dock, as the menu bar's context menu containing checkboxes for all dock widgets is grayed out (it becomes enabled when adding docks with the QDockWidget::DockWidgetClosable feature set). The only way to get the dock back is to delete the window state from the rc file.
My understanding is that a QDockWidget that is marked as not closable should not only not be closable by omitting the "X"/"Close" button, but also an attempt to close it using keyboard shortcuts should be ignored, to also prevent it from closing this way.
@Axel-Spoerl Now that I know that you're the QDockWidgets expert here – is this a bug or is it a feature!? ;-) Do I have to prevent this in my code, or do you agree that Qt should take care of this?
Cheers, Tobias
@l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:
I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418
There is already a bug report. But I don't see how I could assign it …
-
@l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:
I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418
There is already a bug report. But I don't see how I could assign it …
-
@l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:
I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418
There is already a bug report. But I don't see how I could assign it …
@l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:
But I don't see how I could assign it …
Done
-
@Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?
-
@Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?
@l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:
@Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?
No, it was mistake on my little mobile phone.
-
Hey, I was gone for some days.
Will look into it this week! -
Hi all,
I looked into it a bit and replied in the Jira ticket.
Please answer there. -
Looks like the bug doesn't reproduce anymore.
-
A Axel Spoerl has marked this topic as solved