BUG: adding 5 child-widgets to a widgets layout makes widget invisible
See http://www.qtcentre.org/threads/2995...-how-its-added.
This has nothing to do with the particular child-widget used.
In any order 4 is the maximum number of child widgets a layout can handle (even via sub-layouts or addRow where one row equals one child-widget) before the widget becomes invisible.
So confirmed with Qt 4.6.2 under Windows 7.
See submission at http://bugreports.qt.nokia.com/browse/QTBUG-10008
Re: BUG: adding 5 child-widgets to a widgets layout makes widget invisible
You mean this doesn't work?
Code:
#include <QtGui>
int main(int argc, char **argv){
for(int i=0;i<10;i++) {
l->addWidget(b);
}
w.showMaximized();
return app.exec();
}
Re: BUG: adding 5 child-widgets to a widgets layout makes widget invisible
Hi,
this does work. I phrased too general obviously.
I checked other parts of my code. I have 2 QWidget windows. The first accesses the seconds position when the first gets moved. This appears to work as long as there are 4 child-widgets inside. Having 5 leads to the second window being invisible. So it may even be a bug in my code or something I can work around now. I am going to check further with the first window (I stripped the code related to the second window and that "BUG" occurs) and report back.
Re: BUG: adding 5 child-widgets to a widgets layout makes widget invisible
Please ask your invisible widget for its geometry. It is possible you just moved it out of the screen boundaries.
Re: BUG: adding 5 child-widgets to a widgets layout makes widget invisible
Hello,
it appears that a void moveEvent(QMoveEvent*) gets fired on void show() and the moveEvent code gets executed before the show code which is where I initialize variables for the second windows position. As the moveEvent uses these variables the second window gets put to some outside random location thus being invisible.
Not a bug after all (except if that event mechansim is unintentional or not wanted). Apparently the randomness of the uninitialized variables is "outside screen" for 5 child-widgets and "inside screen" for 4 child-widgets.
Thank you.
Re: BUG: adding 5 child-widgets to a widgets layout makes widget invisible
Quote:
Originally Posted by
planetLars
Not a bug after all
Yeeeay... another one bites the star dust :)
Quote:
(except if that event mechansim is unintentional or not wanted).
Of course it is intentional.
Quote:
Apparently the randomness of the uninitialized variables is "outside screen" for 5 child-widgets and "inside screen" for 4 child-widgets.
Not really :)