Hi All,
i have use designer to design a mainwidow which have a stackedWidget ,and the stackedWidget has several pages. i want to the page display fullscreen , and then pressed 'esc' key to exit fullscreen. but didn't respond. didn't print "esc". what's problem?
void MainWindow::keyPressEvent(QKeyEvent *event)
{
if(event->key() == Qt::Key_Escape && !event->isAutoRepeat())
{qDebug() << "esc";
if(ui->stackedWidget->isFullScreen())
{
ui->stackedWidget->setWindowFlags(Qt::SubWindow);
ui->stackedWidget->showNormal();
}
}
}
Please give me a advice!
Thanks and Best Regards!
ken
Added after 1 4 minutes:
i have set the focus, but didn't exit fullscreen also.
Bookmarks