473,245 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,245 software developers and data experts.

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
2 2192
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Paul Morrow | last post by:
I like many am not wild about the <at> operator. I also don't think that the decorator syntax should be so directly attached to the method, since what we're trying to do is to say something about...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
3
by: Tina I | last post by:
I'm trying to 'convert' my self from Qt3 to Qt4 (it rocks!) and one thing seem strange: With Qt3 I usually did "from qt import *", but this does not seem to work with Qt4. I have to use "from...
0
by: Pradnyesh Sawant | last post by:
Hello, i've written a small pyqt code which increments a counter in the backend, and prints it on the frontend. However, i'm passing a dummy string var along with it in the signal/slot mechanism....
2
by: Pradnyesh Sawant | last post by:
Hello, I have a pyqt4 code in which i'm trying the signal/slot mechanism. The (stripped) code is as follows: class D(QtCore.QThread): def __init__(self): QtCore.QThread.__init__(self) tpl =...
0
by: Pradnyesh Sawant | last post by:
Hello, i have the following code: ################################################################# import time import sys from PyQt4 import QtGui, QtCore class Counter(QtCore.QThread): def...
2
by: jiang.haiyun | last post by:
Hi, I am having some serious problems with PyQT4, when i run pyqt script, I always get 'Segmentation fault'. the script is simple: ====================== %less qttest.py from PyQt4 import...
2
by: Alexander Eisenhuth | last post by:
Hello pyqt users, i tried to use signal / slot across threads. With the following example I want to emit a signal when the thread loop is entered. The connected slot is never called. Why? ...
0
by: kunalgalav | last post by:
Hi , I am a newbie to python and I am trying to send a signal to my application using a thread. Here's my code: import sys from PyQt4 import QtGui, QtCore from PyQt4.QtCore import * class...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.