summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-11-26 14:27:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-28 08:43:31 +0100
commit5a9de4c6768e413a56f0e7b6c67ea11db761cd58 (patch)
treee3ec0253adfdad29378b273e038136994e1ef0b3 /examples
parent5dcc36b15c479f532ffd0b5c1330e683fcf8781e (diff)
Always use QAIM to get the default flags.
Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/itemviews/interview/model.cpp2
-rw-r--r--examples/widgets/itemviews/puzzle/piecesmodel.cpp2
-rw-r--r--examples/widgets/itemviews/simpledommodel/dommodel.cpp2
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/mymodel.cpp4
6 files changed, 7 insertions, 7 deletions
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 4eb2abdd6f..f3f961e59e 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -89,7 +89,7 @@ Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const
if (!index.isValid())
return 0;
- return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+ return Qt::ItemIsEditable | QAbstractItemModel::flags(index);
}
//! [3]
diff --git a/examples/widgets/itemviews/interview/model.cpp b/examples/widgets/itemviews/interview/model.cpp
index e99eb477fb..aaecc72b32 100644
--- a/examples/widgets/itemviews/interview/model.cpp
+++ b/examples/widgets/itemviews/interview/model.cpp
@@ -125,7 +125,7 @@ Qt::ItemFlags Model::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
- return (Qt::ItemIsDragEnabled|Qt::ItemIsSelectable|Qt::ItemIsEnabled);
+ return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index);
}
Model::Node *Model::node(int row, Node *parent) const
diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.cpp b/examples/widgets/itemviews/puzzle/piecesmodel.cpp
index 29ce9c8ea5..c7ff78a049 100644
--- a/examples/widgets/itemviews/puzzle/piecesmodel.cpp
+++ b/examples/widgets/itemviews/puzzle/piecesmodel.cpp
@@ -81,7 +81,7 @@ void PiecesModel::addPiece(const QPixmap &pixmap, const QPoint &location)
Qt::ItemFlags PiecesModel::flags(const QModelIndex &index) const
{
if (index.isValid())
- return (Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled);
+ return (QAbstractListModel::flags(index)|Qt::ItemIsDragEnabled);
return Qt::ItemIsDropEnabled;
}
diff --git a/examples/widgets/itemviews/simpledommodel/dommodel.cpp b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
index cf43ebdf3c..7280466ad1 100644
--- a/examples/widgets/itemviews/simpledommodel/dommodel.cpp
+++ b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
@@ -105,7 +105,7 @@ Qt::ItemFlags DomModel::flags(const QModelIndex &index) const
if (!index.isValid())
return 0;
- return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+ return QAbstractItemModel::flags(index);
}
//! [5]
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index 363aa0593a..0eef22d45b 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -99,7 +99,7 @@ Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const
if (!index.isValid())
return 0;
- return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+ return QAbstractItemModel::flags(index);
}
//! [4]
diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
index f64e0d563a..7792c1cc2b 100644
--- a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
@@ -94,8 +94,8 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
//-----------------------------------------------------------------
//! [quoting mymodel_f]
-Qt::ItemFlags MyModel::flags(const QModelIndex & /*index*/) const
+Qt::ItemFlags MyModel::flags(const QModelIndex &index) const
{
- return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled ;
+ return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
}
//! [quoting mymodel_f]