undocking/detaching toolviews to regular windows instead of tool windows

René J.V. Bertin rjvbertin at gmail.com
Thu Oct 12 17:11:13 BST 2017


On Thursday October 12 2017 17:26:46 Kevin Funk wrote:

> No, as I expected you to try this out if you'd like to have the feature.

You did say that it seemed to do the job, but on closer inspection it turned out the snippet you posted wouldn't even build :)

> > 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

> Agreed. Could be an option in the application's setting.

Are there other toolviews where standalone windows make sense, beyond the fact that floating windows do not in general work well when you're using a focus-follows-mouse mode under X11?

> > FWIW, 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?

The topLevelChanged signal signalling a change in the floating state.

> Which signal do you not get? aboutToQuit()?

Indeed. Not on Linux at least, but on Mac I've also seen cases in another ctor.

> Did KDevelop crash?

Not in relation to the above.

It's easy to make it crash after reparenting the widget away though: the m_area and m_view members become NULL pointers because of that.

> 
> Please don't start adding work-arounds (we won't accept them upstream) before 
> having understood the actual problem.

I think I meant workaround in the sense of a way to avoid having to handle complexity here. Basically, revert the "unfloating" and dock the window when about to exit, if it was made into a separate window.

> Then please fix/investigate this first(?)

That issue has long proven to be beyond me.

> ^ 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

Time for me to come off as a bit harsh, but I've been doing this a bit longer than you. I avoid cross-posting to MLs and newsgroups where I'm certain a majority of users will get duplicates. Qt's interest ML and StackOverflow don't fall under that category for me, and in my experience I get answers on either one or the other. I prefer to take my chances to getting answers by asking questions rather than by not asking them and trying to reinvent each wheel I need myself again and again. That's all the more true when dealing with collaborative software.


R.




More information about the KDevelop mailing list