Skip to main content

class QCefConfig

Represents the CEF setting. For more details please refer to: https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage.md#markdown-header-cefsettings.

Summary

MembersDescriptions
public QCefConfig()Constructs a CEF config instance.
public QCefConfig(const QCefConfig & other)Constructs a CEF setting from existing one.
public QCefConfig&operator=(const QCefConfig & other)Assigns an existing config to current.
public ~QCefConfig()Destructs the config.
public void addCommandLineSwitch(const QString & smitch)Adds a switch to the commandline args used to initialize the CEF.
public void addCommandLineSwitchWithValue(const QString & smitch, const QString & v)Adds a switch with value to the commandline args used to initialize the CEF.
public void setWindowlessRenderingEnabled(const bool enabled)Sets the flag to enable/disable OSR mode.
public const QVariant WindowlessRenderingEnabled() constGets the OSR mode flag.
public void setBrowserSubProcessPath(const QString & path)Sets the browser subprocess path.
public const QString browserSubProcessPath() constGets the browser subprocess path.
public void setResourceDirectoryPath(const QString & path)Sets the resource directory path.
public const QString resourceDirectoryPath() constGets the resource directory path.
public void setLocalesDirectoryPath(const QString & path)Sets the locales directory path.
public const QString localesDirectoryPath() constGets the locales directory path.
public void setLogLevel(const LogLevel lvl)Sets the log level.
public const QCefConfig::LogLevel logLevel() constGets the log level.
public void setLocale(const QString & locale)Sets the locale.
public const QString locale() constGets the locale.
public void setUserAgent(const QString & agent)Sets the user agent.
public const QString userAgent() constGets the user agent.
public void setCachePath(const QString & path)Sets the cache directory path.
public const QString cachePath() constGets the cache directory path.
public const QString rootCachePath() constGets the root cache directory path.
public void setRootCachePath(const QString & path)Sets the root cache directory path.
public void setBridgeObjectName(const QString & name)Sets the bridge object name.
public const QString bridgeObjectName() constGets the bridge object name.
public void setBuiltinSchemeName(const QString & name)Sets the built-in scheme name.
public const QString builtinSchemeName() constGets the built-in scheme object name.
public void setBackgroundColor(const QColor & color)Sets the background color of the web page.
public const QVariant backgroundColor() constGets the background color.
public void setAcceptLanguageList(const QString & languages)Sets the acceptable language list.
public const QString acceptLanguageList() constGet the acceptable language list.
public void setPersistSessionCookies(bool enabled)Sets whether to persist session cookie.
public const QVariant persistSessionCookies() constGets whether to persist session cookie.
public void setPersistUserPreferences(bool enabled)Sets whether to persist user preferences.
public const QVariant persistUserPreferences() constGets whether to persist user preferences.
public void setRemoteDebuggingPort(short port)Sets the remote debugging port.
public const QVariant remoteDebuggingPort() constGets the remote debugging port.
enum LogLevelRepresents the log severity.
private QScopedPointer< QCefConfigPrivate > d_ptr

Members


public QCefConfig()

Constructs a CEF config instance.


public QCefConfig(const QCefConfig & other)

Constructs a CEF setting from existing one.


public QCefConfig&operator=(const QCefConfig & other)

Assigns an existing config to current.


public ~QCefConfig()

Destructs the config.


public void addCommandLineSwitch(const QString & smitch)

Adds a switch to the commandline args used to initialize the CEF.

Parameters

  • smitch The switch name

public void addCommandLineSwitchWithValue(const QString & smitch, const QString & v)

Adds a switch with value to the commandline args used to initialize the CEF.

Parameters

  • smitch The swtich name

  • v The switch value


public void setWindowlessRenderingEnabled(const bool enabled)

Sets the flag to enable/disable OSR mode.

Parameters

  • enabled True to enable OSR mode, false to disable

public const QVariant WindowlessRenderingEnabled() const

Gets the OSR mode flag.

Returns

The flag indicates the enable/disable of OSR mode


public void setBrowserSubProcessPath(const QString & path)

Sets the browser subprocess path.

Parameters

  • path The path to the sub process executable

