PDA

View Full Version : Floating MainWindow on OS X



dvmorris
2nd May 2007, 18:15
I recently upgraded to Qt 4.3.0beta, and my MainWindow or my application is now attached to the top left corner of my desktop. I messed around with a few settings and managed to get it to float independently again, but when I fixed the code to compile on windows, and took it back to compile on OS X, the MainWindow is once fixed to the top left corner of my OS X desktop. What is the flag that fixes this? I can't seem to find it. Thanks for the help,

Dave

marcel
2nd May 2007, 18:19
Is this a custom drawn window? I mean, doesn't it have a normal title bar and frame provided by the style?

You should open the Window Flags example on Mac an look which flags give the behavior of your window. You can play with all the available window flags.

The example can be found in the Widgets section of Qt Examples and Demos.

regards

dvmorris
2nd May 2007, 18:54
It's just a class that inherits mainwindow and is declared in my main.cc file like this:

MainWindow mainWindow;

It must be some new default initialization in Qt 4.3beta, because it was never like this before. I tried using this function

void setUnifiedTitleAndToolBarOnMac ( bool set )

but it didn't seem to change anything. I can't find anything specific in the qt examples either.

marcel
2nd May 2007, 18:58
Try playing with the window flags a little bit. Have you set any already?

dvmorris
2nd May 2007, 19:09
i tried

setWindowFlags(Qt::Widget);

and

setWindowFlags(Qt::Window);

from http://doc.trolltech.com/4.3/qt.html#WindowType-enum

and none of the others seem to even fit what I'm trying to do.

marcel
2nd May 2007, 19:13
I'm just guessing here, but maybe the window does not get the default flags when it is created ( it's beta, after all ).

Have you tried Qt::Window | Qt::WindowTitleHint?

dvmorris
2nd May 2007, 19:24
yes, that didn't seem to work either. I will try to download the latest snapshot and compile with that. I am out of ideas. thank you so much for your help,

dave

dvmorris
14th May 2007, 10:11
I tried downloading the latest snapshot and the window is still attached to the top left. How is it not more obvious how to fix this problem? I can't find it anywhere in the documentation.

dave