summaryrefslogtreecommitdiff
path: root/qmphelpwindow.cpp
blob: 8b99ab226f6c363ca9cf980aa8fc003266610f76 (plain) (blame)
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
#include "qmphelpwindow.hpp"
#include "ui_qmphelpwindow.h"

qmpHelpWindow::qmpHelpWindow(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::qmpHelpWindow)
{
	ui->setupUi(this);
	ui->textBrowser->setSearchPaths(QStringList(QString(":/doc"))+QStringList(QString(":/img")));
	ui->textBrowser->setSource(QUrl("qrc:///doc/index.html"));
}

qmpHelpWindow::~qmpHelpWindow()
{
	delete ui;
}

void qmpHelpWindow::on_textBrowser_sourceChanged(const QUrl &src)
{
	if(src.fileName()==QString("version.html"))
	{
		QString s=ui->textBrowser->toHtml();
		s.replace("QT_VERSION_STR",QT_VERSION_STR);
		s.replace("APP_VERSION",APP_VERSION);
		ui->textBrowser->setHtml(s);
	}
}