1234567891011121314151617181920212223242526 |
- #include <QtGui/QApplication>
- #include <QtDeclarative>
- #include <QtDeclarative/QDeclarativeView>
- #include <QtDeclarative/QDeclarativeEngine>
- #include "mainwidget.h"
- #include "cardboard.h"
- #include "colortools.h"
- Q_DECL_EXPORT int main(int argc, char *argv[])
- {
- QApplication app(argc, argv);
- qmlRegisterType<CardBoard>("ecards.qmlcomponents", 1, 0, "CardTools");
- qmlRegisterType<ColorTools>("ecards.qmlcomponents", 1, 0, "ColorTools");
- QDeclarativeView qmlview;
- qmlview.setSource(QUrl("qrc:/qml/main.qml"));
- qmlview.setAttribute(Qt::WA_LockLandscapeOrientation);
- ColorTools *colorTools = new ColorTools();
- qmlview.rootContext()->setContextProperty("colorTools", colorTools);
- CardBoard *cardTools = new CardBoard(&qmlview);
- qmlview.rootContext()->setContextProperty("cardTools", cardTools);
- qmlview.showFullScreen();
- return app.exec();
- }
|