Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ShadowBackgroundLabel Class Reference

A QLabel with a semi-transparent black shadowed background and rounded corners. More...

#include <shadow_background_label.h>

Inheritance diagram for ShadowBackgroundLabel:
[legend]
Collaboration diagram for ShadowBackgroundLabel:
[legend]

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ShadowBackgroundLabel()

ShadowBackgroundLabel::ShadowBackgroundLabel ( QWidget * parent,
const QString & text )
explicit

< Centers the text within the label.

< Ensures minimum size constraints.

Here is the call graph for this function:

Member Function Documentation

◆ paintEvent()

void ShadowBackgroundLabel::paintEvent ( QPaintEvent * event)
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.

Parameters
eventThe paint event for the widget.

◆ resizeEvent()

void ShadowBackgroundLabel::resizeEvent ( QResizeEvent * event)
overrideprotected

Handles resizing of the label.

Ensures the label updates its appearance when resized by triggering a repaint.

Parameters
eventThe resize event containing new size information.

◆ setLabelText()

void ShadowBackgroundLabel::setLabelText ( const QString & text)

< Ensures the text is rendered in white.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: