Auf dieser Seite

QWebViewSettings Class

Ermöglicht die Konfiguration von Browser-Eigenschaften und -Attributen. Mehr...

Kopfzeile: #include <QWebViewSettings>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebView)
target_link_libraries(mytarget PRIVATE Qt6::WebView)
qmake: QT += webview
Since: Qt 6.11

Öffentliche Typen

enum class WebAttribute { LocalStorageEnabled, JavaScriptEnabled, AllowFileAccess, LocalContentCanAccessFileUrls }

Öffentliche Funktionen

void setAttribute(QWebViewSettings::WebAttribute attribute, bool on)
bool testAttribute(QWebViewSettings::WebAttribute attribute) const

Detaillierte Beschreibung

Das QWebViewSettings-Objekt kann verwendet werden, um Browser-Eigenschaften und generische Attribute zu konfigurieren, wie z.B. JavaScript-Unterstützung, Dateizugriff und lokale Speicherfunktionen.

Die Standardwerte werden so belassen, wie sie von den verschiedenen Plattformen vorgegeben werden.

Dokumentation der Mitgliedstypen

enum class QWebViewSettings::WebAttribute

Dieser Enum-Typ spezifiziert Einstellungen für Webseiten:

KonstanteWertBeschreibung
QWebViewSettings::WebAttribute::LocalStorageEnabled0Aktiviert die Unterstützung für die lokale Speicherfunktion von HTML 5.
QWebViewSettings::WebAttribute::JavaScriptEnabled1Ermöglicht die Ausführung von JavaScript-Programmen.
QWebViewSettings::WebAttribute::AllowFileAccess2Ermöglicht lokal geladenen Dokumenten den Zugriff auf andere lokale URLs.
QWebViewSettings::WebAttribute::LocalContentCanAccessFileUrls3Ermöglicht es WebView, Datei-URLs zu laden.

Dokumentation der Mitgliedsfunktionen

void QWebViewSettings::setAttribute(QWebViewSettings::WebAttribute attribute, bool on)

Aktiviert oder deaktiviert die angegebene Funktion attribute je nach dem Wert von on.

bool QWebViewSettings::testAttribute(QWebViewSettings::WebAttribute attribute) const

Gibt true zurück, wenn attribute aktiviert ist; andernfalls wird false zurückgegeben.

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