Review Request 116722: Allow setTransientParent from an item

David Edmundson david at davidedmundson.co.uk
Thu Mar 13 12:48:24 UTC 2014



> On March 11, 2014, 3:57 p.m., Marco Martin wrote:
> > Oddly is exactly the patch that i was trying yesterday ;)
> > one thing i found out tough: item->window() of course is not aways there (for instance whenthe item is in a Dialog that hasn't been shown yet)
> > so in many cases this won't work.
> > I wonder if it may be made a bit more complex keeping the item and connecting to windowChanged() to update the window in case is a qquickItem?
> > 
> > (and in any way it becomes, the corresponding settransientparent in Dialog should also be made behave the same)
> 
> David Edmundson wrote:
>     Can you remember the use case where this didn't work?
> 
> Marco Martin wrote:
>     in https://bugs.kde.org/show_bug.cgi?id=331931
>     the first time window() is 0
>     from the second time you open the popup onwards, that's fine
> 
> David Edmundson wrote:
>     OK. I'll claim that bug and I'll check if I fix that. Updating this if need be.
>     Thanks.

Turns out this is very difficult.
There's no signal windowChanged, and we can't use an event filter on QQuickItem

I tried setting a parent immediately, except (with a bit of shuffling creating ordering) but that gives the parent as the CompactItemExpander, which is the panel window. FullExpanderItem is created before the dialog, so that won't help.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116722/#review52649
-----------------------------------------------------------


On March 11, 2014, 3:52 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116722/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 3:52 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> Allow setTransientParent from an item
> 
> Because QWindow is not exposed as a property of Item in certain cases we
> may not have access to the owning window in a qml that has menus. For
> example WidgetExplorer.
> 
> This patch also fixes crash in setTransientParent is called before a window is set on
> the menu.
> 
> 
> Diffs
> -----
> 
>   src/declarativeimports/plasmacomponents/qmenu.h d1a5b73 
>   src/declarativeimports/plasmacomponents/qmenu.cpp a9b41a9 
> 
> Diff: https://git.reviewboard.kde.org/r/116722/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140313/8c058abf/attachment.html>


More information about the Plasma-devel mailing list