-
Notifications
You must be signed in to change notification settings - Fork 663
Add flag to DockWidget to force dw to be closed with the area that contains it #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@n-elie Very nice! This would be very useful for our application! |
|
I also wonder about how to best handle the case of a closing an area which has some docks with custom close handling (and cannot currently be closed for some reason) - ideal outcome: area does not actually close and the docks that cannot close stay present (but closable docks are no longer visible). |
|
@nickdademo if you use the customclose flag, you need to connect to the |
This is clear :) But what if the dock is not in a state to close (e.g. an operation inside the dock is in progress) when closing the area (i.e. in the custom close handling, we don't close)? So my question is: how to best handle this when closing the area. |
|
Thank you for the pull request. I'm on vacation at the moment and will review your patch when I'm back next week. |
|
@githubuser0xFFFF Did you have time to have a look to this? I would like to make this change to be able to ask the user to confirm he wants to close an area containing multiple widgets. With the current implementation, I can only show a message after the area has been hidden. |
|
I just wanted to comment that I also was troubleshooting what I thought was a bug and now know is the intended current behavior (multiple dockwidgets not deleting on close as desired) . This appears to be exactly what we need for our use case as well! |
|
@githubuser0xFFFF Do you see a way to achieve this goal that would better suit you? I would be happy to implement it |
|
I think the PR in it's current state is OK and I'm looking forward to seeing it being merged :) |
|
@n-elie I'm almost o.k. with the pull request. I think the flag The |
I think this PR won't force close these docks with custom close handling: |
|
With the current implementation, when an area is closed and it contains only one dock widget, the |
|
I just tested the PR and in works the way it should be - perfect. If you add the documentation for the the new flag to the user guide, I will merge the PR. Thank you. |
|
Good to hear! I'm going to add this flag to the user guide. Thanks |
|
I guess we are waiting for the user guide changes from @n-elie ? |
|
Just added a few line in the README to describe the new flag. Not a native english speaker here, so feel free to edit |
| DockWidgetDeleteOnClose = 0x08, ///< deletes the dock widget when it is closed | ||
| CustomCloseHandling = 0x10, ///< clicking the close button will not close the dock widget but emits the closeRequested() signal instead | ||
| DockWidgetFocusable = 0x20, ///< if this is enabled, a dock widget can get focus highlighting | ||
| DockWidgetForceCloseWithArea = 0x40, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DockWidgetForceCloseWithArea = 0x40, | |
| DockWidgetForceCloseWithArea = 0x40, ///< dock widget will be closed when the dock area hosting it is closed | |
| DockWidgetForceCloseWithArea = 0x40, | ||
| DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable, | ||
| AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling, | ||
| NoDockWidgetFeatures = 0x00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| NoDockWidgetFeatures = 0x00 | |
| DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose, | |
| NoDockWidgetFeatures = 0x00 | |
|
Thank you. I merged your pull request with some modifications. |
Add a flag to DockWidget to allow it to be closed when it's area is closed (as described in #222).