PDA

View Full Version : Textbrowser issue



deekayt
29th October 2006, 07:42
I am using QT4 ( Windows)

I am trying to show help through a click of pushbutton . Help file ( first one ) is required to be displayed in a Textbrowser popup where onward one canm follow the links. I have made the first page in html and links are also html .

I am using the following code


steg::steg(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);

connect(ui.helpbutton, SIGNAL(clicked()), this, SLOT(help()));

}

void steg::help()
{

QTextBrowser *sourceViewer = new QTextBrowser(0);
//sourceViewer->setSource(ui.datalineEdit->text());
sourceViewer->resize(600, 600);
sourceViewer->show();

}
In fact how to give setsource().For a normal html file or even a doc file how to give it as url since setsource( const url&) is to be given.

wysota
29th October 2006, 07:51
setSource needs a file. I don't know what your datalineEdit holds, but if it is a path to the file, just convert it to [qtclas]QUrl[/qtclass] for example by using QUrl::fromLocalFile().