Qt 4.8
Functions
qdeclarativeenginedebugservice.cpp File Reference
#include "private/qdeclarativeenginedebugservice_p.h"
#include "private/qdeclarativeboundsignal_p.h"
#include "qdeclarativeengine.h"
#include "private/qdeclarativemetatype_p.h"
#include "qdeclarativeproperty.h"
#include "private/qdeclarativeproperty_p.h"
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativecontext_p.h"
#include "private/qdeclarativewatcher_p.h"
#include "private/qdeclarativevaluetype_p.h"
#include "private/qdeclarativevmemetaobject_p.h"
#include "private/qdeclarativeexpression_p.h"
#include "private/qdeclarativepropertychanges_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qmetaobject.h>

Go to the source code of this file.

Functions

static bool hasValidSignal (QObject *object, const QString &propertyName)
 
static bool isSignalPropertyName (const QString &signalName)
 
QDataStreamoperator<< (QDataStream &ds, const QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
 
QDataStreamoperator<< (QDataStream &ds, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
 
QDataStreamoperator>> (QDataStream &ds, QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
 
QDataStreamoperator>> (QDataStream &ds, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
 
 Q_GLOBAL_STATIC (QDeclarativeEngineDebugService, qmlEngineDebugService)
 

Function Documentation

◆ hasValidSignal()

static bool hasValidSignal ( QObject object,
const QString propertyName 
)
static

Definition at line 120 of file qdeclarativeenginedebugservice.cpp.

Referenced by QDeclarativeEngineDebugService::resetBinding(), and QDeclarativeEngineDebugService::setBinding().

121 {
122  if (!isSignalPropertyName(propertyName))
123  return false;
124 
125  QString signalName = propertyName.mid(2);
126  signalName[0] = signalName.at(0).toLower();
127 
128  int sigIdx = QDeclarativePropertyPrivate::findSignalByName(object->metaObject(), signalName.toLatin1()).methodIndex();
129 
130  if (sigIdx == -1)
131  return false;
132 
133  return true;
134 }
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &)
Return the signal corresponding to name.
The QString class provides a Unicode character string.
Definition: qstring.h:83
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
static bool isSignalPropertyName(const QString &signalName)
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1239
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

◆ isSignalPropertyName()

static bool isSignalPropertyName ( const QString signalName)
inlinestatic

Definition at line 113 of file qdeclarativeenginedebugservice.cpp.

Referenced by hasValidSignal().

114 {
115  // see QmlCompiler::isSignalPropertyName
116  return signalName.length() >= 3 && signalName.startsWith(QLatin1String("on")) &&
117  signalName.at(2).isLetter() && signalName.at(2).isUpper();
118 }
bool isLetter() const
Returns true if the character is a letter (Letter_* categories); otherwise returns false...
Definition: qchar.cpp:653
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool isUpper() const
Returns true if the character is an uppercase letter, i.
Definition: qchar.h:273

◆ operator<<() [1/2]

◆ operator<<() [2/2]

◆ operator>>() [1/2]

◆ operator>>() [2/2]

◆ Q_GLOBAL_STATIC()

Q_GLOBAL_STATIC ( QDeclarativeEngineDebugService  ,
qmlEngineDebugService   
)