Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot make widget full screen
Forum Updated to NodeBB v4.3 + New Features

Cannot make widget full screen

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 260 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GunkutA
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • G GunkutA

      @Bonnie That is a QWidget. So can I only make windows fullscreen?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @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).

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #2

        Is this protocolForm a window?
        You cannot make a child widget full screen.

        G 1 Reply Last reply
        1
        • B Bonnie

          Is this protocolForm a window?
          You cannot make a child widget full screen.

          G Offline
          G Offline
          GunkutA
          wrote on last edited by
          #3

          @Bonnie That is a QWidget. So can I only make windows fullscreen?

          jsulmJ 1 Reply Last reply
          0
          • G GunkutA

            @Bonnie That is a QWidget. So can I only make windows fullscreen?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @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).

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            4

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved