-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
Mac OS X 10.6.5, Qt 4.7.1
-
5fd505cac71e97cf181c0d05867a77e640814fc6
When setting setUnifiedTitleAndToolBarOnMac to true and going to fullscreen and back to normal view, the application crashes, see stack trace in attached text file.
How to reproduce
- On a Mac, Compile the attached example code
- Go fullscreen (CMD + F or toggle action in toolbar/menu)
- Go normal view (again same action)
- crash
Example code
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setUnifiedTitleAndToolBarOnMac(true); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_fullscreenAction_triggered() { if (!isFullScreen()) { // setUnifiedTitleAndToolBarOnMac(false); showFullScreen(); } else { // setUnifiedTitleAndToolBarOnMac(true); showNormal(); } }
Workaround
When following the advice on http://doc.trolltech.com/4.7/qmainwindow.html#unifiedTitleAndToolBarOnMac-prop : "However, a good practice would be that turning off the unified toolbar before you call showFullScreen() and restoring it after you call showNormal()." then there is no crash. See commented out code.
Example code attached.