#include <card_info_picture_with_text_overlay_widget.h>
|
| void | paintEvent (QPaintEvent *event) override |
| | Paints the widget, including both the card image and the text overlay.
|
| void | mousePressEvent (QMouseEvent *event) override |
| QSize | minimumSizeHint () const override |
| | Provides the minimum recommended size for this widget.
|
| void | resizeEvent (QResizeEvent *event) override |
| | Handles widget resizing by updating the pixmap size.
|
| void | paintEvent (QPaintEvent *) override |
| | Custom paint event that draws the card image with rounded corners.
|
| void | enterEvent (QEnterEvent *event) override |
| | Starts the hover timer to show the enlarged pixmap on hover.
|
| void | leaveEvent (QEvent *event) override |
| | Stops the hover timer and hides the enlarged pixmap when the mouse leaves.
|
| void | moveEvent (QMoveEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| | Moves the enlarged pixmap widget to follow the mouse cursor.
|
| void | mousePressEvent (QMouseEvent *event) override |
| void | hideEvent (QHideEvent *event) override |
| void | loadPixmap () |
| | Loads the appropriate pixmap based on the current card info.
|
| const QPixmap & | getResizedPixmap () const |
| void | showEnlargedPixmap () const |
| | Displays the enlarged version of the card's pixmap near the cursor.
|
|
| void | drawOutlinedText (QPainter &painter, const QRect &textRect, const QString &text, const QTextOption &textOption) const |
| | Draws text with an outline for visibility.
|
◆ CardInfoPictureWithTextOverlayWidget()
| CardInfoPictureWithTextOverlayWidget::CardInfoPictureWithTextOverlayWidget |
( |
QWidget * | parent = nullptr, |
|
|
bool | hoverToZoomEnabled = false, |
|
|
bool | raiseOnEnter = false, |
|
|
const QColor & | textColor = Qt::white, |
|
|
const QColor & | outlineColor = Qt::black, |
|
|
int | fontSize = 12, |
|
|
Qt::Alignment | alignment = Qt::AlignCenter ) |
|
explicit |
Constructs a CardPictureWithTextOverlay widget.
- Parameters
-
| parent | The parent widget. |
| hoverToZoomEnabled | If this widget will spawn a larger widget when hovered over. |
| raiseOnEnter | If this widget will raise slightly when entered. |
| textColor | The color of the overlay text. |
| outlineColor | The color of the outline around the text. |
| fontSize | The font size of the overlay text. |
| alignment | The alignment of the text within the overlay. |
Sets the widget's size policy and default border style.
◆ drawOutlinedText()
| void CardInfoPictureWithTextOverlayWidget::drawOutlinedText |
( |
QPainter & | painter, |
|
|
const QRect & | textRect, |
|
|
const QString & | text, |
|
|
const QTextOption & | textOption ) const |
|
private |
Draws text with an outline for visibility.
- Parameters
-
| painter | The painter to draw the text. |
| textRect | The rectangle area to draw the text in. |
| text | The text to display. |
| textOption | The text layout options, such as alignment. |
Draws an outline around the text to enhance readability before drawing the main text.
◆ imageClicked
◆ minimumSizeHint()
| QSize CardInfoPictureWithTextOverlayWidget::minimumSizeHint |
( |
| ) |
const |
|
nodiscardoverrideprotected |
Provides the minimum recommended size for this widget.
- Returns
- The minimum widget size.
◆ mousePressEvent()
| void CardInfoPictureWithTextOverlayWidget::mousePressEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
◆ paintEvent()
| void CardInfoPictureWithTextOverlayWidget::paintEvent |
( |
QPaintEvent * | event | ) |
|
|
overrideprotected |
Paints the widget, including both the card image and the text overlay.
- Parameters
-
Draws the card image first, then overlays text on top. The text is wrapped and centered within the image.
◆ setFontSize()
| void CardInfoPictureWithTextOverlayWidget::setFontSize |
( |
int | size | ) |
|
Sets the font size for the overlay text.
- Parameters
-
◆ setHighlighted()
| void CardInfoPictureWithTextOverlayWidget::setHighlighted |
( |
bool | _highlighted | ) |
|
◆ setOutlineColor()
| void CardInfoPictureWithTextOverlayWidget::setOutlineColor |
( |
const QColor & | color | ) |
|
Sets the outline color around the overlay text.
- Parameters
-
| color | The new outline color. |
◆ setOverlayText()
| void CardInfoPictureWithTextOverlayWidget::setOverlayText |
( |
const QString & | text | ) |
|
Sets the overlay text to be displayed on the card.
- Parameters
-
Updates the widget to display the new overlay text.
◆ setTextAlignment()
| void CardInfoPictureWithTextOverlayWidget::setTextAlignment |
( |
Qt::Alignment | alignment | ) |
|
Sets the alignment of the overlay text within the widget.
- Parameters
-
| alignment | The new text alignment. |
◆ setTextColor()
| void CardInfoPictureWithTextOverlayWidget::setTextColor |
( |
const QColor & | color | ) |
|
Sets the color of the overlay text.
- Parameters
-
◆ sizeHint()
| QSize CardInfoPictureWithTextOverlayWidget::sizeHint |
( |
| ) |
const |
|
nodiscardoverride |
Provides the recommended size for this widget.
- Returns
- The suggested widget size.
◆ fontSize
| int CardInfoPictureWithTextOverlayWidget::fontSize |
|
private |
◆ highlighted
| bool CardInfoPictureWithTextOverlayWidget::highlighted |
|
private |
◆ outlineColor
| QColor CardInfoPictureWithTextOverlayWidget::outlineColor |
|
private |
◆ overlayText
| QString CardInfoPictureWithTextOverlayWidget::overlayText |
|
private |
◆ textAlignment
| Qt::Alignment CardInfoPictureWithTextOverlayWidget::textAlignment |
|
private |
◆ textColor
| QColor CardInfoPictureWithTextOverlayWidget::textColor |
|
private |
The documentation for this class was generated from the following files: