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
88df2801
Commit
88df2801
authored
Mar 23, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the new style of defining signals, slots and connecting them
parent
4df84b45
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
lineedit.py
blink/widgets/lineedit.py
+6
-4
searchbox.py
blink/widgets/searchbox.py
+3
-3
No files found.
blink/widgets/lineedit.py
View file @
88df2801
# Copyright (c) 2010 AG Projects. See LICENSE for details.
#
from
PyQt4.QtCore
import
Qt
,
QEvent
,
SIGNAL
from
PyQt4.QtCore
import
Qt
,
QEvent
,
pyqtSignal
from
PyQt4.QtGui
import
QLineEdit
,
QBoxLayout
,
QHBoxLayout
,
QLayout
,
QPainter
,
QPalette
,
QSpacerItem
,
QSizePolicy
,
QStyle
,
QWidget
,
QStyleOptionFrameV2
from
blink.widgets.util
import
QtDynamicProperty
class
SideWidget
(
QWidget
):
sizeHintChanged
=
pyqtSignal
()
def
__init__
(
self
,
parent
=
None
):
QWidget
.
__init__
(
self
,
parent
)
def
event
(
self
,
event
):
if
event
.
type
()
==
QEvent
.
LayoutRequest
:
self
.
emit
(
SIGNAL
(
"sizeHintChanged()"
)
)
self
.
sizeHintChanged
.
emit
(
)
return
QWidget
.
event
(
self
,
event
)
...
...
@@ -38,8 +40,8 @@ class LineEdit(QLineEdit):
self
.
right_layout
.
setDirection
(
box_direction
)
self
.
right_layout
.
addItem
(
QSpacerItem
(
0
,
0
,
QSizePolicy
.
Expanding
,
QSizePolicy
.
Minimum
))
self
.
widgetSpacing
=
2
self
.
connect
(
self
.
left_widget
,
SIGNAL
(
"sizeHintChanged()"
),
self
.
_update_text_margins
)
self
.
connect
(
self
.
right_widget
,
SIGNAL
(
"sizeHintChanged()"
),
self
.
_update_text_margins
)
self
.
left_widget
.
sizeHintChanged
.
connect
(
self
.
_update_text_margins
)
self
.
right_widget
.
sizeHintChanged
.
connect
(
self
.
_update_text_margins
)
@
property
def
left_margin
(
self
):
...
...
blink/widgets/searchbox.py
View file @
88df2801
# Copyright (c) 2010 AG Projects. See LICENSE for details.
#
from
PyQt4.QtCore
import
Qt
,
SIGNAL
,
SLOT
from
PyQt4.QtCore
import
Qt
from
PyQt4.QtGui
import
QAbstractButton
,
QPainter
,
QPalette
,
QPixmap
,
QWidget
from
blink.resources
import
Resources
...
...
@@ -88,8 +88,8 @@ class SearchBox(LineEdit):
self
.
addHeadWidget
(
self
.
search_icon
)
self
.
addTailWidget
(
self
.
clear_button
)
self
.
clear_button
.
hide
()
self
.
c
onnect
(
self
.
clear_button
,
SIGNAL
(
"clicked()"
),
self
,
SLOT
(
"clear()"
)
)
self
.
connect
(
self
,
SIGNAL
(
"textChanged(const QString&)"
),
self
.
text_changed
)
self
.
c
lear_button
.
clicked
.
connect
(
self
.
clear
)
self
.
textChanged
.
connect
(
self
.
text_changed
)
self
.
inactiveText
=
u"Search"
def
text_changed
(
self
,
text
):
...
...
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