Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
share_bar_widget.h
Go to the documentation of this file.
1
6
7#ifndef SHARE_BAR_WIDGET_H
8#define SHARE_BAR_WIDGET_H
9
10#include <QString>
11#include <QWidget>
12#include <qtmetamacros.h>
13
14class QLabel;
15class QLineEdit;
16class QPushButton;
17
26class ShareBarWidget final : public QWidget
27{
28 Q_OBJECT
29
30public:
31 explicit ShareBarWidget(QWidget *parent = nullptr);
32
33 void retranslateUi();
34
36 [[nodiscard]] QString name() const;
37
39 void setName(const QString &name);
40
42 void setCountText(const QString &text);
43
45 void setHintText(const QString &text, bool visible);
46
48 void setCreateEnabled(bool enabled);
49
51 void focusName();
52
53signals:
56
57private:
58 QLabel *hintLabel;
59 QLineEdit *nameEdit;
60 QLabel *countLabel;
61 QPushButton *cancelButton;
62 QPushButton *createButton;
63};
64
65#endif // SHARE_BAR_WIDGET_H
QLineEdit * nameEdit
Definition share_bar_widget.h:59
void setCountText(const QString &text)
Sets the selected-count summary label text.
Definition share_bar_widget.cpp:58
void setCreateEnabled(bool enabled)
Enables or disables the create-share-link button (guards double submission).
Definition share_bar_widget.cpp:69
void focusName()
Moves keyboard focus to the name field.
Definition share_bar_widget.cpp:74
QLabel * hintLabel
Definition share_bar_widget.h:58
QString name() const
Definition share_bar_widget.cpp:48
QLabel * countLabel
Definition share_bar_widget.h:60
void cancelRequested()
void createRequested()
QPushButton * createButton
Definition share_bar_widget.h:62
void retranslateUi()
Definition share_bar_widget.cpp:41
void setName(const QString &name)
Resets the name field to the given default.
Definition share_bar_widget.cpp:53
QPushButton * cancelButton
Definition share_bar_widget.h:61
ShareBarWidget(QWidget *parent=nullptr)
Definition share_bar_widget.cpp:8
void setHintText(const QString &text, bool visible)
Sets the explainer hint text, showing it when visible is true.
Definition share_bar_widget.cpp:63