34 #include <QStyleOption>
37 : QFrame(parent, f), header(header)
39 this->setAttribute(Qt::WA_Hover,
true);
41 this->setCursor(Qt::PointingHandCursor);
42 QColor background = this->palette().color(QPalette::Window);
43 QColor lighter = background.lighter(110);
45 this->
hoverStylesheet =
"QFrame {background-color: " + lighter.name() +
";}";
53 this->setCursor(Qt::PointingHandCursor);
55 this->setCursor(Qt::ForbiddenCursor);
98 this->
caretLabel->setPixmap(QPixmap(pixmapPath));
103 this->setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Fixed);
104 this->setLayout(
new QHBoxLayout());
107 this->
caretLabel->setPixmap(QPixmap(
":/qAccordionIcons/caret-right.png"));
114 dynamic_cast<QHBoxLayout*
>(this->layout())->addStretch();
Defines AccordionWidget class.
void setClickable(bool status)
Change clickable status.
void setNormalStylesheet(QString stylesheet)
Set the default stylesheet.
void mousePressEvent(QMouseEvent *event)
Reimplemented function to QMouseEvents.
QString getHoverStylesheet()
Get mouseover stylesheet.
void setHeader(QString header)
Set the header string.
void setHoverStylesheet(QString stylesheet)
Set mouseover stylesheet.
QString getHeader()
Get the header string.
void singleClick(QPoint pos)
Signal that is emitted upon a singleclick.
ClickableFrame(QString header, QWidget *parent=0, Qt::WindowFlags f={})
ClickableFrame constructor.
void enterEvent(QEvent *event)
Enter event for mouse over effects.
QString getNormalStylesheet()
Get the default stylesheet.
void setCaretPixmap(QString pixmapPath)
Set the caret pixmap.
bool getClickable()
Check if the frame is clickable.
void leaveEvent(QEvent *event)
Leave effect for mouse over effects.