-
Notifications
You must be signed in to change notification settings - Fork 0
/
uri.cpp
39 lines (27 loc) · 917 Bytes
/
uri.cpp
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
#include <QtWidgets>
#include "uri.h"
URI::URI(QWidget *parent) : QWidget(parent)
{
gridGroupBox = new QGroupBox(tr("New Zealand COVID Pass URI"));
QVBoxLayout *layout = new QVBoxLayout;
smallEditor = new QTextEdit;
smallEditor->setAcceptRichText(false);
smallEditor->setMinimumSize(QSize(0, 250));
smallEditor->setPlaceholderText(tr("NZCP:/1/..."));
layout->addWidget(smallEditor);
QHBoxLayout *layout2 = new QHBoxLayout;
button = new QPushButton(tr("Verify"));
button->setAutoDefault(false);
button->setFixedWidth(100);
layout2->addWidget(button);
layout->addLayout(layout2);
connect(button, &QAbstractButton::clicked, this, &URI::verify);
gridGroupBox->setLayout(layout);
setLayout(layout);
}
void URI::verify()
{
QString uri = smallEditor->toPlainText();
std::string stdUri = uri.toStdString();
verifyPassURISignal(stdUri);
}