Results 1 to 4 of 4

Thread: How to change QComboBox background with a picture?

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How to change QComboBox background with a picture?

    I wish to use qComboBox->setStyleSheet("*******");
    to change QComboBox background with a picture.

    First, I change QComboBox background with color, it works.
    qComboBox->setStyleSheet("QComboBox:editable{background: red;});

    Second, I try to change QComboBox background with a picture, it does not works.
    qComboBox->setStyleSheet("QComboBox:editable{background: url(:/QReaderFrame/Resources/settingdialog/combox_normal.png);});
    qComboBox->setStyleSheet("QComboBox {background: url(:/QReaderFrame/Resources/settingdialog/combox_normal.png);});


    So why I swith color with picture, it does not work?
    And what should I do for this situation?

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to change QComboBox background with a picture?

    It should be background-image

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change QComboBox background with a picture?

    I found the solution,
    change QComboBox background with a picture, should use border-image

    But thanks the same

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to change QComboBox background with a picture?

    Nice that you found a solution.

    It is not only changing the background image though.

Similar Threads

  1. Replies: 2
    Last Post: 29th March 2010, 15:43
  2. Qt Picture change
    By Raymond in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2010, 03:19
  3. Replies: 2
    Last Post: 11th March 2009, 02:00
  4. Replies: 1
    Last Post: 24th August 2007, 11:18
  5. change picture size
    By raphaelf in forum Newbie
    Replies: 1
    Last Post: 27th November 2006, 18:15

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.