PDA

View Full Version : QMdiArea, doesn't bring QWidget childs to front when clicking on them



conti
17th February 2012, 13:33
Hi i'm having some problems with the QMdiArea. The Problem is that when i add child widgets to the mdi area the newest added child stays allways on top and i cannot switch to a child which was added before. Well actually i can switch by clicking on the older child but the older child widget is not moved to the front (i can see that a lineedit in the older child gets the blinking cursor so it gets the focus but the widget stays behind the mdi childs which where added later to the mdi area). However if i use a double click on the mdi child window title bar it works, it is brought to front and maximized. Am i missing something? Do i need call some kind of bringtofront() function when receiving a click ?

conti
22nd February 2012, 13:55
I "fixed" it with:
void MyCustomView::mousePressEvent ( QMouseEvent * e ){
((QWidget*)parent())->raise();
}

but should this not happen automaticaly in a mdi area when clicking on child views?