RFC : Layer widget

Patrick Julien freak at ideasandassociates.com
Tue Apr 2 15:44:54 BST 2002


I need some advice. In krita, the code for the layer widget and the 
channel widget are basically copy pasted from each other.  Since I need 
to add a path widget and a mask widget, I'm thinking I want a generic 
one for all of these, but I've been struggling with the way I it should 
be implemented...

Basically, I want a widget with 2 buttons, 1 label and 1 editable text 
area.  The first button is Show/Hide layer/channel/whatever button, the 
second one is linked/unlinked button, the label is a preview of the 
paint device(layer/channel/whatever), the edit box is the name of the 
painting device.

This seems easy enough, just put 2 buttons, 1 label and 1 KLineEdit 
inside a QHBox and put these in a QListBox.

However, since QListBoxItem isn't a widget, I can't do this directly, I 
would have to resort to some bitBlt()'s from some internal widget inside 
the QListBoxItem to the QPainter passed to it.  I don't really want to 
do this ;-).

If I choose a QListView instead of a QListBox, I have the same problem, 
now QTable supports placing widgets in it's cells, but that seems like a 
waste for what I want to do.

Obviously I could do a QListBox and a custom QListBoxItem which paints 3 
pixmaps an some text, I just find it hard to believe that I'm the first 
one that needs a QListBox that has widgets in all of Qt/KDE.

Advice?  Comments?

-- 
Patrick Julien
Ideas & Associates
(514) 940-2891x211





More information about the kde-core-devel mailing list