-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLicenseReader.cpp
More file actions
29 lines (24 loc) · 961 Bytes
/
Copy pathLicenseReader.cpp
File metadata and controls
29 lines (24 loc) · 961 Bytes
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
#include "LicenseReader.h"
LicenseReader::LicenseReader(QWidget *parent) : QWidget(parent) {
headingLabel = new QLabel(tr("<b>You must accept the license agreement to use this software product.</b>"));
acceptButton = new QPushButton(tr("Accept"));
rejectButton = new QPushButton(tr("Reject"));
buttonLayout = new QHBoxLayout;
mainLayout = new QVBoxLayout;
textEdit = new QTextEdit;
buttonLayout->addStretch();
buttonLayout->addWidget(acceptButton);
buttonLayout->addWidget(rejectButton);
mainLayout->addWidget(headingLabel);
mainLayout->addWidget(textEdit);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
setFixedSize(810,610);
QFile file(":/LICENSE.GPL3");
file.open(QIODevice::ReadOnly);
QTextStream stream(&file);
textEdit->setText(stream.readAll());
textEdit->setReadOnly(true);
connect(acceptButton,SIGNAL(clicked()),this,SIGNAL(accepted()));
connect(rejectButton,SIGNAL(clicked()),this,SIGNAL(rejected()));
}