That's not working for me. I create some widgets with something similar to this:
QList<QWidget *> test;
for(int n = 0; n < 10; n++)
{
tempW->show();
tempW->move(0, n*70);
test.append(tempW);
}
QWidget * main;
main = new QWidget;
QList<QWidget *> test;
for(int n = 0; n < 10; n++)
{
QWidget * tempW;
tempW = new QWidget(main);
tempW->show();
tempW->move(0, n*70);
test.append(tempW);
}
To copy to clipboard, switch view to plain text mode
Then in another portion of code I reorganize the widgets and the QList and after that their default draw order is no longer appropriate. Now if I'm understanding you correctly this:
for(int n = 0; n < test.count(); n++)
test[n]->hide();
for(int n = 0; n < test.count(); n++)
test[n]->show();
for(int n = 0; n < test.count(); n++)
test[n]->hide();
for(int n = 0; n < test.count(); n++)
test[n]->show();
To copy to clipboard, switch view to plain text mode
should order them so that the later indexed widgets draw on top of the earlier indexed widgets. But that's not happening. They continue to draw according to the order they were "new"ed in.
Bookmarks