Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
learn_card_widget.h
Go to the documentation of this file.
1
10#ifndef LEARN_CARD_WIDGET_H
11#define LEARN_CARD_WIDGET_H
12
13#include <QWidget>
14#include <QFrame>
15#include <QColor>
16
17class QPushButton;
18
19namespace Ui {
20class LearnCardWidget;
21}
22
26class LearnCardWidget : public QFrame
27{
28 Q_OBJECT
29
30public:
35 explicit LearnCardWidget(QWidget *parent = nullptr);
36
39
45 void setLinksCollapsed(bool collapsed);
46
51 bool isLinksCollapsed() const;
52
53protected:
61 bool event(QEvent *event) override;
62
63private:
67 enum ValidityType {
68 AllVersions,
69 ReleaseOnly,
70 DevOnly
71 };
72
76 struct LinkType {
77 QString url;
78 QString label;
79 QString short_label;
80 QString tooltip;
81 ValidityType validity;
82 };
83
87 struct ButtonType {
88 QString url;
89 QString label;
90 QString tooltip;
91 QColor color;
92 QColor hover_color;
93 ValidityType validity;
94 };
95
96 Ui::LearnCardWidget *ui_;
97 QList<LinkType> links_;
98 QList<ButtonType> buttons_;
99 bool links_collapsed_;
104 void loadLinksFromRessource();
105
109 void setupLinks();
110
114 void setupActionButtons();
115};
116
117#endif //LEARN_CARD_WIDGET_H
A card widget displaying learning resources, links, and action buttons.
Definition learn_card_widget.h:27
~LearnCardWidget()
Destroy the widget and its UI form.
Definition learn_card_widget.cpp:56
bool isLinksCollapsed() const
Return whether the links section is currently collapsed.
Definition learn_card_widget.cpp:224
bool event(QEvent *event) override
Handle widget events, including palette and style changes.
Definition learn_card_widget.cpp:229
void setLinksCollapsed(bool collapsed)
Collapse or expand the links section.
Definition learn_card_widget.cpp:208