Re: [PyKDE] Auto-connecting Slots

2006-01-30 Thread Giovanni Bajo
Jesper Anderson <[EMAIL PROTECTED]> wrote: > and when you want to avoid typing pyqtSignature: > > from PyQt4.QtCore import * > from PyQt4.QtCore import pyqtSignature as signature Sure, or more simply: signature = pyqtSignature -- Giovanni Bajo ___

Re: [PyKDE] Auto-connecting Slots

2006-01-30 Thread Jesper Anderson
On Sat, Jan 28, 2006 at 08:18:25PM +0100, Gerard Vermeulen wrote: > > [ .. ] > > > > I mostly dislike the packing scheme of PyQt4, but I see where it's > > > coming > > > from, and as long as I'm allowed to use the "from QtCore import *" > > > without > > > polluting the global namespace, it's stil

Re: [PyKDE] Auto-connecting Slots

2006-01-29 Thread Giovanni Bajo
Patrick K. O'Brien <[EMAIL PROTECTED]> wrote: >>> If we're going to use other large projects as examples then surely >>> wxPython is a better one. They spent the past year or two moving >>> from this: >>> >>> from wx import * >>> button = wxButton(...) >>> >>> [...] >>> >>> to: >>> >>

Re: [PyKDE] Auto-connecting Slots

2006-01-29 Thread Patrick K. O'Brien
Giovanni Bajo wrote: > Patrick K. O'Brien <[EMAIL PROTECTED]> wrote: > >> If we're going to use other large projects as examples then surely >> wxPython is a better one. They spent the past year or two moving >> from this: >> >> from wx import * >> button = wxButton(...) >> >> [...] >> >>

Re: [PyKDE] Auto-connecting Slots

2006-01-29 Thread Giovanni Bajo
Patrick K. O'Brien <[EMAIL PROTECTED]> wrote: > If we're going to use other large projects as examples then surely > wxPython is a better one. They spent the past year or two moving > from this: > > from wx import * > button = wxButton(...) > > [...] > > to: > > import wx > button

Re: [PyKDE] Auto-connecting Slots

2006-01-29 Thread Giovanni Bajo
Gerard Vermeulen <[EMAIL PROTECTED]> wrote: >>> I understand that you like to take an unrecommended shortcut and >>> pollute the global namespace (Q-, q-prefix or not), but it is no >>> reason to make life harder for people who don't. >> >> The Q prefix *is* a namespace. It's the way namespaces ha

Re: [PyKDE] Auto-connecting Slots

