How to remove a Qt WindowFlag?

qt

Solution

Use the binary negation flag ~

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

So, to remove a customization window hint: -

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

Problem

To set the window flags I use `setWindowFlags(/* flags */)` function. How can I remove a only one window flag? Is this possible?

Original source