public const QString browserSubProcessPath() const

Gets the browser subprocess path.


public void setResourceDirectoryPath(const QString & path)

Sets the resource directory path.

Parameters

  • path The resource directory path

public const QString resourceDirectoryPath() const

Gets the resource directory path.


public void setLocalesDirectoryPath(const QString & path)

Sets the locales directory path.

Parameters

  • path The locales directory path

public const QString localesDirectoryPath() const

Gets the locales directory path.


public void setLogLevel(const LogLevel lvl)

Sets the log level.

Parameters

  • lvl

public const QCefConfig::LogLevel logLevel() const

Gets the log level.

Returns

The current log level


public void setLocale(const QString & locale)

Sets the locale.

Parameters

  • locale The locale to use. If empty the default locale of "en-US" will be used. This value is ignored on Linux where locale is determined using environment variable parsing with the precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang" command-line switch.

public const QString locale() const

Gets the locale.


public void setUserAgent(const QString & agent)

Sets the user agent.

Parameters

  • agent The user agent

public const QString userAgent() const

Gets the user agent.


public void setCachePath(const QString & path)

Sets the cache directory path.

Parameters

  • path The cache path

public const QString cachePath() const

Gets the cache directory path.


public const QString rootCachePath() const

Gets the root cache directory path.


public void setRootCachePath(const QString & path)

Sets the root cache directory path.

Parameters

  • path The root cache directory path

public void setBridgeObjectName(const QString & name)

Sets the bridge object name.

Parameters

  • name The bridge object name

The bridge object represents a Javascript object which will be inserted into all browser and frames. This object is designated for communicating between Javascript in web content and native context(C/C++) code. This object is set as an property of window object. That means it can be obtained by calling window.bridgeObject in the Javascript code


public const QString bridgeObjectName() const

Gets the bridge object name.


public void setBuiltinSchemeName(const QString & name)

Sets the built-in scheme name.

Parameters

  • name The scheme name

The default value is CefView


public const QString builtinSchemeName() const

Gets the built-in scheme object name.


public void setBackgroundColor(const QColor & color)

Sets the background color of the web page.

Parameters

  • color The color to be set

This only works if the web page has no background color set. The alpha component value will be adjusted to 0 or 255, it means if you pass a value with alpha value in the range of [1, 255], it will be accepted as 255. The default value is qRgba(255, 255, 255, 255)


public const QVariant backgroundColor() const

Gets the background color.


public void setAcceptLanguageList(const QString & languages)

Sets the acceptable language list.

Parameters

  • languages Comma delimited ordered list of language codes without any whitespace that will be used in the "Accept-Language" HTTP header.

public const QString acceptLanguageList() const

Get the acceptable language list.


public void setPersistSessionCookies(bool enabled)

Sets whether to persist session cookie.

Parameters

  • enabled True if to persist session cookie

public const QVariant persistSessionCookies() const

Gets whether to persist session cookie.


public void setPersistUserPreferences(bool enabled)

Sets whether to persist user preferences.

Parameters

  • enabled True if to persist user preferences

public const QVariant persistUserPreferences() const

Gets whether to persist user preferences.


public void setRemoteDebuggingPort(short port)

Sets the remote debugging port.

Parameters

  • port The port to use

CEF supports the remote debugging with Dev Tools in Chrome/Edge. if this value is set then you can debug the web application by accessing http://127.0.0.1:port from Chrome/Edge


public const QVariant remoteDebuggingPort() const

Gets the remote debugging port.


enum LogLevel

Represents the log severity.

ValuesDescriptions
LOGSEVERITY_DEFAULTDefault logging (currently INFO logging)
LOGSEVERITY_VERBOSEVerbose logging.
LOGSEVERITY_DEBUGDEBUG logging.
LOGSEVERITY_INFOINFO logging.
LOGSEVERITY_WARNINGWARNING logging.
LOGSEVERITY_ERRORERROR logging.
LOGSEVERITY_FATALFATAL logging.
LOGSEVERITY_DISABLEDisable logging to file for all messages, and to stderr for messages with severity less than FATAL.

private QScopedPointer< QCefConfigPrivate > d_ptr