[Solved] QML in MFC app
Hello All
I am new to QT/QML would like to know, is it possible to use QML with in existing MFC app?
Please let me know
Thanks & Regards
3 replies
Here is how i am able to do that
- int CQtQuickMFCTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate( lpCreateStruct ) == -1 )
- return -1;
- widget = new QWinWidget( this );
- QDeclarativeView *qmlView1 = new QDeclarativeView;
- hbox->addWidget( qmlView1 );
- hbox->addWidget( label );
- hbox->addWidget( edit );
- QDeclarativeView *qmlView = new QDeclarativeView;
- hbox->addWidget( qmlView );
- widget->move( 30, 30 );
- widget->show();
- return 0;
- }
CQtQuickMFCTestView is the main view class
widget is defined in QtQuickMFCTestView.h
also i am using qtwinmigrate project
following are my includes
- #include <QtWinMigrate/qmfcapp.h>
- #include <QtWinMigrate/qwinwidget.h>
- #include <qdeclarative.h>
- #include <QDeclarativeView>
- #include <QDeclarativeEngine>
- #include <QDeclarativeComponent>
- #include <QtWinMigrate/qwinwidget.h>
- #include <QtGui/QLabel>
- #include <QtGui/QLineEdit>
- #include <QtGui/QLayout>
I will add more detail (or a wiki article) as soon as i got some time
You must log in to post a reply. Not a member yet? Register here!


