Jump to content

add setTopMost function to Widget class


photo

Recommended Posts

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

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

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
×
×
  • Create New...