commit fa79ff2db2c8e0746447cf7eaa5eebbd575ebe97
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Apr 5 11:47:59 2019 +0200
Resolve some implicit conversion warnings.
---
src/frontends/qt4/GuiIdListModel.cpp | 20 ++++++++++----------
src/frontends/qt4/GuiIdListModel.h | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/frontends/qt4/GuiIdListModel.cpp
b/src/frontends/qt4/GuiIdListModel.cpp
index c80e573..5780cec 100644
--- a/src/frontends/qt4/GuiIdListModel.cpp
+++ b/src/frontends/qt4/GuiIdListModel.cpp
@@ -31,35 +31,35 @@ QVariant GuiIdListModel::data(QModelIndex const & index,
int role) const
if (!rowIsValid(row))
return QVariant();
if (role == Qt::DisplayRole || role == Qt::EditRole)
- return userData_[row].uiString;
+ return userData_[ulong(row)].uiString;
if (role == Qt::ToolTipRole) {
- QString const ttstr = userData_[row].ttString.toString();
- return !ttstr.isEmpty() ? ttstr : userData_[row].uiString;
+ QString const ttstr = userData_[ulong(row)].ttString.toString();
+ return !ttstr.isEmpty() ? ttstr :
userData_[ulong(row)].uiString;
}
if (role == Qt::UserRole)
- return userData_[row].idString;
+ return userData_[ulong(row)].idString;
return QVariant();
}
-bool GuiIdListModel::setData (QModelIndex const & index,
+bool GuiIdListModel::setData(QModelIndex const & index,
const QVariant & value, int role)
{
int const row = index.row();
if (!rowIsValid(row))
return false;
if (role == Qt::DisplayRole || role == Qt::EditRole) {
- userData_[row].uiString = value;
+ userData_[ulong(row)].uiString = value;
dataChanged(index, index);
return true;
}
if (role == Qt::UserRole) {
- userData_[row].idString = value;
+ userData_[ulong(row)].idString = value;
dataChanged(index, index);
return true;
}
if (role == Qt::ToolTipRole) {
- userData_[row].ttString = value;
+ userData_[ulong(row)].ttString = value;
dataChanged(index, index);
return true;
}
@@ -77,7 +77,7 @@ bool GuiIdListModel::insertRows(int row, int count,
return false;
vector<OurData>::iterator it = userData_.begin() + row;
beginInsertRows(QModelIndex(), row, row + count - 1);
- userData_.insert(it, count, OurData());
+ userData_.insert(it, ulong(count), OurData());
endInsertRows();
return true;
}
@@ -122,7 +122,7 @@ QMap<int, QVariant> GuiIdListModel::itemData(QModelIndex
const & index) const
if (!rowIsValid(row))
return QMap<int, QVariant>();
QMap<int, QVariant> qm = QAbstractListModel::itemData(index);
- qm[Qt::UserRole] = userData_[row].idString;
+ qm[Qt::UserRole] = userData_[ulong(row)].idString;
return qm;
}
diff --git a/src/frontends/qt4/GuiIdListModel.h
b/src/frontends/qt4/GuiIdListModel.h
index 03c891d..a63b40d 100644
--- a/src/frontends/qt4/GuiIdListModel.h
+++ b/src/frontends/qt4/GuiIdListModel.h
@@ -45,7 +45,7 @@ public:
//////////////////////////////////////////////////////////////////////
///
int rowCount(QModelIndex const & = QModelIndex()) const
- { return userData_.size(); }
+ { return int(userData_.size()); }
///
virtual QVariant data(QModelIndex const & index,