Hi,

I loaded a QML file from QT C++ class using QDeclarativeView object. I want a signal from QML file to CPP after it is active.
My sample code is :
Qt Code:
  1. QDeclarativeView *view = new QDeclarativeView();
  2. view->setSource(QUrl::fromLocalFile("base.qml"));
  3. Qmlview = view;
  4. QObject *item = view->rootObject();
  5. QObject::connect(item,SIGNAL(qmlSignal(QString)),this,SLOT(cppSlot(QString)));
  6. Qmlview->show();
To copy to clipboard, switch view to plain text mode 

and in the QML side i wrote:
Qt Code:
  1. Rectangle {
  2. id : item1
  3. width: 400
  4. height: 400
  5. color: "#d5b9b9"
  6.  
  7. signal qmlSignal(string msg)
  8. Component.onCompleted:
  9. {
  10.  
  11. item1.qmlSignal("string msg")
  12. }
  13.  
  14. }
To copy to clipboard, switch view to plain text mode 

but it seems that the signal will emit before the connection handler.
Is there any event in QML which will active after "Qmlview->show();" ?

Thanks in advance...