yektaayduk
9th January 2008, 06:51
Hello
The code below is taken from an example and works fine.
I will use it during the startup for presenting the self test flow and results(any better way?).
The problem is:
Currently the first column is accessable ,but I dont know how to enter the test results to the second column.I want to enter some text as test results like passed ,running or/and related icons .
Yekta Ayduk
CheckLists::CheckLists( QWidget *parent, const char *name )
: QWidget( parent, name )
{
QHBoxLayout *lay = new QHBoxLayout( this );
lay->setMargin( 5 );
// create a widget which layouts its childs in a column
QVBoxLayout *vbox1 = new QVBoxLayout( lay );
vbox1->setMargin( 5 );
// First child: a Label
vbox1->addWidget( new QLabel( "Check some items!", this ) );
// Second child: the ListView
lv1 = new QListView( this );
vbox1->addWidget( lv1 );
lv1->addColumn( "Test Items" );
lv1->addColumn( "Test Results" );
lv1->setRootIsDecorated( TRUE );
QValueList<QListViewItem *> parentList;
parentList.append( new QCheckListItem( lv1, "Test Items", QCheckListItem::CheckBoxController ) );
QListViewItem *item = 0;
QValueList<QListViewItem*>::Iterator it = parentList.begin();
( *it )->setOpen( TRUE );
item = *it;
test_1= new QCheckListItem( item, "Test 1", QCheckListItem::CheckBox );
test_2= new QCheckListItem( item, "Test 2", QCheckListItem::CheckBox );
test_3= new QCheckListItem( item, "Test 3", QCheckListItem::CheckBox );
test_3->setOn(TRUE);//executed test selected by code
//mouse keyboard selection disabled
test_1->setSelectable(FALSE);
test_2->setSelectable(FALSE);
test_3->setSelectable(FALSE);
}
The code below is taken from an example and works fine.
I will use it during the startup for presenting the self test flow and results(any better way?).
The problem is:
Currently the first column is accessable ,but I dont know how to enter the test results to the second column.I want to enter some text as test results like passed ,running or/and related icons .
Yekta Ayduk
CheckLists::CheckLists( QWidget *parent, const char *name )
: QWidget( parent, name )
{
QHBoxLayout *lay = new QHBoxLayout( this );
lay->setMargin( 5 );
// create a widget which layouts its childs in a column
QVBoxLayout *vbox1 = new QVBoxLayout( lay );
vbox1->setMargin( 5 );
// First child: a Label
vbox1->addWidget( new QLabel( "Check some items!", this ) );
// Second child: the ListView
lv1 = new QListView( this );
vbox1->addWidget( lv1 );
lv1->addColumn( "Test Items" );
lv1->addColumn( "Test Results" );
lv1->setRootIsDecorated( TRUE );
QValueList<QListViewItem *> parentList;
parentList.append( new QCheckListItem( lv1, "Test Items", QCheckListItem::CheckBoxController ) );
QListViewItem *item = 0;
QValueList<QListViewItem*>::Iterator it = parentList.begin();
( *it )->setOpen( TRUE );
item = *it;
test_1= new QCheckListItem( item, "Test 1", QCheckListItem::CheckBox );
test_2= new QCheckListItem( item, "Test 2", QCheckListItem::CheckBox );
test_3= new QCheckListItem( item, "Test 3", QCheckListItem::CheckBox );
test_3->setOn(TRUE);//executed test selected by code
//mouse keyboard selection disabled
test_1->setSelectable(FALSE);
test_2->setSelectable(FALSE);
test_3->setSelectable(FALSE);
}