KDeclarative::KDeclarative

KDeclarative::KDeclarative Class Reference

#include <KDeclarative/KDeclarative>

Public Member Functions

 KDeclarative (const KDeclarative &)=delete
 
QQmlEnginedeclarativeEngine () const
 
void initialize ()
 
KDeclarativeoperator= (const KDeclarative &)=delete
 
void setDeclarativeEngine (QQmlEngine *engine)
 
void setTranslationDomain (const QString &translationDomain)
 
void setupBindings ()
 
void setupContext ()
 
QString translationDomain () const
 

Static Public Member Functions

static QString componentsTarget ()
 
static QString defaultComponentsTarget ()
 
static QStringList runtimePlatform ()
 
static void setRuntimePlatform (const QStringList &platform)
 
static void setupEngine (QQmlEngine *engine)
 
static void setupQmlJsDebugger ()
 

Detailed Description

TODO.

Definition at line 40 of file kdeclarative.h.

Member Function Documentation

QString KDeclarative::KDeclarative::componentsTarget ( )
static
Returns
the QML components target, based on the runtime platform. e.g. touch or desktop
Since
4.10

Definition at line 155 of file kdeclarative.cpp.

QString KDeclarative::KDeclarative::defaultComponentsTarget ( )
static
Returns
the default components target; can be used to compare against the returned value from
See also
componentsTarget()
Since
4.10

Definition at line 150 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::initialize ( )
Deprecated:
since 5.0.

The method is a no-op now, any call can be simply removed.

Definition at line 67 of file kdeclarative.cpp.

QStringList KDeclarative::KDeclarative::runtimePlatform ( )
static
Returns
the runtime platform, e.g. "desktop" or "tablet, touch". The first entry/ies in the list relate to the platform formfactor and the last is the input method specialization. If the string is empty, there is no specified runtime platform and a traditional desktop environment may be assumed
Since
4.10

Definition at line 165 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setRuntimePlatform ( const QStringList platform)
static

Sets the runtime platform from now on, globally to the process.

Already loaded QML components won't be affected

Definition at line 183 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setTranslationDomain ( const QString translationDomain)

Call this method before calling setupContext to install a translation domain for all i18n global functions.

If a translation domain is set all i18n calls delegate to the matching i18nd calls with the provided translation domain.

The translationDomain affects all i18n calls including those from imports. Because of that modules intended to be used as imports should prefer the i18nd variants and set the translation domain explicitly in each call.

This method is only required if your declarative usage is inside a library. If it's in an application there is no need to set the translation domain as the application's domain can be used.

Parameters
translationDomainThe translation domain to be used for i18n calls.
Since
5.0

Definition at line 130 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setupBindings ( )

Call this after setDeclarativeEngine to set the i18n global functions, the runtime platform, etc.

Deprecated:
since 5.45 use setupContext() and setupEngine()

Definition at line 73 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setupContext ( )

Call this after setDeclarativeEngine to set the i18n global functions.

Since
5.45
See also
setupEngine

Definition at line 80 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setupEngine ( QQmlEngine engine)
static

Setup the QML engine used by this KDeclarative object.

This needs to be done only once per QQmlEngine instance.

Since
5.45
Parameters
engineThe engine to setup
See also
setupContext

Definition at line 100 of file kdeclarative.cpp.

void KDeclarative::KDeclarative::setupQmlJsDebugger ( )
static

This method must be called very early at startup time to ensure the QQuickDebugger is enabled.

Ideally it should be called in main(), after command-line options are defined.

Definition at line 143 of file kdeclarative.cpp.

QString KDeclarative::KDeclarative::translationDomain ( ) const
Returns
the translation domain for the i18n calls done in this QML engine
Since
5.0

Definition at line 138 of file kdeclarative.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 23:11:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.