Added some improvements
[flowchart-guider:flowchart-guider.git] / frmhelp.cpp
1 #include "frmhelp.h"
2 #include "ui_frmhelp.h"
3 #include <QDir>
4
5 frmHelp::frmHelp(QWidget *parent) :
6     QMainWindow(parent),
7     ui(new Ui::frmHelp)
8 {
9     ui->setupUi(this);
10     QDir dir(QApplication::applicationDirPath()+"/help/");
11     if (dir.exists())
12         ui->webView->load(QUrl::fromLocalFile(dir.absolutePath()+"/help.html"));
13
14     connect(ui->lineEdit,SIGNAL(returnPressed()),ui->pushButton_2,SLOT(click()));
15 }
16
17 frmHelp::~frmHelp()
18 {
19     delete ui;
20 }
21
22 void frmHelp::changeEvent(QEvent *e)
23 {
24     QMainWindow::changeEvent(e);
25     switch (e->type()) {
26     case QEvent::LanguageChange:
27         ui->retranslateUi(this);
28         break;
29     default:
30         break;
31     }
32 }
33
34 void frmHelp::on_pushButton_2_clicked()
35 {
36     ui->webView->findText("");
37     if (ui->webView->findText(ui->lineEdit->text(),(QWebPage::FindWrapsAroundDocument))) {
38         ui->lineEdit->setStyleSheet("background: #CEFFCF;");
39     }
40     else ui->lineEdit->setStyleSheet("background: #FFBEBE;");
41 }