Hello everybody,
I created a graphical interface with QML, I would like to integrate it in Visual studio 2012 to do some treatements and operations with C++

I did some research in NET, I found an exemple with QDeclarativeView
Qt Code:
  1. TestListView::TestListView(QWidget *parent)
  2. : QMainWindow(parent)
  3. {
  4. ui= new QDeclarativeView;
  5. QString filePath = QDir::currentPath() + "/main_view.qml";
  6.  
  7. ui->setSource(QUrl::fromLocalFile(filePath));
  8. setCentralWidget(ui);
  9.  
  10. ui->setResizeMode(QDeclarativeView::SizeRootObjectToView);
  11. root = ui->rootObject();
  12. ui->rootContext()->setContextProperty("Window", this);
  13.  
  14. std::vector<std::string> dataTable;
  15. dataTable.push_back("C++");
  16. dataTable.push_back("Java");
  17. dataTable.push_back("Python");
  18.  
  19. QList<QObject*> dataList;
  20. QString color = "gray";
  21.  
  22. for(int i=0; i<dataTable.size(); i++)
  23. {
  24. color = (color == "gray") ? "silver" : "gray" ;
  25. dataList.append(new DataObject(QString(dataTable.at(i).c_str()), color));
  26.  
  27. }
  28.  
  29. ui->rootContext()->setContextProperty("dataModel", QVariant::fromValue(dataList));
  30. }
To copy to clipboard, switch view to plain text mode 

But QtDeclarative works only with QtQuick 1.0
I'm using QtQuick 2.0 so I tried to use QQuickView :
Qt Code:
  1. ui= new QQuickView;
  2. QString filePath = QDir::currentPath() + "/main_view.qml";
  3.  
  4. ui->setSource(QUrl::fromLocalFile(filePath));
  5. setCentralWidget(ui); // QQuickView is incompatible with QWidget
  6.  
  7. ui->setResizeMode(QQuickView::SizeRootObjectToView);
  8. root = ui->rootObject();
  9. ui->rootContext()->setContextProperty("Window", this);
To copy to clipboard, switch view to plain text mode 

Someone can resolve this error

best regards