8#ifndef CARD_PICTURE_WITH_TEXT_OVERLAY_H
9#define CARD_PICTURE_WITH_TEXT_OVERLAY_H
28 Qt::Alignment alignment = Qt::AlignCenter);
37 [[nodiscard]] QSize
sizeHint()
const override;
48 const QRect &textRect,
50 const QTextOption &textOption)
const;
void setOutlineColor(const QColor &color)
Sets the outline color around the overlay text.
Definition card_info_picture_with_text_overlay_widget.cpp:58
void paintEvent(QPaintEvent *event) override
Paints the widget, including both the card image and the text overlay.
Definition card_info_picture_with_text_overlay_widget.cpp:105
Qt::Alignment textAlignment
Definition card_info_picture_with_text_overlay_widget.h:56
bool highlighted
Definition card_info_picture_with_text_overlay_widget.h:57
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)
Constructs a CardPictureWithTextOverlay widget.
Definition card_info_picture_with_text_overlay_widget.cpp:19
int fontSize
Definition card_info_picture_with_text_overlay_widget.h:55
QColor outlineColor
Definition card_info_picture_with_text_overlay_widget.h:54
void setHighlighted(bool _highlighted)
Definition card_info_picture_with_text_overlay_widget.cpp:84
void setTextColor(const QColor &color)
Sets the color of the overlay text.
Definition card_info_picture_with_text_overlay_widget.cpp:48
QString overlayText
Definition card_info_picture_with_text_overlay_widget.h:52
void setOverlayText(const QString &text)
Sets the overlay text to be displayed on the card.
Definition card_info_picture_with_text_overlay_widget.cpp:38
void imageClicked(QMouseEvent *event, CardInfoPictureWithTextOverlayWidget *instance)
void drawOutlinedText(QPainter &painter, const QRect &textRect, const QString &text, const QTextOption &textOption) const
Draws text with an outline for visibility.
Definition card_info_picture_with_text_overlay_widget.cpp:229
void mousePressEvent(QMouseEvent *event) override
Definition card_info_picture_with_text_overlay_widget.cpp:94
QSize minimumSizeHint() const override
Provides the minimum recommended size for this widget.
Definition card_info_picture_with_text_overlay_widget.cpp:262
QSize sizeHint() const override
Provides the recommended size for this widget.
Definition card_info_picture_with_text_overlay_widget.cpp:253
QColor textColor
Definition card_info_picture_with_text_overlay_widget.h:53
void setFontSize(int size)
Sets the font size for the overlay text.
Definition card_info_picture_with_text_overlay_widget.cpp:68
void setTextAlignment(Qt::Alignment alignment)
Sets the alignment of the overlay text within the widget.
Definition card_info_picture_with_text_overlay_widget.cpp:78