QWebViewSettings Class
Ermöglicht die Konfiguration von Browsereigenschaften und -attributen. Mehr...
| Kopfzeile: | #include <QWebViewSettings> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WebView) target_link_libraries(mytarget PRIVATE Qt6::WebView) |
| qmake: | QT += webview |
| Seit: | 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 |
Ausführliche Beschreibung
Mit dem QWebViewSettings-Objekt lassen sich Browsereigenschaften und generische Attribute konfigurieren, wie z. B. JavaScript-Unterstützung, Dateizugriff und Funktionen für den lokalen Speicher.
Die Standardwerte entsprechen den von den verschiedenen Plattformen festgelegten Einstellungen.
Dokumentation zu den Mitgliedstypen
enum class QWebViewSettings::WebAttribute
Dieser Enum-Typ legt Einstellungen für Webseiten fest:
| Konstante | Wert | Beschreibung |
|---|---|---|
QWebViewSettings::WebAttribute::LocalStorageEnabled | 0 | Aktiviert die Unterstützung für die HTML5-Funktion „Local Storage“. |
QWebViewSettings::WebAttribute::JavaScriptEnabled | 1 | Aktiviert die Ausführung von JavaScript-Programmen. |
QWebViewSettings::WebAttribute::AllowFileAccess | 2 | Aktiviert das Laden von Datei-URLs durch den „ WebView “. |
QWebViewSettings::WebAttribute::LocalContentCanAccessFileUrls | 3 | Ermöglicht lokal geladenen Dokumenten den Zugriff auf andere lokale URLs. |
Dokumentation zu den Member-Funktionen
void QWebViewSettings::setAttribute(QWebViewSettings::WebAttribute attribute, bool on)
Aktiviert oder deaktiviert die angegebene „ attribute “-Funktion 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.