I'm pretty new to the Qt environment. I have an application that I want to display on a second monitor. Currently, in the MainWindow constructor, I'm moving the window to a second monitor using the following code.
main():
MainWindow w;
w.showFullScreen();
MainWindow() constructor:
QRect screenres = QApplication::desktop()->screenGeometry(1);
this->move(QPoint(screenres.x(), screenres.y()));
this->resize(screenres.width(), screenres.height());
This works for my main window. The problem is that all the children widgets still get displayed on the first monitor. I have a menu widget that is part of the centralWidgetFrame that gets created in the constructor after the move(), but it doesn't get created on the second monitor. From my understanding, the child widgets should be created in positions relative to their parent.
The MainWindow returns a pos() of (1920,0) as expected and the child menu widget gives me a pos() of (0,0).
I'm using Qt 4.7.1. Any suggestions?