add scrollbar for kinetic list
[kineticlist.git] / main.cpp
blob526124e56768c1b0f54d6e37b1c72060ee851e22
1 /////////////////////////////////////////////////////////////////////////
2 // main.cpp //
3 // //
4 // Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>//
5 // Copyright(C) 2009 Adenilson Cavalcanti <adenilson.silva@idnt.org.br>//
6 // //
7 // This library is free software; you can redistribute it and/or //
8 // modify it under the terms of the GNU Lesser General Public //
9 // License as published by the Free Software Foundation; either //
10 // version 2.1 of the License, or (at your option) any later version. //
11 // //
12 // This library is distributed in the hope that it will be useful, //
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
15 // Lesser General Public License for more details. //
16 // //
17 // You should have received a copy of the GNU Lesser General Public //
18 // License along with this library; if not, write to the Free Software //
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA //
20 // 02110-1301 USA //
21 /////////////////////////////////////////////////////////////////////////
22 #include <QtGui>
23 #include "item.h"
24 #include "kineticview.h"
26 int main(int argc, char *argv[])
28 QApplication app(argc, argv);
29 QGraphicsScene scene;
30 scene.setSceneRect(0, 0, 600, 600);
32 AItem ui[30];
33 KineticView *t = new KineticView;
34 t->resize( 300, 600);
36 scene.addItem( t );
37 QGraphicsWidget *w = new QGraphicsWidget;
38 QGraphicsLinearLayout *l = new QGraphicsLinearLayout( Qt::Vertical, w );
40 ui[0].setColor( Qt::black );
41 ui[1].setColor( Qt::green );
42 ui[2].setColor( Qt::red );
43 ui[3].setColor( Qt::blue );
44 ui[4].setColor( Qt::gray );
45 ui[5].setColor( Qt::lightGray );
46 ui[6].setColor( Qt::yellow );
47 ui[7].setColor( Qt::black );
48 ui[8].setColor( Qt::green );
49 ui[9].setColor( Qt::red );
50 ui[10].setColor( Qt::black );
51 ui[11].setColor( Qt::green );
52 ui[12].setColor( Qt::red );
53 ui[13].setColor( Qt::blue );
54 ui[14].setColor( Qt::gray );
55 ui[15].setColor( Qt::lightGray );
56 ui[16].setColor( Qt::yellow );
57 ui[17].setColor( Qt::black );
58 ui[18].setColor( Qt::green );
59 ui[19].setColor( Qt::red );
60 ui[20].setColor( Qt::black );
61 ui[21].setColor( Qt::green );
62 ui[22].setColor( Qt::red );
63 ui[23].setColor( Qt::blue );
64 ui[24].setColor( Qt::gray );
65 ui[25].setColor( Qt::lightGray );
66 ui[26].setColor( Qt::yellow );
67 ui[27].setColor( Qt::black );
68 ui[28].setColor( Qt::green );
69 ui[29].setColor( Qt::red );
72 for( int i = 0 ; i < 30; i++ ) {
73 l->addItem( &ui[i] );
75 t->setWidget( w );
76 QGraphicsView view(&scene);
77 view.setRenderHint(QPainter::Antialiasing);
78 /* view drag */
79 //view.setDragMode(QGraphicsView::ScrollHandDrag);
80 view.show();
82 return app.exec();