summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-06 07:37:29 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-06 07:37:29 (GMT)
commit32d6c5adb9d75ad7e3b2cef818f6b17d77d0f929 (patch)
treec4f78b3bd143af52372064cd3ba5c0ae440813c5 /doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
parentbda164303570629e44185e8baa52908ced6da301 (diff)
parent745ecfd8925716d962c97a4415881377faf6bdd5 (diff)
downloadQt-32d6c5adb9d75ad7e3b2cef818f6b17d77d0f929.zip
Qt-32d6c5adb9d75ad7e3b2cef818f6b17d77d0f929.tar.gz
Qt-32d6c5adb9d75ad7e3b2cef818f6b17d77d0f929.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (484 commits) Updated WebKit to 0eee8df53d1873669a9dda8f9c0340543258a316 Reformat whitespace according to coding style QGraphicsView: Handle wheelEvents correctly with Qt::Popup widgets. QGraphicsProxyWidget: Fixes QComboBox popup closing issue. Crash while changing the windows flags from a Qt::Drawer window on Cocoa Fix invalid bookmark in anomaly demo Fixed pre-built resources deployment in Symbian Fix build failure on Symbian^3. warn about stray meta data don't complain multiple times about same abuse of //% meta strings fix double percent sign after migration to yyMsg() Fixed deployment paths for WebKit declarative plugin. Fix s60main linking issue with gcce applications Fixed deployment paths for the symbian/linux-armcc mkspec. Fixed a relative path problem in qml demos. Added the APP_PRIVATE_DIR_BASE variable. Various fixes to autotests when using the symbian/linux-armcc mkspec. Fixed Symbian resources not honoring TARGET with a path. Improved QCommandLinkButton's vertical spacing syncqt: abort on permission error writing to include/Qt ...
Diffstat (limited to 'doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp')
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
new file mode 100644
index 0000000..174adee
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
+#include <QApplication>
+#include <QDirModel>
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ QDirModel model;
+ view.rootContext()->setContextProperty("dirModel", &model);
+
+ view.setSource(QUrl::fromLocalFile("view.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+