cf::ui::widget::material::GroupBox¶
Material Design 3 GroupBox widget. More...
#include <groupbox.h>
Inherits from QGroupBox
Public Functions¶
| Name | |
|---|---|
| GroupBox(QWidget * parent =nullptr) Constructor. |
|
| GroupBox(constQString & title, QWidget * parent =nullptr) Constructor with title. |
|
| ~GroupBox() override Destructor. |
|
| int | elevation() const Gets the elevation level. |
| void | setElevation(int level) Sets the elevation level. |
| float | cornerRadius() const Gets the effective corner radius. |
| void | setCornerRadius(float radius) Sets the corner radius. |
| bool | hasBorder() const Gets whether the group box has a border. |
| void | setHasBorder(bool hasBorder) Sets whether the group box has a border. |
| QSize | sizeHint() const override Gets the recommended size. |
| QSize | minimumSizeHint() const override Gets the minimum recommended size. |
Protected Functions¶
| Name | |
|---|---|
| void | paintEvent(QPaintEvent * event) override Paints the group box. |
| void | childEvent(QChildEvent * event) override Handles child event. |
| void | changeEvent(QEvent * event) override Handles widget change event. |
| void | resizeEvent(QResizeEvent * event) override Handles resize event. |
Public Properties¶
| Name | |
|---|---|
| int | elevation |
| float | cornerRadius |
| bool | hasBorder |
Detailed Description¶
Material Design 3 GroupBox widget.
Since: 0.1
Implements Material Design 3 group box with rounded corners, optional elevation shadows, and theme-aware colors. Provides a container for grouping related widgets with a title.
Public Functions Documentation¶
function GroupBox¶
Constructor.
Parameters:
- parent QObject parent.
Exceptions:
- None
Since: 0.1
Note: None
Warning: None
function GroupBox¶
Constructor with title.
Parameters:
- title Group box title.
- parent QObject parent.
Exceptions:
- None
Since: 0.1
Note: None
Warning: None
function ~GroupBox¶
Destructor.
Exceptions:
- None
Since: 0.1
Note: None
Warning: None
function elevation¶
Gets the elevation level.
Exceptions:
- None
Return: Elevation level (0-5).
Since: 0.1
Note: Material Design defines 6 standard levels.
Warning: None
function setElevation¶
Sets the elevation level.
Parameters:
- level Elevation level (0-5).
Exceptions:
- None
Since: 0.1
Note: Affects shadow rendering.
Warning: None
function cornerRadius¶
Gets the effective corner radius.
Exceptions:
- None
Return: Corner radius in pixels. Returns 0 for default (auto-calculate).
Since: 0.1
Note: Default is based on Material Design shape scale (ShapeSmall).
Warning: None
function setCornerRadius¶
Sets the corner radius.
Parameters:
- radius Corner radius in pixels.
Exceptions:
- None
Since: 0.1
Note: Value is clamped to valid range.
Warning: None
function hasBorder¶
Gets whether the group box has a border.
Exceptions:
- None
Return: true if border is enabled, false otherwise.
Since: 0.1
Note: Default is true.
Warning: None
function setHasBorder¶
Sets whether the group box has a border.
Parameters:
- hasBorder true to enable border, false to disable.
Exceptions:
- None
Since: 0.1
Note: When disabled, only shadow is drawn (if elevation > 0).
Warning: None
function sizeHint¶
Gets the recommended size.
Exceptions:
- None
Return: Recommended size for the group box.
Since: 0.1
Note: Based on content and margins.
Warning: None
function minimumSizeHint¶
Gets the minimum recommended size.
Exceptions:
- None
Return: Minimum recommended size.
Since: 0.1
Note: Ensures minimum content size.
Warning: None
Protected Functions Documentation¶
function paintEvent¶
Paints the group box.
Parameters:
- event Paint event.
Exceptions:
- None
Since: 0.1
Note: Implements Material Design paint pipeline.
Warning: None
function childEvent¶
Handles child event.
Parameters:
- event Child event.
Exceptions:
- None
Since: 0.1
Note: Used to detect layout changes.
Warning: None
function changeEvent¶
Handles widget change event.
Parameters:
- event Change event.
Exceptions:
- None
Since: 0.1
Note: Updates title tracking when title changes.
Warning: None
function resizeEvent¶
Handles resize event.
Parameters:
- event Resize event.
Exceptions:
- None
Since: 0.1
Note: Updates content margins on resize.
Warning: None
Public Property Documentation¶
property elevation¶
property cornerRadius¶
property hasBorder¶
Updated on 2026-03-09 at 10:14:00 +0000