Read from tableview

  • How i can read data, from tableview
    my code
    @model->setHeaderData(0, Qt::Horizontal, QObject::tr("Subject"));
    model->setHeaderData(1, Qt::Horizontal, QObject::tr("Sender"));
    model->setHeaderData(2, Qt::Horizontal, QObject::tr("Date"));
    from 1 column 1 row and 3 column 3 row

  • You read data from the model (QAbstractItemModel::data()), not the view. I don't see what that has to do with the code snippet you posted though.

  • <- screenshoot
    @edited all
    now i reading by this
    QString qs = model ->data(model->index(0, 0),Qt::DisplayRole).toString();
    and adding to last row by this
    @model->insertRow(model ->rowCount());
    model->setData(model->index(model ->rowCount()-1, 0),ui->comboBox->currentText());@
    ty for trying to help me

Log in to reply

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