Results 1 to 6 of 6

Thread: MaximizeButton

  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default MaximizeButton

    I want have maximizebutton on my Dialog. I tried like this, but not work.

    Qt Code:
    1. setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: MaximizeButton

    It must be somthing else in your code, this will work.

    BTW which dialog are you using?
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: MaximizeButton

    Use QDialog

    Qt Code:
    1. ManFavorite::ManFavorite(QWidget *parent) :
    2. QDialog(parent),
    3. ui(new Ui::ManFavorite)
    4. {
    5. ui->setupUi(this);
    6. setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
    7. }
    To copy to clipboard, switch view to plain text mode 

    Ubuntu 12.04-64bit
    Using Qt version 4.8.1 in /usr/lib/x86_64-linux-gnu

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: MaximizeButton

    try this on your setup
    Qt Code:
    1. int main (int argc, char **argv)
    2. {
    3. QApplication app(argc, argv);
    4.  
    5. QDialog dialog;
    6. dialog.setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
    7. dialog.show();
    8.  
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  5. #5
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: MaximizeButton

    Still not work

    Btw, I don't call it from main function. But from QMainWindow

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MaximizeButton

    Well, it is a hint. Maybe your windowing environment decides to ignore it.

    Cheers,
    _

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.