#include "customcombobox.h" CustomComboBox::CustomComboBox(QWidget *parent) : QComboBox(parent) { this->setStyleSheet("QComboBox { background-color : black; color : #f7e0b5; " "}QComboBox:editable {" " background: black; selection-background-color: black; color : #f7e0b5;}" "QComboBox QAbstractItemView {" " selection-background-color: black;}" ); } void CustomComboBox::enterEvent(QEnterEvent * event) { this->setStyleSheet("QComboBox { background-color : black; color : green; " "}QComboBox:editable {" " background: black; selection-background-color: black; color : green; selection-color: green;}" "QComboBox QAbstractItemView {" " selection-background-color: black; selection-color: green;}" ); emit focused(); } void CustomComboBox::leaveEvent(QEvent * event) { this->setStyleSheet("QComboBox { background-color : black; color :#f7e0b5; " "}QComboBox:editable {" " background: black; selection-background-color: black; color : #f7e0b5; selection-color: #f7e0b5; }" "QComboBox QAbstractItemView {" " selection-background-color: black;}" ); emit unfocused(); }