QCefView
Loading...
Searching...
No Matches
QCefConfig

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

#include <QCefConfig.h>

Public Types

enum  LogLevel
 Represents the log severity. More...
 

Public Member Functions

 QCefConfig ()
 Constructs a CEF config instance.
 
 QCefConfig (const QCefConfig &other)
 Constructs a CEF setting from existing one.
 
QCefConfigoperator= (const QCefConfig &other)
 Assigns an existing config to current.
 
 ~QCefConfig ()
 Destructs the config.
 
void addCommandLineSwitch (const QString &smitch)
 Adds a switch to the commandline args used to initialize the CEF.
 
void addCommandLineSwitchWithValue (const QString &smitch, const QString &v)
 Adds a switch with value to the command line args used to initialize the CEF.
 
void setWindowlessRenderingEnabled (const bool enabled)
 Sets the flag to enable/disable OSR mode.
 
const QVariant windowlessRenderingEnabled () const
 Gets the OSR mode flag.
 
void setStandaloneMessageLoopEnabled (const bool enabled)
 Sets the flag to enable/disable standalone message loop thread for CEF main thread.
 
const QVariant standaloneMessageLoopEnabled () const
 Gets the standalone message loop flag.
 
void setSandboxDisabled (const bool disabled)
 Sets the flag to enable/disable sandbox.
 
const QVariant sandboxDisabled () const
 Gets the flag of sandbox status.
 
void setCommandLinePassthroughDisabled (const bool disabled)
 Sets the flag to disable the command line pass through.
 
const QVariant commandLinePassthroughDisabled () const
 Gets the flag of disable command line pass through.
 
void setLogLevel (const LogLevel lvl)
 Sets the log level.
 
const QCefConfig::LogLevel logLevel () const
 Gets the log level.
 
void setLocale (const QString &locale)
 Sets the locale.
 
const QString locale () const
 Gets the locale.
 
void setUserAgent (const QString &agent)
 Sets the user agent.
 
const QString userAgent () const
 Gets the user agent.
 
void setCachePath (const QString &path)
 Sets the cache directory path.
 
const QString cachePath () const
 Gets the cache directory path.
 
void setUserDataPath (const QString &path)
 Sets the user data directory path.
 
const QString userDataPath () const
 Gets the user data directory path.
 
void setRootCachePath (const QString &path)
 Sets the root cache directory path.
 
const QString rootCachePath () const
 Gets the root cache directory path.
 
void setBridgeObjectName (const QString &name)
 Sets the bridge object name.
 
const QString bridgeObjectName () const
 Gets the bridge object name.
 
void setBuiltinSchemeName (const QString &name)
 Sets the built-in scheme name.
 
const QString builtinSchemeName () const
 Gets the built-in scheme object name.
 
void setBackgroundColor (const QColor &color)
 Sets the background color of the web page.
 
const QVariant backgroundColor () const
 Gets the background color.
 
void setAcceptLanguageList (const QString &languages)
 Sets the acceptable language list.
 
const QString acceptLanguageList () const
 Get the acceptable language list.
 
void setPersistSessionCookies (bool enabled)
 Sets whether to persist session cookie.
 
const QVariant persistSessionCookies () const
 Gets whether to persist session cookie.
 
void setPersistUserPreferences (bool enabled)
 Sets whether to persist user preferences.
 
const QVariant persistUserPreferences () const
 Gets whether to persist user preferences.
 
void setRemoteDebuggingPort (short port)
 Sets the remote debugging port.
 
const QVariant remoteDebuggingPort () const
 Gets the remote debugging port.
 

Detailed Description

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

Member Enumeration Documentation

◆ LogLevel

Represents the log severity.

Enumerator
LOGSEVERITY_DEFAULT  

Default logging (currently INFO logging)

LOGSEVERITY_VERBOSE  

Verbose logging.

LOGSEVERITY_DEBUG  

DEBUG logging.

LOGSEVERITY_INFO  

INFO logging.

LOGSEVERITY_WARNING  

WARNING logging.

LOGSEVERITY_ERROR  

ERROR logging.

LOGSEVERITY_FATAL  

FATAL logging.

LOGSEVERITY_DISABLE 99 

Disable logging to file for all messages, and to stderr for messages with severity less than FATAL.

Constructor & Destructor Documentation

◆ QCefConfig() [1/2]

QCefConfig::QCefConfig ( )

Constructs a CEF config instance.

◆ QCefConfig() [2/2]

QCefConfig::QCefConfig ( const QCefConfig & other)

Constructs a CEF setting from existing one.

◆ ~QCefConfig()

QCefConfig::~QCefConfig ( )

Destructs the config.

Member Function Documentation

◆ operator=()

QCefConfig & QCefConfig::operator= ( const QCefConfig & other)

Assigns an existing config to current.

◆ addCommandLineSwitch()

void QCefConfig::addCommandLineSwitch ( const QString & smitch)

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

Parameters
smitchThe switch name

◆ addCommandLineSwitchWithValue()

void QCefConfig::addCommandLineSwitchWithValue ( const QString & smitch,
const QString & v )

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

Parameters
smitchThe swtich name
vThe switch value

◆ setWindowlessRenderingEnabled()

void QCefConfig::setWindowlessRenderingEnabled ( const bool enabled)

Sets the flag to enable/disable OSR mode.

Parameters
enabledTrue to enable OSR mode, false to disable

◆ windowlessRenderingEnabled()

