472,326 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Custom PyQt4 Slots

ff
Is it possible to create custom PyQt4 Slots, i have searched high and
low to no avail;

I have an application that can set animation speed to different
levels, i want the user to alter this, now quite clearly i can write a
single function to control setting any speed with something like:

def setSpeed(self, speed):
some code in here to set speed

but if i have mutiple option for speed do i have to connect them all
to seperate callables for each individual speed which each in turn
call setSpeed with their respective speeds or can i create a slot that
can simply pass an integer to setSpeed in much the same way as the
built-in SIGNAL from something like a combo box can pass its current
index??

i realise this could be impossibly, knowing that would be equally
useful and i will just work around it, albeit with more verbose code!!

thanks

ff
Aug 11 '08 #1
3 2472
ff schrieb:
Is it possible to create custom PyQt4 Slots, i have searched high and
low to no avail;

I have an application that can set animation speed to different
levels, i want the user to alter this, now quite clearly i can write a
single function to control setting any speed with something like:

def setSpeed(self, speed):
some code in here to set speed

but if i have mutiple option for speed do i have to connect them all
to seperate callables for each individual speed which each in turn
call setSpeed with their respective speeds or can i create a slot that
can simply pass an integer to setSpeed in much the same way as the
built-in SIGNAL from something like a combo box can pass its current
index??

i realise this could be impossibly, knowing that would be equally
useful and i will just work around it, albeit with more verbose code!!
http://docs.huihoo.com/pyqt/pyqt4.ht...and-qt-signals

"""
PyQt allows new signals to be defined dynamically. The act of emitting a
PyQt signal implicitly defines it. PyQt v4 signals are also referenced
using the QtCore.SIGNAL() function.
"""

Work on your google-fu...

Diez
Aug 11 '08 #2
Diez B. Roggisch schrieb:
ff schrieb:
>Is it possible to create custom PyQt4 Slots, i have searched high and
low to no avail;

I have an application that can set animation speed to different
levels, i want the user to alter this, now quite clearly i can write a
single function to control setting any speed with something like:

def setSpeed(self, speed):
some code in here to set speed

but if i have mutiple option for speed do i have to connect them all
to seperate callables for each individual speed which each in turn
call setSpeed with their respective speeds or can i create a slot that
can simply pass an integer to setSpeed in much the same way as the
built-in SIGNAL from something like a combo box can pass its current
index??

i realise this could be impossibly, knowing that would be equally
useful and i will just work around it, albeit with more verbose code!!

http://docs.huihoo.com/pyqt/pyqt4.ht...and-qt-signals

"""
PyQt allows new signals to be defined dynamically. The act of emitting a
PyQt signal implicitly defines it. PyQt v4 signals are also referenced
using the QtCore.SIGNAL() function.
"""
And not to forget:

"""
A slot is a function (in PyQt a slot is any Python callable).
"""

It's as easy as it can get.

Diez
Aug 11 '08 #3
ff
On Aug 11, 9:56*pm, "Diez B. Roggisch" <de...@nospam.web.dewrote:
Diez B. Roggisch schrieb:
ff schrieb:
Is it possible to create custom PyQt4 Slots, i have searched high and
low to no avail;
I have an application that can set animation speed to different
levels, i want the user to alter this, now quite clearly i can write a
single function to control setting any speed with something like:
def setSpeed(self, speed):
* * *some code in here to set speed
but if i have mutiple option for speed do i have to connect them all
to seperate callables for each individual speed which each in turn
call setSpeed with their respective speeds or can i create a slot that
can simply pass an integer to setSpeed in much the same way as the
built-in SIGNAL from something like a combo box can pass its current
index??
i realise this could be impossibly, knowing that would be equally
useful and i will just work around it, albeit with more verbose code!!
http://docs.huihoo.com/pyqt/pyqt4.ht...and-qt-signals
"""
PyQt allows new signals to be defined dynamically. The act of emitting a
PyQt signal implicitly defines it. PyQt v4 signals are also referenced
using the QtCore.SIGNAL() function.
"""

And not to forget:

"""
A slot is a function (in PyQt a slot is any Python callable).
"""

It's as easy as it can get.

Diez
Sorry, yeah getting confused between SIGNALS and SLOTS, thanks
Aug 11 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Harshad | last post by:
Hi, I'm writing a program using Python 2.4 and PyQt4. The aim is to implement drag and drop from filesystem and display a list of files dragged...
3
by: Skink | last post by:
Hi, I created simple property classes with editing option, but since i'm not too much experienced in PyQt4 i'd like to ask if i handle...
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...
25
by: Daniel Jonsson | last post by:
So, I've reached the point where my building pipeline tools actually needs to be used by other people in my company. By this reason I actually need...
2
by: AngelOfDarkness | last post by:
Hi guys, unfortunately I am pretty new to Python and Qt and all that. Well, I managed to successfully program a little stuff for my work...
2
by: Pradnyesh Sawant | last post by:
Hello, I have a newly installed ubuntu 6.06 system. I am trying to install pyqt4 on it, but without success. The contents of the...
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:...
0
by: Phil Thompson | last post by:
On Sunday 04 May 2008, Lance Gamet wrote: I think QMainWindow.setCentralWidget() is what you are looking for. The eric4 IDE probably covers...
2
by: Bighead | last post by:
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,...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.