467,920 Members | 1,170 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,920 developers. It's quick & easy.

About the slot declaration decorator in PyQt4

I remember when I did UI Design in PyQt4 for the first time, I found a
manual. In it, no "connect" was used. Instead, an OO approach is
applied, new UI classes inherit from old ones, and all the slot
functions are automatically connected to some signals, using a
decorator. In the __init__ function of our newly written class,
"connect" is not invoked.

I like this style...

Unfortunately, I cannot find that manual now.... So anyone have read
something like that before? If so, could you tell me where can I find
that manual please? Thank you :)
Jul 14 '08 #1
  • viewed: 1994
Share:
2 Replies
Bighead <Xu*********@gmail.com>:
I remember when I did UI Design in PyQt4 for the first time, I found a
manual. In it, no "connect" was used. Instead, an OO approach is
applied, new UI classes inherit from old ones, and all the slot
functions are automatically connected to some signals, using a
decorator. In the __init__ function of our newly written class,
"connect" is not invoked.

I like this style...

Unfortunately, I cannot find that manual now.... So anyone have read
something like that before? If so, could you tell me where can I find
that manual please? Thank you :)
I guess, you're referring to QtCore.pyqtSignature and
QtCore.QMetaObject.connectSlotsByName.

See
http://www.riverbankcomputing.co.uk/...ture-decorator

Especially "3.7.3 Connecting Slots By Name"

Hih

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Jul 14 '08 #2
On Jul 15, 2:04 am, "Sebastian \"lunar\" Wiesner"
<basti.wies...@gmx.netwrote:
Bighead <Xue.Huic...@gmail.com>:
I remember when I did UI Design in PyQt4 for the first time, I found a
manual. In it, no "connect" was used. Instead, an OO approach is
applied, new UI classes inherit from old ones, and all the slot
functions are automatically connected to some signals, using a
decorator. In the __init__ function of our newly written class,
"connect" is not invoked.
I like this style...
Unfortunately, I cannot find that manual now.... So anyone have read
something like that before? If so, could you tell me where can I find
that manual please? Thank you :)

I guess, you're referring to QtCore.pyqtSignature and
QtCore.QMetaObject.connectSlotsByName.

Seehttp://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#t...

Especially "3.7.3 Connecting Slots By Name"

Hih

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Oh yes, that's it! connectSlotsByName. That is the reason I though Qt
was easy to use.

This will be much easier :) Thank you very much.
Jul 15 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Paul Morrow | last post: by
161 posts views Thread by KraftDiner | last post: by
3 posts views Thread by Tina I | last post: by
reply views Thread by Pradnyesh Sawant | last post: by
2 posts views Thread by Pradnyesh Sawant | last post: by
reply views Thread by Pradnyesh Sawant | last post: by
2 posts views Thread by jiang.haiyun | last post: by
2 posts views Thread by Alexander Eisenhuth | last post: by
reply views Thread by kunalgalav | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.