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] How I can set QTableWidget cells?
QtWS25 Last Chance

[SOLVED] How I can set QTableWidget cells?

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

    I have a QTableWidget, with 2 colums, and n row.
    How I can fill the cells?

    I wrote this code, but didnt work.

    @QTableWidgetItem *newItem = new QTableWidgetItem;
    newItem->setText(list[i]);
    ui->tableWidget->setItem(row, 0, newItem);
    ++row;
    ui->tableWidget->update();@

    Sorry, for my bad English. My first language is Hungarian.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      I-sty
      wrote on last edited by
      #2

      [SOLVED] :D

      I added this line and worked.
      @ ui->tableWidget->insertRow(row);@

      Google is my best friend :D

      Sorry, for my bad English. My first language is Hungarian.

      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