天天看点

model中的index()函数

        QModelIndex  TradeTableModel::index ( int row, int column, const QModelIndex & parent) const

        {

            if (row < 0 || column < 0)

            {

                return QModelIndex();

            }

            return createIndex(row, column);//创建当前row和column处item的QModelIndex

        }

//根据行列,返回相应的QModelIndex,