Post by René J.V. BertinPost by Kevin FunkMakes sense. Patches welcome.
Should be easy enough, you need to reparent the widget contained in the
QDockWidget, set the Qt::Window flag and show it again. Work from there.
Hmm, I can try this too. For now I've tinkered with changing the window
flags back to Qt::Window when the floating state changes. That also works
but it's tricky (because apparently platform-dependent). But reparenting
could have more side-effects, have you tried re-docking the window for
instance?
No, as I expected you to try this out if you'd like to have the feature.
Post by René J.V. BertinThis is something that can probably much better be done upstream: a
QDockWidget::setFloatAsRegularWindow(bool) could modify how
QDockWidget::setFloating(true) "tears off" windows.
Normally I'm all for giving the user choice, but wouldn't it be sufficient
(better) in this case to let the toolview decide rather than adding a menu
to obtain a different kind of floating window? That would give 2 menu
actions to detach the window, which comes with having to handle transitions
between those modes and will probably also lead to surprises when the
floating windows are restored as Qt::Tool instead of Qt::Window.
Agreed. Could be an option in the application's setting.
Post by René J.V. BertinFWIW, automatic restore is tricky to get right with my approach too. There
is no state change notification of course, and apparently
QDockWidget::isFloating() cannot yet be queried reliably in the ctor. I've
been trying to work around this by re-attaching the windows on exit using
QCoreApplication::aboutToQuit, but that only works on Mac. On Linux I
simply don't get the signal.
State change about what? Which signal do you not get? aboutToQuit()? Did
KDevelop crash?
Please don't start adding work-arounds (we won't accept them upstream) before
having understood the actual problem.
Post by René J.V. BertinAnother thing that makes restore tricky is the
fact that the (documentation) toolview is restored multiple times; when
it's being restored in detached mode I can see the window open and close
multiple time while the session loads (possibly once per project).
Then please fix/investigate this first(?)
Post by René J.V. BertinPost by Kevin Funkhttp://lists.qt-project.org/pipermail/interest/2017-October/028275.html
That was a general how-to.
https://stackoverflow.com/questions/46699115/qdockwidgets-how-to-get-regular-windows-in-detached-floating-mode
^ That, too? Same question, 1:1 copy from mail on the Qt interest list, fired
off almost at the same time.
Please have a read:
https://en.opensuse.org/openSUSE:Mailing_list_netiquette#Cross_posting
I'd recommend you to spend more time digging through code, studying it, trying
things out, polishing things, adding unit tests, *then* come up with a review
request and trigger discussions -- instead of bombarding everyone with mails
asking how to implement this and that. (It's not just us (KDevelop), and I
just see the fraction of your mails on mailing lists I'm tracking... (Qt,
KDE))
I'm sorry this may come off a bit harsh, but it's not like there's no
precedent here.
PS: And I just received another mail of you, 40 minutes after the last one,
posting yet another incomplete patch. That doesn't help anyone.
Regards,
Kevin
--
Kevin Funk | ***@kde.org | http://kfunk.org