Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.5.0
-
None
-
None
-
Mac OS X 10.5.8
-
-
725d8e061ededee9a5ddf0914aabd0f6aa2ee741
Description
Consider this code:
// QT4 Includes #include <QApplication> #include <QWidget> #include <QMainWindow> #include <QPushButton> #include <QHBoxLayout> int main(int argc, char **argv) { // Handle command line parameters for GUI QApplication app(argc, argv); QMainWindow * myWindow = new QMainWindow(); QWidget * center = new QWidget(); myWindow -> setCentralWidget(center); QHBoxLayout * h = new QHBoxLayout(); center -> setLayout(h); QWidget * drawer = new QWidget(myWindow, Qt::Drawer); drawer -> hide(); QPushButton * show = new QPushButton("Show Drawer"); app.connect (show, SIGNAL(clicked()), drawer, SLOT(show())); h -> addWidget(show); QPushButton * hide = new QPushButton("Hide Drawer"); app.connect (hide, SIGNAL(clicked()), drawer, SLOT(hide())); h -> addWidget(hide); myWindow -> show(); myWindow -> raise(); if (0) { myWindow -> setWindowState(Qt::WindowFullScreen); myWindow -> setWindowState(Qt::WindowNoState); } app.exec(); }
Be on Mac OS X. Compile it. Run it. Two buttons, one shows the drawer, one hides it. Right? That's okay.
Now replace the "if (0)" with "if(1)" or something similar. Recompile, rerun. The QMainWindow goes full screen, then back to normal. Click on the buttons. Note that there is no drawer anymore. It's completely gone.