C++ (Qt)void QComboBox::changeEvent(QEvent *e){ Q_D(QComboBox); switch (e->type()) { case QEvent::StyleChange: d->updateDelegate();... void QComboBoxPrivate::updateDelegate(){ Q_Q(QComboBox); QStyleOptionComboBox opt; q->initStyleOption(&opt); if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q)) q->setItemDelegate(new QComboMenuDelegate(q->view(), q)); else q->setItemDelegate(new QComboBoxDelegate(q->view(), q));}