Results 1 to 11 of 11

Thread: Dialog and minimize, maximize buttons

  1. #1
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Dialog and minimize, maximize buttons

    In the Qt::dialog Window Flag description one can read: "decorated as a dialog (i.e., typically no maximize or minimize buttons in the title bar)"

    Any idea why this does not work (at least under Linux)?

    I can get either the whole Title Bar (with minimize/maximize buttons) or nothing.

    How to eliminate the minimize/maximize buttons in Dialog?
    (Arithmetical & with negation of according flags does not work)

    thanks for your help
    me

  2. #2
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Dialog and minimize, maximize buttons

    Try this:
    setWindowFlags(Qt:ialog);

    That gives me a dialog with a title bar and a close X but no minimize or maximize buttons.

    Ignore the icon, it's Qt: Dialog without the space.

  3. #3
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dialog and minimize, maximize buttons

    Thanks for the answer, but exactly this (and some other things) does not work on Linux. I suppose you are working on Windows. I am afraid, that it is the the X Manager feature and I can't remove this stupid buttons. Even the dialog examples have the minimize/maximize buttons, and there is nothing to do to get rid of them.
    Last edited by lotek; 23rd November 2010 at 23:59.

  4. #4
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Dialog and minimize, maximize buttons

    Yes, I am working on Windows, for now. But from what you said, I will have the same problems when I go over to Linux.

  5. #5
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dialog and minimize, maximize buttons - partially succseed

    Hi,

    The maximize button disappears when the setMaximumSize() method is called for a dialog.

    For the context help button the arithmetical & with negation of the Qt::WindowContextHelpButtonHint flag works.

    Qt::WindowFlags f = windowFlags();
    f &= ~Qt::WindowContextHelpButtonHint;
    setWindowFlags(f);

    Only the minimize button stays, but i can live with it.

  6. #6
    Join Date
    Jul 2010
    Posts
    41
    Thanks
    6
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Dialog and minimize, maximize buttons - partially succseed

    You should set "Qt::CustomizeWindowHint" for window flags,
    Qt Code:
    1. setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
    To copy to clipboard, switch view to plain text mode 
    Last edited by srazi; 24th November 2010 at 12:57. Reason: spelling corrections

  7. #7
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dialog and minimize, maximize buttons

    Nice idea, but sorry...

    I've already checked it. on Linux ( SuSE 11.2) the minimize and maximize buttons ale still visible. The close button and context help button disappear.

    Anyway thanks for the hint!
    me

  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: Dialog and minimize, maximize buttons

    hi,
    In Debian its working. It should work with windowflags ,
    try Qt::FramelessWindowHint and if u want to show a title ,add a QLabel and show ur title.

    Or Try window styles, like motif,kde etc using QStyle

    Thnks
    Bala

  9. #9
    Join Date
    Jul 2010
    Posts
    41
    Thanks
    6
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Dialog and minimize, maximize buttons

    Quote Originally Posted by lotek View Post
    Nice idea, but sorry...

    I've already checked it. on Linux ( SuSE 11.2) the minimize and maximize buttons ale still visible. The close button and context help button disappear.

    Anyway thanks for the hint!
    me
    I used this and it works with Ubuntu 9.10 and 10.04,
    Please when you found the solution, write it here.

  10. #10
    Join Date
    Apr 2010
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Thumbs up Re: Dialog and minimize, maximize buttons

    Works well in Ubuntu 10.04

    All buttons visible and all buttons enabled: setWindowFlags(Qt::Tool)
    All buttons visible, close and maximize buttons enabled, minimize button disabled: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
    All buttons visible, maximize button enabled, close and minimize disabled: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::CustomizeWindowHint)
    Only close button is visible and enabled setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
    No buttons in title bar: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)

  11. #11
    Join Date
    Feb 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dialog and minimize, maximize buttons

    If i am understanding this problem correctly then this works with Qt4 on Ubuntu 10.10

    w.setWindowFlags(Qt::Tool);

    add that line before w.show() in your main.cpp and all you will have is the close button

    HTH
    TpwUK

Similar Threads

  1. Disable the minimize, maximize,close buttons
    By qtlinuxnewbie in forum Newbie
    Replies: 10
    Last Post: 25th February 2010, 10:18
  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.