[Qt-interest] question about new boilerplate in creator
Sivan Greenberg
sivan at omniqueue.com
Mon Oct 10 21:06:45 CEST 2011
Hi All,
So after updating my sdk, I see that the main.cpp files have changed to:
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer->setMainQmlFile(QLatin1String("qml/panimaldesktop/main.qml"));
viewer->showExpanded();
return app->exec();
}
I was wondering why Q_DECL_EXPORT was introduced, and why
createApplication is not longer on its own, as well as using Qt's
abstraction to allocate and clear the sotrage classes, while before
they were allocated on the stack such that when going out of the
program execution contest, the compiler would take care of
deallocation ?
Curious for the answers.
--
-Sivan
More information about the Qt-interest-old
mailing list