diff options
author | Frédéric Brière <fbriere@fbriere.net> | 2016-01-10 19:12:00 -0500 |
---|---|---|
committer | Frédéric Brière <fbriere@fbriere.net> | 2016-01-10 19:21:12 -0500 |
commit | 9cf3a88c29861cc2341fe1f3be4fcc96d1540d52 (patch) | |
tree | c7fa69c4def491cc8714e96aa13ec334a2f77bb7 | |
parent | e1cef093bfc67027cb5c403f8e1e4db86fab3af0 (diff) | |
download | twinkle-9cf3a88c29861cc2341fe1f3be4fcc96d1540d52.tar twinkle-9cf3a88c29861cc2341fe1f3be4fcc96d1540d52.tar.gz twinkle-9cf3a88c29861cc2341fe1f3be4fcc96d1540d52.tar.lz twinkle-9cf3a88c29861cc2341fe1f3be4fcc96d1540d52.tar.xz twinkle-9cf3a88c29861cc2341fe1f3be4fcc96d1540d52.zip |
Initially sort address book entries
-rw-r--r-- | src/gui/addresstablemodel.cpp | 5 | ||||
-rw-r--r-- | src/gui/addresstablemodel.h | 5 | ||||
-rw-r--r-- | src/gui/getaddressform.cpp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/addresstablemodel.cpp b/src/gui/addresstablemodel.cpp index d706b94..6a891de 100644 --- a/src/gui/addresstablemodel.cpp +++ b/src/gui/addresstablemodel.cpp @@ -19,11 +19,6 @@ #include "addresstablemodel.h" #include <QtDebug> -// Columns -#define COL_ADDR_NAME 0 -#define COL_ADDR_PHONE 1 -#define COL_ADDR_REMARK 2 - AddressTableModel::AddressTableModel(QObject *parent, const list<t_address_card>& data) : QAbstractTableModel(parent) { diff --git a/src/gui/addresstablemodel.h b/src/gui/addresstablemodel.h index c38b9ac..b1c7772 100644 --- a/src/gui/addresstablemodel.h +++ b/src/gui/addresstablemodel.h @@ -23,6 +23,11 @@ #include <QAbstractTableModel> #include <QList> +// Columns +#define COL_ADDR_NAME 0 +#define COL_ADDR_PHONE 1 +#define COL_ADDR_REMARK 2 + class AddressTableModel : public QAbstractTableModel { private: diff --git a/src/gui/getaddressform.cpp b/src/gui/getaddressform.cpp index 4b1fd26..2303c38 100644 --- a/src/gui/getaddressform.cpp +++ b/src/gui/getaddressform.cpp @@ -49,6 +49,8 @@ GetAddressForm::GetAddressForm(QWidget *parent) m_model = new AddressTableModel(this, ab_local->get_address_list()); localListView->setModel(m_model); + localListView->sortByColumn(COL_ADDR_NAME, Qt::AscendingOrder); + #if QT_VERSION >= 0x050000 localListView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); #else |