Qt 中QtableView中如何得到任意一行的数据

  • Post author:
  • Post category:其他


生成的两个对象:


    model = new QStandardItemModel;
    tableView = new QTableView(this);



    int colum = index1.column();
    int row = index1.row();

    QString str=model->data(model->index(row,3)).toString();//第row行第3列的内容
    qDebug()<<"pathname = "<<str<<endl;



版权声明:本文为u011418878原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。