[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] QListbox: SetColumnMode(int)
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2004-06-30 12:58:09
Message-ID: 200406301358.09902.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Wednesday 30 June 2004 12:30 pm, Sibylle Koczian wrote:
> Hello,
>
> this doesn't seem to work as it should. In the example "listbox.py" (part
> of the PyQt-package) the first radio button should set the listbox to a
> fixed number of columns, as given in the spinbox below. But it doesn't, the
> listbox doesn't react at all. The same for the radio button that should set
> the box to a fixed number of rows: SetRowMode(int) doesn't seem to work
> either. I didn't change anything in the example. The two other radio
> buttons work as expected: set the number of columns (or of rows) to the
> maximal number visible in the listbox and change the number of rows (or of
> columns) accordingly.
>
>  From the Qt documentation I see that there are two overloaded methods
> SetColumnMode and SetRowMode:
> SetColumnMode(int), SetColumnMode(LayoutMode), and LayoutMode is an
> enumeration type. I don't know how that translates to Python, and I suspect
> the problem might lie here.

You analysis is exactly right. SIP uses integers to implement enums and so 
cannot distinguish between to two setColumnMode() signatures.

> Using PyQt 3.12, sip 4.0, Python 2.3.3 on SuSE Linux 9.1.
>
> How can I set the number of columns in a listbox to a fixed value greater
> than 1?

I don't think you can without modifying PyQt. You would need to edit 
qlistbox.sip and change...

	virtual void setColumnMode(int);

...to something like...

	virtual void setColumnMode(int) /PyName=setNrColumns/;

...and for setRowMode() as well.

I will fix this properly for SIP 4.1 and implement enums as a different type.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic