00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "olistviewdemo.h"
00034
00035
00036 #include <opie2/olistview.h>
00037 #include <opie2/odebug.h>
00038
00039
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