Hi,

I'm making a gui app with Qt 4.8.5. I have a basic wizard with 3 wizardpages. On the fisrt one I have a combobox (mycb) and two lineedits (le1 and le2).

The thing is that when the have the focus they have a thin light blue border which I would like to change and make it bigger or to have another color so the user can see which element has the focus clearly.

I've tried to do it first with the combobox, implementing a BaseComboBox (class BaseComboBox : public QComboBox) class with that:

Qt Code:
  1. void BaseComboBox::focusInEvent(QFocusEvent *e)
  2. {
  3. if (e->reason() == Qt::TabFocusReason)
  4. {
  5. emit(changeStyle());
  6. }
  7. QComboBox::focusInEvent(e);
  8. }
To copy to clipboard, switch view to plain text mode 

and then in the wizard page constructor:
Qt Code:
  1. connect(mycb,SIGNAL(changeStyle()),this, SLOT(changeStyleSLOT())); // BaseComboBox mycb;
To copy to clipboard, switch view to plain text mode 

and the slot:
Qt Code:
  1. void WPConfigs12::changeStyleSLOT()
  2. {
  3. mycb->setStyleSheet("BaseComboBox:focus { border: 5px solid red;");
  4. }
To copy to clipboard, switch view to plain text mode 

But it doesn't change. It just works as always with the thin blue default border. Any idea for that?


Thank you so much!