代码拉取完成,页面将自动刷新
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(simplebrowser LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/simplebrowser")
find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
qt_add_executable(simplebrowser
browser.cpp browser.h
browserwindow.cpp browserwindow.h
certificateerrordialog.ui
downloadmanagerwidget.cpp downloadmanagerwidget.h downloadmanagerwidget.ui
downloadwidget.cpp downloadwidget.h downloadwidget.ui
main.cpp
passworddialog.ui
tabwidget.cpp tabwidget.h
webpage.cpp webpage.h
webpopupwindow.cpp webpopupwindow.h
webview.cpp webview.h
)
if(WIN32)
set_property(
TARGET simplebrowser
APPEND PROPERTY
SOURCES simplebrowser.exe.manifest)
endif()
set_target_properties(simplebrowser PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.simplebrowser"
)
target_link_libraries(simplebrowser PUBLIC
Qt::Core
Qt::Gui
Qt::WebEngineWidgets
)
# Resources:
set(simplebrowser_resource_files
"data/AppLogoColor.png"
"data/ninja.png"
)
qt_add_resources(simplebrowser "simplebrowser"
PREFIX
"/"
BASE
"data"
FILES
${simplebrowser_resource_files}
)
set(simplebrowser1_resource_files
"data/3rdparty/dialog-error.png"
"data/3rdparty/edit-clear.png"
"data/3rdparty/go-bottom.png"
"data/3rdparty/go-next.png"
"data/3rdparty/go-previous.png"
"data/3rdparty/process-stop.png"
"data/3rdparty/text-html.png"
"data/3rdparty/view-refresh.png"
)
qt_add_resources(simplebrowser "simplebrowser1"
PREFIX
"/"
BASE
"data/3rdparty"
FILES
${simplebrowser1_resource_files}
)
if (APPLE)
set_target_properties(simplebrowser PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
)
if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
# Need to sign application for location permissions to work
add_custom_command(TARGET simplebrowser
POST_BUILD COMMAND codesign -s - simplebrowser.app)
endif()
endif()
install(TARGETS simplebrowser
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。