qt—为什么窗口无法输入?
qt函数如下:
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
resize(700,500);
QTextEdit *text = new QTextEdit(this);
//设置中心主控件
setCentralWidget(text);
//在状态栏显示信息
setWindowTitle("there");//设置主窗口的标题栏
statusBar()->showMessage("Welcome to there");
}
//退出弹窗
bool MainWindow::event(QEvent *close)
{
if(close->type() == QEvent::Close )
{
qDebug()<<"close";
QMessageBox::information(
this,
"Information",
"closeEvent!",
QMessageBox::Ok);
return true;
}
}
如果不加后面的退出弹窗窗口就可以输入,加了反而没法输入。拜求各位大神给点解决办法。。。。