There is another mechanism of initialization widgets in Qt4. Could you post problem codes of initialization of QMainWindow ?