|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QWebSettings Class Reference
[QtWebKit module]

The QWebSettings class provides a objects that is used to store the settings used by QWebPage and QWebFrame. More...

     #include <QWebSettings>

This class was introduced in Qt 4.4.

- List of all members, including inherited members

### Public Types

- enum FontFamily { StandardFont, FixedFont, SerifFont, SansSerifFont, CursiveFont, FantasyFont }
- enum FontSize { MinimumFontSize, MinimumLogicalFontSize, DefaultFontSize, DefaultFixedFontSize }
- enum WebAttribute { AutoLoadImages, JavascriptEnabled, JavaEnabled, PluginsEnabled, ..., LinksIncludedInFocusChain }
- enum WebGraphic { MissingImageGraphic, MissingPluginGraphic, DefaultFrameIconGraphic, TextAreaSizeGripCornerGraphic }

### Public Functions

- QString fontFamily ( FontFamily which ) const
- int fontSize ( FontSize type ) const
- void resetAttribute ( WebAttribute attr )
- void resetFontFamily ( FontFamily which )
- void resetFontSize ( FontSize type )
- void setAttribute ( WebAttribute attr, bool on )
- void setFontFamily ( FontFamily which, const QString & family )
- void setFontSize ( FontSize type, int size )
- void setUserStyleSheetUrl ( const QUrl & location )
- bool testAttribute ( WebAttribute attr ) const
- QUrl userStyleSheetUrl () const

### Static Public Members

- void clearIconDatabase ()
- QWebSettings * globalSettings ()
- QString iconDatabasePath ()
- QIcon iconForUrl ( const QUrl & url )
- int maximumPagesInCache ()
- void setIconDatabasePath ( const QString & path )
- void setMaximumPagesInCache ( int pages )
- void setObjectCacheCapacities ( int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity )
- void setWebGraphic ( WebGraphic type, const QPixmap & graphic )
- QPixmap webGraphic ( WebGraphic type )

## Detailed Description

The QWebSettings class provides a objects that is used to store the settings used by QWebPage and QWebFrame.

## Member Type Documentation

### enum QWebSettings::FontFamily

This enum describes the generic font families defined by CSS 2. For more information see the CSS standard.

Constant | Value
--- | ---
`QWebSettings::StandardFont` | `0`
`QWebSettings::FixedFont` | `1`
`QWebSettings::SerifFont` | `2`
`QWebSettings::SansSerifFont` | `3`
`QWebSettings::CursiveFont` | `4`
`QWebSettings::FantasyFont` | `5`

### enum QWebSettings::FontSize

This enum describes the font sizes configurable through QWebSettings.

Constant | Value | Description
--- | --- | ---
`QWebSettings::MinimumFontSize` | `0` | The hard minimum font size.
`QWebSettings::MinimumLogicalFontSize` | `1` | The minimum logical font size that is applied after zooming with QWebFrame's textSizeMultiplier().
`QWebSettings::DefaultFontSize` | `2` | The default font size for regular text.
`QWebSettings::DefaultFixedFontSize` | `3` | The default font size for fixed-pitch text.

### enum QWebSettings::WebAttribute

This enum describes various attributes that are configurable through QWebSettings.

Constant | Value | Description
--- | --- | ---
`QWebSettings::AutoLoadImages` | `0` | Specifies whether to automatically load images in web pages.
`QWebSettings::JavascriptEnabled` | `1` | Enables or disables the running of JavaScript programs.
`QWebSettings::JavaEnabled` | `2` | Enables or disables Java applets. Currently Java applets are not supported.
`QWebSettings::PluginsEnabled` | `3` | Enables or disables plugins in web pages. Currently Flash and other plugins are not supported.
`QWebSettings::PrivateBrowsingEnabled` | `4` | Private browsing prevents WebKit from recording visited pages in the history as well as storage of web page icons.
`QWebSettings::JavascriptCanOpenWindows` | `5` | Specifies whether JavaScript programs can open new windows.
`QWebSettings::JavascriptCanAccessClipboard` | `6` | Specifies whether JavaScript programs can read or write to the clipboard.
`QWebSettings::DeveloperExtrasEnabled` | `7` | Enables extra tools for Web developers. Currently this enables the "Inspect" element in the context menu, which shows the WebKit WebInspector for web site debugging.
`QWebSettings::LinksIncludedInFocusChain` | `8` | Specifies whether hyperlinks should be included in the keyboard focus chain.

### enum QWebSettings::WebGraphic

