43 : QWidget(parent), content(content)
60 this->
container->layout()->removeWidget(this->content);
61 if (this->content !=
nullptr)
64 dynamic_cast<QVBoxLayout*
>(this->
container->layout())->insertWidget(0, this->content);
84 this->header->setHeader(std::move(
header));
94 this->
header->setToolTip(tooltip);
99 return this->
header->toolTip();
124 this->
header->setFrameStyle(style);
129 return this->
header->frameStyle();
164 this->
headerFrameStyle = QFrame::Shape::StyledPanel | QFrame::Shadow::Raised;
169 this->setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Maximum);
171 this->setLayout(
new QVBoxLayout());
172 this->layout()->setSpacing(0);
173 this->layout()->setContentsMargins(QMargins());
184 this->layout()->addWidget(this->header);
192 this->
container->setLayout(
new QVBoxLayout());
195 this->
container->setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Preferred);
196 this->layout()->addWidget(this->
container);
198 if (this->
content ==
nullptr) {
203 this->
container->layout()->setSpacing(0);
204 this->
container->layout()->setContentsMargins(QMargins());
209 this->
openAnimation = std::unique_ptr<QPropertyAnimation>(
new QPropertyAnimation());
210 this->
closeAnimation = std::unique_ptr<QPropertyAnimation>(
new QPropertyAnimation());
226 this->
openAnimation->setEasingCurve(QEasingCurve(QEasingCurve::Type::Linear));
227 this->
closeAnimation->setEasingCurve(QEasingCurve(QEasingCurve::Type::Linear));
240 style()->drawPrimitive(QStyle::PE_Widget, &o, &p,
this);
Defines ContentPane class.
The ClickableFrame class.
void setNormalStylesheet(QString stylesheet)
Set the default stylesheet.
QString getHoverStylesheet()
Get mouseover stylesheet.
void setHoverStylesheet(QString stylesheet)
Set mouseover stylesheet.
QString getHeader()
Get the header string.
void singleClick(QPoint pos)
Signal that is emitted upon a singleclick.
QString getNormalStylesheet()
Get the default stylesheet.
void setCaretPixmap(QString pixmapPath)
Set the caret pixmap.
void setHeaderTooltip(QString tooltip)
Set header tooltip.
void clicked()
Clicked signal is emitted when the header is clicked.
QString getHeaderStylesheet()
Get the current header style sheet.
void setHeaderStylesheet(QString stylesheet)
Set a stylesheet for the header frame.
QString getHeaderTooltip()
Get the header tooltip.
int getMaximumHeight()
Get the maximum height of the content pane container frame.
int containerAnimationMaxHeight
void closeContentPane()
Close the content pane.
ContentPane(QString header, QWidget *parent=0)
ContentPane constructor.
QString getHeader()
Return the header of the content pane.
int contentPaneFrameStyle
QFrame * getContentFrame()
Get the content frame of the content pane.
void openContentPane()
Open the content pane.
std::unique_ptr< QPropertyAnimation > openAnimation
bool getActive()
Check if this Content pane is active.
QString getHeaderHoverStylesheet()
Get the mouse over header style sheet.
void initHeaderFrame(QString header)
void setContentFrame(QFrame *content)
Set the content frame.
void setHeaderFrameStyle(int style)
Set the header frame style.
int getContainerFrameStyle()
Get the container frame style.
void setHeader(QString header)
Set the header of the content pane.
void setMaximumHeight(int maxHeight)
Set the maximum height of the content pane container.
void headerClicked()
Slot that is called when the header has been triggered.
void initDefaults(QString header)
void setHeaderHoverStylesheet(QString stylesheet)
Set a stylesheet for the header frame when the mouse hovers over it.
void setContainerFrameStyle(int style)
Set the container frame style.
int getHeaderFrameStyle()
Get the header frame style.
std::unique_ptr< QPropertyAnimation > closeAnimation
void initContainerContentFrame()
void paintEvent(ATTR_UNUSED QPaintEvent *event)
paintEvent Reimplement paintEvent to use stylesheets in derived Widgets
const char *const CARRET_ICON_OPENED
Qt qrc "path" for the opened icon.
const char *const CARRET_ICON_CLOSED
Qt qrc "path" for the closed icon.