Results 1 to 5 of 5

Thread: How to create a color bar in combobox ?

  1. #1
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    2

    Question How to create a color bar in combobox ?

    Hello everyone, I am a beginner of QT and having some trouble to make a combobox with colorbar item.
    Such like this pic:

    QQ图片20140122142746.jpg

    Thanks for the help.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,418
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to create a color bar in combobox ?

    What have you got so far? What is it you are have a problem with?

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    likaci (22nd January 2014)

  4. #3
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    2

    Default Re: How to create a color bar in combobox ?

    Quote Originally Posted by anda_skoa View Post
    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 :
    Attachment 9959

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

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,418
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to create a color bar in combobox ?

    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,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    likaci (22nd January 2014)

  7. #5
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    2

    Default Re: How to create a color bar in combobox ?

    Quote Originally Posted by anda_skoa View Post
    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.

Similar Threads

  1. Color ComboBox
    By ioannis in forum Qt Programming
    Replies: 14
    Last Post: 23rd March 2016, 07:08
  2. Replies: 0
    Last Post: 25th July 2011, 14:11
  3. Changing color of combobox placed in toolbar?
    By Jennie Bystrom in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2010, 08:08
  4. color comboBox problem
    By chguy2 in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2007, 09:57
  5. Color combobox
    By chguy2 in forum Qt Programming
    Replies: 9
    Last Post: 5th April 2007, 14:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.