Solved Cannot make widget full screen
-
Hello I am trying to make full screen the form I am using, when the spesific key pressed. I am using this part of the code for that:
void protocolForm::keyPressEvent(QKeyEvent *event) { . . . . . else if(event->key()==Qt::Key_F) { if(isFullScreen()) { this->setWindowState(this->windowState() | Qt::WindowMaximized); } else { this->setWindowState(this->windowState() | Qt::WindowFullScreen); qDebug()<<"F PRESSED."; } } }
Although it entert the else if statement. It never changes the window size.
-
@GunkutA said in Cannot make widget full screen:
So can I only make windows fullscreen?
You can make QWidget full-screen if it is a window (does not have parent).
-
Is this
protocolForm
a window?
You cannot make a child widget full screen. -
@Bonnie That is a QWidget. So can I only make windows fullscreen?
-
@GunkutA said in Cannot make widget full screen:
So can I only make windows fullscreen?
You can make QWidget full-screen if it is a window (does not have parent).