QDialog - How to remove the minimize button

寵の児 提交于 2019-12-05 22:07:23

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);

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 );
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!