-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHelpDialog.cpp
More file actions
executable file
·46 lines (32 loc) · 861 Bytes
/
HelpDialog.cpp
File metadata and controls
executable file
·46 lines (32 loc) · 861 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "HelpDialog.hpp"
#include "../build-mrptQt-Desktop_Qt_5_10_0_GCC_64bit-Debug/ui_Helpdialog.h"
using namespace std;
HelpDialog::HelpDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpDialog)
{
ui->setupUi(this);
setColors();
setText();
}
void HelpDialog::setColors(){
QPalette pal = ui->textEdit->palette();
pal.setColor(QPalette::Base, this->palette().color(this->backgroundRole()));
ui->textEdit->setPalette(pal);
}
void HelpDialog::setText(){
QFile file(":/new/prefix1/help.html");
if(!file.open(QIODevice::ReadOnly)){
QMessageBox::information(this, "Error", file.errorString());
}
QTextStream in(&file);
QString text = "";
while(!in.atEnd()){
text.append(in.readAll());
}
ui->textEdit->setHtml(text);
}
HelpDialog::~HelpDialog()
{
delete ui;
}