Ionică Bizău
Ionică Bizău

Reputation: 113455

How to remove a Qt WindowFlag?

To set the window flags I use setWindowFlags(/* flags */) function.

How can I remove a only one window flag?

Is this possible?

Upvotes: 5

Views: 3575

Answers (1)

TheDarkKnight
TheDarkKnight

Reputation: 27621

Use the binary negation flag ~

unsigned int flags = flags();
flags = flags & (~FlagEnum);

So, to remove a customization window hint: -

flags = flags & (~Qt::CustomizeWindowHint);

Upvotes: 7

Related Questions