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.
QWidget单击关闭按钮后是否可以保持打开状态?假设小部件是主小部件。即不是另一个小部件的孩子。
QWidget
我会尝试:
void Widget::closeEvent(QCloseEvent *event) { [..] event->ignore(); }
正如文件所说:
“例如,您可以通过对所有事件调用 ignore() 来阻止窗口关闭。”