-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmhelp.cpp
48 lines (40 loc) · 1.22 KB
/
frmhelp.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
40
41
42
43
44
45
46
47
#include "frmhelp.h"
#include "ui_frmhelp.h"
#include "jukeboxconfig.h"
frmHelp::frmHelp(QWidget *parent) :
QDialog(parent),
ui(new Ui::frmHelp)
{
ui->setupUi(this);
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
ui->btnUp->setPixmap(QPixmap(UpArrow()));
ui->btnDown->setPixmap(QPixmap(DownArrow()));
QObject::connect(ui->btnUp,SIGNAL(clicked()),this,SLOT(btnUpClicked()));
QObject::connect(ui->btnDown,SIGNAL(clicked()),this,SLOT(btnDownClicked()));
QObject::connect(ui->btnExit,SIGNAL(clicked()),this,SLOT(accept()));
//ui->textBrowser->setSource(QUrl(ResourcesDirectory() + "/manual/manual.html"));
ui->textBrowser->setSource(QUrl("resources/manual/manual.html"));
}
frmHelp::~frmHelp()
{
delete ui;
}
void frmHelp::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void frmHelp::btnUpClicked()
{
QApplication::sendEvent(ui->textBrowser,new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, 0, 0));
}
void frmHelp::btnDownClicked()
{
QApplication::sendEvent(ui->textBrowser,new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, 0, 0));
}