I want to open a html file in the text browser ,
and the code is as follows:
#include <QtGui>
#include <QUrl>
#include <QTextBrowser>
int main(int argc, char **argv)
{
bw
->setSource
(QUrl("D:\\Wikipedia.html"));
bw->setGeometry ( 100,100,400,400 );
bw->show();
return app.exec();
}
#include <QtGui>
#include <QUrl>
#include <QTextBrowser>
int main(int argc, char **argv)
{
QApplication app( argc, argv );
QTextBrowser *bw = new QTextBrowser;
bw->setSource (QUrl("D:\\Wikipedia.html"));
bw->setGeometry ( 100,100,400,400 );
bw->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
QFSFileEngine:
pen: No file name specified
QTextBrowser: Cannot open 'D:\Wikipedia.html' for reading
QTextBrowser: No document for D:\Wikipedia.html
But the browser is unable to open the file ...
What changes has to be made to identify the file and open it????
Bookmarks