[PyQt] Null dates in QDateEdit

2008-01-09 Thread Catriona Johnson
Hello I am new to PyQT and would appreciate help with the following problem. I have a database table that has, amongst other fields, a nullable date - EndDate. On my form I have a QDateEdit widget which I only want to show a value if the date is not null, a user will enter a date once there is one

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread nytmyn
I've played with signals and slots in PyQt about 2 month ago and came to this: - Qt signals added to Qt classes with names as in qt, implemented using __get__ protocol, so calls like connect(w.signal, w.slot) are possible - overloaded signals - there are not many of them - e.g: clicked() and click

Re: [PyQt] __gettattr__/__setattr__ special method support

2008-01-09 Thread Phil Thompson
On Wednesday 09 January 2008, Matt Newell wrote: > Is there a specific reason that sip doesn't support __gettattr__ and > __setattr__ special methods? Or does it and i'm just missing something? They are used by SIP itself. Phil ___ PyQt mailing list

[PyQt] __gettattr__/__setattr__ special method support

2008-01-09 Thread Matt Newell
Is there a specific reason that sip doesn't support __gettattr__ and __setattr__ special methods? Or does it and i'm just missing something? Thanks, Matt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/li

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Giovanni Bajo schrieb: >> I don't have a real example, but that's not the point. The point is >> that they are different as far as Qt is concerned and so both need to >> be able to be represented in the same class (even though the >> programmer that designed the class needs to be shot). > > But g

Re: [PyQt] [PyKDE4] Text of menus not showing up

2008-01-09 Thread Adeodato Simó
* Simon Edwards [Wed, 09 Jan 2008 22:00:33 +0100]: > Adeodato Simó wrote: >> I'm starting to port my application (audio player) to PyKDE4. The >> bindings compiled fine, but after the first steps I encountered that the >> text in the menu bar and the menus themselves was not being displayed. >> I

Re: [PyQt] [PyKDE4] Text of menus not showing up

2008-01-09 Thread Simon Edwards
Hi, Adeodato Simó wrote: I'm starting to port my application (audio player) to PyKDE4. The bindings compiled fine, but after the first steps I encountered that the text in the menu bar and the menus themselves was not being displayed. If you could try to reproduce, that'd be nice. I attach two

[PyQt] PyQt book: problem with database example

2008-01-09 Thread Sibylle Koczian
Hello, the assetmanager.pyw example doesn't seem to work correctly, or I'm using it wrongly: - The logs view always shows one empty line after the records belonging to the selected asset. Why? When I try to write such a master-detail dialog myself, using the asset manager as a model, I get eve

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Henrik Pauli
On Wednesday 09 January 2008, Phil Thompson wrote: > Or even just add SIGNAL as a method to QObject and retain the current > method of specifying arguments, ie... > > self.connect(baz.SIGNAL("const QString &"), self.bar) > I find this one the most palatable :) Very logical too. The only draw

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Giovanni Bajo
On 1/9/2008 4:53 PM, Henrik Pauli wrote: On Wednesday 09 January 2008, Phil Thompson wrote: Or even just add SIGNAL as a method to QObject and retain the current method of specifying arguments, ie... self.connect(baz.SIGNAL("const QString &"), self.bar) I find this one the most palatable

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Phil Thompson
On Wednesday 09 January 2008, Giovanni Bajo wrote: > On 1/9/2008 4:03 PM, Phil Thompson wrote: > > On Wednesday 09 January 2008, Aaron Digulla wrote: > >> Quoting Phil Thompson <[EMAIL PROTECTED]>: > >>> What about... > >>> > >>> foo(const QString &) > >>> foo(QString *) > >> > >> Can you give an e

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Giovanni Bajo
On 1/9/2008 4:03 PM, Phil Thompson wrote: On Wednesday 09 January 2008, Aaron Digulla wrote: Quoting Phil Thompson <[EMAIL PROTECTED]>: What about... foo(const QString &) foo(QString *) Can you give an example with two signals with the same name and such parameters? I can't imagine to see tha

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Phil Thompson
On Wednesday 09 January 2008, Aaron Digulla wrote: > Quoting Phil Thompson <[EMAIL PROTECTED]>: > > What about... > > > > foo(const QString &) > > foo(QString *) > > Can you give an example with two signals with the same name and such > parameters? I can't imagine to see that for any single class.

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: What about... foo(const QString &) foo(QString *) Can you give an example with two signals with the same name and such parameters? I can't imagine to see that for any single class. It *might* happen with signals from different classes but there,

Re: [PyQt] signal-slot connect problem

2008-01-09 Thread Martin Höfling
Am Mittwoch, 9. Januar 2008 schrieb Aaron Digulla: > Quoting Phil Thompson <[EMAIL PROTECTED]>: > >> I mean it is a very common mistake, even for advanced PyQt developers, > > > > Is it? I'wouldn't consider myself as an advanced PyQt developer, but for me it is. > In my projects, I'm predefining

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Phil Thompson
On Wednesday 09 January 2008, Henrik Pauli wrote: > On Wednesday 09 January 2008, Aaron Digulla wrote: > > > type(SIGNAL('')) would show that it is just a string. > > > > That confuses me a bit because when I try to pass a string as the > > second argument to connect, I get "argument 2 has a wrong

Re: [PyQt] signal-slot connect problem

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: I mean it is a very common mistake, even for advanced PyQt developers, Is it? In my projects, I'm predefining all signals and slots as python constants and use those in connect() and emit(). a) makes the code more reliable and b) enables code com

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Henrik Pauli <[EMAIL PROTECTED]>: But anyway: How much work would it be to have SIP generate constants for all SIGNAL's in a class? So I could say: self.connect(w1, w1.SOME_SIGNAL, ...) Pro: Doesn't break old code, API, etc. No more typos (or python will warn about a missing attri

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Henrik Pauli
On Wednesday 09 January 2008, Aaron Digulla wrote: > > > > type(SIGNAL('')) would show that it is just a string. > > That confuses me a bit because when I try to pass a string as the > second argument to connect, I get "argument 2 has a wrong type" :) > > But anyway: How much work would it be to ha

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: From the documentation, I got the impression that the result of SIGNAL() is more or less a constant. Is this code valid? signal = SIGNAL() self.connect(w1, signal, self.w1Clicked) self.connect(w2, signal, self.w2Clicked) Yes - given a corre

Re: [PyQt] signal-slot connect problem

2008-01-09 Thread Phil Thompson
On Wednesday 09 January 2008, David Douard wrote: > On Tue, Jan 08, 2008 at 05:26:53PM +, Phil Thompson wrote: > > On Tuesday 08 January 2008, Martin Höfling wrote: > > > Hi all, > > > > > > I am trying to create a filter Toolbar bar class, filtering a model. > > > > > > why does the following

Re: [PyQt] signal-slot connect problem

2008-01-09 Thread David Douard
On Tue, Jan 08, 2008 at 05:26:53PM +, Phil Thompson wrote: > On Tuesday 08 January 2008, Martin Höfling wrote: > > Hi all, > > > > I am trying to create a filter Toolbar bar class, filtering a model. > > > > why does the following connect command in the loadModel Method not work?: > > > > clas