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 Updated to NodeBB v4.3 + New Features

Adding QTableView into QFrame

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 5 Posters 2.4k Views 3 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.
  • G Offline
    G Offline
    gaurav118
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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 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

        jsulmJ 1 Reply Last reply
        0
        • G gaurav118

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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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
          2
          • jsulmJ jsulm

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

            G Offline
            G Offline
            gaurav118
            wrote on last edited by
            #5

            @jsulm the controls are packaged in vertical layout

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on 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
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on 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
                3
                • mrjjM mrjj

                  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 last edited by
                  #8

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

                  mrjjM 1 Reply Last reply
                  0
                  • G gaurav118

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

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 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 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?

                      mrjjM 1 Reply Last reply
                      0
                      • G gaurav118

                        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?

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 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
                        0
                        • mrjjM mrjj

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

                          G Offline
                          G Offline
                          gaurav118
                          wrote on 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

                          mrjjM 1 Reply Last reply
                          0
                          • G gaurav118

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

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by mrjj
                            #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
                            0
                            • mrjjM mrjj

                              @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 last edited by
                              #14

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

                              mrjjM 1 Reply Last reply
                              0
                              • G gaurav118

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

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 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

                                • Login

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