Qt WebEngine Widgets C++ Classes
QWidget 기반 애플리케이션에서 웹 콘텐츠를 렌더링하기 위한 C++ 클래스를 제공합니다. 더 보기...
클래스
웹 문서를 보고 편집하는 데 사용되는 위젯입니다. |
상세 설명
Qt WebEngine 위젯 모듈은 웹 브라우저 엔진과 웹 콘텐츠 렌더링 및 상호 작용을 위한 C++ 클래스를 제공합니다.
qmake로 빌드를 사용하여 모듈에 링크하려면 qmake .pro 파일에 다음 QT 변수를 추가하세요:
QT += webenginewidgets
CMake로 빌드할 경우 find_package()
명령을 사용하여 Qt6 패키지에서 필요한 모듈 컴포넌트를 찾고 target_link_libraries()
명령을 사용하여 모듈에 링크합니다:
find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets)
target_link_libraries(target PRIVATE Qt6::WebEngineWidgets)
HTML 페이지를 로드하고 표시하는 데 필요한 최소한의 코드는 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(); }
© 2025 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.