[Kde-java] More on KListViewItem

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Mar 13 12:55:36 CET 2004


On Saturday 13 March 2004 11:22, Paul Sprakes wrote:
> I'm trying to get rows in a KListView to display text in a colour other
> then black. From looking at some c++ code examples I believe I am supposed
> to override paintCell() in my ListViewItem subclass - however my method
> never seems to be called (I have checked my class hasn't been garbage
> collected).
>
> Is it possible to do this from Java?
No, I'm afraid you can't with this release - that's the biggest limitation of 
the current bindings. The next version that I'm working on, is based on the 
'Smoke' library, which has every possible Qt/KDE callback. That should be 
working soon - a month or two, and due for release with KDE 3.3.

All methods of  type 'void foo(void)', 'bool foo(void)' and 'void 
foo(someobject)' in QObject instances now have callbacks. You can 
subclass and override event handlers, or standard kde 'hooks' such as 
KMainWindow.queryClose(). But as KListViewItem isn't a QObject it doesn't have 
any virtual method 'hooks' to override paintCell() - bummer!

-- Richard


More information about the Kde-java mailing list