PDA

View Full Version : Palette toolbar



Radagast
7th July 2008, 13:39
I need a widget that implements the palette toolbar, like in CorelDRAW (or at least like in Windows' Paint). I mean that there should be a column of tiny squares, each represent a color and a button, when I press it, some more columns appear with the rest of colors. And also it must be possible to add custom colors. And current color should be highlighted somehow.
I've looked through Qxt, Qwt, many websites, but didn't find anything appropriate :( I'm sure that such a widget must exist...somewhere...
thanks in advance


P.S. and a little question...I wonder why QGraphicsItem (and none of its children) doesn't have copy constructor and operator= :confused:

wysota
7th July 2008, 14:05
I have plans to make such a widget and actually I have something very similar already implemented in my QwwColorButton widget that is part of wwWidgets. The model and the view are already there, only that the view is no available as a separate widget.

Radagast
7th July 2008, 14:21
I've seen your QwwColorButton :) well it seems like a single button that can change its color, and I need a huge set of buttons in a toolbar that doesn't change their colors. Well if nobody sends a ready implementation, I'll make my own...would you like to add it to your lib? :)

wysota
7th July 2008, 14:28
Click on the button and you'll see your list.

Radagast
7th July 2008, 14:36
is it possible to add QToolButtons into single QToolBar in several rows(columns)?

wysota
7th July 2008, 14:39
Not out of the box. But you can add widgets so in theory you can make a widget with a vertical or horizontal layout that contains several toolbars and put that widget into the top-level toolbar. It would probably look bad, though.

wysota
7th July 2008, 14:57
Is this what you wanted?

Radagast
7th July 2008, 17:18
wysota
looks like that...can't say exactly till I see the source :)

wysota
7th July 2008, 17:56
This is taken directly from wwWidgets - a standard QListView with disabled scrollbars, fixed width and QFrame::NoFrame frame style with a ColorModel and ColorDelegate set. The view needs to have the vertical and not horizontal item placement direction and wrapping enabled.

The first widget shows a single "column", the second one shows three "columns".