Skip to content
Snippets Groups Projects
Commit ccf9ba6d authored by konstantin.kukharenko's avatar konstantin.kukharenko
Browse files

Features 3090

parent 4fa195d8
No related branches found
No related tags found
2 merge requests!17Develop old,!11Feature 3131
#include "CustomComboBox.h"
/** @brief constructor
* @param a_parent object parent
*/
CustomComboBox::CustomComboBox(QWidget *parent):
QComboBox (parent)
{
}
/** @brief Reimplemented QComboBox::enterEvent is sent to the widget when the mouse cursor enters the widget.
* @param event
*/
void CustomComboBox:: enterEvent(QEvent *event)
{
Q_UNUSED(event);
setProperty("hoverState",1);
style()->unpolish(this);
style()->polish(this);
update();
}
/** @brief Reimplemented QComboBox::leaveEvent is sent to the widget when the mouse cursor leaves the widget.
* @param event
*/
void CustomComboBox::leaveEvent(QEvent *event)
{
Q_UNUSED(event);
setProperty("hoverState",0);
style()->unpolish(this);
style()->polish(this);
update();
}
#ifndef CUSTOMCOMBOBOX_H
#define CUSTOMCOMBOBOX_H
#include <QComboBox>
/** @brief QComboBox with changing downArrow when hover on control.
*To indicate the selection of an object in css
*
*#ComboBoxName[hoverState = "1"]::drop-down,
*{
* image: url(path to icon);
*}
*
* Everything else unchanged
*/
class CustomComboBox : public QComboBox
{
Q_OBJECT
public:
CustomComboBox(QWidget *parent = Q_NULLPTR);
protected:
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
};
#endif // CUSTOMCOMBOBOX_H
......@@ -34,5 +34,6 @@ void StyledDropShadowEffect::updateStyle()
//Offset:
int x = Utils::toIntValue(AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "x"));
int y = Utils::toIntValue(AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "y"));
this->setOffset(x, y);
}
SOURCES += \
$$PWD/AnimationChangingWidget.cpp \
$$PWD/ComboBoxDelegate.cpp \
$$PWD/CustomComboBox.cpp \
$$PWD/CustomLineHeightLabel.cpp \
$$PWD/CustomPlacementButton.cpp \
$$PWD/ServersComboBox.cpp \
......@@ -12,6 +13,7 @@ SOURCES += \
HEADERS += \
$$PWD/AnimationChangingWidget.h \
$$PWD/ComboBoxDelegate.h \
$$PWD/CustomComboBox.h \
$$PWD/CustomLineHeightLabel.h \
$$PWD/CustomPlacementButton.h \
$$PWD/ServersComboBox.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment