Maki
Formally verfied low-code orchestration
Toggle main menu visibility
Loading...
Searching...
No Matches
frame.h
1
#pragma once
2
3
#include <QColor>
4
#include <QFrame>
5
#include <QPainter>
6
#include <QPainterPath>
7
#include <oclero/qlementine.hpp>
8
9
class
StyledFrame
:
public
QFrame
10
{
11
Q_OBJECT
12
13
public
:
14
enum class
BackgroundRole
15
{
16
Window,
17
Base,
18
Button,
19
Midlight,
20
Custom
21
};
22
23
enum class
BorderRole
24
{
25
None,
26
Mid,
27
Highlight,
28
Custom
29
};
30
36
StyledFrame
(QWidget* parent =
nullptr
);
37
43
void
setBackgroundRole
(BackgroundRole role);
44
50
void
setBorderRole
(BorderRole role);
51
57
void
setCustomBackgroundColor
(
const
QColor& color);
58
64
void
setCustomBorderColor
(
const
QColor& color);
65
71
void
setBorderWidth
(
int
width);
72
78
void
setRadius
(qreal radius);
79
80
protected
:
86
void
paintEvent
(QPaintEvent* event)
override
;
87
88
private
:
89
BackgroundRole mBackgroundRole = BackgroundRole::Base;
90
BorderRole
mBorderRole
= BorderRole::Mid;
91
92
QColor
mCustomBackgroundColor
;
93
QColor
mCustomBorderColor
;
94
95
int
mBorderWidth
= 1;
96
qreal
mRadius
= 0.0;
97
103
QColor
backgroundColor
()
const
;
104
110
QColor
borderColor
()
const
;
111
};
StyledFrame::paintEvent
void paintEvent(QPaintEvent *event) override
Handles the paint event to draw the styled frame.
Definition
frame.cpp:49
StyledFrame::mBorderRole
BorderRole mBorderRole
Current background role.
Definition
frame.h:90
StyledFrame::mRadius
qreal mRadius
Width of the border.
Definition
frame.h:96
StyledFrame::setBackgroundRole
void setBackgroundRole(BackgroundRole role)
Sets the background role of the frame.
Definition
frame.cpp:11
StyledFrame::setCustomBackgroundColor
void setCustomBackgroundColor(const QColor &color)
Sets a custom background color for the frame.
Definition
frame.cpp:23
StyledFrame::mCustomBorderColor
QColor mCustomBorderColor
Custom background color.
Definition
frame.h:93
StyledFrame::setRadius
void setRadius(qreal radius)
Sets the radius for rounded corners.
Definition
frame.cpp:43
StyledFrame::setBorderWidth
void setBorderWidth(int width)
Sets the width of the border.
Definition
frame.cpp:37
StyledFrame::mBorderWidth
int mBorderWidth
Custom border color.
Definition
frame.h:95
StyledFrame::backgroundColor
QColor backgroundColor() const
Radius for rounded corners.
Definition
frame.cpp:75
StyledFrame::setCustomBorderColor
void setCustomBorderColor(const QColor &color)
Sets a custom border color for the frame.
Definition
frame.cpp:30
StyledFrame::setBorderRole
void setBorderRole(BorderRole role)
Sets the border role of the frame.
Definition
frame.cpp:17
StyledFrame::mCustomBackgroundColor
QColor mCustomBackgroundColor
Current border role.
Definition
frame.h:92
StyledFrame::borderColor
QColor borderColor() const
Returns the current border color based on the role.
Definition
frame.cpp:96
StyledFrame::StyledFrame
StyledFrame(QWidget *parent=nullptr)
Constructs a StyledFrame with the given parent.
Definition
frame.cpp:3
Generated for
MAKI
· © 2026 with
Doxygen
1.9.8
GitHub
Research