Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Using QList and QTableWidgetItem

    General and Desktop
    1
    1
    541
    Loading More Posts
    • 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
      topocc last edited by

      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 Reply Quote 0
      • First post
        Last post