Diffstat (limited to 'libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp index cf1e443..9db4e62 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp | |||
@@ -1,158 +1,158 @@ | |||
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 "oversatileviewdemo.h" | 33 | #include "oversatileviewdemo.h" |
34 | #include <opie2/oversatileview.h> | 34 | #include <opie2/oversatileview.h> |
35 | #include <opie2/oversatileviewitem.h> | 35 | #include <opie2/oversatileviewitem.h> |
36 | 36 | ||
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | #include <qpixmap.h> | 38 | #include <qpixmap.h> |
39 | #include <qlistview.h> | 39 | #include <qlistview.h> |
40 | 40 | ||
41 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) | 41 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) |
42 | :QVBox( parent, name, f ) | 42 | :QVBox( parent, name, f ) |
43 | { | 43 | { |
44 | vv = new OVersatileView( this ); | 44 | vv = new OVersatileView( this ); |
45 | 45 | ||
46 | vv->addColumn( "First" ); | 46 | vv->addColumn( "First" ); |
47 | vv->addColumn( "2nd" ); | 47 | vv->addColumn( "2nd" ); |
48 | vv->addColumn( "IIIrd" ); | 48 | vv->addColumn( "IIIrd" ); |
49 | 49 | ||
50 | QString counter; | 50 | QString counter; |
51 | 51 | ||
52 | QPixmap leaf( "leaf.png" ); | 52 | QPixmap leaf( "leaf.png" ); |
53 | QPixmap opened( "folder_opened.png" ); | 53 | QPixmap opened( "folder_opened.png" ); |
54 | QPixmap closed( "folder_closed.png" ); | 54 | QPixmap closed( "folder_closed.png" ); |
55 | 55 | ||
56 | QPixmap leaf32( "leaf32.png" ); | 56 | QPixmap leaf32( "leaf32.png" ); |
57 | QPixmap opened32( "folder_opened32.png" ); | 57 | QPixmap opened32( "folder_opened32.png" ); |
58 | QPixmap closed32( "folder_closed32.png" ); | 58 | QPixmap closed32( "folder_closed32.png" ); |
59 | 59 | ||
60 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); | 60 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); |
61 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); | 61 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); |
62 | 62 | ||
63 | OVersatileViewItem* item; | 63 | OVersatileViewItem* item; |
64 | OVersatileViewItem* item2; | 64 | OVersatileViewItem* item2; |
65 | 65 | ||
66 | for ( int i = 0; i < 5; ++i ) | 66 | for ( int i = 0; i < 5; ++i ) |
67 | { | 67 | { |
68 | counter.sprintf( "%d", i ); | 68 | counter.sprintf( "%d", i ); |
69 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); | 69 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); |
70 | item->setRenameEnabled( true ); | 70 | item->setRenameEnabled( true ); |
71 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); | 71 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); |
72 | item2->setRenameEnabled( true ); | 72 | item2->setRenameEnabled( true ); |
73 | 73 | ||
74 | } | 74 | } |
75 | 75 | ||
76 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); | 76 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); |
77 | connect( vv, SIGNAL( selectionChanged( OVersatileViewItem * ) ), this, SLOT( selectionChanged( OVersatileViewItem * ) ) ); | 77 | connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); |
78 | connect( vv, SIGNAL( currentChanged( OVersatileViewItem * ) ), this, SLOT( currentChanged( OVersatileViewItem * ) ) ); | 78 | connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); |
79 | connect( vv, SIGNAL( clicked( OVersatileViewItem * ) ), this, SLOT( clicked( OVersatileViewItem * ) ) ); | 79 | connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); |
80 | connect( vv, SIGNAL( pressed( OVersatileViewItem * ) ), this, SLOT( pressed( OVersatileViewItem * ) ) ); | 80 | connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); |
81 | 81 | ||
82 | connect( vv, SIGNAL( doubleClicked( OVersatileViewItem * ) ), this, SLOT( doubleClicked( OVersatileViewItem * ) ) ); | 82 | connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); |
83 | connect( vv, SIGNAL( returnPressed( OVersatileViewItem * ) ), this, SLOT( returnPressed( OVersatileViewItem * ) ) ); | 83 | connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); |
84 | 84 | ||
85 | connect( vv, SIGNAL( onItem( OVersatileViewItem * ) ), this, SLOT( onItem( OVersatileViewItem * ) ) ); | 85 | connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); |
86 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); | 86 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); |
87 | 87 | ||
88 | connect( vv, SIGNAL( expanded( OVersatileViewItem * ) ), this, SLOT( expanded( OVersatileViewItem * ) ) ); | 88 | connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); |
89 | connect( vv, SIGNAL( collapsed( OVersatileViewItem * ) ), this, SLOT( collapsed( OVersatileViewItem * ) ) ); | 89 | connect( vv, SIGNAL( collapsed(OVersatileViewItem*) ), this, SLOT( collapsed(OVersatileViewItem*) ) ); |
90 | 90 | ||
91 | connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); | 91 | connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); |
92 | 92 | ||
93 | connect( vv, SIGNAL( contextMenuRequested( OVersatileViewItem *, const QPoint&, int ) ), this, SLOT( contextMenuRequested( OVersatileViewItem *, const QPoint&, int ) ) ); | 93 | connect( vv, SIGNAL( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ) ); |
94 | 94 | ||
95 | } | 95 | } |
96 | 96 | ||
97 | OVersatileViewDemo::~OVersatileViewDemo() | 97 | OVersatileViewDemo::~OVersatileViewDemo() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | void OVersatileViewDemo::selectionChanged() | 101 | void OVersatileViewDemo::selectionChanged() |
102 | { | 102 | { |
103 | qDebug( "received signal selectionChanged()" ); | 103 | qDebug( "received signal selectionChanged()" ); |
104 | } | 104 | } |
105 | void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) | 105 | void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) |
106 | { | 106 | { |
107 | qDebug( "received signal selectionChanged(OVersatileViewItem*)" ); | 107 | qDebug( "received signal selectionChanged(OVersatileViewItem*)" ); |
108 | } | 108 | } |
109 | void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) | 109 | void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) |
110 | { | 110 | { |
111 | qDebug( "received signal currentChanged( OVersatileViewItem * )" ); | 111 | qDebug( "received signal currentChanged( OVersatileViewItem * )" ); |
112 | } | 112 | } |
113 | void OVersatileViewDemo::clicked( OVersatileViewItem * item ) | 113 | void OVersatileViewDemo::clicked( OVersatileViewItem * item ) |
114 | { | 114 | { |
115 | qDebug( "received signal clicked( OVersatileViewItem * )" ); | 115 | qDebug( "received signal clicked( OVersatileViewItem * )" ); |
116 | } | 116 | } |
117 | void OVersatileViewDemo::pressed( OVersatileViewItem * item ) | 117 | void OVersatileViewDemo::pressed( OVersatileViewItem * item ) |
118 | { | 118 | { |
119 | qDebug( "received signal pressed( OVersatileViewItem * )" ); | 119 | qDebug( "received signal pressed( OVersatileViewItem * )" ); |
120 | } | 120 | } |
121 | 121 | ||
122 | void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) | 122 | void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) |
123 | { | 123 | { |
124 | qDebug( "received signal doubleClicked( OVersatileViewItem *item )" ); | 124 | qDebug( "received signal doubleClicked( OVersatileViewItem *item )" ); |
125 | } | 125 | } |
126 | void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) | 126 | void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) |
127 | { | 127 | { |
128 | qDebug( "received signal returnPressed( OVersatileViewItem *item )" ); | 128 | qDebug( "received signal returnPressed( OVersatileViewItem *item )" ); |
129 | } | 129 | } |
130 | 130 | ||
131 | void OVersatileViewDemo::onItem( OVersatileViewItem *item ) | 131 | void OVersatileViewDemo::onItem( OVersatileViewItem *item ) |
132 | { | 132 | { |
133 | qDebug( "received signal onItem( OVersatileViewItem *item )" ); | 133 | qDebug( "received signal onItem( OVersatileViewItem *item )" ); |
134 | } | 134 | } |
135 | void OVersatileViewDemo::onViewport() | 135 | void OVersatileViewDemo::onViewport() |
136 | { | 136 | { |
137 | qDebug( "received signal onViewport()" ); | 137 | qDebug( "received signal onViewport()" ); |
138 | } | 138 | } |
139 | 139 | ||
140 | void OVersatileViewDemo::expanded( OVersatileViewItem *item ) | 140 | void OVersatileViewDemo::expanded( OVersatileViewItem *item ) |
141 | { | 141 | { |
142 | qDebug( "received signal expanded( OVersatileViewItem *item )" ); | 142 | qDebug( "received signal expanded( OVersatileViewItem *item )" ); |
143 | } | 143 | } |
144 | 144 | ||
145 | void OVersatileViewDemo::collapsed( OVersatileViewItem *item ) | 145 | void OVersatileViewDemo::collapsed( OVersatileViewItem *item ) |
146 | { | 146 | { |
147 | qDebug( "received signal collapsed( OVersatileViewItem *item )" ); | 147 | qDebug( "received signal collapsed( OVersatileViewItem *item )" ); |
148 | } | 148 | } |
149 | 149 | ||
150 | void OVersatileViewDemo::moved() | 150 | void OVersatileViewDemo::moved() |
151 | { | 151 | { |
152 | qDebug( "received signal moved( OVersatileViewItem *item )" ); | 152 | qDebug( "received signal moved( OVersatileViewItem *item )" ); |
153 | } | 153 | } |
154 | 154 | ||
155 | void OVersatileViewDemo::contextMenuRequested( OVersatileViewItem *item, const QPoint& pos, int col ) | 155 | void OVersatileViewDemo::contextMenuRequested( OVersatileViewItem *item, const QPoint& pos, int col ) |
156 | { | 156 | { |
157 | qDebug( "received signal contextMenuRequested( OVersatileViewItem *item )" ); | 157 | qDebug( "received signal contextMenuRequested( OVersatileViewItem *item )" ); |
158 | } | 158 | } |