我想使右上角的X按钮无效,因此在论坛上搜索一番后,决定重新实现closeEvent()函数。
在mainwindow.h的protected处加上void closeEvent(QCloseEvent *e)
在mainwindow.cpp中加入
void MainWindow::closeEvent(QCloseEvent *e)
{
e->ignore();
}
但是编译时出错了,提示invalid use of incomplete type 'struct QCloseEvent'。我看help中也是类似的用法啊为什么会出错呢?
[ 此帖被yzpdsg在2010-05-22 08:45重新编辑 ]