Am not sure about the number of screens,
but u can try this -
Call a QTimer::singlShot(0,this,initialize()); from the constructor.

In the initialize function try to get the number of screens
Qt Code:
  1. MyWindow::initialize()
  2. {
  3. m_no_of_screens = qApp->desktop()->numScreens();
  4. }
To copy to clipboard, switch view to plain text mode 

see if the value is correct this time.