Results 1 to 9 of 9

Thread: how to remove maximize minimize close

  1. #1
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default how to remove maximize minimize close

    i need to create window.
    I need to remove (maximize, minimize, close) button
    how to remove that ?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to remove maximize minimize close

    use Qt::FramelessWindowHint like

    widget->setWindowFlags(Qt::FramelessWindowHint);

  3. #3
    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: how to remove maximize minimize close

    take a look at this example QTDIR/examples/widgets/windowflags.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #4
    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: how to remove maximize minimize close

    Quote Originally Posted by talk2amulya View Post
    use Qt::FramelessWindowHint like

    widget->setWindowFlags(Qt::FramelessWindowHint);
    or use these flags
    Qt::WindowTitleHint | Qt::CustomizeWindowHint
    in this case you don't lose possibility of widget resizing.
    Last edited by spirit; 2nd April 2009 at 17:39.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default Re: how to remove maximize minimize close

    Quote Originally Posted by spirit View Post
    or use these flags

    in this case you don't lose possibility of widget resizing.
    my code like this ...
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : QMainWindow(parent), ui(new Ui::MainWindowClass)
    3. {
    4. ui->setupUi(this);
    To copy to clipboard, switch view to plain text mode 

    how to set ?

  6. #6
    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: how to remove maximize minimize close

    try this in ctor
    Qt Code:
    1. ...
    2. setWindowFlags(windowFlags() | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
    3. ...
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #7
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default Re: how to remove maximize minimize close

    Quote Originally Posted by spirit View Post
    try this in ctor
    Qt Code:
    1. ...
    2. setWindowFlags(windowFlags() | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
    3. ...
    To copy to clipboard, switch view to plain text mode 
    this code can't remove them....
    Attached Images Attached Images

  8. #8
    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: how to remove maximize minimize close

    yup, my mistake, try this
    Qt Code:
    1. setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. #9
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Thumbs up Re: how to remove maximize minimize close

    Quote Originally Posted by spirit View Post
    yup, my mistake, try this
    Qt Code:
    1. setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
    To copy to clipboard, switch view to plain text mode 
    it's ok now ! thanks a lot!

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. Replies: 1
    Last Post: 21st February 2009, 14:59
  3. User has not minimize or maximize buttons
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2007, 19:23
  4. Remove close button on a Dialog in Linux
    By Krish_ng in forum Qt Programming
    Replies: 5
    Last Post: 20th July 2007, 07:10
  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.