Qt WebEngine Widgets C++ Classes
Proporciona clases C++ para renderizar contenido web en una aplicación basada en QWidget. Más...
Clases
Widget que se utiliza para ver y editar documentos web |
Descripción detallada
El módulo Qt WebEngine Widgets proporciona un motor de navegador web así como clases C++ para renderizar e interactuar con contenido web.
Para enlazar con el módulo usando qmake, añade la siguiente variable QT a tu archivo qmake .pro:
QT += webenginewidgets
Para compilar con CMake utilice el comando find_package() para localizar los componentes del módulo necesarios en el paquete Qt6 y target_link_libraries() para enlazar con el módulo:
find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets)
target_link_libraries(target PRIVATE Qt6::WebEngineWidgets)La mínima cantidad de código necesaria para cargar y mostrar una página HTML requiere sólo implementar la clase QWebEngineView.
#include <QApplication> #include <QWebEngineView> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWebEngineView view; view.load(QUrl("https://qt-project.org/")); view.resize(1024, 750); view.show(); return app.exec(); }
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.