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. QTableWidget not displaying the QTableWidgetItem data
Forum Updated to NodeBB v4.3 + New Features

QTableWidget not displaying the QTableWidgetItem data

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 982 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.
  • LorenDBL Offline
    LorenDBL Offline
    LorenDB
    wrote on last edited by
    #1

    I am trying to display a QString in a QTableWidget using a QTableWidgetItem. My problem is that the string never gets displayed. I know that the code is getting executed (I have a button, which, when clicked, adds a new row containing new data to the table) but it just isn't showing up. Am I missing something or is Qt having problems?

    Files of interest in my program:
    https://gitlab.com/LorenDB/klock/-/blob/master/chronometer.cpp#L75 (where the signal containing the new data is emitted)
    https://gitlab.com/LorenDB/klock/-/blob/master/klockmainwindow.cpp#L76 (where the new row is created)

    System info:
    OS: Kubuntu 20.04
    Qt version: 5.12.8

    TIA.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      QTableWidget row/column is zero-based.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • LorenDBL Offline
        LorenDBL Offline
        LorenDB
        wrote on last edited by
        #3

        I added one to my row and column values. Still nothing.

        1 Reply Last reply
        0
        • LorenDBL Offline
          LorenDBL Offline
          LorenDB
          wrote on last edited by
          #4

          That moment when it hits you...

          Of course! Subtract one, not add one! Using the correct mathematics makes it work!

          Christian EhrlicherC 1 Reply Last reply
          0
          • LorenDBL LorenDB

            That moment when it hits you...

            Of course! Subtract one, not add one! Using the correct mathematics makes it work!

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @LorenDB Then please mark this topic as solved, thx.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            LorenDBL 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @LorenDB Then please mark this topic as solved, thx.

              LorenDBL Offline
              LorenDBL Offline
              LorenDB
              wrote on last edited by
              #6

              @Christian-Ehrlicher Already did that. 😉

              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