maider
12th March 2010, 10:03
Hello,
I'm trying to open a .pdf file from qt. I have develop the following code to achieve my goal:
#include <QDesktopServices>
#include <QUrl>
exercise::exercise(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.open,SIGNAL(clicked()),this,SLOT(openDo cument()));
}
exercise::~exercise()
{
}
void exercise::openDocument()
{
QDesktopServices desk;
desk.openUrl(QUrl("file://C:/a.pdf"));
}
Can someone help me? i have read the post about this thread, but i'm not capable to solve the problem.
I'm trying to open a .pdf file from qt. I have develop the following code to achieve my goal:
#include <QDesktopServices>
#include <QUrl>
exercise::exercise(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.open,SIGNAL(clicked()),this,SLOT(openDo cument()));
}
exercise::~exercise()
{
}
void exercise::openDocument()
{
QDesktopServices desk;
desk.openUrl(QUrl("file://C:/a.pdf"));
}
Can someone help me? i have read the post about this thread, but i'm not capable to solve the problem.