Diffstat (limited to 'libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp index 5ba7b69..7834b3b 100644 --- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp +++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp | |||
@@ -1,80 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer |
5 | <mickey@tm.informatik.uni-frankfurt.de> | 5 | <mickey@tm.informatik.uni-frankfurt.de> |
6 | =. | 6 | =. |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include "olistviewdemo.h" | 33 | #include "olistviewdemo.h" |
34 | #include <opie2/olistview.h> | 34 | #include <opie2/olistview.h> |
35 | 35 | ||
36 | #include <qstring.h> | 36 | #include <qstring.h> |
37 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | 39 | ||
40 | using namespace Opie::Ui; | ||
41 | |||
40 | OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) | 42 | OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) |
41 | :QVBox( parent, name, f ) | 43 | :QVBox( parent, name, f ) |
42 | { | 44 | { |
43 | lv = new ONamedListView( this ); | 45 | lv = new ONamedListView( this ); |
44 | lv->setRootIsDecorated( true ); | 46 | lv->setRootIsDecorated( true ); |
45 | lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); | 47 | lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); |
46 | 48 | ||
47 | ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 49 | ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
48 | item->setText( "Column2", "ModifiedText" ); | 50 | item->setText( "Column2", "ModifiedText" ); |
49 | item->setText( "Column5", "ThisColumnDoesNotExits" ); | 51 | item->setText( "Column5", "ThisColumnDoesNotExits" ); |
50 | 52 | ||
51 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 53 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
52 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 54 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
53 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); | 55 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); |
54 | item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); | 56 | item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); |
55 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 57 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
56 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 58 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
57 | 59 | ||
58 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 60 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
59 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 61 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
60 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 62 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
61 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); | 63 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); |
62 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); | 64 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); |
63 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); | 65 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); |
64 | 66 | ||
65 | if ( lv->find( 3, "Mickey", 3 ) ) | 67 | if ( lv->find( 3, "Mickey", 3 ) ) |
66 | qDebug( "found Mickey :-)" ); | 68 | qDebug( "found Mickey :-)" ); |
67 | else | 69 | else |
68 | qDebug( "did not found Mickey :-(" ); | 70 | qDebug( "did not found Mickey :-(" ); |
69 | 71 | ||
70 | if ( lv->find( 3, "Minni", 0 ) ) | 72 | if ( lv->find( 3, "Minni", 0 ) ) |
71 | qDebug( "found Minni :-)" ); | 73 | qDebug( "found Minni :-)" ); |
72 | else | 74 | else |
73 | qDebug( "did not found Minni :-(" ); | 75 | qDebug( "did not found Minni :-(" ); |
74 | 76 | ||
75 | } | 77 | } |
76 | 78 | ||
77 | OListViewDemo::~OListViewDemo() | 79 | OListViewDemo::~OListViewDemo() |
78 | { | 80 | { |
79 | } | 81 | } |
80 | 82 | ||