diff options
author | Boris Barbulovski <bbarbulovski@gmail.com> | 2014-02-09 18:18:54 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-09 14:42:06 -0800 |
commit | bbac1438cf4cc79c83940b4ae38cf442455404d5 (patch) | |
tree | ec3074af3ea2b7bceb3125cc88db7b2ef42c60b4 /qt-ui/divelistview.cpp | |
parent | 2d3e48f4ae0c0137030988451e3fcb42c2320a8d (diff) | |
download | subsurface-bbac1438cf4cc79c83940b4ae38cf442455404d5.tar.gz |
DiveListView tiny cleanup
* Change 'searchBox' member type from 'QLineEdit *' to 'QLineEdit'
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 50d3a8bf3..014f00583 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -28,7 +28,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelection(false), - sortColumn(0), currentOrder(Qt::DescendingOrder), searchBox(new QLineEdit(this)) + sortColumn(0), currentOrder(Qt::DescendingOrder), searchBox(this) { setItemDelegate(new DiveListDelegate(this)); setUniformRowHeights(true); @@ -51,10 +51,10 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec showSearchBox->setShortcutContext(Qt::WindowShortcut); addAction(showSearchBox); - searchBox->installEventFilter(this); - searchBox->hide(); + searchBox.installEventFilter(this); + searchBox.hide(); connect(showSearchBox, SIGNAL(triggered(bool)), this, SLOT(showSearchEdit())); - connect(searchBox, SIGNAL(textChanged(QString)), model, SLOT(setFilterFixedString(QString))); + connect(&searchBox, SIGNAL(textChanged(QString)), model, SLOT(setFilterFixedString(QString))); setupUi(); } @@ -275,8 +275,8 @@ void DiveListView::selectDives(const QList< int >& newDiveSelection) void DiveListView::showSearchEdit() { - searchBox->show(); - searchBox->setFocus(); + searchBox.show(); + searchBox.setFocus(); } bool DiveListView::eventFilter(QObject* , QEvent* event) @@ -287,8 +287,8 @@ bool DiveListView::eventFilter(QObject* , QEvent* event) if (keyEv->key() != Qt::Key_Escape) return false; - searchBox->clear(); - searchBox->hide(); + searchBox.clear(); + searchBox.hide(); QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel*>(model()); m->setFilterFixedString(QString()); return true; |