IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWebEngineFileSystemAccessRequest Class

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

This class was introduced in Qt 6.4.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWebEngineFileSystemAccessRequest Class

  • Header: QWebEngineFileSystemAccessRequest

  • Since: Qt 6.4

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)

    target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)

  • qmake: QT += webenginecore

Detailed Description

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() or reject().

Property Documentation

 

[read-only] accessFlags : const AccessFlags

Contains the requested file access rights.

Access functions:

  • accessFlags() const

[read-only] filePath : const QUrl

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

Access functions:

  • filePath() const

[read-only] handleType : const HandleType

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

Access functions:

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

Access functions:

  • origin() const

Member Function Documentation

 

void QWebEngineFileSystemAccessRequest::accept()

Accepts the request to access local files.

void QWebEngineFileSystemAccessRequest::reject()

Rejects a request to access local files.

Related Non-Members

 

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

Returns true if lhs and rhs point to different requests.

bool operator==(const QWebEngineFileSystemAccessRequest &lhs, const QWebEngineFileSystemAccessRequest &rhs)

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+