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. Adding QTableView into QFrame
Forum Update on Monday, May 27th 2025

Adding QTableView into QFrame

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 5 Posters 2.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.
  • G Offline
    G Offline
    gaurav118
    wrote on 7 May 2018, 12:58 last edited by
    #1

    hi.. i have made a separate source file containing QTableView and some other controls. My issue is when i am loading that widget in QFrame, internal QTableView is not adopting the size of parent container class(i.e., QFrame). Can any one help me what i might be doing wrong.?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 May 2018, 13:30 last edited by
      #2

      Hi,

      Are you properly using layouts in your custom widgets ?

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

      1 Reply Last reply
      2
      • G Offline
        G Offline
        gaurav118
        wrote on 8 May 2018, 05:06 last edited by
        #3

        Yes... Its comprising of a Vertical Layout that further has a horizontal layout and TableView
        0_1525755959451_43cdbaa2-f307-40cc-b210-b67a85686275-image.png

        J 1 Reply Last reply 8 May 2018, 06:19
        0
        • G gaurav118
          8 May 2018, 05:06

          Yes... Its comprising of a Vertical Layout that further has a horizontal layout and TableView
          0_1525755959451_43cdbaa2-f307-40cc-b210-b67a85686275-image.png

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 8 May 2018, 06:19 last edited by
          #4

          @gaurav118 No, because your customTable does not have a layout...

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

          G 1 Reply Last reply 8 May 2018, 06:38
          2
          • J jsulm
            8 May 2018, 06:19

            @gaurav118 No, because your customTable does not have a layout...

            G Offline
            G Offline
            gaurav118
            wrote on 8 May 2018, 06:38 last edited by
            #5

            @jsulm the controls are packaged in vertical layout

            1 Reply Last reply
            0
            • V Offline
              V Offline
              VRonin
              wrote on 8 May 2018, 07:28 last edited by
              #6

              You see that red 🚫 on the left of customTable in the top right?
              That means you did not set a layout on it. Right click on the background and layout->layout horizontally

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              5
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 8 May 2018, 09:33 last edited by
                #7

                Hi
                The red layout you used is a floating one. its for inserting into
                other layouts. As @VRonin says, you should apply a layout to custom table
                to have red layout use all space available.

                G 1 Reply Last reply 9 May 2018, 04:45
                3
                • M mrjj
                  8 May 2018, 09:33

                  Hi
                  The red layout you used is a floating one. its for inserting into
                  other layouts. As @VRonin says, you should apply a layout to custom table
                  to have red layout use all space available.

                  G Offline
                  G Offline
                  gaurav118
                  wrote on 9 May 2018, 04:45 last edited by
                  #8

                  @mrjj @VRonin Thanx a lot buddy. i think its working now..:)

                  M 1 Reply Last reply 9 May 2018, 06:32
                  0
                  • G gaurav118
                    9 May 2018, 04:45

                    @mrjj @VRonin Thanx a lot buddy. i think its working now..:)

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 9 May 2018, 06:32 last edited by
                    #9

                    @gaurav118
                    super :)
                    While the red layouts are very tempting. The most used way to apply layout is
                    to right click and choose one from layout menu. To further subdivide
                    the layout into ""sections", the red ones can be used.

                    1 Reply Last reply
                    3
                    • G Offline
                      G Offline
                      gaurav118
                      wrote on 9 May 2018, 12:44 last edited by
                      #10

                      Instead of actually laying out customTable in MainWindow, i am trying to give it a sliding effect to populate the customTable object. Any help i can get?

                      M 1 Reply Last reply 9 May 2018, 13:41
                      0
                      • G gaurav118
                        9 May 2018, 12:44

                        Instead of actually laying out customTable in MainWindow, i am trying to give it a sliding effect to populate the customTable object. Any help i can get?

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 9 May 2018, 13:41 last edited by
                        #11

                        @gaurav118
                        Hi
                        You can use
                        http://doc.qt.io/qt-5/animation-overview.html
                        for that.

                        G 1 Reply Last reply 9 May 2018, 13:57
                        0
                        • M mrjj
                          9 May 2018, 13:41

                          @gaurav118
                          Hi
                          You can use
                          http://doc.qt.io/qt-5/animation-overview.html
                          for that.

                          G Offline
                          G Offline
                          gaurav118
                          wrote on 9 May 2018, 13:57 last edited by
                          #12

                          @mrjj Thanks a lot... I am actually trying to figure it out. I am trying to change the height property of QFrame

                          M 1 Reply Last reply 9 May 2018, 15:20
                          0
                          • G gaurav118
                            9 May 2018, 13:57

                            @mrjj Thanks a lot... I am actually trying to figure it out. I am trying to change the height property of QFrame

                            M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 9 May 2018, 15:20 last edited by mrjj 5 Sept 2018, 15:21
                            #13

                            @gaurav118
                            Hi
                            If you need inspiration, this does a slide out using the animation framework.
                            https://github.com/chrisaverage/burger-menu
                            Check out
                            void BurgerMenu::toggle(bool checked)
                            note that this sample animates while in a layout.

                            G 1 Reply Last reply 10 May 2018, 05:31
                            0
                            • M mrjj
                              9 May 2018, 15:20

                              @gaurav118
                              Hi
                              If you need inspiration, this does a slide out using the animation framework.
                              https://github.com/chrisaverage/burger-menu
                              Check out
                              void BurgerMenu::toggle(bool checked)
                              note that this sample animates while in a layout.

                              G Offline
                              G Offline
                              gaurav118
                              wrote on 10 May 2018, 05:31 last edited by
                              #14

                              @mrjj thanx... it was awesome. These Hamburger style menu is much common in Windows 10

                              M 1 Reply Last reply 10 May 2018, 06:41
                              0
                              • G gaurav118
                                10 May 2018, 05:31

                                @mrjj thanx... it was awesome. These Hamburger style menu is much common in Windows 10

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 10 May 2018, 06:41 last edited by
                                #15

                                @gaurav118
                                Super. :)
                                Yeah they are pretty much
                                seen all places nowadays.
                                I even have one in my new app ;)

                                1 Reply Last reply
                                1

                                1/15

                                7 May 2018, 12:58

                                • Login

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