Good day.
I’m trying to set the QComboBox popup list but unable to change the font size.
Anyone know how to do this?
Does anyone know how to do this or is qtnecessitas problem?
worked correctly before and not now.
QLabel, QComboBox QAbstractItemView{ color:red; font: 20pt bold;
}
/*or*/
QLabel, QAbstractItemView{ color:red; font: 20pt bold;
}
With QLabel everything happens correctly, with [QAbstractItemView], only the color has changed.
Also have a problem regarding QComboBox, I think it was already mentioned. I have Comboboxes which only show highlighted items in green with a white text color. When I show the list, only the selected item is visible all other content is white. So how can I change the textcolor of not selected items? Do I have to change the stylesheet for QAbstractItemView?
Thanks for your answers
void ffrmsyspri00::doInit()
{
#ifdef Q_OS_ANDROID
//CORRECAO PARA FONT MUITO GRANDE DO COMBOBOX
int dpi=QPaintDevice::physicalDpiX();
int fontsize=dpi/12; //change to your liking
QFont myf=QApplication::font();
myf.setPixelSize(fontsize);
QApplication::setFont(myf);
#endif
}header:
----------------
{
public:
MySpinBox(QWidget *parent);
QLineEdit * editor () const;
}; implementation: ---------------- MySpinBox::MySpinBox(QWidget *parent):QSpinBox(parent) { editor()->setAlignment(Qt::AlignCenter); } QLineEdit * MySpinBox::editor () const { return this->lineEdit(); }use:
----------------
spinBox->editor()->setStyleSheet([see below])