CSS ComboBox Editable Items

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
uxout
Posts:82
Joined: Wed Jul 20, 2016 12:07 pm

CSS ComboBox Editable Items

Post by uxout »

Just play around with CSS and QComboBox and I can't find how to add styles to list items when the ComboBox is editable (when it is not editable, it is working as expected).
Here is a part of my CSS :

Code: Select all

QComboBox QAbstractItemView {
  outline: none;
  border: none;
}

QComboBox QAbstractItemView::item {
  padding: 5px;
  background-color: #EBEBEB;
  color: black;
}

QComboBox QAbstractItemView::item:hover {
  background-color: #CCCCCC;
}
Any idea how to make this work for editables ComboBox too? Is it a bug?
Attachments
combobox_editable.png
combobox_editable.png (1.55 KiB) Viewed 3536 times
combobox.png
combobox.png (1.61 KiB) Viewed 3537 times

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: CSS ComboBox Editable Items

Post by adaneau »

Hi,

Be careful that QCombobox is having a pseudo state for editable :). So you need to adapt your CSS.

See https://doc.qt.io/qt-5/stylesheet-examp ... -qcombobox

Something like :

QComboBox:editable {
background: white;
}

BR
Alexandre

uxout
Posts:82
Joined: Wed Jul 20, 2016 12:07 pm

Re: CSS ComboBox Editable Items

Post by uxout »

Hey Alexandre,

You are right, there is a pseudo state editable but it is not working as it should be.
Just done another test without [type = "xxx"] and it works correctly as expected.
Is there a bug with this attribute when working on QCombobox Editable?

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: CSS ComboBox Editable Items

Post by adaneau »

Hi,

I also noticed that background color doesnt work, maybe Qt bug or ETM missing implementation, best is to open bugtracker or SR if you have access. All other entries however worked fine for me.

Background is easy to solve as the background color set inside GEDI is applied to both item box and field.

BR
Alexandre Daneau

4 posts • Page 1 of 1