Theo
Theo

Reputation: 1475

QDialog - How to remove the minimize button

Qt 4.8 based, application - Issue with QDialog, minimize button

But here comes the issue:

It seems that this is a platform dependent feature -

I am not quite sure on what do do.

Any ideas...? (I tried already with a few windowsFlags but could not find the one set that works.

Tried:

--- But the basic question is why the behavior on Windows/GNOME is different from KDE

Upvotes: 7

Views: 11093

Answers (2)

Jacob Krieg
Jacob Krieg

Reputation: 3164

From the Qt Documentation:

In Linux with KDE this code make a window without an close and minimize and maximize buttons in title bar.

setWindowFlags( Qt::Dialog | Qt::WindowTitleHint );

Upvotes: 0

mostafaTmj
mostafaTmj

Reputation: 383

if you want the MainWindow don't have any buttons on top use this in constructor of MainWindow:

this->setWindowFlags(Qt::SubWindow);

and if you want to remove just the minimize button use this:

this->setWindowFlags(Qt::Dialog);

Upvotes: 5

Related Questions