Prepare for the addition of another subclass.
Change-Id: I340f735503e661d9d735f3316a065f807294921b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
int childrenCount = children.count();
for (int ii = 0; ii < children.count(); ++ii) {
- if (qobject_cast<QQmlContext*>(children[ii]) || QQmlBoundSignal::cast(children[ii]))
+ if (qobject_cast<QQmlContext*>(children[ii]) || qobject_cast<QQmlAbstractBoundSignal*>(children[ii]))
--childrenCount;
}
QObject *child = children.at(ii);
if (qobject_cast<QQmlContext*>(child))
continue;
- QQmlBoundSignal *signal = QQmlBoundSignal::cast(child);
+ QQmlAbstractBoundSignal *signal = qobject_cast<QQmlAbstractBoundSignal*>(child);
if (signal) {
if (!dumpProperties)
continue;
return rv;
}
-QQmlBoundSignal *QQmlBoundSignal::cast(QObject *o)
-{
- QQmlAbstractBoundSignal *s = qobject_cast<QQmlAbstractBoundSignal*>(o);
- return static_cast<QQmlBoundSignal *>(s);
-}
-
int QQmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
{
if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) {
public:
QQmlAbstractBoundSignal(QObject *parent = 0);
virtual ~QQmlAbstractBoundSignal() = 0;
+
+ virtual int index() const = 0;
+ virtual QQmlExpression *expression() const = 0;
+ virtual QQmlExpression *setExpression(QQmlExpression *) = 0;
};
class QQmlBoundSignalParameters;
bool isEvaluating() const { return m_isEvaluating; }
- static QQmlBoundSignal *cast(QObject *);
-
protected:
virtual int qt_metacall(QMetaObject::Call c, int id, void **a);
friend class QQmlComponent;
friend class QQmlComponentPrivate;
friend class QQmlScriptPrivate;
- friend class QQmlBoundSignalProxy;
friend class QQmlContextData;
QQmlContext(QQmlContextData *);
QQmlContext(QQmlEngine *, bool);
for (int ii = 0; ii < children.count(); ++ii) {
QObject *child = children.at(ii);
- QQmlBoundSignal *signal = QQmlBoundSignal::cast(child);
+ QQmlAbstractBoundSignal *signal = qobject_cast<QQmlAbstractBoundSignal*>(child);
if (signal && signal->index() == that.index())
return signal->expression();
}
for (int ii = 0; ii < children.count(); ++ii) {
QObject *child = children.at(ii);
- QQmlBoundSignal *signal = QQmlBoundSignal::cast(child);
+ QQmlAbstractBoundSignal *signal = qobject_cast<QQmlAbstractBoundSignal*>(child);
if (signal && signal->index() == that.index())
return signal->setExpression(expr);
}
foreach (const QmlDebugPropertyReference &p, oref.properties) {
QCOMPARE(p.objectDebugId, QQmlDebugService::idForObject(o));
- // signal properties are fake - they are generated from QQmlBoundSignal children
+ // signal properties are fake - they are generated from QQmlAbstractBoundSignal children
if (p.name.startsWith("on") && p.name.length() > 2 && p.name[2].isUpper()) {
- QList<QQmlBoundSignal*> signalHandlers =
- o->findChildren<QQmlBoundSignal*>();
+ QList<QQmlAbstractBoundSignal*> signalHandlers =
+ o->findChildren<QQmlAbstractBoundSignal*>();
QString signal = p.value.toString();
bool found = false;
for (int i = 0; i < signalHandlers.count(); ++i)