Results 1 to 11 of 11

Thread: Button on the Upper Right Corner of MainWindow?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Button on the Upper Right Corner of MainWindow?

    Hi All,

    I am working on QT 4.3.3 on my MAC.
    I have a QMainWindow on which I have a button on the upper right corner by default on my MAC (Actually I does not know what the button is called).

    I want to hide that button so how should I do it.

    Thanks.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Button on the Upper Right Corner of MainWindow?

    What happens when you click the button? Does by any chance the dialog get closed?

  3. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Button on the Upper Right Corner of MainWindow?

    No The Dialog doesnot close.
    generally it hides the toolbar but in my case it actually reduce the height of the mainWindow and when I again click it add some space to the main window.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Button on the Upper Right Corner of MainWindow?

    Do you have a toolbar? Even if you think you don't, it might be there - it might simply be empty.

  5. #5
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Button on the Upper Right Corner of MainWindow?

    yes I have a toolbar.
    But in my case it is not hiding the toolbar it increases or decreases the height of QMainWindow.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Button on the Upper Right Corner of MainWindow?

    How did you add the toolbar to the main window?

  7. #7
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Button on the Upper Right Corner of MainWindow?

    I have just added the toolbar from the Designer and set the movable property to false.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Button on the Upper Right Corner of MainWindow?

    And the button does something else than it should, correct? Can you verify that it works correctly for examples bundled with Qt?

  9. #9
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Button on the Upper Right Corner of MainWindow?

    I can not veriy.
    But in qt examples it doesnot increases or decreases the height of QMainWindow still it hides and show the toolbar.

    So It is possible to hide the button.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Button on the Upper Right Corner of MainWindow?

    Quote Originally Posted by vishal.chauhan View Post
    I can not veriy.
    What do you mean? You can't run the examples or the button doesn't work?

    But in qt examples it doesnot increases or decreases the height of QMainWindow still it hides and show the toolbar.
    Hmm... now I'm confused. So does it work or not?

    So It is possible to hide the button.
    If you found an application that hides the button, then just look into its sources - it probably passes some WindowFlag to the widget's constructor.

  11. #11
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Button on the Upper Right Corner of MainWindow?

    Seeing into the Examples it only comes when the tool bar is added to the mainwindow.
    If even I hide the toolbar then button is coming but it does not do any work.
    so it is related to the toolbar but in example it does not hide when toolbar is coming.

Similar Threads

  1. Replies: 1
    Last Post: 7th July 2007, 09:03

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
  •  
Qt is a trademark of The Qt Company.