How can I create a QDialog that has no minimize, maximize and close buttons in the titlebar?

You can achieve this by specifying a combination of window flags [qt.nokia.com] provided your window manager supports those flags.

The example below demonstrates how this can be done, if this example does not remove the buttons for you, then it is likely because your window manager does not support that, and there is nothing we can do about that in Qt unfortunately.

  1. #include <QtGui>
  2.  
  3. int main(int argc, char **argv)
  4. {
  5.     QApplication app(argc, argv);
  6.     QDialog box(0, Qt::WindowTitleHint);
  7.     box.show();
  8.     return app.exec();
  9. }  

1 comment

April 8, 2011

Picture of Pau Pau

Lab Rat

As an extra reference:
The Window Flags example [doc.trolltech.com] , hosted on the Qt docs website, shows how to use the window flags available in Qt.

Write a comment

Sorry, you must be logged in to post a comment.