このページでは

QWebViewSettings Class

ブラウザのプロパティや属性を設定できます。詳細...

ヘッダー: #include <QWebViewSettings>
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

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

定数値説明
QWebViewSettings::WebAttribute::LocalStorageEnabled0HTML 5のローカルストレージ機能のサポートを有効にします。
QWebViewSettings::WebAttribute::JavaScriptEnabled1JavaScript プログラムの実行を有効にします。
QWebViewSettings::WebAttribute::AllowFileAccess2WebView がファイル URL を読み込めるようにします。
QWebViewSettings::WebAttribute::LocalContentCanAccessFileUrls3ローカルで読み込まれたドキュメントが、他のローカル 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.