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. A possible solution for column splitting in QTableWidget
Forum Updated to NodeBB v4.3 + New Features

A possible solution for column splitting in QTableWidget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.4k Views 1 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
    gigi
    wrote on last edited by
    #1

    Hi,
    I must implement a table in which every column must be subdivided into three subcolumns starting from a given row. That is, for every column I've one numeric value in the first three rows and three values in the next ones.

    I have read that the columns of a QTableWidget cannot be splitted. So, I think a possible solution could be the use of a widget (having, for example, three line edits) for the cells with three numeric values, but I don't know if it's the correct approach. Is it the only way to solve my problem ? Is there any other possible and more elegant solution ?

    Thanks in advance
    Luigi

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi there,
      Interesting question and I think the answer lies in the use of delegates. For every cell or for every cell in a column you can set a different delegate. In this delegate you might be able to set a new table to fill. Never ever done it myself by the way, so it's just a thought.
      Good luck and let us know how it goes!

      Greetz, Jeroen

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

        Yes the answer is to use a delegate to achieve the same. You can also have a look "Qt-Grid-View":http://qt-apps.org/content/show.php/Qt+Grid+View?content=145913 and download the source code to get a hint about the implementation.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gigi
          wrote on last edited by
          #4

          Thank you for your quick reply, I'll try with delegates and have a look at Qt-Grid-View.

          Luigi

          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