From 558b3911c8b1ed64103d884ee137e0cf92159fe5 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Sun, 7 Oct 2018 10:42:59 +0200 Subject: [PATCH] Removed warnings and little fixes --- lib/include/DOtherSide/DosIQAbstractItemModelImpl.h | 2 +- lib/include/DOtherSide/DosQAbstractItemModel.h | 2 +- lib/src/DOtherSide.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/include/DOtherSide/DosIQAbstractItemModelImpl.h b/lib/include/DOtherSide/DosIQAbstractItemModelImpl.h index 67935f8..3a33248 100644 --- a/lib/include/DOtherSide/DosIQAbstractItemModelImpl.h +++ b/lib/include/DOtherSide/DosIQAbstractItemModelImpl.h @@ -63,7 +63,7 @@ public: virtual void publicDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) = 0; /// @see QAbstractItemModel::createIndex - virtual QModelIndex publicCreateIndex(int row, int column, void *data = 0) const = 0; + virtual QModelIndex publicCreateIndex(int row, int column, void *data = nullptr) const = 0; /// @see QAbstractItemModel::hasChildren virtual bool defaultHasChildren(const QModelIndex &parent) const = 0; diff --git a/lib/include/DOtherSide/DosQAbstractItemModel.h b/lib/include/DOtherSide/DosQAbstractItemModel.h index 1a2106c..977fdc2 100644 --- a/lib/include/DOtherSide/DosQAbstractItemModel.h +++ b/lib/include/DOtherSide/DosQAbstractItemModel.h @@ -115,7 +115,7 @@ public: bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; /// Expose hasIndex - bool hasIndex(int row, int column, const QModelIndex &parent) const; + bool hasIndex(int row, int column, const QModelIndex &parent) const override; /// Expose the canFetchMore bool canFetchMore(const QModelIndex &parent) const override; diff --git a/lib/src/DOtherSide.cpp b/lib/src/DOtherSide.cpp index 84024dc..abe7c87 100644 --- a/lib/src/DOtherSide.cpp +++ b/lib/src/DOtherSide.cpp @@ -206,7 +206,7 @@ void dos_qpixmap_assign(DosPixmap *vptr, const DosPixmap *other) { if (vptr) { auto lhs = static_cast(vptr); - auto rhs = static_cast(vptr); + auto rhs = static_cast(other); *lhs = rhs ? *rhs : QPixmap(); } } @@ -257,7 +257,7 @@ void dos_qquickview_set_source_url(::DosQQuickView *vptr, ::DosQUrl *url) void dos_qquickview_set_resize_mode(::DosQQuickView *vptr, int resizeMode) { auto view = static_cast(vptr); - view->setResizeMode((QQuickView::ResizeMode) resizeMode); + view->setResizeMode(static_cast(resizeMode)); } ::DosQQmlContext *dos_qquickview_rootContext(::DosQQuickView *vptr) @@ -514,7 +514,7 @@ bool dos_qobject_signal_connect(::DosQObject *senderVPtr, { auto sender = static_cast(senderVPtr); auto receiver = static_cast(receiverVPtr); - return QObject::connect(sender, signal, receiver, method, (Qt::ConnectionType) type); + return QObject::connect(sender, signal, receiver, method, static_cast(type)); } bool dos_qobject_signal_disconnect(::DosQObject *senderVPtr, @@ -658,7 +658,7 @@ void dos_qresource_register(const char *filename) ::DosQUrl *dos_qurl_create(const char *url, int parsingMode) { - return new QUrl(QString::fromUtf8(url), (QUrl::ParsingMode) parsingMode); + return new QUrl(QString::fromUtf8(url), static_cast(parsingMode)); } void dos_qurl_delete(::DosQUrl *vptr) @@ -925,7 +925,7 @@ int dos_qabstractitemmodel_flags(DosQAbstractItemModel *vptr, DosQModelIndex *do auto object = static_cast(vptr); auto model = dynamic_cast(object); auto index = static_cast(dosIndex); - return model->defaultFlags(*index); + return static_cast(model->defaultFlags(*index)); } DosQVariant *dos_qabstractitemmodel_headerData(DosQAbstractItemModel *vptr, int section, int orientation, int role)