More likely having two properties of type QObject* and two properties of type QString.
Once all four properties are set, code is triggered that does
1) lookup of slot and signal through QMetaObject
2) call connect with the two objects and the retrieved signal and slot signatures
Cheers,
_
Added after 8 minutes:
Ok, I have to say I don't understand the problem.
I get DirectConnection behavior in a simple test application
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
#include <QtQuick>
{
Q_OBJECT
public:
explicit Timer
( QObject* parent
= 0 );
signals:
void timeout();
private:
private slots:
void onInternalTimeout();
};
#endif // TIMER_H
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
#include <QtQuick>
class QTimer;
class Timer : public QObject
{
Q_OBJECT
public:
explicit Timer( QObject* parent = 0 );
signals:
void timeout();
private:
QTimer* m_timer;
private slots:
void onInternalTimeout();
};
#endif // TIMER_H
To copy to clipboard, switch view to plain text mode
#include "timer.h"
#include <QDebug>
#include <QTimer>
{
m_timer->setInterval( 1000 );
connect(m_timer, SIGNAL(timeout()), this, SLOT(onInternalTimeout()));
m_timer->start();
}
void Timer::onInternalTimeout()
{
qDebug() << Q_FUNC_INFO;
emit timeout();
qDebug() << "emit timeout() returned";
}
#include "timer.h"
#include <QDebug>
#include <QTimer>
Timer::Timer( QObject* parent )
: QObject( parent ),
m_timer( new QTimer( this ) )
{
m_timer->setInterval( 1000 );
connect(m_timer, SIGNAL(timeout()), this, SLOT(onInternalTimeout()));
m_timer->start();
}
void Timer::onInternalTimeout()
{
qDebug() << Q_FUNC_INFO;
emit timeout();
qDebug() << "emit timeout() returned";
}
To copy to clipboard, switch view to plain text mode
import QtQuick 2.0
import CustomComponents 1.0
Timer {
id: timer
onTimeout: console.log( "onTimeout in QML" )
}
import QtQuick 2.0
import CustomComponents 1.0
Timer {
id: timer
onTimeout: console.log( "onTimeout in QML" )
}
To copy to clipboard, switch view to plain text mode
Obviously exporting the Timer class with qmlRegisterType in "CustomComponents" version 1.0
Output is
void Timer::onInternalTimeout()
onTimeout in QML
emit timeout() returned
void Timer::onInternalTimeout()
onTimeout in QML
emit timeout() returned
To copy to clipboard, switch view to plain text mode
So emit returns after the "QML slot" has been called. AKA DirectConnection
Cheers,
_
Bookmarks