aboutexecut.cpp
28 lines
| 748 B
| text/x-c
|
CppLexer
Jeandet Alexis
|
r13 | #include "aboutexecut.h" | ||
#include <QFile> | ||||
#include <QTextStream> | ||||
#include <QDesktopServices> | ||||
aboutExecut::aboutExecut(QWidget *parent) : | ||||
QTextBrowser(parent) | ||||
{ | ||||
this->setReadOnly(true); | ||||
QString code; | ||||
QFile file; | ||||
code.clear(); | ||||
file.setFileName(":/about/about.html"); | ||||
this->setAcceptRichText(true); | ||||
file.open(QIODevice::ReadOnly); | ||||
QTextStream filestrm(&file); | ||||
while(!filestrm.atEnd())code.append(filestrm.readLine()+"\n"); | ||||
this->setHtml(code); | ||||
file.close(); | ||||
this->setMinimumSize(400,400); | ||||
connect(this,SIGNAL(anchorClicked(QUrl)),this,SLOT(anchorClicked_slt(QUrl))); | ||||
this->setOpenLinks(false); | ||||
} | ||||
void aboutExecut::anchorClicked_slt(const QUrl &url) | ||||
{ | ||||
QDesktopServices::openUrl(url); | ||||
} | ||||