Archived:Como usar um QWebView
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
Qt Quick should be used for all UI development on mobile devices. The approach described in this article (based on QWidget) is deprecated.
Qt Quick should be used for all UI development on mobile devices. The approach described in this article (based on QWidget) is deprecated.
Dados do artigo
Testado com
SDK: Qt 4.5
Aparelho(s): S60 Emulator
Compatibilidade
Plataforma(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Artigo
Palavras-chave: QWebView
Tradução:
Originado de Archived:How to use QWebView
Por valderind4
Última alteração feita por hamishwillee
em 11 Oct 2012
Contents |
Introdução
A classe QWebView provêr um widget, o qual é usado para visualizar e editar documentos web.
QWebView é o principal componente widget do QtWebKit, módulo de navegação web. Ele pode ser usado em várias aplicaçãoes para mostrar contéudo online da internet.
Este exemplo faz uso das seguintes classes: QWebView - Provides a widget that is used to view and edit web documents
Funcionalidades
- Este trecho de código é usado para carregar uma URL específica.
web->load(QUrl("http://www.google.com.au/"));
- Esta propriedade contém a URL da página web atualmente visualizada.
web->setUrl(QUrl("http://www.google.com.au/"));
Código fonte
#include <QtGui/QApplication>
#include "webdialog.h"
#include<QWidget>
#include<QWebView>
#include<QVBoxLayout>
#include<QUrl>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win=new QWidget();
QVBoxLayout *lay=new QVBoxLayout();
QWebView *web=new QWebView();
web->load(QUrl("http://www.google.com.au/"));
web->show();
lay->addWidget(web);
win->setLayout(lay);
win->showMaximized();
win->setStyleSheet("* { background-color:rgb(150,147,88); padding: 7px ; color:rgb(255,255,255)}");
return a.exec();
}
Screenshot
For more Details in QWebView.



(no comments yet)