Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

olistviewdemo.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) 2003 Michael 'Mickey' Lauer
00005                              <mickey@tm.informatik.uni-frankfurt.de>
00006               =.
00007             .=l.
00008            .>+-=
00009  _;:,     .>    :=|.         This program is free software; you can
00010 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00011 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00012 .="- .-=="i,     .._         License as published by the Free Software
00013  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00014      ._= =}       :          or (at your option) any later version.
00015     .%`+i>       _;_.
00016     .i_,=:_.      -<s.       This program is distributed in the hope that
00017      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00018     : ..    .:,     . . .    without even the implied warranty of
00019     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00020   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00021 ..}^=.=       =       ;      Library General Public License for more
00022 ++=   -.     .`     .:       details.
00023  :     =  ...= . :.=-
00024  -.   .:....=;==+<;          You should have received a copy of the GNU
00025   -_. . .   )=.  =           Library General Public License along with
00026     --        :-=`           this library; see the file COPYING.LIB.
00027                              If not, write to the Free Software Foundation,
00028                              Inc., 59 Temple Place - Suite 330,
00029                              Boston, MA 02111-1307, USA.
00030 
00031 */
00032 
00033 #include "olistviewdemo.h"
00034 
00035 /* OPIE */
00036 #include <opie2/olistview.h>
00037 #include <opie2/odebug.h>
00038 
00039 /* QT */
00040 #include <qstring.h>
00041 #include <qpixmap.h>
00042 #include <qlistview.h>
00043 
00044 using namespace Opie::Ui;
00045 
00046 OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f )
00047                    :QVBox( parent, name, f )
00048 {
00049     lv = new ONamedListView( this );
00050     lv->setRootIsDecorated( true );
00051     lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) );
00052 
00053     ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
00054     item->setText( "Column2", "ModifiedText" );
00055     item->setText( "Column5", "ThisColumnDoesNotExits" );
00056 
00057     new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
00058     new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
00059     new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) );
00060     item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) );
00061     new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
00062     new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
00063 
00064     new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
00065     new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
00066     new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
00067     item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) );
00068     item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) );
00069     item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) );
00070 
00071     if ( lv->find( 3, "Mickey", 3 ) )
00072         odebug << "found Mickey :-)" << oendl;
00073     else
00074         odebug << "did not found Mickey :-(" << oendl;
00075 
00076     if ( lv->find( 3, "Minni", 0 ) )
00077         odebug << "found Minni :-)" << oendl;
00078     else
00079         odebug << "did not found Minni :-(" << oendl;
00080 
00081 }
00082 
00083 OListViewDemo::~OListViewDemo()
00084 {
00085 }
00086 

Generated on Sat Nov 5 16:15:59 2005 for OPIE by  doxygen 1.4.2