From ac037fd7970c8bc4f3a50dda06589016a1190af7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 17:25:37 -0600 Subject: Fix FTBFS --- examples/checklists/checklists.cpp | 162 --------------------------------- examples/checklists/checklists.doc | 29 ------ examples/checklists/checklists.h | 35 ------- examples/checklists/checklists.pro | 11 --- examples/checklists/main.cpp | 24 ----- examples/chectdelists/chectdelists.cpp | 162 +++++++++++++++++++++++++++++++++ examples/chectdelists/chectdelists.doc | 29 ++++++ examples/chectdelists/chectdelists.h | 35 +++++++ examples/chectdelists/chectdelists.pro | 11 +++ examples/chectdelists/main.cpp | 24 +++++ 10 files changed, 261 insertions(+), 261 deletions(-) delete mode 100644 examples/checklists/checklists.cpp delete mode 100644 examples/checklists/checklists.doc delete mode 100644 examples/checklists/checklists.h delete mode 100644 examples/checklists/checklists.pro delete mode 100644 examples/checklists/main.cpp create mode 100644 examples/chectdelists/chectdelists.cpp create mode 100644 examples/chectdelists/chectdelists.doc create mode 100644 examples/chectdelists/chectdelists.h create mode 100644 examples/chectdelists/chectdelists.pro create mode 100644 examples/chectdelists/main.cpp (limited to 'examples') diff --git a/examples/checklists/checklists.cpp b/examples/checklists/checklists.cpp deleted file mode 100644 index 08b11fc30..000000000 --- a/examples/checklists/checklists.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include "checklists.h" - -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructor - * - * Create all child widgets of the CheckList Widget - */ - -CheckLists::CheckLists( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) -{ - TQHBoxLayout *lay = new TQHBoxLayout( this ); - lay->setMargin( 5 ); - - // create a widget which layouts its childs in a column - TQVBoxLayout *vbox1 = new TQVBoxLayout( lay ); - vbox1->setMargin( 5 ); - - // First child: a Label - vbox1->addWidget( new TQLabel( "Check some items!", this ) ); - - // Second child: the ListView - lv1 = new TQListView( this ); - vbox1->addWidget( lv1 ); - lv1->addColumn( "Items" ); - lv1->setRootIsDecorated( TRUE ); - - // create a list with 4 ListViewItems which will be parent items of other ListViewItems - TQValueList parentList; - - parentList.append( new TQCheckListItem( lv1, "Parent Item 1", TQCheckListItem::CheckBoxController ) ); - parentList.append( new TQCheckListItem( lv1, "Parent Item 2", TQCheckListItem::CheckBoxController ) ); - parentList.append( new TQCheckListItem( lv1, "Parent Item 3", TQCheckListItem::CheckBoxController ) ); - parentList.append( new TQCheckListItem( lv1, "Parent Item 4", TQCheckListItem::CheckBoxController ) ); - - TQListViewItem *item = 0; - unsigned int num = 1; - // go through the list of parent items... - for ( TQValueList::Iterator it = parentList.begin(); it != parentList.end(); - ( *it )->setOpen( TRUE ), ++it, num++ ) { - item = *it; - // ...and create 5 checkable child ListViewItems for each parent item - for ( unsigned int i = 1; i <= 5; i++ ) - (void)new TQCheckListItem( item, TQString( "%1. Child of Parent %2" ).arg( i ).arg( num ), TQCheckListItem::CheckBox ); - } - - // Create another widget for layouting - TQVBoxLayout *tmp = new TQVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create a pushbutton - TQPushButton *copy1 = new TQPushButton( " -> ", this ); - tmp->addWidget( copy1 ); - copy1->setMaximumWidth( copy1->sizeHint().width() ); - // connect the SIGNAL clicked() of the pushbutton with the SLOT copy1to2() - connect( copy1, SIGNAL( clicked() ), this, SLOT( copy1to2() ) ); - - // another widget for layouting - TQVBoxLayout *vbox2 = new TQVBoxLayout( lay ); - vbox2->setMargin( 5 ); - - // and another label - vbox2->addWidget( new TQLabel( "Check one item!", this ) ); - - // create the second listview - lv2 = new TQListView( this ); - vbox2->addWidget( lv2 ); - lv2->addColumn( "Items" ); - lv2->setRootIsDecorated( TRUE ); - - // another widget needed for layouting only - tmp = new TQVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create another pushbutton... - TQPushButton *copy2 = new TQPushButton( " -> ", this ); - lay->addWidget( copy2 ); - copy2->setMaximumWidth( copy2->sizeHint().width() ); - // ...and connect its clicked() SIGNAL to the copy2to3() SLOT - connect( copy2, SIGNAL( clicked() ), this, SLOT( copy2to3() ) ); - - tmp = new TQVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // and create a label which will be at the right of the window - label = new TQLabel( "No Item yet...", this ); - tmp->addWidget( label ); -} - -/* - * SLOT copy1to2() - * - * Copies all checked ListViewItems from the first ListView to - * the second one, and inserts them as Radio-ListViewItem. - */ - -void CheckLists::copy1to2() -{ - // create an iterator which operates on the first ListView - TQListViewItemIterator it( lv1 ); - - lv2->clear(); - - // Insert first a controller Item into the second ListView. Always if Radio-ListViewItems - // are inserted into a Listview, the parent item of these MUST be a controller Item! - TQCheckListItem *item = new TQCheckListItem( lv2, "Controller", TQCheckListItem::Controller ); - item->setOpen( TRUE ); - - // iterate through the first ListView... - for ( ; it.current(); ++it ) - // ...check state of childs, and... - if ( it.current()->parent() ) - // ...if the item is checked... - if ( ( (TQCheckListItem*)it.current() )->isOn() ) - // ...insert a Radio-ListViewItem with the same text into the second ListView - (void)new TQCheckListItem( item, it.current()->text( 0 ), TQCheckListItem::RadioButton ); - - if ( item->firstChild() ) - ( ( TQCheckListItem* )item->firstChild() )->setOn( TRUE ); -} - -/* - * SLOT copy2to3() - * - * Copies the checked item of the second ListView into the - * Label at the right. - */ - -void CheckLists::copy2to3() -{ - // create an iterator which operates on the second ListView - TQListViewItemIterator it( lv2 ); - - label->setText( "No Item checked" ); - - // iterate through the second ListView... - for ( ; it.current(); ++it ) - // ...check state of childs, and... - if ( it.current()->parent() ) - // ...if the item is checked... - if ( ( (TQCheckListItem*)it.current() )->isOn() ) - // ...set the text of the item to the label - label->setText( it.current()->text( 0 ) ); -} - diff --git a/examples/checklists/checklists.doc b/examples/checklists/checklists.doc deleted file mode 100644 index 417afe6b7..000000000 --- a/examples/checklists/checklists.doc +++ /dev/null @@ -1,29 +0,0 @@ -/* -*/ -/*! \page checklists-example.html - - \ingroup examples - \title Listviews with Checkable Items - - This example program shows how to use listviews with different types of - checkable items. - -
- - Header file: - - \include checklists/checklists.h - -
- - Implementation: - - \include checklists/checklists.cpp - -
- - Main: - - \include checklists/main.cpp -*/ - diff --git a/examples/checklists/checklists.h b/examples/checklists/checklists.h deleted file mode 100644 index d2097dd18..000000000 --- a/examples/checklists/checklists.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#ifndef CHECKLISTS_H -#define CHECKLISTS_H - -#include - -class TQListView; -class TQLabel; - -class CheckLists : public TQWidget -{ - TQ_OBJECT - -public: - CheckLists( TQWidget *parent = 0, const char *name = 0 ); - -protected: - TQListView *lv1, *lv2; - TQLabel *label; - -protected slots: - void copy1to2(); - void copy2to3(); - -}; - -#endif diff --git a/examples/checklists/checklists.pro b/examples/checklists/checklists.pro deleted file mode 100644 index a1a6f12d8..000000000 --- a/examples/checklists/checklists.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = app -TARGET = checklists - -CONFIG += qt warn_on release -DEPENDPATH = ../../include - -REQUIRES = large-config - -HEADERS = checklists.h -SOURCES = checklists.cpp \ - main.cpp diff --git a/examples/checklists/main.cpp b/examples/checklists/main.cpp deleted file mode 100644 index 65f368348..000000000 --- a/examples/checklists/main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include "checklists.h" -#include - -int main( int argc, char **argv ) -{ - TQApplication a( argc, argv ); - - CheckLists checklists; - checklists.resize( 650, 350 ); - checklists.setCaption( "TQt Example - CheckLists" ); - a.setMainWidget( &checklists ); - checklists.show(); - - return a.exec(); -} diff --git a/examples/chectdelists/chectdelists.cpp b/examples/chectdelists/chectdelists.cpp new file mode 100644 index 000000000..08b11fc30 --- /dev/null +++ b/examples/chectdelists/chectdelists.cpp @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for TQt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "checklists.h" + +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructor + * + * Create all child widgets of the CheckList Widget + */ + +CheckLists::CheckLists( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) +{ + TQHBoxLayout *lay = new TQHBoxLayout( this ); + lay->setMargin( 5 ); + + // create a widget which layouts its childs in a column + TQVBoxLayout *vbox1 = new TQVBoxLayout( lay ); + vbox1->setMargin( 5 ); + + // First child: a Label + vbox1->addWidget( new TQLabel( "Check some items!", this ) ); + + // Second child: the ListView + lv1 = new TQListView( this ); + vbox1->addWidget( lv1 ); + lv1->addColumn( "Items" ); + lv1->setRootIsDecorated( TRUE ); + + // create a list with 4 ListViewItems which will be parent items of other ListViewItems + TQValueList parentList; + + parentList.append( new TQCheckListItem( lv1, "Parent Item 1", TQCheckListItem::CheckBoxController ) ); + parentList.append( new TQCheckListItem( lv1, "Parent Item 2", TQCheckListItem::CheckBoxController ) ); + parentList.append( new TQCheckListItem( lv1, "Parent Item 3", TQCheckListItem::CheckBoxController ) ); + parentList.append( new TQCheckListItem( lv1, "Parent Item 4", TQCheckListItem::CheckBoxController ) ); + + TQListViewItem *item = 0; + unsigned int num = 1; + // go through the list of parent items... + for ( TQValueList::Iterator it = parentList.begin(); it != parentList.end(); + ( *it )->setOpen( TRUE ), ++it, num++ ) { + item = *it; + // ...and create 5 checkable child ListViewItems for each parent item + for ( unsigned int i = 1; i <= 5; i++ ) + (void)new TQCheckListItem( item, TQString( "%1. Child of Parent %2" ).arg( i ).arg( num ), TQCheckListItem::CheckBox ); + } + + // Create another widget for layouting + TQVBoxLayout *tmp = new TQVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create a pushbutton + TQPushButton *copy1 = new TQPushButton( " -> ", this ); + tmp->addWidget( copy1 ); + copy1->setMaximumWidth( copy1->sizeHint().width() ); + // connect the SIGNAL clicked() of the pushbutton with the SLOT copy1to2() + connect( copy1, SIGNAL( clicked() ), this, SLOT( copy1to2() ) ); + + // another widget for layouting + TQVBoxLayout *vbox2 = new TQVBoxLayout( lay ); + vbox2->setMargin( 5 ); + + // and another label + vbox2->addWidget( new TQLabel( "Check one item!", this ) ); + + // create the second listview + lv2 = new TQListView( this ); + vbox2->addWidget( lv2 ); + lv2->addColumn( "Items" ); + lv2->setRootIsDecorated( TRUE ); + + // another widget needed for layouting only + tmp = new TQVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create another pushbutton... + TQPushButton *copy2 = new TQPushButton( " -> ", this ); + lay->addWidget( copy2 ); + copy2->setMaximumWidth( copy2->sizeHint().width() ); + // ...and connect its clicked() SIGNAL to the copy2to3() SLOT + connect( copy2, SIGNAL( clicked() ), this, SLOT( copy2to3() ) ); + + tmp = new TQVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // and create a label which will be at the right of the window + label = new TQLabel( "No Item yet...", this ); + tmp->addWidget( label ); +} + +/* + * SLOT copy1to2() + * + * Copies all checked ListViewItems from the first ListView to + * the second one, and inserts them as Radio-ListViewItem. + */ + +void CheckLists::copy1to2() +{ + // create an iterator which operates on the first ListView + TQListViewItemIterator it( lv1 ); + + lv2->clear(); + + // Insert first a controller Item into the second ListView. Always if Radio-ListViewItems + // are inserted into a Listview, the parent item of these MUST be a controller Item! + TQCheckListItem *item = new TQCheckListItem( lv2, "Controller", TQCheckListItem::Controller ); + item->setOpen( TRUE ); + + // iterate through the first ListView... + for ( ; it.current(); ++it ) + // ...check state of childs, and... + if ( it.current()->parent() ) + // ...if the item is checked... + if ( ( (TQCheckListItem*)it.current() )->isOn() ) + // ...insert a Radio-ListViewItem with the same text into the second ListView + (void)new TQCheckListItem( item, it.current()->text( 0 ), TQCheckListItem::RadioButton ); + + if ( item->firstChild() ) + ( ( TQCheckListItem* )item->firstChild() )->setOn( TRUE ); +} + +/* + * SLOT copy2to3() + * + * Copies the checked item of the second ListView into the + * Label at the right. + */ + +void CheckLists::copy2to3() +{ + // create an iterator which operates on the second ListView + TQListViewItemIterator it( lv2 ); + + label->setText( "No Item checked" ); + + // iterate through the second ListView... + for ( ; it.current(); ++it ) + // ...check state of childs, and... + if ( it.current()->parent() ) + // ...if the item is checked... + if ( ( (TQCheckListItem*)it.current() )->isOn() ) + // ...set the text of the item to the label + label->setText( it.current()->text( 0 ) ); +} + diff --git a/examples/chectdelists/chectdelists.doc b/examples/chectdelists/chectdelists.doc new file mode 100644 index 000000000..417afe6b7 --- /dev/null +++ b/examples/chectdelists/chectdelists.doc @@ -0,0 +1,29 @@ +/* +*/ +/*! \page checklists-example.html + + \ingroup examples + \title Listviews with Checkable Items + + This example program shows how to use listviews with different types of + checkable items. + +
+ + Header file: + + \include checklists/checklists.h + +
+ + Implementation: + + \include checklists/checklists.cpp + +
+ + Main: + + \include checklists/main.cpp +*/ + diff --git a/examples/chectdelists/chectdelists.h b/examples/chectdelists/chectdelists.h new file mode 100644 index 000000000..d2097dd18 --- /dev/null +++ b/examples/chectdelists/chectdelists.h @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for TQt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef CHECKLISTS_H +#define CHECKLISTS_H + +#include + +class TQListView; +class TQLabel; + +class CheckLists : public TQWidget +{ + TQ_OBJECT + +public: + CheckLists( TQWidget *parent = 0, const char *name = 0 ); + +protected: + TQListView *lv1, *lv2; + TQLabel *label; + +protected slots: + void copy1to2(); + void copy2to3(); + +}; + +#endif diff --git a/examples/chectdelists/chectdelists.pro b/examples/chectdelists/chectdelists.pro new file mode 100644 index 000000000..a1a6f12d8 --- /dev/null +++ b/examples/chectdelists/chectdelists.pro @@ -0,0 +1,11 @@ +TEMPLATE = app +TARGET = checklists + +CONFIG += qt warn_on release +DEPENDPATH = ../../include + +REQUIRES = large-config + +HEADERS = checklists.h +SOURCES = checklists.cpp \ + main.cpp diff --git a/examples/chectdelists/main.cpp b/examples/chectdelists/main.cpp new file mode 100644 index 000000000..65f368348 --- /dev/null +++ b/examples/chectdelists/main.cpp @@ -0,0 +1,24 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for TQt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "checklists.h" +#include + +int main( int argc, char **argv ) +{ + TQApplication a( argc, argv ); + + CheckLists checklists; + checklists.resize( 650, 350 ); + checklists.setCaption( "TQt Example - CheckLists" ); + a.setMainWidget( &checklists ); + checklists.show(); + + return a.exec(); +} -- cgit v1.2.3