VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
QmlUtil Class Reference

QML accessible versions of the Util functions. More...

Inheritance diagram for QmlUtil:
QObject

Public Member Functions

Q_INVOKABLE QString getPathToAsset (const QString &assetPath)
 Returns the platform dependent path for assetPath. More...
 
Q_INVOKABLE QUrl getUrlPathToAsset (const QString &assetPath)
 Returns platform dependent path URL to assetPath. More...
 
Q_INVOKABLE QString getPathToFont (const QString &fontPath)
 Returns the platform dependent path to the font in fontPath. More...
 
Q_INVOKABLE QString getPathToImage (const QString &imagePath)
 Returns the platform dependent path to the image in imagePath. More...
 
Q_INVOKABLE QString getPathToMovie (const QString &moviePath)
 Returns the platform dependent path to the movie in moviePath. More...
 
Q_INVOKABLE QString getPathToSound (const QString &soundPath)
 Returns the platform dependent path to the sound in soundPath. More...
 
Q_INVOKABLE bool deviceHasTouchScreen ()
 Returns true if the device on which the game is running has a touch screen. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObject * metaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThread * thread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
T findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArray > dynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObject * parent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Static Public Member Functions

static QmlUtil * getInstance ()
 Returns the QmlUtil singleton instance of this object. More...
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Additional Inherited Members

- Protected Member Functions inherited from QObject
QObject * sender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

QML accessible versions of the Util functions.

This is a singleton class that simply contains a mapping from Util namespace functions to QML.

Member Function Documentation

Q_INVOKABLE bool QmlUtil::deviceHasTouchScreen ( )

Returns true if the device on which the game is running has a touch screen.

static QmlUtil* QmlUtil::getInstance ( )
static

Returns the QmlUtil singleton instance of this object.

Q_INVOKABLE QString QmlUtil::getPathToAsset ( const QString &  assetPath)

Returns the platform dependent path for assetPath.

Parameters
assetPathPath of asset to resolve to filesystem path
Q_INVOKABLE QString QmlUtil::getPathToFont ( const QString &  fontPath)

Returns the platform dependent path to the font in fontPath.

Parameters
fontPathPath of font to resolve
Q_INVOKABLE QString QmlUtil::getPathToImage ( const QString &  imagePath)

Returns the platform dependent path to the image in imagePath.

Parameters
imagePathPath of image to resolve
Q_INVOKABLE QString QmlUtil::getPathToMovie ( const QString &  moviePath)

Returns the platform dependent path to the movie in moviePath.

Parameters
moviePathPath of movie to resolve
Q_INVOKABLE QString QmlUtil::getPathToSound ( const QString &  soundPath)

Returns the platform dependent path to the sound in soundPath.

Parameters
soundPathPath of sound to resolve
Q_INVOKABLE QUrl QmlUtil::getUrlPathToAsset ( const QString &  assetPath)

Returns platform dependent path URL to assetPath.

Parameters
assetPathPath of asset to resolve.