Important: Please read the Qt Code of Conduct -

Hide WindowMinimizeButton of the WindowTitleBar

  • Hello,

    I want hide the MinimizeButton (~Qt::WindowMinimizeButtonHint) of the WindowTitle, but it doesn't work and I don't understand why. I already look in the internet, this and several other forums, etc., but I didn't found an answer which works for me!

    I want to realize it by setting the WindowFlags.
    I am using OpenSuse 13.1, Qt4.8 and KDE.
    I am initializing a QMainWindow(QWidget* parent = 0, Qt::WindowFlags fl = Qt::Dialog))
    I also use the setMaximumSize(); function. So the MaximumButton is hidden by default, as I already found out.

    At the end i have the ContextHelpButton, the MinimizeButton and the CloseButton in my WindowTitlebar.

    By using following code, I can hide the Close Button:
    @ setWindowFlags(((this->windowFlags() | Qt::CustomizeWindowHint)
    & ~Qt::WindowCloseButtonHint));@
    This works fine.

    By using following code, I can hide the HelpButton:
    @ setWindowFlags(((this->windowFlags() | Qt::CustomizeWindowHint)
    & ~Qt::WindowContextHelpButtonHint));@
    This works fine, too.

    But the same code for the Minimize Button, doesn't work:
    @ setWindowFlags(((this->windowFlags() | Qt::CustomizeWindowHint)
    & ~Qt::WindowMinimizeButtonHint));@

    And I don't understand why.

    • Is is not possible with KDE or this Linux version?
    • Do I need an other windowManager?
    • Must the parent set per default, also if I don't have a parent?
    • Is it not possible with QMainWindow?

    Any ideas or any other solutions?

    Thanx for all hints in advance.


Log in to reply