This enums describes the standard graphical elements used in webpages.

Constant | Value | Description
--- | --- | ---
`QWebSettings::MissingImageGraphic` | `0` | The replacement graphic shown when an image could not be loaded.
`QWebSettings::MissingPluginGraphic` | `1` | The replacement graphic shown when a plugin could not be loaded.
`QWebSettings::DefaultFrameIconGraphic` | `2` | The default icon for QWebFrame::icon().
`QWebSettings::TextAreaSizeGripCornerGraphic` | `3` | The graphi shown for the size grip of text areas.

## Member Function Documentation

### void QWebSettings::clearIconDatabase () `[static]`

This will remove all the data from the icon database. If no icon database is enabled noting is going to happen.

### QString QWebSettings::fontFamily ( FontFamily which ) const

Returns the default font family for the specified which of font.

See also setFontFamily().

### int QWebSettings::fontSize ( FontSize type ) const

Returns the default font size for type.

See also setFontSize().

### QWebSettings * QWebSettings::globalSettings () `[static]`

Returns the global settings object.

Any setting changed on the default object is automatically applied to all QWebPage instances where the particular setting is not overriden already.

### QString QWebSettings::iconDatabasePath () `[static]`

Returns whether the path of the icon database or an empty string if the icon database is disabled.

See also setIconDatabasePath().

### QIcon QWebSettings::iconForUrl ( const QUrl & url ) `[static]`

Returns the site icon for url If there is no icon for the url or the icon is not currently loaded from the database a null QIcon is returned.

### int QWebSettings::maximumPagesInCache () `[static]`

Returns the maximum number of web pages that are kept in the memory cache.

See also setMaximumPagesInCache().

### void QWebSettings::resetAttribute ( WebAttribute attr )

Resets the setting of attr. The global default for attr will be used instead.

This function has not effect on the default QWebSettings instance.

### void QWebSettings::resetFontFamily ( FontFamily which )

Resets the font family for specified which of fonts in a web page to the default.

This function has not effect on the default QWebSettings instance.

### void QWebSettings::resetFontSize ( FontSize type )

Resets the font size for type to the size specified in the default settings object.

This function has not effect on the default QWebSettings instance.

### void QWebSettings::setAttribute ( WebAttribute attr, bool on )

Enables or disables the specified attr feature depending on the value of on.

### void QWebSettings::setFontFamily ( FontFamily which, const QString & family )

Sets the default font family to family for the specified which of font.

See also fontFamily().

### void QWebSettings::setFontSize ( FontSize type, int size )

Sets the font size for type to size.

See also fontSize().

### void QWebSettings::setIconDatabasePath ( const QString & path ) `[static]`

Sets the path of the icon database. The icon database is used to store favicons associated with web sites.

The path must point to an existing directory where the icons are stored.

If path is empty then the icon database is disabled.

See also iconDatabasePath().

### void QWebSettings::setMaximumPagesInCache ( int pages ) `[static]`

Sets the maximum number of pages to hold in the memory cache to pages.

See also maximumPagesInCache().

### void QWebSettings::setObjectCacheCapacities ( int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity ) `[static]`

Specifies the capacities for the memory cache for dead objects such as stylesheets or scripts.

The cacheMinDeadCapacity specifies the minimum number of bytes that dead objects should consume when the cache is under pressue. cacheMaxDead is the maximum number of bytes that dead objects should consume when the cache is not under pressure.

totalCapacity specifies the maximum number of bytes that the cache should consume overall.

Calling setObjectCacheCapacities(0, 0, 0) will disable the cache. Calling it with one non-zero value will enable it again. The cache is enabled by default.

### void QWebSettings::setUserStyleSheetUrl ( const QUrl & location )

Specifies the location of a user stylesheet to load with every web page.

The location can be a URL as well as a path on the local filesystem.

See also userStyleSheetUrl().

### void QWebSettings::setWebGraphic ( WebGraphic type, const QPixmap & graphic ) `[static]`

Sets graphic to be drawn when QtWebKit needs to drawn an image of the given type.

See also webGraphic().

### bool QWebSettings::testAttribute ( WebAttribute attr ) const

Returns true if attr is enabled; otherwise returns false.

### QUrl QWebSettings::userStyleSheetUrl () const

Returns the location of the user stylesheet.

See also setUserStyleSheetUrl().

### QPixmap QWebSettings::webGraphic ( WebGraphic type ) `[static]`

Returns a previously set pixmap that is used to draw replacement graphics of the specified type.

See also setWebGraphic().