This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
qiactionsheet.h
55 lines (39 loc) · 1.57 KB
/
qiactionsheet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef QIACTIONSHEET_H
#define QIACTIONSHEET_H
#include <QQuickItem>
class QIActionSheet : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(QStringList otherButtonTitles READ otherButtonTitles WRITE setOtherButtonTitles NOTIFY otherButtonTitlesChanged)
Q_PROPERTY(int clickedButtonIndex READ clickedButtonIndex WRITE setClickedButtonIndex NOTIFY clickedButtonIndexChanged)
Q_PROPERTY(QString cancelButtonTitle READ cancelButtonTitle WRITE setCancelButtonTitle NOTIFY cancelButtonTitleChanged)
public:
QIActionSheet(QQuickItem* parent = 0);
~QIActionSheet();
QString title() const;
void setTitle(const QString &title);
QStringList otherButtonTitles() const;
void setOtherButtonTitles(const QStringList &otherButtonTitles);
int clickedButtonIndex() const;
void setClickedButtonIndex(int clickedButtonIndex);
Q_INVOKABLE void show();
QString cancelButtonTitle() const;
void setCancelButtonTitle(const QString &cancelButtonTitle);
signals:
void clicked(int buttonIndex);
void titleChanged();
void otherButtonTitlesChanged();
void clickedButtonIndexChanged();
void cancelButtonTitleChanged();
/// The signal is emitted when the action sheet is dismissed completely.
void dismissed(int buttonIndex);
private:
Q_INVOKABLE void onReceived(QString name,QVariantMap data);
QString m_title;
QStringList m_otherButtonTitles;
QString m_cancelButtonTitle;
int m_clickedButtonIndex;
bool running;
};
#endif // QIACTIONSHEET_H