このページでは

QWebViewSettings Class

ブラウザのプロパティと属性を設定できるようにします。詳細...

ヘッダ #include <QWebViewSettings>
CMake.CMakeを使用して、ブラウザのプロパティを設定することができます: find_package(Qt6 REQUIRED COMPONENTS WebView)
target_link_libraries(mytarget PRIVATE Qt6::WebView)
qmake: QT += webview
以来:Qt 6.11

パブリックな型

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

パブリック関数

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

詳しい説明

QWebViewSettings オブジェクトは、JavaScript のサポート、ファイルアクセス、ローカルストレージ機能など、ブラウザのプロパティや一般的な属性を設定するために使用できます。

デフォルト値は異なるプラットフォームによって設定されたままになっています。

メンバ型ドキュメント

enum class QWebViewSettings::WebAttribute

この列挙型は、ウェブページの設定を指定します:

定数説明
QWebViewSettings::WebAttribute::LocalStorageEnabled0HTML 5 のローカルストレージ機能のサポートを有効にします。
QWebViewSettings::WebAttribute::JavaScriptEnabled1JavaScriptプログラムの実行を有効にします。
QWebViewSettings::WebAttribute::AllowFileAccess2ローカルに読み込まれたドキュメントが他のローカルURLにアクセスできるようにします。
QWebViewSettings::WebAttribute::LocalContentCanAccessFileUrls3WebView がファイル URL をロードできるようにする。

メンバー関数ドキュメント

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

on の値に応じて、指定されたattribute 機能を有効または無効にする。

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

attribute が有効な場合はtrue を返し、そうでない場合はfalse を返す。

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