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. Layout Problem

Layout Problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 2.7k 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.
  • Taz742T Offline
    Taz742T Offline
    Taz742
    wrote on last edited by
    #1

    So I have Form Layout, Here lies Widget.
    The problem is the next, my screen size is 1920x1080 and And everything seems fine, but when start my program 1366x768 screen rezolution, The lower part cut.

    alt text

    alt text

    What can I do?

    Do what you want.

    mrjjM 1 Reply Last reply
    0
    • Taz742T Taz742

      So I have Form Layout, Here lies Widget.
      The problem is the next, my screen size is 1920x1080 and And everything seems fine, but when start my program 1366x768 screen rezolution, The lower part cut.

      alt text

      alt text

      What can I do?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      @Taz742
      Resize the window?
      Check resolution and resize your window to fit. if all in layouts - all widgets will resize.

      QScreen *screen = QGuiApplication::primaryScreen();
      QRect screenGeometry = screen->geometry();
      int height = screenGeometry.height();
      int width = screenGeometry.width();

      Taz742T 1 Reply Last reply
      0
      • mrjjM mrjj

        @Taz742
        Resize the window?
        Check resolution and resize your window to fit. if all in layouts - all widgets will resize.

        QScreen *screen = QGuiApplication::primaryScreen();
        QRect screenGeometry = screen->geometry();
        int height = screenGeometry.height();
        int width = screenGeometry.width();

        Taz742T Offline
        Taz742T Offline
        Taz742
        wrote on last edited by
        #3

        @mrjj
        QScreen *screen = QGuiApplication::primaryScreen();
        QRect screenGeometry = screen->geometry();
        int height = screenGeometry.height();
        int width = screenGeometry.width();
        I got it correctly measures the resolution which I have now.
        Now my mainwindow resize this screenGeometry?

        Do what you want.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          The widgets have a minimum size that need to be respected. In you case you should maybe add a QScrollArea so the user can scroll through your UI if the screen resolution doesn't allow to show everything.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Taz742T 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            The widgets have a minimum size that need to be respected. In you case you should maybe add a QScrollArea so the user can scroll through your UI if the screen resolution doesn't allow to show everything.

            Taz742T Offline
            Taz742T Offline
            Taz742
            wrote on last edited by
            #5

            @SGaist
            Yes I tried QScrollArea. But Normal Resolution i do not want to see ScrollArea.
            It would be good if I will be able to appear and then when it's needed.
            But I dont understand how to do it.

            Do what you want.

            A 1 Reply Last reply
            0
            • Taz742T Taz742

              @SGaist
              Yes I tried QScrollArea. But Normal Resolution i do not want to see ScrollArea.
              It would be good if I will be able to appear and then when it's needed.
              But I dont understand how to do it.

              A Offline
              A Offline
              ambershark
              wrote on last edited by
              #6

              @Taz742 You could have all the controls in the scrollarea and just hide the scrollbar when they are all visible. Then when the resolution is the smaller one where it is needed, it would show the scrollbar again.

              So it would look normal like in your screenshot at 1080p but then have a scrollbar in the smaller resolution.

              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

              Taz742T 1 Reply Last reply
              0
              • A ambershark

                @Taz742 You could have all the controls in the scrollarea and just hide the scrollbar when they are all visible. Then when the resolution is the smaller one where it is needed, it would show the scrollbar again.

                So it would look normal like in your screenshot at 1080p but then have a scrollbar in the smaller resolution.

                Taz742T Offline
                Taz742T Offline
                Taz742
                wrote on last edited by
                #7

                @ambershark
                I believe scrollbar is only one solution?

                Do what you want.

                mrjjM 1 Reply Last reply
                0
                • Taz742T Taz742

                  @ambershark
                  I believe scrollbar is only one solution?

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Taz742
                  Hi
                  The scrollbar is one way yes. Maybe the best.

                  Or you can simply resize the window in designer so it fits lower res.
                  Or do it runtime.

                  Taz742T 1 Reply Last reply
                  2
                  • mrjjM mrjj

                    @Taz742
                    Hi
                    The scrollbar is one way yes. Maybe the best.

                    Or you can simply resize the window in designer so it fits lower res.
                    Or do it runtime.

                    Taz742T Offline
                    Taz742T Offline
                    Taz742
                    wrote on last edited by
                    #9

                    @mrjj
                    automatic resize is something event?

                    Do what you want.

                    mrjjM 1 Reply Last reply
                    0
                    • Taz742T Taz742

                      @mrjj
                      automatic resize is something event?

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Taz742

                      There is no automatic resize of window. You must get adjust height yourself.

                      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