Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Disable QDialogs default close button (upper left “x button”)?
To solve the in the title described problem I tried to costumize the QDialog window by @setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);@ or @setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint);@ . Problem is, that both ideas still leave the maximize button and when maximized the close button appears again. Any idea?
Just using @setWindowFlags(Qt::CustomizeWindowHint)@ solves the problem but leaves the dialog without a border which is a pain in the eyes :D.
Hostel last edited by
On Linux with KDE this code helped me:
setWindowFlags( Qt::Dialog | Qt::WindowTitleHint );
I tried your suggestion and unfortunately it does not work. The dialogs close and maximize buttons are still available.
andre last edited by
On what platform are you working?
I am working on Linux Ubuntu 11.10 with the Unity desktop. However, the GUI I
ve written wont just be used on the same Linux Ubuntu version especially the desktop is another one (I guess it is the classic Gnome desktop), but it will always be used on Linux Ubuntu.