Here is an example of qml:

Qt Code:
  1. Item {
  2. signal titleBarClicked()
  3.  
  4. MouseArea {
  5. anchor.fill: parent
  6. onClicked: titleBarClicked()
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

and C++:

Qt Code:
  1. QDeclarativeEngine *engine = new QDeclarativeEngine;
  2. QDeclarativeComponent component(engine, QUrl::fromLocalFile("qml/TestQML/TestQML.qml"));
  3. QObject *myObject = component.create();
  4. QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(myObject);
  5. qDebug()<<QObject::connect(item, SIGNAL(titleBarClicked()), &viewer, SLOT(showMaximized()));
To copy to clipboard, switch view to plain text mode 

connect() return true, but slot is not called. What's wrong?

P.S. If you want to vote for this bug - go there