Results 1 to 8 of 8

Thread: Floating MainWindow on OS X

  1. #1
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Floating MainWindow on OS X

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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

  3. #3
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    Try playing with the window flags a little bit. Have you set any already?

  5. #5
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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.

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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?

  7. #7
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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

  8. #8
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating MainWindow on OS X

    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

Similar Threads

  1. mainwindow disappearing
    By locus in forum Qt Programming
    Replies: 1
    Last Post: 28th January 2007, 09:24
  2. How do I use a mainwindow .ui file?
    By thomaspu in forum Qt Tools
    Replies: 2
    Last Post: 23rd November 2006, 06:32
  3. Replies: 3
    Last Post: 23rd July 2006, 18:02
  4. MainWindow update during computations
    By Gizmho in forum Qt Programming
    Replies: 7
    Last Post: 13th July 2006, 20:10
  5. mainwindow does not refresh
    By edb in forum Qt Programming
    Replies: 22
    Last Post: 25th January 2006, 16:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.