Results 1 to 11 of 11

Thread: Disable the minimize, maximize,close buttons

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Disable the minimize, maximize,close buttons

    hi,

    i need to disable the window's maximize , minimize, close buttons in my app...
    can any one, have any idea ?
    any little help, could be appreciated.

    @qtlinuxnewbie

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    see window flags, and widget attributes.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Disable the minimize, maximize,close buttons

    i have already gone through the window flags but i dint get anything out of it..

    Could u mention in specific,....

    @qtlinuxnewbie

  4. #4
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    hi,
    u can use
    Qt Code:
    1. setWindowFlags(Qt::FramelessWindowHint);
    To copy to clipboard, switch view to plain text mode 
    hope it helps
    Bala

  5. #5
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Disable the minimize, maximize,close buttons

    @Bala

    Thnk you for ur snippet
    it worked well . and the buttons are not visible.
    But the buttons should be visible in disable mode.
    Is it possible ?

    @qtlinuxnewbie

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    Qt Code:
    1. if(pWindow->isEnabled()){
    2. pWindow->setWindowFlags(Qt::FramelessWindowHint);
    3. }else {
    4. pWindow->setWindowFlags(Qt::Window);
    5. }
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    I don't think that you can achieve this by standard Qt's methods.
    you can use such flags combination, but no minimize & maximize buttons will be not visible.
    Qt::Window
    | Qt::WindowTitleHint
    | Qt::WindowSystemMenuHint
    | Qt::CustomizeWindowHint
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #8
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    Try the following flag

    Qt Code:
    1. setWindowFlags(Qt::WindowTitleHint);
    To copy to clipboard, switch view to plain text mode 

    This show only the titlebar without min,max,close button
    hope it helps
    Bala

  9. #9
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Disable the minimize, maximize,close buttons

    have u tried qtlinuxnewbie?

    Bala

  10. #10
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Disable the minimize, maximize,close buttons

    setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

    @bala :this is what i have used:


    @qtlinuxnewbie

  11. #11
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: Disable the minimize, maximize,close buttons

    Thnk u all .. my problem solved

    @qtlinuxnewbie

Similar Threads

  1. QDialog with Close, Maximize and Context Help Buttons
    By mclark in forum Qt Programming
    Replies: 7
    Last Post: 1st May 2020, 16:53
  2. how to remove maximize minimize close
    By tsuibin in forum Qt Programming
    Replies: 8
    Last Post: 2nd April 2009, 18:28
  3. Replies: 1
    Last Post: 21st February 2009, 14:59
  4. User has not minimize or maximize buttons
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2007, 19:23
  5. Replies: 3
    Last Post: 25th March 2006, 06:15

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.