2023-12-07 16:55:56 +03:00
|
|
|
#include "customcombobox.h"
|
|
|
|
|
|
|
|
CustomComboBox::CustomComboBox(QWidget *parent) : QComboBox(parent)
|
|
|
|
{
|
|
|
|
this->setStyleSheet("QComboBox { background-color : black; color : #d4ae13; "
|
|
|
|
"}QComboBox:editable {"
|
|
|
|
" background: black; selection-background-color: black; color : #d4ae13;}"
|
|
|
|
"QComboBox QAbstractItemView {"
|
|
|
|
" selection-background-color: black;}"
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
2023-12-13 14:36:44 +03:00
|
|
|
/*
|
2023-12-07 16:55:56 +03:00
|
|
|
void CustomComboBox::wheelEvent(QWheelEvent * event)
|
|
|
|
{
|
|
|
|
if (event->delta() > 0) {
|
|
|
|
emit wheelUp();
|
|
|
|
}else{
|
|
|
|
emit wheelDown();
|
|
|
|
}
|
|
|
|
}
|
2023-12-13 14:36:44 +03:00
|
|
|
*/
|
2023-12-07 16:55:56 +03:00
|
|
|
/*
|
|
|
|
void CustomComboBox::mousePressEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
emit clicked();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2023-12-13 14:36:44 +03:00
|
|
|
void CustomComboBox::enterEvent(QEnterEvent * event)
|
2023-12-07 16:55:56 +03:00
|
|
|
{
|
|
|
|
this->setStyleSheet("QComboBox { background-color : black; color : green; "
|
|
|
|
"}QComboBox:editable {"
|
|
|
|
" background: black; selection-background-color: black;}"
|
|
|
|
"QComboBox QAbstractItemView {"
|
|
|
|
" selection-background-color: black;}"
|
|
|
|
);
|
2023-12-13 14:36:44 +03:00
|
|
|
|
2023-12-07 16:55:56 +03:00
|
|
|
emit focused();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CustomComboBox::leaveEvent(QEvent * event)
|
|
|
|
{
|
|
|
|
this->setStyleSheet("QComboBox { background-color : black; color : #d4ae13; "
|
|
|
|
"}QComboBox:editable {"
|
|
|
|
" background: black; selection-background-color: black; color : #d4ae13; selection-color: #d4ae13; }"
|
|
|
|
"QComboBox QAbstractItemView {"
|
|
|
|
" selection-background-color: black;}"
|
|
|
|
);
|
2023-12-13 14:36:44 +03:00
|
|
|
|
2023-12-07 16:55:56 +03:00
|
|
|
emit unfocused();
|
|
|
|
}
|