C++ (Qt)QVariant data(const QModelIndex &index, int role) const{static int i = 0; i = qMax(i, index.row ()); return (role == Qt::DisplayRole) ? QString::number (i): QVariant();}
C++ (Qt)w.show();w.resizeColumnsToContents ();
C++ (Qt) QVariant data(const QModelIndex &index, int role) const { static int i = 0; if (role == Qt::DisplayRole) { qDebug() << ++i; return i; } return QVariant(); }
C++ (Qt) if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole)) return QVariant(); int id = index.row() * nColumns + index.column(); int arrayOffset = id * typeSize[type] + offset; if (arrayOffset + typeSize[type] > dataArray->size()) return QVariant(); const char* pointer = static_cast<const char*>(dataPtr) + arrayOffset; switch (type) { case Hex: return QString("%1").arg(reinterpret_cast<const uchar*>(pointer)[0], 2, 16, QChar('0')).toUpper(); .... return QVariant();