次のコードを使用して、全画面表示と最大化ウィンドウを切り替えています。
void MainWindow::keyPressEvent(QKeyEvent *e)
{
if ((e->key()==Qt::Key_Enter) && (e->modifiers()==Qt::AltModifier))
this->setWindowState(Qt::WindowFullScreen);
if (e->key()==Qt::Key_Escape)
if(isFullScreen())
this->setWindowState(Qt::WindowMaximized);
}
しかし、これは機能しません。誰かがここで何が問題なのか教えてもらえますか?