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. Problems with showFullScreen!
Forum Updated to NodeBB v4.3 + New Features

Problems with showFullScreen!

Scheduled Pinned Locked Moved General and Desktop
12 Posts 2 Posters 4.4k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    andreyc
    wrote on last edited by
    #2

    Welcome to Qt DevNet!

    From MainWindow try
    @
    this->setWindowState(this->windowState() | Qt::WindowFullScreen);
    @

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bladice
      wrote on last edited by
      #3

      Thanks for your response andreyc.
      Still getting the same problem. I put that on the constructor and on a slot that receives pressed event of the top buttons. @ui->gbNewUser->setVisible(true);
      ui->gbInfoUser->setVisible(false);
      ui->gbNewAccount->setVisible(false);
      ui->gbSorteo->setVisible(false);
      ui->gbStock->setVisible(false);@

      This is how my logic works, when an specific buttom is pushed one groupBox is showed and the rest groupBox are hidden.

      Could it be the problem?

      Thanks,
      German Zapata

      For some reason, non technical people use to think that every thing with buttons can be fixed by a programmer…

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andreyc
        wrote on last edited by
        #4

        Does this small app work?

        • fullScreenWindow.pro
          @
          QT += widgets
          TARGET = fullScreenWindow
          TEMPLATE = app
          SOURCES += main.cpp
          @

        • main.cpp
          @
          #include <QApplication>
          #include <QMainWindow>
          #include <QShortcut>

        int main(int argc, char argv[])
        {
        QApplication a(argc, argv);
        QMainWindow w;
        QShortcut
        q = new QShortcut(QKeySequence("q"), &w);
        QObject::connect(q, &QShortcut::activated, &w, &QMainWindow::close);
        w.setWindowState(w.windowState() | Qt::WindowFullScreen);
        w.show();

        return a.exec&#40;&#41;;
        

        }
        @

        [EDIT]: added .pro file

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bladice
          wrote on last edited by
          #5

          Yes it works, my application also works correctly in some states, i have just an specific group box that makes this problem occur, the main difference between this specific group box and the others is that this specific groupBox is overcharged of Labels, TextEdits, etc. The others are working like a charm.

          For some reason, non technical people use to think that every thing with buttons can be fixed by a programmer…

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andreyc
            wrote on last edited by
            #6

            I don't think that amount of the Labels, TextEdits, etc may change the MainWindow state or position.

            Try to disable all "bad" GroupBoxes except one and check the main window state and coordinates before and after switching to and from "bad" GroupBox.

            Do you build the UI in the code or in a designer?

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bladice
              wrote on last edited by
              #7

              I used the designer.

              For some reason, non technical people use to think that every thing with buttons can be fixed by a programmer…

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andreyc
                wrote on last edited by
                #8

                Did you use "QStackedWidget":http://qt-project.org/doc/qt-5/QStackedWidget.html or you put all GroupBoxes into one central widget of main window and then hide, show the Groupboxes on the signals from the buttons?

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bladice
                  wrote on last edited by
                  #9

                  I used, the second alternative, si there any problem with it?

                  For some reason, non technical people use to think that every thing with buttons can be fixed by a programmer…

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andreyc
                    wrote on last edited by
                    #10

                    [quote author="bladice" date="1406764299"]I used, the second alternative, si there any problem with it?[/quote]No, there is nothing wrong with it. It requires more attention though.

                    Did you try to check main window state and coordinates before and after switching between the GroupBoxes?

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bladice
                      wrote on last edited by
                      #11

                      yes i checked an it report me real coordinates, so if it moves, it starts at coordinates different to 0,0. I would check QStackedWidgets. This is a minor problem rigth now, but it isn't the first time that i got this problem.

                      For some reason, non technical people use to think that every thing with buttons can be fixed by a programmer…

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andreyc
                        wrote on last edited by
                        #12

                        Usually such unexpected behavior is a sign of some hidden issues like incorrect calculation or walking pointer.
                        When you decide to dig it deeper I would suggest to take one of "bad" group box and copy it to a separate application, just UI without business logic and see how it will behave.

                        1 Reply Last reply
                        0

                        • Login

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