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 tableview to scene, appearing small and with scroll bars
QtWS25 Last Chance

Adding tableview to scene, appearing small and with scroll bars

Scheduled Pinned Locked Moved Solved General and Desktop
qgraphicsviewqtableviewqt desktop
18 Posts 2 Posters 2.0k 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
    sachinrd
    wrote on 11 Jul 2021, 12:39 last edited by
    #9
    This post is deleted!
    1 Reply Last reply
    0
    • S Offline
      S Offline
      sachinrd
      wrote on 11 Jul 2021, 12:40 last edited by
      #10

      Hi @mrjj . Thanks for the quick reply. around some 20 to 25 pixels is missing . we are doing resizeColumnsToContents() right. This should be considering the font sizes right ?

      M 1 Reply Last reply 11 Jul 2021, 12:48
      0
      • S sachinrd
        11 Jul 2021, 12:40

        Hi @mrjj . Thanks for the quick reply. around some 20 to 25 pixels is missing . we are doing resizeColumnsToContents() right. This should be considering the font sizes right ?

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 11 Jul 2021, 12:48 last edited by
        #11

        @sachinrd
        Hi
        yes resizeColumnsToContents();
        should calculate the needed space with the current font.
        and we then add up the needed sizes and expand the view.

        Do you use any stylesheet or anything that could make the calculation a bit off ?

        I don't see it here from a fast test so i wonder what difference it.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sachinrd
          wrote on 11 Jul 2021, 13:02 last edited by
          #12

          @mrjj . yeah i am using this style:
          indexPageTableView->setStyleSheet("QTableView::item{border: 2px solid black}");

          M 1 Reply Last reply 11 Jul 2021, 13:04
          0
          • S sachinrd
            11 Jul 2021, 13:02

            @mrjj . yeah i am using this style:
            indexPageTableView->setStyleSheet("QTableView::item{border: 2px solid black}");

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 11 Jul 2021, 13:04 last edited by
            #13

            @sachinrd
            Hi
            Ok
            can you check without if its then accurate ?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sachinrd
              wrote on 11 Jul 2021, 13:09 last edited by
              #14

              sure let me check.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sachinrd
                wrote on 11 Jul 2021, 13:40 last edited by
                #15
                This post is deleted!
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sachinrd
                  wrote on 11 Jul 2021, 13:41 last edited by sachinrd 7 Nov 2021, 13:42
                  #16

                  Hi @mrjj . i have removed the stylesheet changes. it still didnt work!
                  61207492-5a56-4b7a-898c-82485b8a54ea-image.png

                  M 1 Reply Last reply 11 Jul 2021, 13:50
                  0
                  • S sachinrd
                    11 Jul 2021, 13:41

                    Hi @mrjj . i have removed the stylesheet changes. it still didnt work!
                    61207492-5a56-4b7a-898c-82485b8a54ea-image.png

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 11 Jul 2021, 13:50 last edited by
                    #17

                    @sachinrd
                    Hi
                    try setting
                    alt text

                    and see if then the table is not fully drawn.
                    I recall it will "reserve" some space for the scrollbars and hence the width of a scrollbar is missing in the calcualation.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sachinrd
                      wrote on 11 Jul 2021, 15:28 last edited by
                      #18

                      @mrjj . Thanks a ton for your help. Its working perfectly.

                      1 Reply Last reply
                      1

                      18/18

                      11 Jul 2021, 15:28

                      • Login

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