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
f4ed5d83
Commit
f4ed5d83
authored
Jul 27, 2010
by
Luci Stanescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed methods for consistency
parent
bf616cbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lineedit.py
blink/widgets/lineedit.py
+9
-9
No files found.
blink/widgets/lineedit.py
View file @
f4ed5d83
...
...
@@ -139,7 +139,7 @@ class ValidatingLineEdit(LineEdit):
self
.
initStyleOption
(
option
)
frame_width
=
self
.
style
()
.
pixelMetric
(
QStyle
.
PM_DefaultFrameWidth
,
option
,
self
)
self
.
setMinimumHeight
(
self
.
invalid_entry_label
.
minimumHeight
()
+
2
+
2
*
frame_width
)
self
.
textChanged
.
connect
(
self
.
text_c
hanged
)
self
.
textChanged
.
connect
(
self
.
_SH_TextC
hanged
)
self
.
text_correct
=
True
self
.
text_allowed
=
True
self
.
exceptions
=
set
()
...
...
@@ -150,7 +150,7 @@ class ValidatingLineEdit(LineEdit):
def
_set_regexp
(
self
,
regexp
):
self
.
__dict__
[
'regexp'
]
=
regexp
self
.
validate
()
self
.
_
validate
()
regexp
=
property
(
_get_regexp
,
_set_regexp
)
del
_get_regexp
,
_set_regexp
...
...
@@ -159,10 +159,10 @@ class ValidatingLineEdit(LineEdit):
def
text_valid
(
self
):
return
self
.
text_correct
and
self
.
text_allowed
def
text_c
hanged
(
self
,
text
):
self
.
validate
()
def
_SH_TextC
hanged
(
self
,
text
):
self
.
_
validate
()
def
validate
(
self
):
def
_
validate
(
self
):
text
=
unicode
(
self
.
text
())
text_correct
=
self
.
regexp
.
search
(
text
)
is
not
None
text_allowed
=
text
not
in
self
.
exceptions
...
...
@@ -174,11 +174,11 @@ class ValidatingLineEdit(LineEdit):
def
addException
(
self
,
exception
):
self
.
exceptions
.
add
(
exception
)
self
.
validate
()
self
.
_
validate
()
def
removeException
(
self
,
exception
):
self
.
exceptions
.
remove
(
exception
)
self
.
validate
()
self
.
_
validate
()
class
SearchIcon
(
QWidget
):
...
...
@@ -268,10 +268,10 @@ class SearchBox(LineEdit):
self
.
setMinimumHeight
(
widgets_height
+
2
+
2
*
frame_width
)
self
.
clear_button
.
hide
()
self
.
clear_button
.
clicked
.
connect
(
self
.
clear
)
self
.
textChanged
.
connect
(
self
.
text_c
hanged
)
self
.
textChanged
.
connect
(
self
.
_SH_TextC
hanged
)
self
.
inactiveText
=
u"Search"
def
text_c
hanged
(
self
,
text
):
def
_SH_TextC
hanged
(
self
,
text
):
self
.
clear_button
.
setVisible
(
not
text
.
isEmpty
())
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