summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@nokia.com>2012-01-24 07:46:44 +0100
committerJens Bache-Wiig <jens.bache-wiig@nokia.com>2012-01-24 07:46:44 +0100
commit8c5ce3be9e9f6e6d40c23909b03ef5370ba60ecd (patch)
tree06d1bdc61182bf9645c748322cd7e56dc4654ff3
parent4d5e5cd2bd853ca9e9751abd184dade43dacc5f2 (diff)
downloadqtquickcontrols-8c5ce3be9e9f6e6d40c23909b03ef5370ba60ecd.tar.gz
Fixed broken renaming
-rw-r--r--src/qtmenu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qtmenu.cpp b/src/qtmenu.cpp
index 98ac4deb..55c8fd47 100644
--- a/src/qtmenu.cpp
+++ b/src/qtmenu.cpp
@@ -208,10 +208,11 @@ void QtMenu::setModel(const QVariant &newModel) {
m_hasNativeModel = false;
m_model = newModel;
+
if (QAbstractItemModel *model = qobject_cast<QAbstractItemModel*>(newModel.value<QObject*>())) {
m_hasNativeModel = true;
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(rebuildMenu()));
- } else if (arg.canConvert(QVariant::StringList)) {
+ } else if (newModel.canConvert(QVariant::StringList)) {
m_hasNativeModel = true;
}
emit modelChanged(m_model);