Depending on some dynamic property, I'd like to set the font style in the top-item of a QComboBox to italic, but keep the appearance of the items in the corresponding popup (QListView).

I tried it with the following qss:

Qt Code:
  1. QComboBox#librarySettingsBox QListView {
  2. font-style: normal;
  3. /* background-color: rgb(255, 255, 127);*/
  4. }
  5. QComboBox[dirty="true"] {
  6. font-style: italic;
  7. /* background-color: rgb(85, 0, 255);*/
  8. }
To copy to clipboard, switch view to plain text mode 

In my C++ code, I call update on the widget after setting the property like this:

Qt Code:
  1. ui->librarySettingsBox->setProperty("dirty", dirty);
  2. ui->librarySettingsBox->style()->unpolish(ui->librarySettingsBox);
  3. ui->librarySettingsBox->style()->polish(ui->librarySettingsBox);
  4. ui->librarySettingsBox->update();
To copy to clipboard, switch view to plain text mode 

The "font-style: normal" setting is supposed to override the italic setting in the QListView, as it has a higher priority due to the id-tag contained. This can also be confirmed by uncommenting the "background-color" tags. However, the font-style does not seem to have any effect on the QListView. Why is it so and how can I fix it?