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?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How I can set QTableWidget cells?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • I Offline
    I Offline
    I-sty
    wrote on 18 Jul 2012, 18:36 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 18 Jul 2012, 19:17 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

      1/2

      18 Jul 2012, 18:36

      • Login

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