2006-01-29 Thread Patrick K. O'Brien
Giovanni Bajo wrote: > Gerard Vermeulen <[EMAIL PROTECTED]> wrote: > >> from PyQt4.QtCore import * >> from PyQt4.QtCore import signature as pyqtSignature >> import signature from signature > > Not a solution, you still have "signature" in the global namespace. > >> I understand that you like to

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Gerard Vermeulen
On Sun, 29 Jan 2006 03:18:35 +0100 "Giovanni Bajo" <[EMAIL PROTECTED]> wrote: > Gerard Vermeulen <[EMAIL PROTECTED]> wrote: > > > from PyQt4.QtCore import * > > from PyQt4.QtCore import signature as pyqtSignature > > import signature from signature > > Not a solution, you still have "signature"

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Giovanni Bajo
Gerard Vermeulen <[EMAIL PROTECTED]> wrote: > from PyQt4.QtCore import * > from PyQt4.QtCore import signature as pyqtSignature > import signature from signature Not a solution, you still have "signature" in the global namespace. > I understand that you like to take an unrecommended shortcut and

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Gerard Vermeulen
On Sat, 28 Jan 2006 17:59:56 +0100 Andreas Pakulat <[EMAIL PROTECTED]> wrote: [ .. ] > > I mostly dislike the packing scheme of PyQt4, but I see where it's coming > > from, and as long as I'm allowed to use the "from QtCore import *" without > > polluting the global namespace, it's still good. Ad

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Andreas Pakulat
On 28.01.06 16:35:35, Giovanni Bajo wrote: > Andreas Pakulat <[EMAIL PROTECTED]> wrote: > > >>> A decorator is just a function and needs to reside in a namespace. > >>> While I could put the signature() function in the global namespace, > >>> that would be dumb. > >> > >> You can put it within the

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Giovanni Bajo
Andreas Pakulat <[EMAIL PROTECTED]> wrote: >>> A decorator is just a function and needs to reside in a namespace. >>> While I could put the signature() function in the global namespace, >>> that would be dumb. >> >> You can put it within the QtCore namespace, but please consider that many >> peopl

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Giovanni Bajo
Phil Thompson <[EMAIL PROTECTED]> wrote: >> You can put it within the QtCore namespace, but please consider that many >> people *will* use "from QtCore import *", as it's the default way to make >> the code similar to the C++ counterpart. If Trolltech added a "signature()" >> function, people woul

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Giovanni Bajo
Jim Bublitz <[EMAIL PROTECTED]> wrote: > I don't believe Phil is imposing anything as far as coding style beyond what > Python already requires with methods/functions imported from modules. > 'signature' has to be part of the QtCore module or some other module. The > alternative to "polluting" the

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Gerard Vermeulen
On Sat, 28 Jan 2006 11:57:00 + Phil Thompson <[EMAIL PROTECTED]> wrote: > On Saturday 28 January 2006 11:29 am, Giovanni Bajo wrote: > > Phil Thompson <[EMAIL PROTECTED]> wrote: > > >>> The QtCore.signature() decorator takes a single argument which is, > > >>> in effect, the C++ signature of t

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Phil Thompson
On Saturday 28 January 2006 11:29 am, Giovanni Bajo wrote: > Phil Thompson <[EMAIL PROTECTED]> wrote: > >>> The QtCore.signature() decorator takes a single argument which is, > >>> in effect, the C++ signature of the method which tells the > >>> auto-connect > >>> code which signal to connect. For

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Andreas Pakulat
On 28.01.06 12:29:13, Giovanni Bajo wrote: > Phil Thompson <[EMAIL PROTECTED]> wrote: > >>> The QtCore.signature() decorator takes a single argument which is, > >>> in effect, the C++ signature of the method which tells the > >>> auto-connect > >>> code which signal to connect. For example... > >>>

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Giovanni Bajo
Phil Thompson <[EMAIL PROTECTED]> wrote: >>> The QtCore.signature() decorator takes a single argument which is, >>> in effect, the C++ signature of the method which tells the >>> auto-connect >>> code which signal to connect. For example... >>> >>> @QtCore.signature("on_spinbox_valueChanged(in

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Phil Thompson
On Saturday 28 January 2006 12:31 am, Giovanni Bajo wrote: > Phil Thompson <[EMAIL PROTECTED]> wrote: > > The QtCore.signature() decorator takes a single argument which is, in > > effect, the C++ signature of the method which tells the auto-connect > > code which signal to connect. For example... >

Re: [PyKDE] Auto-connecting Slots

2006-01-28 Thread Phil Thompson
On Friday 27 January 2006 11:45 pm, Andreas Pakulat wrote: > On 27.01.06 22:46:29, Phil Thompson wrote: > > On Friday 27 January 2006 8:10 pm, Patrick K. O'Brien wrote: > > > Phil Thompson wrote: > > > > Tonight's PyQt4 snapshot implements Torsten's suggestion for using a > > > > decorator to contr

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Jim Bublitz
On Friday 27 January 2006 16:31, Giovanni Bajo wrote: > Phil Thompson <[EMAIL PROTECTED]> wrote: > > The QtCore.signature() decorator takes a single argument which is, in > > effect, the C++ signature of the method which tells the auto-connect > > code which signal to connect. For example... > > >

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Giovanni Bajo
Phil Thompson <[EMAIL PROTECTED]> wrote: > The QtCore.signature() decorator takes a single argument which is, in > effect, the C++ signature of the method which tells the auto-connect > code which signal to connect. For example... > > @QtCore.signature("on_spinbox_valueChanged(int)") > def

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Patrick K. O'Brien
Patrick K. O'Brien wrote: > Andreas Pakulat wrote: > >> then the longer version would IMHO be better as you can directly see >> which slot is meant. > > Anything longer than necessary is redundant, imo. > >> BTW: Will this also solve "issues" like the clicked()-signal from >> QAbstractButton? So

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Patrick K. O'Brien
Andreas Pakulat wrote: > On 27.01.06 22:46:29, Phil Thompson wrote: >> On Friday 27 January 2006 8:10 pm, Patrick K. O'Brien wrote: >>> Phil Thompson wrote: Tonight's PyQt4 snapshot implements Torsten's suggestion for using a decorator to control which signal/slot connections are made whe

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Andreas Pakulat
On 27.01.06 22:46:29, Phil Thompson wrote: > On Friday 27 January 2006 8:10 pm, Patrick K. O'Brien wrote: > > Phil Thompson wrote: > > > Tonight's PyQt4 snapshot implements Torsten's suggestion for using a > > > decorator to control which signal/slot connections are made when pyuic4 > > > auto-conn

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Ismail Donmez
Cts 28 Oca 2006 00:46 tarihinde, Phil Thompson şunları yazmıştı: > On Friday 27 January 2006 8:10 pm, Patrick K. O'Brien wrote: > > Phil Thompson wrote: > > > Tonight's PyQt4 snapshot implements Torsten's suggestion for using a > > > decorator to control which signal/slot connections are made when

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Phil Thompson
On Friday 27 January 2006 8:10 pm, Patrick K. O'Brien wrote: > Phil Thompson wrote: > > Tonight's PyQt4 snapshot implements Torsten's suggestion for using a > > decorator to control which signal/slot connections are made when pyuic4 > > auto-connects. > > > > The problem is best demonstrated by QSp

Re: [PyKDE] Auto-connecting Slots

2006-01-27 Thread Patrick K. O'Brien
Phil Thompson wrote: > Tonight's PyQt4 snapshot implements Torsten's suggestion for using a > decorator > to control which signal/slot connections are made when pyuic4 auto-connects. > > The problem is best demonstrated by QSpinBox which emits > valueChanged(QString) > and valueChanged(int). D

[PyKDE] Auto-connecting Slots

2006-01-27 Thread Phil Thompson
Tonight's PyQt4 snapshot implements Torsten's suggestion for using a decorator to control which signal/slot connections are made when pyuic4 auto-connects. The problem is best demonstrated by QSpinBox which emits valueChanged(QString) and valueChanged(int). Defining an auto-connect method on_sp