GCF LOGO VCL LOGO
GCF::QmlApplication Class Reference

Offers an application object for GCF QML applications. More...

#include <GCF3/QmlApplication>

Public Member Functions

 QmlApplication (int &argc, char **argv)
 
 ~QmlApplication ()
 
int processArgumentsAndExec (const QStringList &additionalArgs=QStringList())
 
- Public Member Functions inherited from GCF::QmlApplicationServices
void setQmlEngine (QQmlEngine *engine)
 
QQmlEngine * qmlEngine () const
 
- Public Member Functions inherited from GCF::ApplicationServices
QDateTime launchTimestamp () const
 
ObjectTreeobjectTree () const
 
QObject * findObject (const QString &path) const
 
void loadComponent (Component *component)
 
void unloadComponent (Component *component)
 
QObjectList components () const
 
void activateComponent (Component *component)
 
void deactivateComponent (Component *component)
 
bool isLoaded (const Component *component) const
 
bool isActive (const Component *component) const
 
void unloadAllComponents ()
 
ComponentinstantiateComponent (const QString &library)
 
ComponentloadComponent (const QString &library)
 
ComponentloadComponent (const QString &library, const QList< QPair< QByteArray, QVariant > > &properties)
 
QList< Component * > loadComponents (const QStringList &libraries)
 
QVariantMap argumentsMap () const
 
void processArguments (const QStringList &additionalArgs=QStringList())
 
GCF::Result invokeMethod (const QString &path, const QString &method, const QVariantList &args, bool secureCall=true) const
 This method can be used to invoke a named method in an object. More...
 
GCF::JobListModeljobs () const
 
QString translate (const QString &string) const
 

Additional Inherited Members

- Static Public Member Functions inherited from GCF::QmlApplicationServices
static QmlApplicationServicesinstance ()
 
- Static Public Member Functions inherited from GCF::ApplicationServices
static GCF::Result invokeMethod (QObject *object, const QString &method, const QVariantList &args, bool secureCall=true)
 This method can be used to invoke a named method in an object. More...
 
static GCF::Result invokeMethod (QObject *object, const QMetaMethod &method, const QVariantList &args, bool secureCall=true)
 This method can be used to invoke a named method in an object. More...
 
- Protected Member Functions inherited from GCF::QmlApplicationServices
 QmlApplicationServices ()
 
 ~QmlApplicationServices ()
 
virtual void initQmlEngine (QQmlEngine *)
 
- Protected Member Functions inherited from GCF::ApplicationServices
 ApplicationServices ()
 
virtual ~ApplicationServices ()
 

Detailed Description

This class implements both QGuiApplication and GCF::QmlApplicationServices. The only function it offers is processArgumentsAndExec(). You must create an instance of this class if you are building a QML application in GCF and call the GCF::QmlApplicationServices::setQmlEngine() method to set a QML engine for your application. Shown below is a typical main() function in a QML application

#include <GCF3/QmlApplication>
#include <GCF3/QmlComponent>
int main(int argc, char **argv)
{
GCF::QmlApplication a(argc, argv);
QQuickView qmlView;
// This part is very important. You must
// set a QML engine with the application!
a.setQmlEngine(qmlView.engine());
....
....
....
return a.processArgumentsAndExec();
}
Note
This class is available only if GCF is compiled and linked against Qt 5.
Qml applications cannot use QtWidgets module

Constructor & Destructor Documentation

GCF::QmlApplication::QmlApplication ( int &  argc,
char **  argv 
)

Constructor.

Parameters
argcreference to an integer that holds number of command-line arguments passed to the applicaiton.
argvpointer to an array of character strings that hold the command-line arguments.
GCF::QmlApplication::~QmlApplication ( )

Destructor

Member Function Documentation

void GCF::QmlApplication::processArgumentsAndExec ( const QStringList &  additionalArgs = QStringList())

Process all arguments from qApp->arguments() and additionalArgs and invokes QApplication::exec().

See Also
GCF::Application::processArgumentsAndExec()