Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
9363efc8
Commit
9363efc8
authored
Mar 25, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented sorting for the contact search list
parent
ce0b30bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
contacts.py
blink/contacts.py
+5
-3
No files found.
blink/contacts.py
View file @
9363efc8
...
@@ -258,6 +258,7 @@ class ContactSearchModel(QSortFilterProxyModel):
...
@@ -258,6 +258,7 @@ class ContactSearchModel(QSortFilterProxyModel):
super
(
ContactSearchModel
,
self
)
.
__init__
(
parent
)
super
(
ContactSearchModel
,
self
)
.
__init__
(
parent
)
self
.
setSourceModel
(
model
)
self
.
setSourceModel
(
model
)
self
.
setDynamicSortFilter
(
True
)
self
.
setDynamicSortFilter
(
True
)
self
.
sort
(
0
)
def
data
(
self
,
index
,
role
=
Qt
.
DisplayRole
):
def
data
(
self
,
index
,
role
=
Qt
.
DisplayRole
):
data
=
super
(
ContactSearchModel
,
self
)
.
data
(
index
,
role
)
data
=
super
(
ContactSearchModel
,
self
)
.
data
(
index
,
role
)
...
@@ -272,8 +273,9 @@ class ContactSearchModel(QSortFilterProxyModel):
...
@@ -272,8 +273,9 @@ class ContactSearchModel(QSortFilterProxyModel):
search_string
=
unicode
(
self
.
filterRegExp
()
.
pattern
())
.
lower
()
search_string
=
unicode
(
self
.
filterRegExp
()
.
pattern
())
.
lower
()
return
search_string
in
item
.
name
.
lower
()
or
search_string
in
item
.
uri
.
lower
()
return
search_string
in
item
.
name
.
lower
()
or
search_string
in
item
.
uri
.
lower
()
def
lessThan
(
self
,
left
,
right
):
def
lessThan
(
self
,
left_index
,
right_index
):
print
"lessThan"
,
left
,
right
,
left
.
model
()
.
data
(
left
,
Qt
.
DisplayRole
)
left_item
=
left_index
.
model
()
.
data
(
left_index
,
Qt
.
DisplayRole
)
return
super
(
ContactSearchModel
,
self
)
.
lessThan
(
left
,
right
)
right_item
=
right_index
.
model
()
.
data
(
right_index
,
Qt
.
DisplayRole
)
return
left_item
.
name
<
right_item
.
name
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment