18#ifndef MATRIXCOMBOBOX_H
19#define MATRIXCOMBOBOX_H
28#include <QApplication>
31#include <QGraphicsDropShadowEffect>
36#include <QStyleOptionComboBox>
53 QComboBox* parent =
nullptr);
68 QComboBox* parentCombo;
90 const QStringList& otherParams);
111 QStringList otherParams;
127 : QPushButton(text, parent) {
129 setMouseTracking(
true);
132 setStyleSheet(
"QPushButton {"
135 " background-color: transparent;"
138 "QPushButton:hover {"
139 " background-color: rgba(0, 0, 0, 10%);"
140 " border-radius: 3px;"
144 shadowEffect =
new QGraphicsDropShadowEffect(
this);
145 shadowEffect->setBlurRadius(10);
146 shadowEffect->setColor(QColor(0, 0, 0, 80));
147 shadowEffect->setOffset(0, 0);
148 shadowEffect->setEnabled(
false);
149 setGraphicsEffect(shadowEffect);
158 bool event(QEvent* event)
override {
159 if (event->type() == QEvent::HoverEnter) {
160 shadowEffect->setEnabled(
true);
161 }
else if (event->type() == QEvent::HoverLeave) {
162 shadowEffect->setEnabled(
false);
164 return QPushButton::event(event);
168 QGraphicsDropShadowEffect* shadowEffect;
ComboBox with custom matrix-style popup for parameter selection.
Definition matrixcombopopup.h:44
void showPopup() override
Shows custom matrix popup instead of standard dropdown.
MatrixComboBox(QWidget *parent=nullptr)
Constructor.
void hidePopup() override
Hides the custom popup.
void setParameters(const QStringList &sParams, const QStringList &otherParams)
Sets parameters to display in popup.
void paintEvent(QPaintEvent *event) override
Custom paint to show popup state.