1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 09:07:19 +02:00

rwviewer: fix Visual Studio warnings

This commit is contained in:
Anonymous Maarten 2018-08-30 02:19:38 +02:00
parent 2a1163d391
commit 089b49b77a
13 changed files with 39 additions and 39 deletions

View File

@ -25,7 +25,7 @@ QVariant AnimationListModel::headerData(int section,
}
int AnimationListModel::rowCount(const QModelIndex&) const {
return animations.size();
return static_cast<int>(animations.size());
}
int AnimationListModel::columnCount(const QModelIndex&) const {

View File

@ -16,15 +16,15 @@ public:
: QAbstractListModel(parent), animations(anims) {
}
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
virtual QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
const AnimationList& getAnimations() const {
return animations;

View File

@ -30,7 +30,7 @@ QVariant IMGArchiveModel::headerData(int section, Qt::Orientation orientation,
}
int IMGArchiveModel::rowCount(const QModelIndex&) const {
return archive.getAssetCount();
return static_cast<int>(archive.getAssetCount());
}
int IMGArchiveModel::columnCount(const QModelIndex&) const {

View File

@ -14,19 +14,19 @@ public:
: QAbstractListModel(parent), archive(archive) {
}
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
virtual QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
const LoaderIMG& getArchive() const {
return archive;
}
};
#endif
#endif

View File

@ -14,7 +14,7 @@ ItemListModel::ItemListModel(GameWorld *world, QObject *parent)
}
int ItemListModel::rowCount(const QModelIndex &) const {
return _world->data->modelinfo.size();
return static_cast<int>(_world->data->modelinfo.size());
}
int ItemListModel::columnCount(const QModelIndex &) const {

View File

@ -19,17 +19,17 @@ public:
qint16 getIDOf(unsigned int row) const;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
virtual QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex& parent) const;
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
};
#endif // ITEMLISTMODEL_HPP

View File

@ -13,7 +13,7 @@ int DFFFramesTreeModel::columnCount(const QModelIndex&) const {
int DFFFramesTreeModel::rowCount(const QModelIndex& parent) const {
ModelFrame* f = static_cast<ModelFrame*>(parent.internalPointer());
if (f) {
return f->getChildren().size();
return static_cast<int>(f->getChildren().size());
}
if (parent.row() == -1) {
@ -40,7 +40,7 @@ QModelIndex DFFFramesTreeModel::parent(const QModelIndex& child) const {
if (cp->getParent()) {
for (size_t i = 0; i < cp->getParent()->getChildren().size(); ++i) {
if (cp->getParent()->getChildren()[i].get() == c->getParent()) {
return createIndex(i, 0, c->getParent());
return createIndex(static_cast<int>(i), 0, c->getParent());
}
}
} else {

View File

@ -5,7 +5,7 @@ ObjectListModel::ObjectListModel(GameData *dat, QObject *parent)
}
int ObjectListModel::rowCount(const QModelIndex &) const {
return _gameData->modelinfo.size();
return static_cast<int>(_gameData->modelinfo.size());
}
int ObjectListModel::columnCount(const QModelIndex &) const {

View File

@ -17,17 +17,17 @@ public:
return _gameData;
}
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
virtual QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex& parent) const;
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
};
#endif // _OBJECTLISTMODEL_HPP_

View File

@ -8,18 +8,18 @@ TextModel::TextModel(QObject *parent)
}
void TextModel::setData(const TextMapType &textMap) {
void TextModel::setMapData(const TextMapType &textMap) {
beginResetModel();
m_textMap = textMap;
endResetModel();
}
int TextModel::rowCount(const QModelIndex &) const {
return m_textMap.keys.size();
return static_cast<int>(m_textMap.keys.size());
}
int TextModel::columnCount(const QModelIndex &) const {
return m_textMap.languages.size();
return static_cast<int>(m_textMap.languages.size());
}
const GameString &TextModel::lookupIndex(const QModelIndex &index) const {

View File

@ -19,7 +19,7 @@ class TextModel : public QAbstractTableModel {
Q_OBJECT
public:
TextModel(QObject *parent = nullptr);
void setData(const TextMapType &textMap);
void setMapData(const TextMapType &textMap);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

View File

@ -217,7 +217,7 @@ void TextViewer::worldChanged() {
textMap.keys.resize(keys.size());
std::move(keys.begin(), keys.end(), textMap.keys.begin());
textModel->setData(textMap);
textModel->setMapData(textMap);
}
std::vector<std::string> TextViewer::getFontTextureNames() {

View File

@ -39,7 +39,7 @@ class TextViewer : public ViewerInterface {
QLineEdit *hexLineEdit;
QTextEdit *textEdit;
virtual void worldChanged() override;
void worldChanged() override;
GameString currentGameString;
font_t currentFont;