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. Using QList and QTableWidgetItem
Forum Update on Monday, May 27th 2025

Using QList and QTableWidgetItem

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 629 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.
  • T Offline
    T Offline
    topocc
    wrote on 29 Apr 2014, 15:32 last edited by
    #1

    I'm using QTableWidgetItem, but QList,.

    @
    QTableWidgetItem *textoItem;
    QList <QTableWidgetItem> *listaItemsBase;
    textoItem = new QTableWidgetItem;
    listaItemsBase = new QList <QTableWidgetItem>;

    for(int x = 0;x<10;x++)
    {
        textoItem->setText(QString::number(x));
        //qDebug() << "item: " << x << ": " << listaItemsBase->at(2);
        listaItemsBase->append(*textoItem);
    }
    
    
    for(int xy = 0;xy<listaItemsBase->size();xy++)
    {
        ui->tableWidget->setCellWidget(xy,0,listaItemsBase->at(xy));
    }
    

    @

    [edit: corrected coding tags @ SGaist]

    1 Reply Last reply
    0

    1/1

    29 Apr 2014, 15:32

    • Login

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