const QVariant QCefConfig::windowlessRenderingEnabled ( ) const

Gets the OSR mode flag.

Returns
The flag indicates the enable/disable of OSR mode

◆ setStandaloneMessageLoopEnabled()

void QCefConfig::setStandaloneMessageLoopEnabled ( const bool enabled)

Sets the flag to enable/disable standalone message loop thread for CEF main thread.

Parameters
enabledTrue to use standalone thread, false to disable

◆ standaloneMessageLoopEnabled()

const QVariant QCefConfig::standaloneMessageLoopEnabled ( ) const

Gets the standalone message loop flag.

Returns
The flag indicates the enable/disable status of standalone message loop thread

◆ setSandboxDisabled()

void QCefConfig::setSandboxDisabled ( const bool disabled)

Sets the flag to enable/disable sandbox.

Parameters
disabledTrue to enable sandbox, false to disable

◆ sandboxDisabled()

const QVariant QCefConfig::sandboxDisabled ( ) const

Gets the flag of sandbox status.

Returns
The flag indicates the enable/disable of sandbox

◆ setCommandLinePassthroughDisabled()

void QCefConfig::setCommandLinePassthroughDisabled ( const bool disabled)

Sets the flag to disable the command line pass through.

Parameters
disabledTrue to disable the command line pass through, false to enable

◆ commandLinePassthroughDisabled()

const QVariant QCefConfig::commandLinePassthroughDisabled ( ) const

Gets the flag of disable command line pass through.

Returns
The flag indicates the enable/disable of OSR mode

◆ setLogLevel()

void QCefConfig::setLogLevel ( const LogLevel lvl)

Sets the log level.

Parameters
lvl

◆ logLevel()

const QCefConfig::LogLevel QCefConfig::logLevel ( ) const

Gets the log level.

Returns
The current log level

◆ setLocale()

void QCefConfig::setLocale ( const QString & locale)

Sets the locale.

Parameters
localeThe 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.

◆ locale()

const QString QCefConfig::locale ( ) const

Gets the locale.

◆ setUserAgent()

void QCefConfig::setUserAgent ( const QString & agent)

Sets the user agent.

Parameters
agentThe user agent

◆ userAgent()

const QString QCefConfig::userAgent ( ) const

Gets the user agent.

◆ setCachePath()

void QCefConfig::setCachePath ( const QString & path)

Sets the cache directory path.

Parameters
pathThe cache path

◆ cachePath()

const QString QCefConfig::cachePath ( ) const

Gets the cache directory path.

◆ setUserDataPath()

void QCefConfig::setUserDataPath ( const QString & path)

Sets the user data directory path.

Parameters
pathThe user data directory path
Deprecated
Deprecated since CEF 115.0.0

◆ userDataPath()

const QString QCefConfig::userDataPath ( ) const

Gets the user data directory path.

Deprecated
Deprecated since CEF 115.0.0

◆ setRootCachePath()

void QCefConfig::setRootCachePath ( const QString & path)

Sets the root cache directory path.

Parameters
pathThe root cache directory path
Since
Introduced since CEF 115.0.0

◆ rootCachePath()

const QString QCefConfig::rootCachePath ( ) const

Gets the root cache directory path.

Since
Introduced since CEF 115.0.0

◆ setBridgeObjectName()

void QCefConfig::setBridgeObjectName ( const QString & name)

Sets the bridge object name.

Parameters
nameThe 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

◆ bridgeObjectName()

const QString QCefConfig::bridgeObjectName ( ) const

Gets the bridge object name.

◆ setBuiltinSchemeName()

void QCefConfig::setBuiltinSchemeName ( const QString & name)

Sets the built-in scheme name.

Parameters
nameThe scheme name

The default value is CefView

◆ builtinSchemeName()

const QString QCefConfig::builtinSchemeName ( ) const

Gets the built-in scheme object name.

◆ setBackgroundColor()

void QCefConfig::setBackgroundColor ( const QColor & color)

Sets the background color of the web page.

Parameters
colorThe 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)

◆ backgroundColor()

const QVariant QCefConfig::backgroundColor ( ) const

Gets the background color.

◆ setAcceptLanguageList()

void QCefConfig::setAcceptLanguageList ( const QString & languages)

Sets the acceptable language list.

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

◆ acceptLanguageList()

const QString QCefConfig::acceptLanguageList ( ) const

Get the acceptable language list.

◆ setPersistSessionCookies()

void QCefConfig::setPersistSessionCookies ( bool enabled)

Sets whether to persist session cookie.

Parameters
enabledTrue if to persist session cookie

◆ persistSessionCookies()

const QVariant QCefConfig::persistSessionCookies ( ) const

Gets whether to persist session cookie.

◆ setPersistUserPreferences()

void QCefConfig::setPersistUserPreferences ( bool enabled)

Sets whether to persist user preferences.

Parameters
enabledTrue if to persist user preferences
Deprecated
Deprecated since CEF 128.0.0

◆ persistUserPreferences()

const QVariant QCefConfig::persistUserPreferences ( ) const

Gets whether to persist user preferences.

Deprecated
Deprecated since CEF 128.0.0

◆ setRemoteDebuggingPort()

void QCefConfig::setRemoteDebuggingPort ( short port)

Sets the remote debugging port.

Parameters
portThe 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

◆ remoteDebuggingPort()

const QVariant QCefConfig::remoteDebuggingPort ( ) const

Gets the remote debugging port.