equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: LocationPickerProxyModel declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LOCATIONPICKERPROXYMODEL_H |
|
19 #define LOCATIONPICKERPROXYMODEL_H |
|
20 |
|
21 |
|
22 #include <QSortFilterProxyModel> |
|
23 |
|
24 |
|
25 /** Class used for sorting and filtering model items |
|
26 * |
|
27 */ |
|
28 class LocationPickerProxyModel : public QSortFilterProxyModel |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 // constructor |
|
34 LocationPickerProxyModel(QObject *parent = 0); |
|
35 |
|
36 // used to |
|
37 void filterParameterChanged(QString aSearchText); |
|
38 |
|
39 protected: |
|
40 // override QSortFilterProxyModel function to define logic for filter |
|
41 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; |
|
42 // override QSortFilterProxyModel function to define logic for sort |
|
43 bool lessThan(const QModelIndex &left, const QModelIndex &right) const; |
|
44 |
|
45 private: |
|
46 // search string |
|
47 QString mSearchText; |
|
48 }; |
|
49 |
|
50 |
|
51 #endif // LOCATIONPICKERPROXYMODEL_H |