diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-18 14:06:19 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-18 17:04:40 +0000 |
commit | 1eeeca9d202ceaf11b2935ebe590a85145d33ef5 (patch) | |
tree | 2feffe49d30a95abd5e30bd480ed684aba969b2b /examples/quickcontrols2/contactlist/contactmodel.h | |
parent | 0cfadeb6de542548c45ef485a4452e820cefb401 (diff) |
Overhaul the Contact List example
Some renames, API tweaks, and structural changes. Glue the pieces
(view/model/dialog) together in contactlist.qml.
Change-Id: Id3a31248b391838c6d39f2f0f355e1c35456ccf5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2/contactlist/contactmodel.h')
-rw-r--r-- | examples/quickcontrols2/contactlist/contactmodel.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/quickcontrols2/contactlist/contactmodel.h b/examples/quickcontrols2/contactlist/contactmodel.h index 2776905f..d09602c4 100644 --- a/examples/quickcontrols2/contactlist/contactmodel.h +++ b/examples/quickcontrols2/contactlist/contactmodel.h @@ -72,13 +72,10 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QHash<int, QByteArray> roleNames() const; - Q_INVOKABLE QString getFullName(int row) const; - Q_INVOKABLE QString getAddress(int row) const; - Q_INVOKABLE QString getCity(int row) const; - Q_INVOKABLE QString getNumber(int row) const; - - Q_INVOKABLE void updateContact(int row, const QString &fullName, const QString &address, const QString &city, const QString &number); - Q_INVOKABLE void removeContact(int row); + Q_INVOKABLE QVariantMap get(int row) const; + Q_INVOKABLE void append(const QString &fullName, const QString &address, const QString &city, const QString &number); + Q_INVOKABLE void set(int row, const QString &fullName, const QString &address, const QString &city, const QString &number); + Q_INVOKABLE void remove(int row); private: struct Contact { |