Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.0
-
None
Description
Reparenting widgets to a different display doesn't seem to work very well on X11.
To reproduce:
run this example on X11 on a computer with multiple DISPLAY's (e.g. 0.0, 0.1 etc).
click the radio button to switch screen for a window. Note that the subwidgets don't paint on the new screen (though you can still click on them)
#include <QtGui>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(int screen)
: QMainWindow(qApp->desktop()->screen(screen))
{
setCentralWidget(new QWidget(this));
QVBoxLayout *lay = new QVBoxLayout(centralWidget());
for (int i=0; i<qApp->desktop()->numScreens(); ++i)
buttons.at(screen)->setChecked(true);
foreach(QRadioButton *rb, buttons)
setAttribute(Qt::WA_DeleteOnClose);
}
public slots:
void changeScreen(bool toggled)
private:
QList<QRadioButton*> buttons;
};
#include "main.moc"
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QList<MainWindow*> windows;
for (int i=0; i<a.desktop()->numScreens(); ++i)
return a.exec();
}