~ubuntu-branches/ubuntu/natty/kde4libs/natty-proposed

« back to all changes in this revision

Viewing changes to kdeui/tests/proxymodeltestapp/kidentityproxymodelwidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell, Scott Kitterman, Jonathan Riddell
  • Date: 2010-11-22 17:59:02 UTC
  • mfrom: (1.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122175902-yubxubd0pg6hn11z
Tags: 4:4.5.80a-0ubuntu1
[ Scott Kitterman ]
* New upstream beta release
  - Refreshed all patches
  - Updated debian/patches/10_make_libkdeinit4_private.diff to use Qfile
    instead of Qstring in kdecore/kernel/kstandarddirs_unix.cpp
  - Updated debian/patches/kubuntu_01_kubuntu_useragent.diff to provide
    Kubuntu in the Konqueror user agen string with the changes in
    kio/kio/kprotocolmanager.cpp
  - Partially updated debian/patches/kubuntu_05_langpack_desktop_files.diff
    and left the balance in kdecore/localization/klocale.cpp.rej for later
    revision
  - Update debian/patches/kubuntu_06_user_disk_mounting.diff for changes in
    solid/solid/backends/hal/halstorageaccess.cpp
  - Remove debian/patches/kubuntu_71_backport_plasma_webview_changes.diff
    (backported from upstream, so already present now)
  - Add minimum version for libattica-dev of 0.1.90 to build-depends
  - Bump minimum version for libsoprano-dev build-depend to 2.5.60
  - Add minimum version for shared-desktop-ontologies of 0.5 in build-dep

[ Jonathan Riddell ]
* Add build-depends on grantlee, libudev-dev, hupnp (FIXME needs packaging fixes)
* Update kubuntu_04_add_langpack_path.diff 28_find_old_kde4_html_documentation.diff
  22_hack_in_etc_kde4_in_kstandarddirs.diff for QT_NO_CAST_FROM_ASCII
* Update kubuntu_05_langpack_desktop_files.diff for new upstream code
* Add kubuntu_78_solid_trunk.diff to fix solid linking
* Add libnepomukutils4 package for new library
* Don't install kcm_ssl for now, e-mailed upstream to suggest moving to kdebase
* Add kubuntu_79_knewstuff_fix.diff to fix compile broken by non-trunk commit
  http://websvn.kde.org/?view=revision&revision=1199825
* kdelibs5-data replaces old kdebase-runtime-data due to moved file
* Add kubuntu_80_find_hupnp.diff to find hupnp include files, committed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2010 Klarälvdalens Datakonsult AB,
 
3
        a KDAB Group company, info@kdab.net,
 
4
        author Stephen Kelly <stephen@kdab.com>
 
5
 
 
6
    This library is free software; you can redistribute it and/or modify it
 
7
    under the terms of the GNU Library General Public License as published by
 
8
    the Free Software Foundation; either version 2 of the License, or (at your
 
9
    option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful, but WITHOUT
 
12
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
14
    License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Library General Public License
 
17
    along with this library; see the file COPYING.LIB.  If not, write to the
 
18
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
19
    02110-1301, USA.
 
20
*/
 
21
 
 
22
#include "kidentityproxymodelwidget.h"
 
23
 
 
24
#include <dynamictreemodel.h>
 
25
#include <kbreadcrumbselectionmodel.h>
 
26
#include <QBoxLayout>
 
27
#include <QSplitter>
 
28
#include <QTreeView>
 
29
#include <QEvent>
 
30
#include "dynamictreewidget.h"
 
31
 
 
32
#include "kidentityproxymodel.h"
 
33
 
 
34
#include "modeltest.h"
 
35
 
 
36
KIdentityProxyModelWidget::KIdentityProxyModelWidget(QWidget* parent, Qt::WindowFlags f)
 
37
  : QWidget(parent, f)
 
38
{
 
39
  QHBoxLayout *layout = new QHBoxLayout(this);
 
40
  QSplitter *splitter = new QSplitter(this);
 
41
  layout->addWidget(splitter);
 
42
 
 
43
  DynamicTreeModel *rootModel = new DynamicTreeModel(this);
 
44
 
 
45
  DynamicTreeWidget *treeWidget = new DynamicTreeWidget(rootModel, splitter);
 
46
  treeWidget->setInitialTree(
 
47
    " - 1"
 
48
    " - 2"
 
49
    " - - 3"
 
50
    " - - 4"
 
51
    " - - 5"
 
52
    " - 6"
 
53
    " - 7"
 
54
    " - - 8"
 
55
    " - - - 9"
 
56
    " - - - 10"
 
57
    " - - 11"
 
58
//     " - - 12"
 
59
//     " - 13"
 
60
//     " - 14"
 
61
//     " - 15"
 
62
//     " - - 16"
 
63
//     " - - - 17"
 
64
//     " - - - 18"
 
65
//     " - 19"
 
66
//     " - 20"
 
67
//     " - 21"
 
68
  );
 
69
 
 
70
  KIdentityProxyModel *proxy = new KIdentityProxyModel(this);
 
71
  proxy->setSourceModel(rootModel);
 
72
 
 
73
  QTreeView *view1 = new QTreeView(splitter);
 
74
  view1->setModel(proxy);
 
75
  view1->expandAll();
 
76
}