MainWindow::MainWindow()
{
centralWidget = new Previewer(this);
setCentralWidget(centralWidget);
QFuture<void> future = QtConcurrent::run(this, &MainWindow::setStartupText);
}
void MainWindow::setStartupText()
{
QString string
= "<html><body><h1>HTML Previewer</h1>" " <p>This example shows you how to use QWebView to"
" preview HTML data written in a QPlainTextEdit.</p>"
"<div id='a'> </div> <input type='button' onclick=\"Qt.viewphp()\"></body></html>";
centralWidget->webView->setHtml(string);
}
MainWindow::MainWindow()
{
centralWidget = new Previewer(this);
setCentralWidget(centralWidget);
QFuture<void> future = QtConcurrent::run(this, &MainWindow::setStartupText);
}
void MainWindow::setStartupText()
{
QString string = "<html><body><h1>HTML Previewer</h1>"
" <p>This example shows you how to use QWebView to"
" preview HTML data written in a QPlainTextEdit.</p>"
"<div id='a'> </div> <input type='button' onclick=\"Qt.viewphp()\"></body></html>";
centralWidget->webView->setHtml(string);
}
To copy to clipboard, switch view to plain text mode
When I do this the text appears in the webView but with no format at all. The <h1> doesn't work and the <input type='button'> doesn't appear,etc.
Am I doing something wrong ? Is this not possible to do?
(This is from previewer example by the way.)
Please help me !
Andre Pimenta
Bookmarks