I tried with QMetaObject. My sample code is
QDeclarativeView *view = new QDeclarativeView();
view
->setSource
(QUrl::fromLocalFile("base.qml"));
Qmlview = view;
QObject *item
= view
->rootObject
();
for(int i=0; i<item->metaObject()->methodCount(); i++)
{
qDebug() << meta.signature();
}
Qmlview->show();
QDeclarativeView *view = new QDeclarativeView();
view->setSource(QUrl::fromLocalFile("base.qml"));
Qmlview = view;
QObject *item = view->rootObject();
for(int i=0; i<item->metaObject()->methodCount(); i++)
{
QMetaMethod meta = item->metaObject()->method( i );
if( meta.methodType() == QMetaMethod::Slot )
qDebug() << meta.signature();
}
Qmlview->show();
To copy to clipboard, switch view to plain text mode
but I'm not getting the expected output.
My Output is :
deleteLater()
_q_reregisterTimers(void*)
updateMicroFocus()
doUpdate()
My QML file is :
import QtQuick 1.1
import File 1.1
Rectangle {
width: 400
height: 400
color: "#d5b9b9"
TextUpdate
{
id : linkFile
}
Connections
{
target: linkFile
onUpdateBaseQml:
{
console.log("Got event")
timeText.text = time
speedText.text = speed
rpmText.text = rpm
fuelText.text = fuel
}
}
import QtQuick 1.1
import File 1.1
Rectangle {
width: 400
height: 400
color: "#d5b9b9"
TextUpdate
{
id : linkFile
}
Connections
{
target: linkFile
onUpdateBaseQml:
{
console.log("Got event")
timeText.text = time
speedText.text = speed
rpmText.text = rpm
fuelText.text = fuel
}
}
To copy to clipboard, switch view to plain text mode
How i get the "onUpdateBaseQml" slot function only?
Bookmarks