1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 03:42:48 +01: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 { int AnimationListModel::rowCount(const QModelIndex&) const {
return animations.size(); return static_cast<int>(animations.size());
} }
int AnimationListModel::columnCount(const QModelIndex&) const { int AnimationListModel::columnCount(const QModelIndex&) const {

View File

@ -16,15 +16,15 @@ public:
: QAbstractListModel(parent), animations(anims) { : 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, QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const; int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation, QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const; int role = Qt::DisplayRole) const override;
const AnimationList& getAnimations() const { const AnimationList& getAnimations() const {
return animations; return animations;

View File

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

View File

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

View File

@ -14,7 +14,7 @@ ItemListModel::ItemListModel(GameWorld *world, QObject *parent)
} }
int ItemListModel::rowCount(const QModelIndex &) const { 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 { int ItemListModel::columnCount(const QModelIndex &) const {

View File

@ -19,17 +19,17 @@ public:
qint16 getIDOf(unsigned int row) const; 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, QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const; int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation, QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const; 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 #endif // ITEMLISTMODEL_HPP

View File

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

View File

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

View File

@ -17,17 +17,17 @@ public:
return _gameData; 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, QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const; int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation, QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const; 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_ #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(); beginResetModel();
m_textMap = textMap; m_textMap = textMap;
endResetModel(); endResetModel();
} }
int TextModel::rowCount(const QModelIndex &) const { 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 { 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 { const GameString &TextModel::lookupIndex(const QModelIndex &index) const {

View File

@ -19,7 +19,7 @@ class TextModel : public QAbstractTableModel {
Q_OBJECT Q_OBJECT
public: public:
TextModel(QObject *parent = nullptr); TextModel(QObject *parent = nullptr);
void setData(const TextMapType &textMap); void setMapData(const TextMapType &textMap);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(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; 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()); textMap.keys.resize(keys.size());
std::move(keys.begin(), keys.end(), textMap.keys.begin()); std::move(keys.begin(), keys.end(), textMap.keys.begin());
textModel->setData(textMap); textModel->setMapData(textMap);
} }
std::vector<std::string> TextViewer::getFontTextureNames() { std::vector<std::string> TextViewer::getFontTextureNames() {

View File

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