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. Possible error in QTableView::resizeRowsToContents
Forum Update on Monday, May 27th 2025

Possible error in QTableView::resizeRowsToContents

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtableviewresize event
9 Posts 2 Posters 2.5k 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.
  • B Offline
    B Offline
    BrianE
    wrote on 2 May 2016, 10:58 last edited by
    #1

    I have a TableView and resizeRowsToContents works fine with normal layout. BUT, when when I have some columns spanned the height of the row is the same as if there were not columns spanned. So a row that should only take up one line of text in a height of (say) 21 pixels actually uses 53 pixels because that's the height it would have taken without spanning. Not sure what to do about this!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 2 May 2016, 22:04 last edited by
      #2

      Hi,

      Can you reproduce that with a simple compilable example ?

      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
      0
      • B Offline
        B Offline
        BrianE
        wrote on 2 May 2016, 22:21 last edited by
        #3

        That'd take me a while since I've just finished creating the whole program - and finding a way to avoid the problem. I could send you a screen shot if I knew how!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 May 2016, 22:53 last edited by
          #4

          You can post a link to image sharing site.

          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
          0
          • B Offline
            B Offline
            BrianE
            wrote on 2 May 2016, 23:15 last edited by BrianE 5 Mar 2016, 00:07
            #5

            TableView with error

            Not sure if the above will show.

            Anyway, the green heading is big because there's lots of words which would make it tall in the 'qty' column. The two blue rows with two words in are two lines high, the same size as the two-line descriptions. The one-word blue rows are just the minimum height allowed.

            Pretty obviously it's the blue/green rows that have their spans set.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 3 May 2016, 20:24 last edited by
              #6

              I think I see what you mean but that really needs a minimal project to test and check.

              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
              0
              • B Offline
                B Offline
                BrianE
                wrote on 3 May 2016, 20:38 last edited by
                #7

                OK I'll copy my project and strip it down. How does one upload a whole project? Zipped and a URL like the picture?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 3 May 2016, 20:46 last edited by
                  #8

                  Most people usually use a git repo (bitbucket, gitlab, github etc.) or something like Dropbox

                  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
                  0
                  • B Offline
                    B Offline
                    BrianE
                    wrote on 3 May 2016, 22:37 last edited by
                    #9

                    OK here we go. All the files are in DropBox and should be available via:

                    https://www.dropbox.com/sh/7hzpv4k021k50y2/AACobsU7FpvbllB_56UUffP5a?dl=0

                    I have hardcoded a minimal data set which is accessed by clicking on the Load button - so as to keep the system as intended. No other buttons work.

                    1 Reply Last reply
                    0

                    2/9

                    2 May 2016, 22:04

                    topic:navigator.unread, 7
                    • Login

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