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. [Solved] Customizing QTableWidget
Forum Updated to NodeBB v4.3 + New Features

[Solved] Customizing QTableWidget

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.6k 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.
  • E Offline
    E Offline
    Endless
    wrote on last edited by
    #1

    Let's say I create a QTableWidget with two rows and columns. The resultant widget has 3 rows and 3 columns (an extra row for the row headers and an extra column for the column headers). Is there anyway to eliminate these? Basically what I'm looking for is a QList with several columns.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fluca1978
      wrote on last edited by
      #2

      Getting the "header":http://developer.qt.nokia.com/doc/qt-4.8/qtableview.html#horizontalHeader and setting it not visible?

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Endless
        wrote on last edited by
        #3

        I see isColumnHidden() and isRowHidden(). In the above example, the only valid entries I have for row and column are 0 and 1 (since there are two of each). How would I specify the "extra" row or column that isn't part of the actual table data?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          You can get access to the header widgets using the horizontalHeader() and verticalHeader() methods.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Endless
            wrote on last edited by
            #5

            Perfect. I then use setHidden(), and they're both gone.

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fluca1978
              wrote on last edited by
              #6

              I pointed you to the documentation that allows you to get back the headers, and then you can call setVisible on them.

              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