//==========================================================
//qml.qrc
<RCC>
<qresource prefix="/ui">
<file alias="qml/qml_main">Auto_Order_UI.qml</file>
<file>images/Alert_09.png</file>
<file>images/Alert_10.png</file>
<file>images/Alert_11.png</file>
<file>images/Alert_12.png</file>
<file>images/Alert_13.png</file>
<file>images/Alert_14.png</file>
<file>images/Alert_15.png</file>
<file>images/Alert_16.png</file>
<file>images/carmageddon2.png</file>
<file>images/counter-strike.png</file>
<file>images/X3.png</file>
<file alias="qml/qml_sw">sw.qml</file>
<file>images/button.png</file>
</qresource>
</RCC>
//==========================================================
//main.cpp
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeComponent>
#include <QtDeclarative/QDeclarativeItem>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeContext>
#include "numbercount.h"
int main(int argc?? char *argv[])
{
QApplication a(argc?? argv);
NumberCount *numberCount = new NumberCount();
QDeclarativeContext *context = view.rootContext();
context->setContextProperty("numberCount"??numberCount);//???C++????qml
view.setSource(QUrl("qrc:/ui/qml/qml_sw"));
QObject *rootObject = dynamic_cast<QObject*>(view.rootObject());
QObject::connect(numberCount?? SIGNAL(resetData(QVariant))?? rootObject?? SLOT(resetData(QVariant)));//??C++?????QML?????
view.show();
return a.exec();
}
????????????
????It is possible to call methods of  QObject   derived types by either exposing the methods as public slots?? or by marking the methods  Q_INVOKABLE .
???????? getTotal()??incre()??????QML?з????
???????н??棺