Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在构造函数中使用此代码向我的 QDialog 添加一个最小化按钮:
Qt::WindowFlags flags = windowFlags(); flags |= Qt::WindowMinMaxButtonsHint; setWindowFlags(flags);
它适用于 Windows,但不适用于 Linux。
这是一个迟到的答案,但可能对其他人有用,我遇到了同样的问题并像这样修复:
Qt::WindowFlags flags = Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint; this->setWindowFlags(flags);
在被覆盖的对话框构造函数中。