473,382 Members | 1,611 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,382 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 2194
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.