aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/proxytestinnermodel.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2013-10-16 17:20:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-21 09:09:15 +0200
commit9bbb073592989565ec407c19ec2492dfba9317c4 (patch)
tree255b3de8d83da47c4f71f1c0fb514e140f4f37e8 /tests/auto/quick/qquicklistview/proxytestinnermodel.h
parentb93ddb95a74fff4bc61073b6b04e9dd7a7dc7f36 (diff)
Reset on model layout changed
Otherwise the next dataChanged from the model may not be received Change-Id: I16b859d92fdb1823c4a56c297d4451abe438fbb1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/proxytestinnermodel.h')
-rw-r--r--tests/auto/quick/qquicklistview/proxytestinnermodel.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/proxytestinnermodel.h b/tests/auto/quick/qquicklistview/proxytestinnermodel.h
new file mode 100644
index 0000000000..1983e69d49
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/proxytestinnermodel.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Canonical Limited and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef INNERMODEL_H
+#define INNERMODEL_H
+
+#include <QAbstractItemModel>
+
+class ProxyTestInnerModel : public QAbstractItemModel
+{
+ Q_OBJECT
+public:
+ ProxyTestInnerModel();
+ virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+ virtual QModelIndex parent(const QModelIndex & /*parent*/) const;
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ virtual int columnCount(const QModelIndex &parent) const;
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+
+ Q_INVOKABLE void doStuff();
+
+private:
+ void append(const QString &s);
+ void setValue(int i, const QString &s);
+ void moveTwoToZero();
+
+private:
+ QList<QString> m_values;
+};
+
+#endif