QTableWidget problem



  • i am using qtablewidget and i have a problem that it don't print the string ,only it add an empty row..this is my code
    @JobsTabel = new QTableWidget(0,3);
    QStringList header;
    header<<"Engineer"<<"Client"<<"Path";
    JobsTabel->setHorizontalHeaderLabels(header);
    JobsTabel->verticalHeader()->hide();
    JobsTabel->setShowGrid(false);
    setCentralWidget(JobsTabel);
    QTableWidgetItem *EngineerNameItem = new QTableWidgetItem("Shaleish");
    QTableWidgetItem *ClientNameItem = new QTableWidgetItem("Gupco");
    QTableWidgetItem *PathItem = new QTableWidgetItem("path");
    JobsTabel->insertRow(JobsTabel->rowCount());
    JobsTabel->setItem(JobsTabel->rowCount(),0,EngineerNameItem);
    JobsTabel->setItem(JobsTabel->rowCount(),1,ClientNameItem);
    JobsTabel->setItem(JobsTabel->rowCount(),2,PathItem);@
    thx in advance =)



  • You add the items in the wrong row
    rowCount will return 1 if you have one row, but you have to add the items in row number 0 :-)



  • thank uuuuuuuuu =)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.