diff options
author | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-07-29 11:51:27 (GMT) |
---|---|---|
committer | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-07-29 11:51:27 (GMT) |
commit | da7f8a556c122a31daa11f434d67c8bb96cbd5ec (patch) | |
tree | 28d906d034d20c9079cebb75d08bb60bc4d1b8d4 /examples/tutorials/modelview/1_readonly | |
parent | 65642dd343bf61510117cd7e13f69e7138247932 (diff) | |
download | Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.zip Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.tar.gz Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.tar.bz2 |
moving over work from 28b49e42f5bddec2d62e957f158cb848da134db8
Diffstat (limited to 'examples/tutorials/modelview/1_readonly')
-rwxr-xr-x[-rw-r--r--] | examples/tutorials/modelview/1_readonly/1_readonly.pro | 13 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/tutorials/modelview/1_readonly/main.cpp | 9 | ||||
-rw-r--r-- | examples/tutorials/modelview/1_readonly/modelview.cpp | 54 | ||||
-rw-r--r-- | examples/tutorials/modelview/1_readonly/modelview.h | 61 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/tutorials/modelview/1_readonly/mymodel.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/tutorials/modelview/1_readonly/mymodel.h | 0 |
6 files changed, 16 insertions, 121 deletions
diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro index 1162d5a..3ecebc2 100644..100755 --- a/examples/tutorials/modelview/1_readonly/1_readonly.pro +++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro @@ -3,8 +3,15 @@ TARGET = mv_readonly TEMPLATE = app SOURCES += main.cpp \ - modelview.cpp \ mymodel.cpp -HEADERS += modelview.h \ - mymodel.h +HEADERS += mymodel.h + + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/1_readonly +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS 1_readonly.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/1_readonly +INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp index fb4726a..2143854 100644..100755 --- a/examples/tutorials/modelview/1_readonly/main.cpp +++ b/examples/tutorials/modelview/1_readonly/main.cpp @@ -41,13 +41,16 @@ //! [Quoting ModelView Tutorial] // main.cpp #include <QtGui/QApplication> -#include "modelview.h" +#include <QtGui/QTableView> +#include "mymodel.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); - ModelView w; - w.show(); + QTableView tableView; + MyModel myModel(0); + tableView.setModel( &myModel ); + tableView.show(); return a.exec(); } //! [Quoting ModelView Tutorial] diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp deleted file mode 100644 index 91a97bf..0000000 --- a/examples/tutorials/modelview/1_readonly/modelview.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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 examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [Quoting ModelView Tutorial] -// modelview.cpp -#include <QTableView> -#include "modelview.h" -#include "mymodel.h" - -ModelView::ModelView(QWidget *parent) - : QMainWindow(parent) -{ - tableView = new QTableView(this); - setCentralWidget(tableView); - tableView->setModel(new MyModel(this)); -} -//! [Quoting ModelView Tutorial] diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h deleted file mode 100644 index cc14d90..0000000 --- a/examples/tutorials/modelview/1_readonly/modelview.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** 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 examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MODELVIEW_H -#define MODELVIEW_H - -//! [Quoting ModelView Tutorial] -// modelview.h -#include <QtGui/QMainWindow> - -QT_FORWARD_DECLARE_CLASS(QTableView) - -class ModelView : public QMainWindow -{ - Q_OBJECT -private: - QTableView *tableView; -public: - ModelView(QWidget *parent = 0); - -}; -//! [Quoting ModelView Tutorial] - -#endif // MODELVIEW_H diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp index 394605a..394605a 100644..100755 --- a/examples/tutorials/modelview/1_readonly/mymodel.cpp +++ b/examples/tutorials/modelview/1_readonly/mymodel.cpp diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h index 6065f6e..6065f6e 100644..100755 --- a/examples/tutorials/modelview/1_readonly/mymodel.h +++ b/examples/tutorials/modelview/1_readonly/mymodel.h |