summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-12-03 06:25:45 +0100
committerArno <arno@disconnect.de>2018-12-03 06:25:45 +0100
commit59fa32ed740080495dbbc255106ac09793a9e9d8 (patch)
tree389779ef09c461c7d7c1260e14cf26c392918fa0
parenta5509fe5925e6099275d402d527f8b740ef091ec (diff)
downloadSheMov-59fa32ed740080495dbbc255106ac09793a9e9d8.tar.gz
SheMov-59fa32ed740080495dbbc255106ac09793a9e9d8.tar.bz2
SheMov-59fa32ed740080495dbbc255106ac09793a9e9d8.zip
Fix clang warnings in SmTreeModel
-rw-r--r--smtreemodel.cpp14
-rw-r--r--smtreemodel.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp
index 1386179..98490fc 100644
--- a/smtreemodel.cpp
+++ b/smtreemodel.cpp
@@ -13,7 +13,7 @@
#include "smtreeitem.h"
#include "smglobals.h"
-SmTreeModel::SmTreeModel(const QStringList &headers, QObject *parent) : QAbstractItemModel(parent), mRootItem(0){
+SmTreeModel::SmTreeModel(const QStringList &headers, QObject *parent) : QAbstractItemModel(parent), mRootItem(nullptr){
mHeaders = headers;
for(int i = 0; i < mHeaders.size(); ++i){
mHeaderData.insert(mHeaders.at(i), i);
@@ -72,7 +72,7 @@ QModelIndex SmTreeModel::parent(const QModelIndex &child) const{
Qt::ItemFlags SmTreeModel::flags(const QModelIndex &index) const{
if(!index.isValid()){
- return 0;
+ return Qt::NoItemFlags;
}
return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
@@ -127,7 +127,7 @@ bool SmTreeModel::setData(const QModelIndex &index, const QVariant &value, int r
}
QModelIndex SmTreeModel::find(const QVariant &value, int column, const QModelIndex &pIdx) const{
- SmTreeItem *parentItem = 0;
+ SmTreeItem *parentItem = nullptr;
if(!pIdx.isValid()){
parentItem = root();
}else{
@@ -248,10 +248,10 @@ void SmTreeModel::reparent(const QModelIndex &idx, const QModelIndex &newParent,
bool SmTreeModel::insertRows(int row, int count, const QModelIndex &pIdx){
SmTreeItem *parentItem = itemAt(pIdx);
- bool retval;
+ bool retval = false;
if(row > parentItem->childCount()){
- return false;
+ return retval;
}
beginInsertRows(pIdx, row, row + count - 1);
@@ -265,10 +265,10 @@ bool SmTreeModel::insertRows(int row, int count, const QModelIndex &pIdx){
bool SmTreeModel::removeRows(int row, int count, const QModelIndex &pIdx){
SmTreeItem *parentItem = itemAt(pIdx);
- bool retval;
+ bool retval = false;
if(row > parentItem->childCount()){
- return false;
+ return retval;
}
beginRemoveRows(pIdx, row, row + count - 1);
diff --git a/smtreemodel.h b/smtreemodel.h
index 5f7ad7e..cb55186 100644
--- a/smtreemodel.h
+++ b/smtreemodel.h
@@ -18,7 +18,7 @@ class SmTreeItem;
class SmTreeModel : public QAbstractItemModel {
Q_OBJECT
public:
- explicit SmTreeModel(const QStringList &headers, QObject *parent = 0);
+ explicit SmTreeModel(const QStringList &headers, QObject *parent = nullptr);
virtual ~SmTreeModel();
// counts