Results 1 to 18 of 18

Thread: Disabling the Maximize button in QMainWindow ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    ucomesdag Guest

    Default Re: Disabling the Maximize button in QMainWindow ?

    Quote Originally Posted by sunil.thaha View Post
    Works well in Windows Xp , but as I mentioned first, It does not work in KDE. KDE seems to ignore the Flags
    It got it running fine in KDE maximize button is gone as in windows it's only disabled.

  2. #2
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Disabling the Maximize button in QMainWindow ?

    I am using KDE 3.3.1 with Plastique Theme, See the screen shot. The maximize button is still there
    Attached Images Attached Images
    We can't solve problems by using the same kind of thinking we used when we created them

  3. #3
    Join Date
    Nov 2006
    Posts
    72
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Disabling the Maximize button in QMainWindow ?

    Thank you, ucomesdag! Is there way to make it disappear completely?

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

    Default Re: Disabling the Maximize button in QMainWindow ?

    You can set same maximum and minimum size As.

    MainForm *MainFormObj=new MainForm(0);
    MainFormObj->show();

    MainFormObj->setMaximumSize (849,626);
    MainFormObj->setMinimumSize (849,626);

    I think it will work.I m using this on my mac using qt 4.2.2.

  5. #5
    Join Date
    Nov 2006
    Posts
    72
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Disabling the Maximize button in QMainWindow ?

    Tried it. It doesn't work on WinXP.

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

    Default Re: Disabling the Maximize button in QMainWindow ?

    what is Happening when you r doing this.
    Is there is an error?
    Actually I am running it correctly and donot know why it is not working in XP.

    check one thing that U also set the geometry of main window as

    MainForm *MainFormObj=new MainForm(0);
    MainFormObj->show();

    MainFormObj->setMaximumSize (849,626);
    MainFormObj->setMinimumSize (849,626);

    MainFormObj->setGeometry(5,42,849,626); //add this line

    Try this.
    Last edited by vishal.chauhan; 10th January 2007 at 12:52. Reason: updated contents

  7. #7
    ucomesdag Guest

    Default Re: Disabling the Maximize button in QMainWindow ?

    Quote Originally Posted by sunil.thaha View Post
    I am using KDE 3.3.1 with Plastique Theme, See the screen shot. The maximize button is still there
    Might be the version of KDE I got 3.5.5 running and it works.

    Quote Originally Posted by Djony View Post
    Thank you, ucomesdag! Is there way to make it disappear completely?
    On windows XP it just disables the button but it doesn't disappear.

  8. #8
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Disabling the Maximize button in QMainWindow ?

    Hi Sunil.thaha,

    How did you solve the above problem? Could you manage to make the maximize button disappeared?

    Regards,
    ~NM

  9. #9
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Disabling the Maximize button in QMainWindow ?

    Read about Qt::WindowFlags

  10. #10
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Disabling the Maximize button in QMainWindow ?

    hi,

    Those flags are not working properly. those working fine on windows but not on Mac. Even I am not being able to have close button on mac.
    I hv posted my code here. http://www.qtcentre.org/threads/2990...063#post140063


    thanks anyway.

  11. #11
    Join Date
    Sep 2013
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Disabling the Maximize button in QMainWindow ?

    check this example
    http://doc.qt.io/qt-5/qtwidgets-widg...s-example.html

    you should use
    qt::window | qt::windowminimizebuttonhint | qt::closebuttonhint | qt::customizewindowhint


    you can not remove the maximize button without the customizewindowhint

Similar Threads

  1. Replies: 2
    Last Post: 1st August 2006, 10:23
  2. custom maximize button---
    By Naveen in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 13:11
  3. Replies: 18
    Last Post: 22nd February 2006, 20:51
  4. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40

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.