Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. way to get cell's size of QGridLayout

way to get cell's size of QGridLayout

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
8 Posts 2 Posters 1.3k 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.
  • S Offline
    S Offline
    superl3
    wrote on last edited by
    #1

    I know there is a method CellRect for QGridLayout.
    but It returns the item's size in specific Cell.

    QT Designer program seems to be solved this problem.
    Is there any way to get exact cell size of QGridLayout?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @superl3 said in way to get cell's size of QGridLayout:

      QT Designer program seems to be solved this problem.

      Why do you think so?

      The size depends on the widgets in the cells. So ask the widgets.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • S Offline
        S Offline
        superl3
        wrote on last edited by
        #3

        I know the size of the widget with CellRect or QLayoutItem's Geometry, but I cannot get the grid size.

        did you mean that there is a answer in widget? if there is, can you tell me the way to get the grid size rathar than the widget size

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          See https://doc.qt.io/qt-5/qlayoutitem.html#geometry

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          S 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            See https://doc.qt.io/qt-5/qlayoutitem.html#geometry

            S Offline
            S Offline
            superl3
            wrote on last edited by
            #5

            @Christian-Ehrlicher

            cb08bdf8-2c61-4d4d-aded-c26b18af6005-image.png
            I want to know that the geometry surrounded by red and green lines which includes widget.
            Get geometry of QLayoutItem still gives me the size of widget..

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I currently don't see a direct way to get them and I also don't understand why they are needed at all.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • S Offline
                S Offline
                superl3
                wrote on last edited by
                #7

                because I want to mimic QT designer's behavior.. okay

                1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Maybe take a look into the designer sources will help you.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  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