PDA

View Full Version : How to create a color bar in combobox ?



likaci
22nd January 2014, 06:42
Hello everyone, I am a beginner of QT and having some trouble to make a combobox with colorbar item.
Such like this pic:

9958

Thanks for the help.

anda_skoa
22nd January 2014, 08:40
What have you got so far? What is it you are have a problem with?

Cheers,
_

likaci
22nd January 2014, 14:49
What have you got so far? What is it you are have a problem with?

Thank for your reply.
The problem is I can create combobox and fill items with single color :
9959

But I have no idea to fill item with series colors :
9960

anda_skoa
22nd January 2014, 15:04
What about this: you create QPixmaps and set them as the combox entries, see addItem() overload that takes a QIcon
You can either paint into the pixmaps or load images into them.

Cheers,
_

likaci
22nd January 2014, 16:16
What about this: you create QPixmaps and set them as the combox entries, see addItem() overload that takes a QIcon
You can either paint into the pixmaps or load images into them.

Thank you very much. I'll try it.