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
    Join Date
    Sep 2006
    Location
    Valdivia, Chile
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: Disabling the Maximize button in QMainWindow ?

    I had tried with diferents Qt Wflags, but it seems no work. So the only way I had found is this:

    // I use this directive in this way:
    #include <qapplication.h>
    #include <qmainwindow.h>

    int main(int argc, char *argv[]) {

    QApplication app( argc, argv );
    QMainWindow *win;
    win = new QMainWindow();

    win->setFixedSize(200, 200);
    app.setMainWidget(win);
    win->show();
    return app.exec();

    }

    If you set the window size, the maximize button won't be shown.
    I hope this be useful. Regards.

  2. The following user says thank you to sir_johann for this useful post:

    sunil.thaha (11th September 2006)

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

    Default Re: Disabling the Maximize button in QMainWindow ?

    I have tried this, but I am using Qt 4.1.4, and my compiler gives me error:

    [HTML]class QApplication' has no member named 'setMainWidget'[/HTML]

    Is there any other way to disable maximize button?

  4. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    22
    Thanked 19 Times in 16 Posts

    Default Re: Disabling the Maximize button in QMainWindow ?

    Quote Originally Posted by Djony View Post
    I have tried this, but I am using Qt 4.1.4, and my compiler gives me error:
    class QApplication' has no member named 'setMainWidget'
    from http://doc.trolltech.com/4.2/porting4.html#qapplication
    QApplication::setMainWidget() is no longer used. When all an application's windows are closed, the application will exit normally.
    The guy, posting the above code probably is using Qt-3.* whereas you are using Qt-4.*.

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

    Default Re: Disabling the Maximize button in QMainWindow ?

    I got that, but the question with maximize button still stands.

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.