Start with the current data, when editing a table cell.
This commit is contained in:
@ -82,7 +82,6 @@ QString GenericCore::getMaintenanceToolFilePath() const {
|
||||
|
||||
/// setting the applicationDirPath hard coded to test update feature from IDE
|
||||
#ifdef QT_DEBUG
|
||||
// REFACTOR retrieve application name automatically instead of using hard coded name
|
||||
applicationDirPath = QString("/opt/%1").arg(APPLICATION_NAME);
|
||||
#endif
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ static const QHash<int, QByteArray> ROLE_NAMES = {{NameRole, "Name"},
|
||||
|
||||
TableModel::TableModel(QObject* parent)
|
||||
: QAbstractTableModel{parent} {
|
||||
for (int row = 0; row < 23; ++row) {
|
||||
for (int row = 0; row < 5; ++row) {
|
||||
QHash<int, QVariant> values;
|
||||
values[NameRole] = QString("Item %1").arg(row);
|
||||
values[DescriptionRole] = QString("This is item %1").arg(row);
|
||||
@ -46,6 +46,7 @@ QVariant TableModel::data(const QModelIndex& index, int role) const {
|
||||
int roleForColumn = getRoleForColumn(column);
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
case Qt::EditRole:
|
||||
return m_items.at(row)->data(roleForColumn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user