10
votes

I create main window by using class QWidget and setup window flag to Qt::CustomizeWindowHint (to disable title bar). But than I found problem - when I click on my program button on Windows taskbar - program won't minimize and maximize. What can I do to remove this problem? I use Windows 7. Sorry 4 my bad english.

2

2 Answers

16
votes

That's the feature of Qt::CustomizeWindowHint.When use this windows flag,you can hardly control the window.What you can try is adding two buttons to your window and connect them to showMaximized() and showMinimized().Then you can maximize or minimize the window by clicking the buttons.

5
votes

This answer is a while ago but I faced the same challenge now and could find a solution. Maybe its helpfull for someone else. As proposed before one should specify Qt::FramelessWindowHint instead of Qt::CustomizeWindowHint. This also hides the title and border of the window. To still have the minimize/maximize feature I additionaly specified Qt::WindowSystemMenuHint, Qt::WindowMinimizeButtonHint and Qt::WindowMaximizeButtonHint. That's it!