A QLabel with a semi-transparent black shadowed background and rounded corners. More...
#include <shadow_background_label.h>
Public Member Functions | |
| ShadowBackgroundLabel (QWidget *parent, const QString &text) | |
| void | setLabelText (const QString &text) |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *event) override |
| Handles resizing of the label. | |
| void | paintEvent (QPaintEvent *event) override |
| Custom paint event for drawing the label's background. | |
A QLabel with a semi-transparent black shadowed background and rounded corners.
This label provides a styled appearance with centered white text and a translucent rounded background, making it suitable for overlay or emphasis in a UI.
|
explicit |
< Centers the text within the label.
< Ensures minimum size constraints.
|
overrideprotected |
Custom paint event for drawing the label's background.
Renders a semi-transparent black rounded rectangle as the background and then delegates text rendering to QLabel.
| event | The paint event for the widget. |
|
overrideprotected |
Handles resizing of the label.
Ensures the label updates its appearance when resized by triggering a repaint.
| event | The resize event containing new size information. |
| void ShadowBackgroundLabel::setLabelText | ( | const QString & | text | ) |
< Ensures the text is rendered in white.