summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/addresstablemodel.cpp5
-rw-r--r--src/gui/addresstablemodel.h5
-rw-r--r--src/gui/getaddressform.cpp2
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