Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
LearnCardWidget Class Reference

A card widget displaying learning resources, links, and action buttons. More...

#include <learn_card_widget.h>

Inheritance diagram for LearnCardWidget:

Public Member Functions

 LearnCardWidget (QWidget *parent=nullptr)
 Construct a LearnCardWidget.
 ~LearnCardWidget ()
 Destroy the widget and its UI form.
void setLinksCollapsed (bool collapsed)
 Collapse or expand the links section.
bool isLinksCollapsed () const
 Return whether the links section is currently collapsed.
void setStyledByParent (bool styled_by_parent)
 Leave the card's styling to an ancestor's style sheet.
void setCardLinkColor (const QColor &color)
 Set the link color of the card (normally CardLink of the live theme). A card styled by its parent keeps this color across theme changes, so the parent can set the color of the theme it shows.

Protected Member Functions

bool event (QEvent *event) override
 Handle widget events, including palette and style changes.

Detailed Description

A card widget displaying learning resources, links, and action buttons.

Constructor & Destructor Documentation

◆ LearnCardWidget()

LearnCardWidget::LearnCardWidget ( QWidget * parent = nullptr)
explicit

Construct a LearnCardWidget.

Parameters
parentThe parent widget; may be nullptr.

Member Function Documentation

◆ event()

bool LearnCardWidget::event ( QEvent * event)
overrideprotected

Handle widget events, including palette and style changes.

Parameters
eventThe event to handle.
Returns
true if the event was consumed; false to allow further processing by the base class.

◆ isLinksCollapsed()

bool LearnCardWidget::isLinksCollapsed ( ) const

Return whether the links section is currently collapsed.

Returns
true if the link list is hidden; false if it is visible.

◆ setCardLinkColor()

void LearnCardWidget::setCardLinkColor ( const QColor & color)

Set the link color of the card (normally CardLink of the live theme). A card styled by its parent keeps this color across theme changes, so the parent can set the color of the theme it shows.

Parameters
colorthe link color.

◆ setLinksCollapsed()

void LearnCardWidget::setLinksCollapsed ( bool collapsed)

Collapse or expand the links section.

Parameters
collapsedtrue to hide the links list; false to show it.

◆ setStyledByParent()

void LearnCardWidget::setStyledByParent ( bool styled_by_parent)

Leave the card's styling to an ancestor's style sheet.

By default the card sets the live learn-card style sheet on itself and renews it on every theme change. A widget's own sheet wins over its ancestors', so a preview that styles the card from its own sheet (the Theme Designer's draft preview) turns this off.

Parameters
styled_by_parenttrue to clear the card's own sheet and keep it clear.

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