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. QTableWidgetItem and setCheckState

QTableWidgetItem and setCheckState

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.9k 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.
  • R Offline
    R Offline
    robby77
    wrote on last edited by
    #1

    Hi guys,
    I'm using a QTableWidget structure in which the first column is used as a check box.
    Here the code:
    @
    for (int row_i=0; row_i < rows; ++row_i)
    {
    for (int column_j=0; column_j < 15; column_j++)
    {
    QTableWidgetItem *item = new QTableWidgetItem;
    item->setText("");
    item->setTextAlignment (Qt::AlignCenter);
    tableWidget->setItem(row_i, column_j, item);
    }
    }
    @
    Then, for each row:
    @tableWidget->item(row, 0)->setCheckState ( Qt::Checked );@

    the problem is that when I select with the mouse the cell (first column for each row) besides the little square you can check or uncheck (precisely on the right side) it appears a rectangle about a text area..
    How can I get rid of this ?
    Many thanks,
    robby77

    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