QWebEngineNewWindowRequest Class

QWebEnginePage::newWindowRequested() 信号的实用程序类型。更多

头文件: #include <QWebEngineNewWindowRequest>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Qt 6.2
在 QML 中: WebEngineNewWindowRequest
继承: QObject

公共类型

enum DestinationType { InNewWindow, InNewTab, InNewDialog, InNewBackgroundTab }

属性

公共功能

QWebEngineNewWindowRequest::DestinationType destination() const
bool isUserInitiated() const
void openIn(QWebEnginePage *page)
QRect requestedGeometry() const
QUrl requestedUrl() const

详细说明

包含在单独的网络引擎视图中加载页面的请求信息。

另请参阅 QWebEnginePage::newWindowRequested().

成员类型文档

enum QWebEngineNewWindowRequest::DestinationType

该枚举描述了所请求的窗口类型:

常量描述
QWebEngineNewWindowRequest::InNewWindow0在单独窗口中。
QWebEngineNewWindowRequest::InNewTab1在同一窗口的标签页中。
QWebEngineNewWindowRequest::InNewDialog2在没有标签栏、工具栏或 URL 栏的窗口中。
QWebEngineNewWindowRequest::InNewBackgroundTab3在同一窗口的标签页中,不隐藏当前可见的网络引擎视图。

属性文档

[read-only] destination : const DestinationType

该属性用于保存所请求的窗口类型。

访问功能:

QWebEngineNewWindowRequest::DestinationType destination() const

[read-only] requestedGeometry : const QRect

该属性用于保存为新页面申请的大小。

访问功能:

QRect requestedGeometry() const

[read-only] requestedUrl : const QUrl

该属性包含为新页面请求的 URL。

访问功能:

QUrl requestedUrl() const

[read-only] userInitiated : const bool

该页面请求是否由键盘或鼠标事件直接触发。

您可以使用此属性阻止自动弹出

访问函数:

bool isUserInitiated() const

成员函数文档

void QWebEngineNewWindowRequest::openIn(QWebEnginePage *page)

page 所代表的视图中打开请求的窗口。

另请参阅 QWebEnginePage::newWindowRequested

© 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.