Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.2
-
None
Description
When setUnifiedTitleAndToolBarOnMac(true) and you have items in the
toolbar, the Y position of the mainwindow will drop around 42 pixels
each Quit/Run despite the fact that the window is not moved while the
program is run.
On quit the geometry is saved to QSettings. I have provided qdebug for
the x & y on quit and run.
For some reason related to setUnifiedTitleAndToolBarOnMac(true) Qt
moves the Y down upon each Quit/run
See enclosed sample file.
Steps to recreate:
Compile and run app.
Notice where the mainwindow is on your screen.
Quit app.
Run app.
Notice the main window has moved down approx. 42pixels since the last
run even though you have not moved the window.
Continue to quit/run until the window moves off the bottom of your
screen.
Now comment out this line:
// setUnifiedTitleAndToolBarOnMac(true);
and recompile and run again.
Observe how the mainwindow no longer moves down after each Quit/Run.
Example here :
#include <QtGui>
class MacMainWindow : public QMainWindow
{
Q_OBJECT
public:
MacMainWindow()
~MacMainWindow()
{ QSettings settings; settings.setValue("Geometry", saveGeometry()); qDebug() << x() << y(); }void resizeEvent(QResizeEvent *e)
{ toolBar->updateGeometry(); }public:
QToolBar * toolBar;
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MacMainWindow mainWindow;
mainWindow.show();
return app.exec();
}
#include "main.moc"