steve3d Posted November 17, 2011 Share Posted November 17, 2011 I remember in this forum there is already some people asked a similar function to set widget's z-order, but I think that a flag to set a Widget as a topMost is much more useful than that. Of course I know there is a function to set a Widget to be permanent focusd, but that is not enough, what if I want to set a window as top most while keeping the focus to another widget, in these case the setPermanentFocus function is the wrong choice. So add a setTopMost function to Widget class will solve this problem. Link to comment
frustum Posted November 17, 2011 Share Posted November 17, 2011 You can call Widget::raise() function to make widget up. Link to comment
steve3d Posted November 18, 2011 Author Share Posted November 18, 2011 I'm confused, the raise function is declared like this void Widget::raise(Widget *widget) { if(parent) parent->raise(this); } the widget parameter didn't used in function. if I have a widget should I use widget.raise(widget) to set it to top most? Link to comment
frustum Posted November 18, 2011 Share Posted November 18, 2011 This is a virtual function. Check the WidgetVBox::raise() function. Link to comment
steve3d Posted November 18, 2011 Author Share Posted November 18, 2011 thanks frustum, But I think this function still have limits, for example, my ime window uses a groupbox and a label in it, the groupbox don't have a parent, so if I want a groupbox to be raised, so I write app->composition_box->raise(app->composition_box); app->candidate_box->raise(app->candidate_box); it should not work, because composition_box's parent is null, (actually, it's parent is gui, but gui don't have a raise function). Link to comment
frustum Posted November 18, 2011 Share Posted November 18, 2011 Gui has internal WidgetVBox as container. So calling of raise function() on any root widget will have result too. Link to comment
Recommended Posts