QWebEngineFileSystemAccessRequest Class

The QWebEngineFileSystemAccessRequest class enables accepting or rejecting requests for local file system access from JavaScript applications. 更多...

头: #include <QWebEngineFileSystemAccessRequest>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Since: Qt 6.4

公共类型

enum AccessFlag { Read, Write }
flags AccessFlags
enum HandleType { File, Directory }

特性

公共函数

void accept ()
QWebEngineFileSystemAccessRequest::AccessFlags accessFlags () const
QUrl filePath () const
QWebEngineFileSystemAccessRequest::HandleType handleType () const
QUrl origin () const
void reject ()
bool operator!= (const QWebEngineFileSystemAccessRequest & lhs , const QWebEngineFileSystemAccessRequest & rhs )
bool operator== (const QWebEngineFileSystemAccessRequest & lhs , const QWebEngineFileSystemAccessRequest & rhs )

详细描述

To allow web applications to access local files of the computer, applications must connect to QWebEnginePage::fileSystemAccessRequested , which takes a QWebEngineFileSystemAccessRequest instance as an argument.

If a web applications requests access to local files or directories, QWebEnginePage::fileSystemAccessRequested will be emitted with an QWebEngineFileSystemAccessRequest instance as an argument where accessFlags () indicates the type of the requested access: read, write or both. The signal handler needs to then either call accept () 或 reject ().

成员类型文档编制

enum QWebEngineFileSystemAccessRequest:: AccessFlag
flags QWebEngineFileSystemAccessRequest:: AccessFlags

This enum describes the type of the requested access: read, write or both. The options can be OR-ed together from the following list:

常量
QWebEngineFileSystemAccessRequest::Read 0x1
QWebEngineFileSystemAccessRequest::Write 0x2

The AccessFlags type is a typedef for QFlags <AccessFlag>. It stores an OR combination of AccessFlag values.

enum QWebEngineFileSystemAccessRequest:: HandleType

This enum describes the type of the requested file system entry.

常量
QWebEngineFileSystemAccessRequest::File 0
QWebEngineFileSystemAccessRequest::Directory 1

特性文档编制

[read-only] accessFlags : const AccessFlags

Contains the requested file access rights.

访问函数:

QWebEngineFileSystemAccessRequest::AccessFlags accessFlags () const

[read-only] filePath : const QUrl

Returns the file path this file system access request is referring to.

访问函数:

QUrl filePath () const

[read-only] handleType : const HandleType

Returns the type of the requested file system entry. (File or directory)

访问函数:

QWebEngineFileSystemAccessRequest::HandleType handleType () const

[read-only] origin : const QUrl

This property holds the URL of the web page that issued the file system access request.

访问函数:

QUrl origin () const

成员函数文档编制

[invokable] void QWebEngineFileSystemAccessRequest:: accept ()

Accepts the request to access local files.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

[invokable] void QWebEngineFileSystemAccessRequest:: reject ()

Rejects a request to access local files.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

相关非成员

[noexcept] bool operator!= (const QWebEngineFileSystemAccessRequest & lhs , const QWebEngineFileSystemAccessRequest & rhs )

返回 true if lhs and rhs point to different requests.

[noexcept] bool operator== (const QWebEngineFileSystemAccessRequest & lhs , const QWebEngineFileSystemAccessRequest & rhs )

返回 true if lhs and rhs both point to the same request.