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
){
ui.setupUi(this);
connect(ui.open,SIGNAL(clicked()),this,SLOT(openDocument()));
}
exercise::~exercise()
{
}
void exercise::openDocument()
{
desk.
openUrl(QUrl("file://C:/a.pdf"));
}
#include <QDesktopServices>
#include <QUrl>
exercise::exercise(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.open,SIGNAL(clicked()),this,SLOT(openDocument()));
}
exercise::~exercise()
{
}
void exercise::openDocument()
{
QDesktopServices desk;
desk.openUrl(QUrl("file://C:/a.pdf"));
}
To copy to clipboard, switch view to plain text mode
Can someone help me? i have read the post about this thread, but i'm not capable to solve the problem.
Bookmarks