From d3e87ed4a07c97c013fb5b50f91db6092cf6fe3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 29 Jan 2013 23:27:33 -0600 Subject: Rename a few build variables for overall consistency --- src/3rdparty/sqlite/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/sqlite/os.c b/src/3rdparty/sqlite/os.c index b4ae7a1..a85810f 100644 --- a/src/3rdparty/sqlite/os.c +++ b/src/3rdparty/sqlite/os.c @@ -1340,7 +1340,7 @@ int sqliteOsReadLock(OsFile *id){ ovlp.Offset = FIRST_LOCKBYTE+1; ovlp.OffsetHigh = 0; ovlp.hEvent = 0; - res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, + res = LockFileEx(id->h, LOCTDEFILE_FAIL_IMMEDIATELY, 0, N_LOCKBYTE, 0, &ovlp); }else{ res = LockFile(id->h, FIRST_LOCKBYTE+lk, 0, 1, 0); -- cgit v1.2.1 From 05d2fcdc9265d1ee8b35899e300bf1ddf90c97de Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 17:25:37 -0600 Subject: Fix FTBFS --- doc/html/checklists-example.html | 283 --------------------------------- doc/html/chectdelists-example.html | 283 +++++++++++++++++++++++++++++++++ doc/html/qchecklistitem-members.html | 120 -------------- doc/html/qchecklistitem.html | 256 ----------------------------- doc/html/qchectdelistitem-members.html | 120 ++++++++++++++ doc/html/qchectdelistitem.html | 256 +++++++++++++++++++++++++++++ doc/man/man3/qchecklistitem.3qt | 229 -------------------------- doc/man/man3/qchectdelistitem.3qt | 229 ++++++++++++++++++++++++++ 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 +++ 18 files changed, 1149 insertions(+), 1149 deletions(-) delete mode 100644 doc/html/checklists-example.html create mode 100644 doc/html/chectdelists-example.html delete mode 100644 doc/html/qchecklistitem-members.html delete mode 100644 doc/html/qchecklistitem.html create mode 100644 doc/html/qchectdelistitem-members.html create mode 100644 doc/html/qchectdelistitem.html delete mode 100644 doc/man/man3/qchecklistitem.3qt create mode 100644 doc/man/man3/qchectdelistitem.3qt 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 diff --git a/doc/html/checklists-example.html b/doc/html/checklists-example.html deleted file mode 100644 index a8f4fcf..0000000 --- a/doc/html/checklists-example.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - -Listviews with Checkable Items - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

Listviews with Checkable Items

- - -

-This example program shows how to use listviews with different types of -checkable items. -


-

Header file: -

/****************************************************************************
-** $Id: qt/checklists.h   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#ifndef CHECKLISTS_H
-#define CHECKLISTS_H
-
-#include <qwidget.h>
-
-class QListView;
-class QLabel;
-
-class CheckLists : public QWidget
-{
-    Q_OBJECT
-
-public:
-    CheckLists( QWidget *parent = 0, const char *name = 0 );
-
-protected:
-    QListView *lv1, *lv2;
-    QLabel *label;
-
-protected slots:
-    void copy1to2();
-    void copy2to3();
-
-};
-
-#endif
-
- -


-

Implementation: -

/****************************************************************************
-** $Id: qt/checklists.cpp   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#include "checklists.h"
-
-#include <qlistview.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qvaluelist.h>
-#include <qstring.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-
-/*
- * Constructor
- *
- * Create all child widgets of the CheckList Widget
- */
-
-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( "Items" );
-    lv1->setRootIsDecorated( TRUE );
-
-    // create a list with 4 ListViewItems which will be parent items of other ListViewItems
-    QValueList<QListViewItem *> parentList;
-
-    parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) );
-
-    QListViewItem *item = 0;
-    unsigned int num = 1;
-    // go through the list of parent items...
-    for ( QValueList<QListViewItem*>::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox );
-    }
-
-    // Create another widget for layouting
-    QVBoxLayout *tmp = new QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // create a pushbutton
-    QPushButton *copy1 = new QPushButton( "  ->  ", 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
-    QVBoxLayout *vbox2 = new QVBoxLayout( lay );
-    vbox2->setMargin( 5 );
-
-    // and another label
-    vbox2->addWidget( new QLabel( "Check one item!", this ) );
-
-    // create the second listview
-    lv2 = new QListView( this );
-    vbox2->addWidget( lv2 );
-    lv2->addColumn( "Items" );
-    lv2->setRootIsDecorated( TRUE );
-
-    // another widget needed for layouting only
-    tmp = new QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // create another pushbutton...
-    QPushButton *copy2 = new QPushButton( "  ->  ", 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 QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // and create a label which will be at the right of the window
-    label = new QLabel( "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
-    QListViewItemIterator 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!
-    QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() )
-                // ...insert a Radio-ListViewItem with the same text into the second ListView
-                (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton );
-
-    if ( item->firstChild() )
-        ( ( QCheckListItem* )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
-    QListViewItemIterator 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 ( ( (QCheckListItem*)it.current() )->isOn() )
-                // ...set the text of the item to the label
-                label->setText( it.current()->text( 0 ) );
-}
-
-
- -


-

Main: -

/****************************************************************************
-** $Id: qt/main.cpp   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#include "checklists.h"
-#include <qapplication.h>
-
-int main( int argc, char **argv )
-{
-    QApplication a( argc, argv );
-
-    CheckLists checklists;
-    checklists.resize( 650, 350 );
-    checklists.setCaption( "Qt Example - CheckLists" );
-    a.setMainWidget( &checklists );
-    checklists.show();
-
-    return a.exec();
-}
-
- -

See also Examples. - - -


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/html/chectdelists-example.html b/doc/html/chectdelists-example.html new file mode 100644 index 0000000..a8f4fcf --- /dev/null +++ b/doc/html/chectdelists-example.html @@ -0,0 +1,283 @@ + + + + + +Listviews with Checkable Items + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Listviews with Checkable Items

+ + +

+This example program shows how to use listviews with different types of +checkable items. +


+

Header file: +

/****************************************************************************
+** $Id: qt/checklists.h   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#ifndef CHECKLISTS_H
+#define CHECKLISTS_H
+
+#include <qwidget.h>
+
+class QListView;
+class QLabel;
+
+class CheckLists : public QWidget
+{
+    Q_OBJECT
+
+public:
+    CheckLists( QWidget *parent = 0, const char *name = 0 );
+
+protected:
+    QListView *lv1, *lv2;
+    QLabel *label;
+
+protected slots:
+    void copy1to2();
+    void copy2to3();
+
+};
+
+#endif
+
+ +


+

Implementation: +

/****************************************************************************
+** $Id: qt/checklists.cpp   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "checklists.h"
+
+#include <qlistview.h>
+#include <qvbox.h>
+#include <qlabel.h>
+#include <qvaluelist.h>
+#include <qstring.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+
+/*
+ * Constructor
+ *
+ * Create all child widgets of the CheckList Widget
+ */
+
+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( "Items" );
+    lv1->setRootIsDecorated( TRUE );
+
+    // create a list with 4 ListViewItems which will be parent items of other ListViewItems
+    QValueList<QListViewItem *> parentList;
+
+    parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) );
+
+    QListViewItem *item = 0;
+    unsigned int num = 1;
+    // go through the list of parent items...
+    for ( QValueList<QListViewItem*>::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox );
+    }
+
+    // Create another widget for layouting
+    QVBoxLayout *tmp = new QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // create a pushbutton
+    QPushButton *copy1 = new QPushButton( "  ->  ", 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
+    QVBoxLayout *vbox2 = new QVBoxLayout( lay );
+    vbox2->setMargin( 5 );
+
+    // and another label
+    vbox2->addWidget( new QLabel( "Check one item!", this ) );
+
+    // create the second listview
+    lv2 = new QListView( this );
+    vbox2->addWidget( lv2 );
+    lv2->addColumn( "Items" );
+    lv2->setRootIsDecorated( TRUE );
+
+    // another widget needed for layouting only
+    tmp = new QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // create another pushbutton...
+    QPushButton *copy2 = new QPushButton( "  ->  ", 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 QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // and create a label which will be at the right of the window
+    label = new QLabel( "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
+    QListViewItemIterator 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!
+    QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() )
+                // ...insert a Radio-ListViewItem with the same text into the second ListView
+                (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton );
+
+    if ( item->firstChild() )
+        ( ( QCheckListItem* )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
+    QListViewItemIterator 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 ( ( (QCheckListItem*)it.current() )->isOn() )
+                // ...set the text of the item to the label
+                label->setText( it.current()->text( 0 ) );
+}
+
+
+ +


+

Main: +

/****************************************************************************
+** $Id: qt/main.cpp   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "checklists.h"
+#include <qapplication.h>
+
+int main( int argc, char **argv )
+{
+    QApplication a( argc, argv );
+
+    CheckLists checklists;
+    checklists.resize( 650, 350 );
+    checklists.setCaption( "Qt Example - CheckLists" );
+    a.setMainWidget( &checklists );
+    checklists.show();
+
+    return a.exec();
+}
+
+ +

See also Examples. + + +


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/html/qchecklistitem-members.html b/doc/html/qchecklistitem-members.html deleted file mode 100644 index b2c739a..0000000 --- a/doc/html/qchecklistitem-members.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -QCheckListItem Member List - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

Complete Member List for QCheckListItem

- -

This is the complete list of member functions for -QCheckListItem, including inherited members. - -

- -


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/html/qchecklistitem.html b/doc/html/qchecklistitem.html deleted file mode 100644 index e00e24e..0000000 --- a/doc/html/qchecklistitem.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - -QCheckListItem Class - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

QCheckListItem Class Reference

- -

The QCheckListItem class provides checkable list view items. -More... -

#include <qlistview.h> -

Inherits QListViewItem. -

List of all member functions. -

Public Members

- -

Protected Members

- -

Detailed Description

- - -The QCheckListItem class provides checkable list view items. -

-

QCheckListItems are used in QListViews to provide -QListViewItems that are checkboxes, radio buttons or -controllers. -

Checkbox and controller check list items may be inserted at any -level in a list view. Radio button check list items must be -children of a controller check list item. -

The item can be checked or unchecked with setOn(). Its type can be -retrieved with type() and its text retrieved with text(). -

List View Items
-

See also QListViewItem, QListView, and Advanced Widgets. - -


Member Type Documentation

-

QCheckListItem::ToggleState

- -

This enum specifies a QCheckListItem's toggle state. -

-

QCheckListItem::Type

- -

This enum type specifies a QCheckListItem's type: -

-

Member Function Documentation

-

QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that a RadioButton must be the child of a -RadioButtonController, otherwise it will not toggle. - -

QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, and with text text -and of type tt. Note that a RadioButton must be the child of -a RadioButtonController, otherwise it will not toggle. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, with text text and -of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that tt must not be RadioButton. -Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, with text text and -of type tt. Note that tt must not be RadioButton. -Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p ) -

-Constructs a RadioButtonController item with parent parent, -text text and pixmap p. - -

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p ) -

-Constructs a RadioButtonController item with parent parent, -text text and pixmap p. - -

QCheckListItem::~QCheckListItem () -

-Destroys the item, and all its children to any depth, freeing up -all allocated resources. - -

void QCheckListItem::activate () [virtual protected] -

-Toggle check box or set radio button to on. - -

Reimplemented from QListViewItem. -

bool QCheckListItem::isOn () const -

- -

Returns TRUE if the item is toggled on; otherwise returns FALSE. - -

bool QCheckListItem::isTristate () const -

-Returns TRUE if the item is tristate; otherwise returns FALSE. -

See also setTristate(). - -

void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) [virtual] -

-Paints the item using the painter p and the color group cg. -The item is in column column, has width width and has -alignment align. (See Qt::AlignmentFlags for valid alignments.) - -

Reimplemented from QListViewItem. -

void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ) [virtual] -

-Draws the focus rectangle r using the color group cg on the -painter p. - -

Reimplemented from QListViewItem. -

int QCheckListItem::rtti () const [virtual] -

- -

Returns 1. -

Make your derived classes return their own values for rtti(), and -you can distinguish between list view items. You should use values -greater than 1000, to allow for extensions to this class. - -

Reimplemented from QListViewItem. -

void QCheckListItem::setOn ( bool b ) [virtual] -

-Sets the button on if b is TRUE, otherwise sets it off. -Maintains radio button exclusivity. - -

void QCheckListItem::setState ( ToggleState s ) -

-Sets the toggle state of the checklistitem to s. s can be -Off, NoChange or On. -

Tristate can only be enabled for CheckBox or CheckBoxController, -therefore the NoChange only applies to them. -

Setting the state to On or Off on a CheckBoxController -will recursivly set the states of its children to the same state. -

Setting the state to NoChange on a CheckBoxController will -make it recursivly recall the previous stored state of its -children. If there was no previous stored state the children are -all set to On. - -

void QCheckListItem::setTristate ( bool b ) -

-Sets tristate to b if the Type is either a CheckBoxController or -a CheckBox. -

CheckBoxControllers are tristate by default. -

See also state() and isTristate(). - -

ToggleState QCheckListItem::state () const -

-Returns the state of the item. -

See also QCheckListItem::ToggleState. - -

void QCheckListItem::stateChange ( bool ) [virtual protected] -

-This virtual function is called when the item changes its state. -NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so -use state() to determine if the state is actually Off or NoChange. - -

QString QCheckListItem::text () const -

- -

Returns the item's text. - -

void QCheckListItem::turnOffChild () [protected] -

-If this is a RadioButtonController that has RadioButton -children, turn off the child that is on. - -

Type QCheckListItem::type () const -

- -

Returns the type of this item. - - -


-This file is part of the Qt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/html/qchectdelistitem-members.html b/doc/html/qchectdelistitem-members.html new file mode 100644 index 0000000..b2c739a --- /dev/null +++ b/doc/html/qchectdelistitem-members.html @@ -0,0 +1,120 @@ + + + + + +QCheckListItem Member List + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Complete Member List for QCheckListItem

+ +

This is the complete list of member functions for +QCheckListItem, including inherited members. + +

+ +


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/html/qchectdelistitem.html b/doc/html/qchectdelistitem.html new file mode 100644 index 0000000..e00e24e --- /dev/null +++ b/doc/html/qchectdelistitem.html @@ -0,0 +1,256 @@ + + + + + +QCheckListItem Class + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

QCheckListItem Class Reference

+ +

The QCheckListItem class provides checkable list view items. +More... +

#include <qlistview.h> +

Inherits QListViewItem. +

List of all member functions. +

Public Members

+ +

Protected Members

+ +

Detailed Description

+ + +The QCheckListItem class provides checkable list view items. +

+

QCheckListItems are used in QListViews to provide +QListViewItems that are checkboxes, radio buttons or +controllers. +

Checkbox and controller check list items may be inserted at any +level in a list view. Radio button check list items must be +children of a controller check list item. +

The item can be checked or unchecked with setOn(). Its type can be +retrieved with type() and its text retrieved with text(). +

List View Items
+

See also QListViewItem, QListView, and Advanced Widgets. + +


Member Type Documentation

+

QCheckListItem::ToggleState

+ +

This enum specifies a QCheckListItem's toggle state. +

+

QCheckListItem::Type

+ +

This enum type specifies a QCheckListItem's type: +

+

Member Function Documentation

+

QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that a RadioButton must be the child of a +RadioButtonController, otherwise it will not toggle. + +

QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, and with text text +and of type tt. Note that a RadioButton must be the child of +a RadioButtonController, otherwise it will not toggle. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, with text text and +of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that tt must not be RadioButton. +Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, with text text and +of type tt. Note that tt must not be RadioButton. +Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p ) +

+Constructs a RadioButtonController item with parent parent, +text text and pixmap p. + +

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p ) +

+Constructs a RadioButtonController item with parent parent, +text text and pixmap p. + +

QCheckListItem::~QCheckListItem () +

+Destroys the item, and all its children to any depth, freeing up +all allocated resources. + +

void QCheckListItem::activate () [virtual protected] +

+Toggle check box or set radio button to on. + +

Reimplemented from QListViewItem. +

bool QCheckListItem::isOn () const +

+ +

Returns TRUE if the item is toggled on; otherwise returns FALSE. + +

bool QCheckListItem::isTristate () const +

+Returns TRUE if the item is tristate; otherwise returns FALSE. +

See also setTristate(). + +

void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) [virtual] +

+Paints the item using the painter p and the color group cg. +The item is in column column, has width width and has +alignment align. (See Qt::AlignmentFlags for valid alignments.) + +

Reimplemented from QListViewItem. +

void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ) [virtual] +

+Draws the focus rectangle r using the color group cg on the +painter p. + +

Reimplemented from QListViewItem. +

int QCheckListItem::rtti () const [virtual] +

+ +

Returns 1. +

Make your derived classes return their own values for rtti(), and +you can distinguish between list view items. You should use values +greater than 1000, to allow for extensions to this class. + +

Reimplemented from QListViewItem. +

void QCheckListItem::setOn ( bool b ) [virtual] +

+Sets the button on if b is TRUE, otherwise sets it off. +Maintains radio button exclusivity. + +

void QCheckListItem::setState ( ToggleState s ) +

+Sets the toggle state of the checklistitem to s. s can be +Off, NoChange or On. +

Tristate can only be enabled for CheckBox or CheckBoxController, +therefore the NoChange only applies to them. +

Setting the state to On or Off on a CheckBoxController +will recursivly set the states of its children to the same state. +

Setting the state to NoChange on a CheckBoxController will +make it recursivly recall the previous stored state of its +children. If there was no previous stored state the children are +all set to On. + +

void QCheckListItem::setTristate ( bool b ) +

+Sets tristate to b if the Type is either a CheckBoxController or +a CheckBox. +

CheckBoxControllers are tristate by default. +

See also state() and isTristate(). + +

ToggleState QCheckListItem::state () const +

+Returns the state of the item. +

See also QCheckListItem::ToggleState. + +

void QCheckListItem::stateChange ( bool ) [virtual protected] +

+This virtual function is called when the item changes its state. +NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so +use state() to determine if the state is actually Off or NoChange. + +

QString QCheckListItem::text () const +

+ +

Returns the item's text. + +

void QCheckListItem::turnOffChild () [protected] +

+If this is a RadioButtonController that has RadioButton +children, turn off the child that is on. + +

Type QCheckListItem::type () const +

+ +

Returns the type of this item. + + +


+This file is part of the Qt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/man/man3/qchecklistitem.3qt b/doc/man/man3/qchecklistitem.3qt deleted file mode 100644 index af09734..0000000 --- a/doc/man/man3/qchecklistitem.3qt +++ /dev/null @@ -1,229 +0,0 @@ -'\" t -.TH QCheckListItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- -.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the -.\" license file included in the distribution for a complete license -.\" statement. -.\" -.ad l -.nh -.SH NAME -QCheckListItem \- Checkable list view items -.SH SYNOPSIS -\fC#include \fR -.PP -Inherits QListViewItem. -.PP -.SS "Public Members" -.in +1c -.ti -1c -.BI "enum \fBType\fR { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }" -.br -.ti -1c -.BI "enum \fBToggleState\fR { Off, NoChange, On }" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, const QPixmap & p )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, const QPixmap & p )" -.br -.ti -1c -.BI "\fB~QCheckListItem\fR ()" -.br -.ti -1c -.BI "virtual void \fBpaintCell\fR ( QPainter * p, const QColorGroup & cg, int column, int width, int align )" -.br -.ti -1c -.BI "virtual void \fBpaintFocus\fR ( QPainter * p, const QColorGroup & cg, const QRect & r )" -.br -.ti -1c -.BI "virtual void \fBsetOn\fR ( bool b )" -.br -.ti -1c -.BI "bool \fBisOn\fR () const" -.br -.ti -1c -.BI "Type \fBtype\fR () const" -.br -.ti -1c -.BI "QString \fBtext\fR () const" -.br -.ti -1c -.BI "void \fBsetTristate\fR ( bool b )" -.br -.ti -1c -.BI "bool \fBisTristate\fR () const" -.br -.ti -1c -.BI "ToggleState \fBstate\fR () const" -.br -.ti -1c -.BI "void \fBsetState\fR ( ToggleState s )" -.br -.ti -1c -.BI "virtual int \fBrtti\fR () const" -.br -.in -1c -.SS "Protected Members" -.in +1c -.ti -1c -.BI "virtual void \fBactivate\fR ()" -.br -.ti -1c -.BI "void \fBturnOffChild\fR ()" -.br -.ti -1c -.BI "virtual void \fBstateChange\fR ( bool )" -.br -.in -1c -.SH DESCRIPTION -The QCheckListItem class provides checkable list view items. -.PP -QCheckListItems are used in QListViews to provide QListViewItems that are checkboxes, radio buttons or controllers. -.PP -Checkbox and controller check list items may be inserted at any level in a list view. Radio button check list items must be children of a controller check list item. -.PP -The item can be checked or unchecked with setOn(). Its type can be retrieved with type() and its text retrieved with text(). -.PP -
-.ce 1 -.B "[Image Omitted]" -.PP -
-.PP -See also QListViewItem, QListView, and Advanced Widgets. -.SS "Member Type Documentation" -.SH "QCheckListItem::ToggleState" -This enum specifies a QCheckListItem's toggle state. -.TP -\fCQCheckListItem::Off\fR -.TP -\fCQCheckListItem::NoChange\fR -.TP -\fCQCheckListItem::On\fR -.SH "QCheckListItem::Type" -This enum type specifies a QCheckListItem's type: -.TP -\fCQCheckListItem::RadioButton\fR -.TP -\fCQCheckListItem::CheckBox\fR -.TP -\fCQCheckListItem::Controller\fR - \fIobsolete\fR (use RadioButtonController instead) -.TP -\fCQCheckListItem::RadioButtonController\fR -.TP -\fCQCheckListItem::CheckBoxController\fR -.SH MEMBER FUNCTION DOCUMENTATION -.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. -.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, and with text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )" -Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )" -Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. -.SH "QCheckListItem::~QCheckListItem ()" -Destroys the item, and all its children to any depth, freeing up all allocated resources. -.SH "void QCheckListItem::activate ()\fC [virtual protected]\fR" -Toggle check box or set radio button to on. -.PP -Reimplemented from QListViewItem. -.SH "bool QCheckListItem::isOn () const" -Returns TRUE if the item is toggled on; otherwise returns FALSE. -.SH "bool QCheckListItem::isTristate () const" -Returns TRUE if the item is tristate; otherwise returns FALSE. -.PP -See also setTristate(). -.SH "void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )\fC [virtual]\fR" -Paints the item using the painter \fIp\fR and the color group \fIcg\fR. The item is in column \fIcolumn\fR, has width \fIwidth\fR and has alignment \fIalign\fR. (See Qt::AlignmentFlags for valid alignments.) -.PP -Reimplemented from QListViewItem. -.SH "void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )\fC [virtual]\fR" -Draws the focus rectangle \fIr\fR using the color group \fIcg\fR on the painter \fIp\fR. -.PP -Reimplemented from QListViewItem. -.SH "int QCheckListItem::rtti () const\fC [virtual]\fR" -Returns 1. -.PP -Make your derived classes return their own values for rtti(), and you can distinguish between list view items. You should use values greater than 1000, to allow for extensions to this class. -.PP -Reimplemented from QListViewItem. -.SH "void QCheckListItem::setOn ( bool b )\fC [virtual]\fR" -Sets the button on if \fIb\fR is TRUE, otherwise sets it off. Maintains radio button exclusivity. -.SH "void QCheckListItem::setState ( ToggleState s )" -Sets the toggle state of the checklistitem to \fIs\fR. \fIs\fR can be Off, NoChange or On. -.PP -Tristate can only be enabled for CheckBox or CheckBoxController, therefore the NoChange only applies to them. -.PP -Setting the state to On or Off on a CheckBoxController will recursivly set the states of its children to the same state. -.PP -Setting the state to NoChange on a CheckBoxController will make it recursivly recall the previous stored state of its children. If there was no previous stored state the children are all set to On. -.SH "void QCheckListItem::setTristate ( bool b )" -Sets tristate to \fIb\fR if the Type is either a CheckBoxController or a CheckBox. -.PP -\fCCheckBoxControllers\fR are tristate by default. -.PP -See also state() and isTristate(). -.SH "ToggleState QCheckListItem::state () const" -Returns the state of the item. -.PP -See also QCheckListItem::ToggleState. -.SH "void QCheckListItem::stateChange ( bool )\fC [virtual protected]\fR" -This virtual function is called when the item changes its state. NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so use state() to determine if the state is actually Off or NoChange. -.SH "QString QCheckListItem::text () const" -Returns the item's text. -.SH "void QCheckListItem::turnOffChild ()\fC [protected]\fR" -If this is a RadioButtonController that has RadioButton children, turn off the child that is on. -.SH "Type QCheckListItem::type () const" -Returns the type of this item. - -.SH "SEE ALSO" -.BR http://doc.trolltech.com/qchecklistitem.html -.BR http://www.trolltech.com/faq/tech.html -.SH COPYRIGHT -Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the -license file included in the distribution for a complete license -statement. -.SH AUTHOR -Generated automatically from the source code. -.SH BUGS -If you find a bug in Qt, please report it as described in -.BR http://doc.trolltech.com/bughowto.html . -Good bug reports help us to help you. Thank you. -.P -The definitive Qt documentation is provided in HTML format; it is -located at $QTDIR/doc/html and can be read using Qt Assistant or with -a web browser. This man page is provided as a convenience for those -users who prefer man pages, although this format is not officially -supported by Trolltech. -.P -If you find errors in this manual page, please report them to -.BR qt-bugs@trolltech.com . -Please include the name of the manual page (qchecklistitem.3qt) and the Qt -version (3.3.8). diff --git a/doc/man/man3/qchectdelistitem.3qt b/doc/man/man3/qchectdelistitem.3qt new file mode 100644 index 0000000..af09734 --- /dev/null +++ b/doc/man/man3/qchectdelistitem.3qt @@ -0,0 +1,229 @@ +'\" t +.TH QCheckListItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the +.\" license file included in the distribution for a complete license +.\" statement. +.\" +.ad l +.nh +.SH NAME +QCheckListItem \- Checkable list view items +.SH SYNOPSIS +\fC#include \fR +.PP +Inherits QListViewItem. +.PP +.SS "Public Members" +.in +1c +.ti -1c +.BI "enum \fBType\fR { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }" +.br +.ti -1c +.BI "enum \fBToggleState\fR { Off, NoChange, On }" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, const QPixmap & p )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, const QPixmap & p )" +.br +.ti -1c +.BI "\fB~QCheckListItem\fR ()" +.br +.ti -1c +.BI "virtual void \fBpaintCell\fR ( QPainter * p, const QColorGroup & cg, int column, int width, int align )" +.br +.ti -1c +.BI "virtual void \fBpaintFocus\fR ( QPainter * p, const QColorGroup & cg, const QRect & r )" +.br +.ti -1c +.BI "virtual void \fBsetOn\fR ( bool b )" +.br +.ti -1c +.BI "bool \fBisOn\fR () const" +.br +.ti -1c +.BI "Type \fBtype\fR () const" +.br +.ti -1c +.BI "QString \fBtext\fR () const" +.br +.ti -1c +.BI "void \fBsetTristate\fR ( bool b )" +.br +.ti -1c +.BI "bool \fBisTristate\fR () const" +.br +.ti -1c +.BI "ToggleState \fBstate\fR () const" +.br +.ti -1c +.BI "void \fBsetState\fR ( ToggleState s )" +.br +.ti -1c +.BI "virtual int \fBrtti\fR () const" +.br +.in -1c +.SS "Protected Members" +.in +1c +.ti -1c +.BI "virtual void \fBactivate\fR ()" +.br +.ti -1c +.BI "void \fBturnOffChild\fR ()" +.br +.ti -1c +.BI "virtual void \fBstateChange\fR ( bool )" +.br +.in -1c +.SH DESCRIPTION +The QCheckListItem class provides checkable list view items. +.PP +QCheckListItems are used in QListViews to provide QListViewItems that are checkboxes, radio buttons or controllers. +.PP +Checkbox and controller check list items may be inserted at any level in a list view. Radio button check list items must be children of a controller check list item. +.PP +The item can be checked or unchecked with setOn(). Its type can be retrieved with type() and its text retrieved with text(). +.PP +
+.ce 1 +.B "[Image Omitted]" +.PP +
+.PP +See also QListViewItem, QListView, and Advanced Widgets. +.SS "Member Type Documentation" +.SH "QCheckListItem::ToggleState" +This enum specifies a QCheckListItem's toggle state. +.TP +\fCQCheckListItem::Off\fR +.TP +\fCQCheckListItem::NoChange\fR +.TP +\fCQCheckListItem::On\fR +.SH "QCheckListItem::Type" +This enum type specifies a QCheckListItem's type: +.TP +\fCQCheckListItem::RadioButton\fR +.TP +\fCQCheckListItem::CheckBox\fR +.TP +\fCQCheckListItem::Controller\fR - \fIobsolete\fR (use RadioButtonController instead) +.TP +\fCQCheckListItem::RadioButtonController\fR +.TP +\fCQCheckListItem::CheckBoxController\fR +.SH MEMBER FUNCTION DOCUMENTATION +.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. +.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, and with text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )" +Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )" +Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. +.SH "QCheckListItem::~QCheckListItem ()" +Destroys the item, and all its children to any depth, freeing up all allocated resources. +.SH "void QCheckListItem::activate ()\fC [virtual protected]\fR" +Toggle check box or set radio button to on. +.PP +Reimplemented from QListViewItem. +.SH "bool QCheckListItem::isOn () const" +Returns TRUE if the item is toggled on; otherwise returns FALSE. +.SH "bool QCheckListItem::isTristate () const" +Returns TRUE if the item is tristate; otherwise returns FALSE. +.PP +See also setTristate(). +.SH "void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )\fC [virtual]\fR" +Paints the item using the painter \fIp\fR and the color group \fIcg\fR. The item is in column \fIcolumn\fR, has width \fIwidth\fR and has alignment \fIalign\fR. (See Qt::AlignmentFlags for valid alignments.) +.PP +Reimplemented from QListViewItem. +.SH "void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )\fC [virtual]\fR" +Draws the focus rectangle \fIr\fR using the color group \fIcg\fR on the painter \fIp\fR. +.PP +Reimplemented from QListViewItem. +.SH "int QCheckListItem::rtti () const\fC [virtual]\fR" +Returns 1. +.PP +Make your derived classes return their own values for rtti(), and you can distinguish between list view items. You should use values greater than 1000, to allow for extensions to this class. +.PP +Reimplemented from QListViewItem. +.SH "void QCheckListItem::setOn ( bool b )\fC [virtual]\fR" +Sets the button on if \fIb\fR is TRUE, otherwise sets it off. Maintains radio button exclusivity. +.SH "void QCheckListItem::setState ( ToggleState s )" +Sets the toggle state of the checklistitem to \fIs\fR. \fIs\fR can be Off, NoChange or On. +.PP +Tristate can only be enabled for CheckBox or CheckBoxController, therefore the NoChange only applies to them. +.PP +Setting the state to On or Off on a CheckBoxController will recursivly set the states of its children to the same state. +.PP +Setting the state to NoChange on a CheckBoxController will make it recursivly recall the previous stored state of its children. If there was no previous stored state the children are all set to On. +.SH "void QCheckListItem::setTristate ( bool b )" +Sets tristate to \fIb\fR if the Type is either a CheckBoxController or a CheckBox. +.PP +\fCCheckBoxControllers\fR are tristate by default. +.PP +See also state() and isTristate(). +.SH "ToggleState QCheckListItem::state () const" +Returns the state of the item. +.PP +See also QCheckListItem::ToggleState. +.SH "void QCheckListItem::stateChange ( bool )\fC [virtual protected]\fR" +This virtual function is called when the item changes its state. NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so use state() to determine if the state is actually Off or NoChange. +.SH "QString QCheckListItem::text () const" +Returns the item's text. +.SH "void QCheckListItem::turnOffChild ()\fC [protected]\fR" +If this is a RadioButtonController that has RadioButton children, turn off the child that is on. +.SH "Type QCheckListItem::type () const" +Returns the type of this item. + +.SH "SEE ALSO" +.BR http://doc.trolltech.com/qchecklistitem.html +.BR http://www.trolltech.com/faq/tech.html +.SH COPYRIGHT +Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the +license file included in the distribution for a complete license +statement. +.SH AUTHOR +Generated automatically from the source code. +.SH BUGS +If you find a bug in Qt, please report it as described in +.BR http://doc.trolltech.com/bughowto.html . +Good bug reports help us to help you. Thank you. +.P +The definitive Qt documentation is provided in HTML format; it is +located at $QTDIR/doc/html and can be read using Qt Assistant or with +a web browser. This man page is provided as a convenience for those +users who prefer man pages, although this format is not officially +supported by Trolltech. +.P +If you find errors in this manual page, please report them to +.BR qt-bugs@trolltech.com . +Please include the name of the manual page (qchecklistitem.3qt) and the Qt +version (3.3.8). diff --git a/examples/checklists/checklists.cpp b/examples/checklists/checklists.cpp deleted file mode 100644 index fd17d09..0000000 --- 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 Qt. 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( 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( "Items" ); - lv1->setRootIsDecorated( TRUE ); - - // create a list with 4 ListViewItems which will be parent items of other ListViewItems - QValueList parentList; - - parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) ); - - QListViewItem *item = 0; - unsigned int num = 1; - // go through the list of parent items... - for ( QValueList::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox ); - } - - // Create another widget for layouting - QVBoxLayout *tmp = new QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create a pushbutton - QPushButton *copy1 = new QPushButton( " -> ", 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 - QVBoxLayout *vbox2 = new QVBoxLayout( lay ); - vbox2->setMargin( 5 ); - - // and another label - vbox2->addWidget( new QLabel( "Check one item!", this ) ); - - // create the second listview - lv2 = new QListView( this ); - vbox2->addWidget( lv2 ); - lv2->addColumn( "Items" ); - lv2->setRootIsDecorated( TRUE ); - - // another widget needed for layouting only - tmp = new QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create another pushbutton... - QPushButton *copy2 = new QPushButton( " -> ", 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 QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // and create a label which will be at the right of the window - label = new QLabel( "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 - QListViewItemIterator 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! - QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() ) - // ...insert a Radio-ListViewItem with the same text into the second ListView - (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton ); - - if ( item->firstChild() ) - ( ( QCheckListItem* )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 - QListViewItemIterator 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 ( ( (QCheckListItem*)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 417afe6..0000000 --- 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 e6cdd1d..0000000 --- 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 Qt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#ifndef CHECKLISTS_H -#define CHECKLISTS_H - -#include - -class QListView; -class QLabel; - -class CheckLists : public QWidget -{ - Q_OBJECT - -public: - CheckLists( QWidget *parent = 0, const char *name = 0 ); - -protected: - QListView *lv1, *lv2; - QLabel *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 a1a6f12..0000000 --- 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 2aa2559..0000000 --- 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 Qt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include "checklists.h" -#include - -int main( int argc, char **argv ) -{ - QApplication a( argc, argv ); - - CheckLists checklists; - checklists.resize( 650, 350 ); - checklists.setCaption( "Qt 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 0000000..fd17d09 --- /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 Qt. 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( 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( "Items" ); + lv1->setRootIsDecorated( TRUE ); + + // create a list with 4 ListViewItems which will be parent items of other ListViewItems + QValueList parentList; + + parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) ); + + QListViewItem *item = 0; + unsigned int num = 1; + // go through the list of parent items... + for ( QValueList::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox ); + } + + // Create another widget for layouting + QVBoxLayout *tmp = new QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create a pushbutton + QPushButton *copy1 = new QPushButton( " -> ", 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 + QVBoxLayout *vbox2 = new QVBoxLayout( lay ); + vbox2->setMargin( 5 ); + + // and another label + vbox2->addWidget( new QLabel( "Check one item!", this ) ); + + // create the second listview + lv2 = new QListView( this ); + vbox2->addWidget( lv2 ); + lv2->addColumn( "Items" ); + lv2->setRootIsDecorated( TRUE ); + + // another widget needed for layouting only + tmp = new QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create another pushbutton... + QPushButton *copy2 = new QPushButton( " -> ", 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 QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // and create a label which will be at the right of the window + label = new QLabel( "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 + QListViewItemIterator 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! + QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() ) + // ...insert a Radio-ListViewItem with the same text into the second ListView + (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton ); + + if ( item->firstChild() ) + ( ( QCheckListItem* )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 + QListViewItemIterator 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 ( ( (QCheckListItem*)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 0000000..417afe6 --- /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 0000000..e6cdd1d --- /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 Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef CHECKLISTS_H +#define CHECKLISTS_H + +#include + +class QListView; +class QLabel; + +class CheckLists : public QWidget +{ + Q_OBJECT + +public: + CheckLists( QWidget *parent = 0, const char *name = 0 ); + +protected: + QListView *lv1, *lv2; + QLabel *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 0000000..a1a6f12 --- /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 0000000..2aa2559 --- /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 Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "checklists.h" +#include + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + + CheckLists checklists; + checklists.resize( 650, 350 ); + checklists.setCaption( "Qt Example - CheckLists" ); + a.setMainWidget( &checklists ); + checklists.show(); + + return a.exec(); +} -- cgit v1.2.1 From 4b9e514d7c18cdaa3e07347245b27d47825196c5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 17:32:43 -0600 Subject: Fix prior commit --- doc/html/checklists-example.html | 283 +++++++++++++++++++++++++++++++++ doc/html/chectdelists-example.html | 283 --------------------------------- doc/html/qchecklistitem-members.html | 120 ++++++++++++++ doc/html/qchecklistitem.html | 256 +++++++++++++++++++++++++++++ doc/html/qchectdelistitem-members.html | 120 -------------- doc/html/qchectdelistitem.html | 256 ----------------------------- doc/man/man3/qchecklistitem.3qt | 229 ++++++++++++++++++++++++++ doc/man/man3/qchectdelistitem.3qt | 229 -------------------------- 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 --- 18 files changed, 1149 insertions(+), 1149 deletions(-) create mode 100644 doc/html/checklists-example.html delete mode 100644 doc/html/chectdelists-example.html create mode 100644 doc/html/qchecklistitem-members.html create mode 100644 doc/html/qchecklistitem.html delete mode 100644 doc/html/qchectdelistitem-members.html delete mode 100644 doc/html/qchectdelistitem.html create mode 100644 doc/man/man3/qchecklistitem.3qt delete mode 100644 doc/man/man3/qchectdelistitem.3qt create mode 100644 examples/checklists/checklists.cpp create mode 100644 examples/checklists/checklists.doc create mode 100644 examples/checklists/checklists.h create mode 100644 examples/checklists/checklists.pro create mode 100644 examples/checklists/main.cpp delete mode 100644 examples/chectdelists/chectdelists.cpp delete mode 100644 examples/chectdelists/chectdelists.doc delete mode 100644 examples/chectdelists/chectdelists.h delete mode 100644 examples/chectdelists/chectdelists.pro delete mode 100644 examples/chectdelists/main.cpp diff --git a/doc/html/checklists-example.html b/doc/html/checklists-example.html new file mode 100644 index 0000000..a8f4fcf --- /dev/null +++ b/doc/html/checklists-example.html @@ -0,0 +1,283 @@ + + + + + +Listviews with Checkable Items + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Listviews with Checkable Items

+ + +

+This example program shows how to use listviews with different types of +checkable items. +


+

Header file: +

/****************************************************************************
+** $Id: qt/checklists.h   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#ifndef CHECKLISTS_H
+#define CHECKLISTS_H
+
+#include <qwidget.h>
+
+class QListView;
+class QLabel;
+
+class CheckLists : public QWidget
+{
+    Q_OBJECT
+
+public:
+    CheckLists( QWidget *parent = 0, const char *name = 0 );
+
+protected:
+    QListView *lv1, *lv2;
+    QLabel *label;
+
+protected slots:
+    void copy1to2();
+    void copy2to3();
+
+};
+
+#endif
+
+ +


+

Implementation: +

/****************************************************************************
+** $Id: qt/checklists.cpp   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "checklists.h"
+
+#include <qlistview.h>
+#include <qvbox.h>
+#include <qlabel.h>
+#include <qvaluelist.h>
+#include <qstring.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+
+/*
+ * Constructor
+ *
+ * Create all child widgets of the CheckList Widget
+ */
+
+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( "Items" );
+    lv1->setRootIsDecorated( TRUE );
+
+    // create a list with 4 ListViewItems which will be parent items of other ListViewItems
+    QValueList<QListViewItem *> parentList;
+
+    parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) );
+    parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) );
+
+    QListViewItem *item = 0;
+    unsigned int num = 1;
+    // go through the list of parent items...
+    for ( QValueList<QListViewItem*>::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox );
+    }
+
+    // Create another widget for layouting
+    QVBoxLayout *tmp = new QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // create a pushbutton
+    QPushButton *copy1 = new QPushButton( "  ->  ", 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
+    QVBoxLayout *vbox2 = new QVBoxLayout( lay );
+    vbox2->setMargin( 5 );
+
+    // and another label
+    vbox2->addWidget( new QLabel( "Check one item!", this ) );
+
+    // create the second listview
+    lv2 = new QListView( this );
+    vbox2->addWidget( lv2 );
+    lv2->addColumn( "Items" );
+    lv2->setRootIsDecorated( TRUE );
+
+    // another widget needed for layouting only
+    tmp = new QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // create another pushbutton...
+    QPushButton *copy2 = new QPushButton( "  ->  ", 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 QVBoxLayout( lay );
+    tmp->setMargin( 5 );
+
+    // and create a label which will be at the right of the window
+    label = new QLabel( "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
+    QListViewItemIterator 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!
+    QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() )
+                // ...insert a Radio-ListViewItem with the same text into the second ListView
+                (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton );
+
+    if ( item->firstChild() )
+        ( ( QCheckListItem* )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
+    QListViewItemIterator 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 ( ( (QCheckListItem*)it.current() )->isOn() )
+                // ...set the text of the item to the label
+                label->setText( it.current()->text( 0 ) );
+}
+
+
+ +


+

Main: +

/****************************************************************************
+** $Id: qt/main.cpp   3.3.8   edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
+**
+** This file is part of an example program for Qt.  This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "checklists.h"
+#include <qapplication.h>
+
+int main( int argc, char **argv )
+{
+    QApplication a( argc, argv );
+
+    CheckLists checklists;
+    checklists.resize( 650, 350 );
+    checklists.setCaption( "Qt Example - CheckLists" );
+    a.setMainWidget( &checklists );
+    checklists.show();
+
+    return a.exec();
+}
+
+ +

See also Examples. + + +


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/html/chectdelists-example.html b/doc/html/chectdelists-example.html deleted file mode 100644 index a8f4fcf..0000000 --- a/doc/html/chectdelists-example.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - -Listviews with Checkable Items - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

Listviews with Checkable Items

- - -

-This example program shows how to use listviews with different types of -checkable items. -


-

Header file: -

/****************************************************************************
-** $Id: qt/checklists.h   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#ifndef CHECKLISTS_H
-#define CHECKLISTS_H
-
-#include <qwidget.h>
-
-class QListView;
-class QLabel;
-
-class CheckLists : public QWidget
-{
-    Q_OBJECT
-
-public:
-    CheckLists( QWidget *parent = 0, const char *name = 0 );
-
-protected:
-    QListView *lv1, *lv2;
-    QLabel *label;
-
-protected slots:
-    void copy1to2();
-    void copy2to3();
-
-};
-
-#endif
-
- -


-

Implementation: -

/****************************************************************************
-** $Id: qt/checklists.cpp   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#include "checklists.h"
-
-#include <qlistview.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qvaluelist.h>
-#include <qstring.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-
-/*
- * Constructor
- *
- * Create all child widgets of the CheckList Widget
- */
-
-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( "Items" );
-    lv1->setRootIsDecorated( TRUE );
-
-    // create a list with 4 ListViewItems which will be parent items of other ListViewItems
-    QValueList<QListViewItem *> parentList;
-
-    parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) );
-    parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) );
-
-    QListViewItem *item = 0;
-    unsigned int num = 1;
-    // go through the list of parent items...
-    for ( QValueList<QListViewItem*>::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox );
-    }
-
-    // Create another widget for layouting
-    QVBoxLayout *tmp = new QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // create a pushbutton
-    QPushButton *copy1 = new QPushButton( "  ->  ", 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
-    QVBoxLayout *vbox2 = new QVBoxLayout( lay );
-    vbox2->setMargin( 5 );
-
-    // and another label
-    vbox2->addWidget( new QLabel( "Check one item!", this ) );
-
-    // create the second listview
-    lv2 = new QListView( this );
-    vbox2->addWidget( lv2 );
-    lv2->addColumn( "Items" );
-    lv2->setRootIsDecorated( TRUE );
-
-    // another widget needed for layouting only
-    tmp = new QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // create another pushbutton...
-    QPushButton *copy2 = new QPushButton( "  ->  ", 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 QVBoxLayout( lay );
-    tmp->setMargin( 5 );
-
-    // and create a label which will be at the right of the window
-    label = new QLabel( "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
-    QListViewItemIterator 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!
-    QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() )
-                // ...insert a Radio-ListViewItem with the same text into the second ListView
-                (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton );
-
-    if ( item->firstChild() )
-        ( ( QCheckListItem* )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
-    QListViewItemIterator 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 ( ( (QCheckListItem*)it.current() )->isOn() )
-                // ...set the text of the item to the label
-                label->setText( it.current()->text( 0 ) );
-}
-
-
- -


-

Main: -

/****************************************************************************
-** $Id: qt/main.cpp   3.3.8   edited Jan 11 14:37 $
-**
-** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
-**
-** This file is part of an example program for Qt.  This example
-** program may be used, distributed and modified without limitation.
-**
-*****************************************************************************/
-
-#include "checklists.h"
-#include <qapplication.h>
-
-int main( int argc, char **argv )
-{
-    QApplication a( argc, argv );
-
-    CheckLists checklists;
-    checklists.resize( 650, 350 );
-    checklists.setCaption( "Qt Example - CheckLists" );
-    a.setMainWidget( &checklists );
-    checklists.show();
-
-    return a.exec();
-}
-
- -

See also Examples. - - -


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/html/qchecklistitem-members.html b/doc/html/qchecklistitem-members.html new file mode 100644 index 0000000..b2c739a --- /dev/null +++ b/doc/html/qchecklistitem-members.html @@ -0,0 +1,120 @@ + + + + + +QCheckListItem Member List + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Complete Member List for QCheckListItem

+ +

This is the complete list of member functions for +QCheckListItem, including inherited members. + +

+ +


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/html/qchecklistitem.html b/doc/html/qchecklistitem.html new file mode 100644 index 0000000..e00e24e --- /dev/null +++ b/doc/html/qchecklistitem.html @@ -0,0 +1,256 @@ + + + + + +QCheckListItem Class + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

QCheckListItem Class Reference

+ +

The QCheckListItem class provides checkable list view items. +More... +

#include <qlistview.h> +

Inherits QListViewItem. +

List of all member functions. +

Public Members

+
    +
  • enum Type { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }
  • +
  • enum ToggleState { Off, NoChange, On }
  • +
  • QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • +
  • QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )
  • +
  • QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )
  • +
  • ~QCheckListItem ()
  • +
  • virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
  • +
  • virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )
  • +
  • virtual void setOn ( bool b )
  • +
  • bool isOn () const
  • +
  • Type type () const
  • +
  • QString text () const
  • +
  • void setTristate ( bool b )
  • +
  • bool isTristate () const
  • +
  • ToggleState state () const
  • +
  • void setState ( ToggleState s )
  • +
  • virtual int rtti () const
  • +
+

Protected Members

+ +

Detailed Description

+ + +The QCheckListItem class provides checkable list view items. +

+

QCheckListItems are used in QListViews to provide +QListViewItems that are checkboxes, radio buttons or +controllers. +

Checkbox and controller check list items may be inserted at any +level in a list view. Radio button check list items must be +children of a controller check list item. +

The item can be checked or unchecked with setOn(). Its type can be +retrieved with type() and its text retrieved with text(). +

List View Items
+

See also QListViewItem, QListView, and Advanced Widgets. + +


Member Type Documentation

+

QCheckListItem::ToggleState

+ +

This enum specifies a QCheckListItem's toggle state. +

    +
  • QCheckListItem::Off +
  • QCheckListItem::NoChange +
  • QCheckListItem::On +
+

QCheckListItem::Type

+ +

This enum type specifies a QCheckListItem's type: +

    +
  • QCheckListItem::RadioButton +
  • QCheckListItem::CheckBox +
  • QCheckListItem::Controller - obsolete (use RadioButtonController instead) +
  • QCheckListItem::RadioButtonController +
  • QCheckListItem::CheckBoxController +
+

Member Function Documentation

+

QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that a RadioButton must be the child of a +RadioButtonController, otherwise it will not toggle. + +

QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, and with text text +and of type tt. Note that a RadioButton must be the child of +a RadioButtonController, otherwise it will not toggle. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, with text text and +of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, text text +and of type tt. Note that tt must not be RadioButton. +Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) +

+Constructs a checkable item with parent parent, which is after +after in the parent's list of children, with text text and +of type tt. Note that tt must not be RadioButton. +Radio buttons must be children of a RadioButtonController. + +

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p ) +

+Constructs a RadioButtonController item with parent parent, +text text and pixmap p. + +

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p ) +

+Constructs a RadioButtonController item with parent parent, +text text and pixmap p. + +

QCheckListItem::~QCheckListItem () +

+Destroys the item, and all its children to any depth, freeing up +all allocated resources. + +

void QCheckListItem::activate () [virtual protected] +

+Toggle check box or set radio button to on. + +

Reimplemented from QListViewItem. +

bool QCheckListItem::isOn () const +

+ +

Returns TRUE if the item is toggled on; otherwise returns FALSE. + +

bool QCheckListItem::isTristate () const +

+Returns TRUE if the item is tristate; otherwise returns FALSE. +

See also setTristate(). + +

void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) [virtual] +

+Paints the item using the painter p and the color group cg. +The item is in column column, has width width and has +alignment align. (See Qt::AlignmentFlags for valid alignments.) + +

Reimplemented from QListViewItem. +

void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ) [virtual] +

+Draws the focus rectangle r using the color group cg on the +painter p. + +

Reimplemented from QListViewItem. +

int QCheckListItem::rtti () const [virtual] +

+ +

Returns 1. +

Make your derived classes return their own values for rtti(), and +you can distinguish between list view items. You should use values +greater than 1000, to allow for extensions to this class. + +

Reimplemented from QListViewItem. +

void QCheckListItem::setOn ( bool b ) [virtual] +

+Sets the button on if b is TRUE, otherwise sets it off. +Maintains radio button exclusivity. + +

void QCheckListItem::setState ( ToggleState s ) +

+Sets the toggle state of the checklistitem to s. s can be +Off, NoChange or On. +

Tristate can only be enabled for CheckBox or CheckBoxController, +therefore the NoChange only applies to them. +

Setting the state to On or Off on a CheckBoxController +will recursivly set the states of its children to the same state. +

Setting the state to NoChange on a CheckBoxController will +make it recursivly recall the previous stored state of its +children. If there was no previous stored state the children are +all set to On. + +

void QCheckListItem::setTristate ( bool b ) +

+Sets tristate to b if the Type is either a CheckBoxController or +a CheckBox. +

CheckBoxControllers are tristate by default. +

See also state() and isTristate(). + +

ToggleState QCheckListItem::state () const +

+Returns the state of the item. +

See also QCheckListItem::ToggleState. + +

void QCheckListItem::stateChange ( bool ) [virtual protected] +

+This virtual function is called when the item changes its state. +NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so +use state() to determine if the state is actually Off or NoChange. + +

QString QCheckListItem::text () const +

+ +

Returns the item's text. + +

void QCheckListItem::turnOffChild () [protected] +

+If this is a RadioButtonController that has RadioButton +children, turn off the child that is on. + +

Type QCheckListItem::type () const +

+ +

Returns the type of this item. + + +


+This file is part of the Qt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ diff --git a/doc/html/qchectdelistitem-members.html b/doc/html/qchectdelistitem-members.html deleted file mode 100644 index b2c739a..0000000 --- a/doc/html/qchectdelistitem-members.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -QCheckListItem Member List - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

Complete Member List for QCheckListItem

- -

This is the complete list of member functions for -QCheckListItem, including inherited members. - -

- -


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/html/qchectdelistitem.html b/doc/html/qchectdelistitem.html deleted file mode 100644 index e00e24e..0000000 --- a/doc/html/qchectdelistitem.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - -QCheckListItem Class - - - - - - - -
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

QCheckListItem Class Reference

- -

The QCheckListItem class provides checkable list view items. -More... -

#include <qlistview.h> -

Inherits QListViewItem. -

List of all member functions. -

Public Members

-
    -
  • enum Type { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }
  • -
  • enum ToggleState { Off, NoChange, On }
  • -
  • QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
  • -
  • QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )
  • -
  • QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )
  • -
  • ~QCheckListItem ()
  • -
  • virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
  • -
  • virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )
  • -
  • virtual void setOn ( bool b )
  • -
  • bool isOn () const
  • -
  • Type type () const
  • -
  • QString text () const
  • -
  • void setTristate ( bool b )
  • -
  • bool isTristate () const
  • -
  • ToggleState state () const
  • -
  • void setState ( ToggleState s )
  • -
  • virtual int rtti () const
  • -
-

Protected Members

- -

Detailed Description

- - -The QCheckListItem class provides checkable list view items. -

-

QCheckListItems are used in QListViews to provide -QListViewItems that are checkboxes, radio buttons or -controllers. -

Checkbox and controller check list items may be inserted at any -level in a list view. Radio button check list items must be -children of a controller check list item. -

The item can be checked or unchecked with setOn(). Its type can be -retrieved with type() and its text retrieved with text(). -

List View Items
-

See also QListViewItem, QListView, and Advanced Widgets. - -


Member Type Documentation

-

QCheckListItem::ToggleState

- -

This enum specifies a QCheckListItem's toggle state. -

    -
  • QCheckListItem::Off -
  • QCheckListItem::NoChange -
  • QCheckListItem::On -
-

QCheckListItem::Type

- -

This enum type specifies a QCheckListItem's type: -

    -
  • QCheckListItem::RadioButton -
  • QCheckListItem::CheckBox -
  • QCheckListItem::Controller - obsolete (use RadioButtonController instead) -
  • QCheckListItem::RadioButtonController -
  • QCheckListItem::CheckBoxController -
-

Member Function Documentation

-

QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that a RadioButton must be the child of a -RadioButtonController, otherwise it will not toggle. - -

QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, and with text text -and of type tt. Note that a RadioButton must be the child of -a RadioButtonController, otherwise it will not toggle. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, with text text and -of type tt. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, text text -and of type tt. Note that tt must not be RadioButton. -Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController ) -

-Constructs a checkable item with parent parent, which is after -after in the parent's list of children, with text text and -of type tt. Note that tt must not be RadioButton. -Radio buttons must be children of a RadioButtonController. - -

QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p ) -

-Constructs a RadioButtonController item with parent parent, -text text and pixmap p. - -

QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p ) -

-Constructs a RadioButtonController item with parent parent, -text text and pixmap p. - -

QCheckListItem::~QCheckListItem () -

-Destroys the item, and all its children to any depth, freeing up -all allocated resources. - -

void QCheckListItem::activate () [virtual protected] -

-Toggle check box or set radio button to on. - -

Reimplemented from QListViewItem. -

bool QCheckListItem::isOn () const -

- -

Returns TRUE if the item is toggled on; otherwise returns FALSE. - -

bool QCheckListItem::isTristate () const -

-Returns TRUE if the item is tristate; otherwise returns FALSE. -

See also setTristate(). - -

void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) [virtual] -

-Paints the item using the painter p and the color group cg. -The item is in column column, has width width and has -alignment align. (See Qt::AlignmentFlags for valid alignments.) - -

Reimplemented from QListViewItem. -

void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ) [virtual] -

-Draws the focus rectangle r using the color group cg on the -painter p. - -

Reimplemented from QListViewItem. -

int QCheckListItem::rtti () const [virtual] -

- -

Returns 1. -

Make your derived classes return their own values for rtti(), and -you can distinguish between list view items. You should use values -greater than 1000, to allow for extensions to this class. - -

Reimplemented from QListViewItem. -

void QCheckListItem::setOn ( bool b ) [virtual] -

-Sets the button on if b is TRUE, otherwise sets it off. -Maintains radio button exclusivity. - -

void QCheckListItem::setState ( ToggleState s ) -

-Sets the toggle state of the checklistitem to s. s can be -Off, NoChange or On. -

Tristate can only be enabled for CheckBox or CheckBoxController, -therefore the NoChange only applies to them. -

Setting the state to On or Off on a CheckBoxController -will recursivly set the states of its children to the same state. -

Setting the state to NoChange on a CheckBoxController will -make it recursivly recall the previous stored state of its -children. If there was no previous stored state the children are -all set to On. - -

void QCheckListItem::setTristate ( bool b ) -

-Sets tristate to b if the Type is either a CheckBoxController or -a CheckBox. -

CheckBoxControllers are tristate by default. -

See also state() and isTristate(). - -

ToggleState QCheckListItem::state () const -

-Returns the state of the item. -

See also QCheckListItem::ToggleState. - -

void QCheckListItem::stateChange ( bool ) [virtual protected] -

-This virtual function is called when the item changes its state. -NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so -use state() to determine if the state is actually Off or NoChange. - -

QString QCheckListItem::text () const -

- -

Returns the item's text. - -

void QCheckListItem::turnOffChild () [protected] -

-If this is a RadioButtonController that has RadioButton -children, turn off the child that is on. - -

Type QCheckListItem::type () const -

- -

Returns the type of this item. - - -


-This file is part of the Qt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


- -
Copyright © 2007 -TrolltechTrademarks -
Qt 3.3.8
-
- diff --git a/doc/man/man3/qchecklistitem.3qt b/doc/man/man3/qchecklistitem.3qt new file mode 100644 index 0000000..af09734 --- /dev/null +++ b/doc/man/man3/qchecklistitem.3qt @@ -0,0 +1,229 @@ +'\" t +.TH QCheckListItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the +.\" license file included in the distribution for a complete license +.\" statement. +.\" +.ad l +.nh +.SH NAME +QCheckListItem \- Checkable list view items +.SH SYNOPSIS +\fC#include \fR +.PP +Inherits QListViewItem. +.PP +.SS "Public Members" +.in +1c +.ti -1c +.BI "enum \fBType\fR { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }" +.br +.ti -1c +.BI "enum \fBToggleState\fR { Off, NoChange, On }" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, const QPixmap & p )" +.br +.ti -1c +.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, const QPixmap & p )" +.br +.ti -1c +.BI "\fB~QCheckListItem\fR ()" +.br +.ti -1c +.BI "virtual void \fBpaintCell\fR ( QPainter * p, const QColorGroup & cg, int column, int width, int align )" +.br +.ti -1c +.BI "virtual void \fBpaintFocus\fR ( QPainter * p, const QColorGroup & cg, const QRect & r )" +.br +.ti -1c +.BI "virtual void \fBsetOn\fR ( bool b )" +.br +.ti -1c +.BI "bool \fBisOn\fR () const" +.br +.ti -1c +.BI "Type \fBtype\fR () const" +.br +.ti -1c +.BI "QString \fBtext\fR () const" +.br +.ti -1c +.BI "void \fBsetTristate\fR ( bool b )" +.br +.ti -1c +.BI "bool \fBisTristate\fR () const" +.br +.ti -1c +.BI "ToggleState \fBstate\fR () const" +.br +.ti -1c +.BI "void \fBsetState\fR ( ToggleState s )" +.br +.ti -1c +.BI "virtual int \fBrtti\fR () const" +.br +.in -1c +.SS "Protected Members" +.in +1c +.ti -1c +.BI "virtual void \fBactivate\fR ()" +.br +.ti -1c +.BI "void \fBturnOffChild\fR ()" +.br +.ti -1c +.BI "virtual void \fBstateChange\fR ( bool )" +.br +.in -1c +.SH DESCRIPTION +The QCheckListItem class provides checkable list view items. +.PP +QCheckListItems are used in QListViews to provide QListViewItems that are checkboxes, radio buttons or controllers. +.PP +Checkbox and controller check list items may be inserted at any level in a list view. Radio button check list items must be children of a controller check list item. +.PP +The item can be checked or unchecked with setOn(). Its type can be retrieved with type() and its text retrieved with text(). +.PP +
+.ce 1 +.B "[Image Omitted]" +.PP +
+.PP +See also QListViewItem, QListView, and Advanced Widgets. +.SS "Member Type Documentation" +.SH "QCheckListItem::ToggleState" +This enum specifies a QCheckListItem's toggle state. +.TP +\fCQCheckListItem::Off\fR +.TP +\fCQCheckListItem::NoChange\fR +.TP +\fCQCheckListItem::On\fR +.SH "QCheckListItem::Type" +This enum type specifies a QCheckListItem's type: +.TP +\fCQCheckListItem::RadioButton\fR +.TP +\fCQCheckListItem::CheckBox\fR +.TP +\fCQCheckListItem::Controller\fR - \fIobsolete\fR (use RadioButtonController instead) +.TP +\fCQCheckListItem::RadioButtonController\fR +.TP +\fCQCheckListItem::CheckBoxController\fR +.SH MEMBER FUNCTION DOCUMENTATION +.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. +.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, and with text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" +Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. +.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )" +Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. +.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )" +Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. +.SH "QCheckListItem::~QCheckListItem ()" +Destroys the item, and all its children to any depth, freeing up all allocated resources. +.SH "void QCheckListItem::activate ()\fC [virtual protected]\fR" +Toggle check box or set radio button to on. +.PP +Reimplemented from QListViewItem. +.SH "bool QCheckListItem::isOn () const" +Returns TRUE if the item is toggled on; otherwise returns FALSE. +.SH "bool QCheckListItem::isTristate () const" +Returns TRUE if the item is tristate; otherwise returns FALSE. +.PP +See also setTristate(). +.SH "void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )\fC [virtual]\fR" +Paints the item using the painter \fIp\fR and the color group \fIcg\fR. The item is in column \fIcolumn\fR, has width \fIwidth\fR and has alignment \fIalign\fR. (See Qt::AlignmentFlags for valid alignments.) +.PP +Reimplemented from QListViewItem. +.SH "void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )\fC [virtual]\fR" +Draws the focus rectangle \fIr\fR using the color group \fIcg\fR on the painter \fIp\fR. +.PP +Reimplemented from QListViewItem. +.SH "int QCheckListItem::rtti () const\fC [virtual]\fR" +Returns 1. +.PP +Make your derived classes return their own values for rtti(), and you can distinguish between list view items. You should use values greater than 1000, to allow for extensions to this class. +.PP +Reimplemented from QListViewItem. +.SH "void QCheckListItem::setOn ( bool b )\fC [virtual]\fR" +Sets the button on if \fIb\fR is TRUE, otherwise sets it off. Maintains radio button exclusivity. +.SH "void QCheckListItem::setState ( ToggleState s )" +Sets the toggle state of the checklistitem to \fIs\fR. \fIs\fR can be Off, NoChange or On. +.PP +Tristate can only be enabled for CheckBox or CheckBoxController, therefore the NoChange only applies to them. +.PP +Setting the state to On or Off on a CheckBoxController will recursivly set the states of its children to the same state. +.PP +Setting the state to NoChange on a CheckBoxController will make it recursivly recall the previous stored state of its children. If there was no previous stored state the children are all set to On. +.SH "void QCheckListItem::setTristate ( bool b )" +Sets tristate to \fIb\fR if the Type is either a CheckBoxController or a CheckBox. +.PP +\fCCheckBoxControllers\fR are tristate by default. +.PP +See also state() and isTristate(). +.SH "ToggleState QCheckListItem::state () const" +Returns the state of the item. +.PP +See also QCheckListItem::ToggleState. +.SH "void QCheckListItem::stateChange ( bool )\fC [virtual protected]\fR" +This virtual function is called when the item changes its state. NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so use state() to determine if the state is actually Off or NoChange. +.SH "QString QCheckListItem::text () const" +Returns the item's text. +.SH "void QCheckListItem::turnOffChild ()\fC [protected]\fR" +If this is a RadioButtonController that has RadioButton children, turn off the child that is on. +.SH "Type QCheckListItem::type () const" +Returns the type of this item. + +.SH "SEE ALSO" +.BR http://doc.trolltech.com/qchecklistitem.html +.BR http://www.trolltech.com/faq/tech.html +.SH COPYRIGHT +Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the +license file included in the distribution for a complete license +statement. +.SH AUTHOR +Generated automatically from the source code. +.SH BUGS +If you find a bug in Qt, please report it as described in +.BR http://doc.trolltech.com/bughowto.html . +Good bug reports help us to help you. Thank you. +.P +The definitive Qt documentation is provided in HTML format; it is +located at $QTDIR/doc/html and can be read using Qt Assistant or with +a web browser. This man page is provided as a convenience for those +users who prefer man pages, although this format is not officially +supported by Trolltech. +.P +If you find errors in this manual page, please report them to +.BR qt-bugs@trolltech.com . +Please include the name of the manual page (qchecklistitem.3qt) and the Qt +version (3.3.8). diff --git a/doc/man/man3/qchectdelistitem.3qt b/doc/man/man3/qchectdelistitem.3qt deleted file mode 100644 index af09734..0000000 --- a/doc/man/man3/qchectdelistitem.3qt +++ /dev/null @@ -1,229 +0,0 @@ -'\" t -.TH QCheckListItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- -.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the -.\" license file included in the distribution for a complete license -.\" statement. -.\" -.ad l -.nh -.SH NAME -QCheckListItem \- Checkable list view items -.SH SYNOPSIS -\fC#include \fR -.PP -Inherits QListViewItem. -.PP -.SS "Public Members" -.in +1c -.ti -1c -.BI "enum \fBType\fR { RadioButton, CheckBox, Controller, RadioButtonController = Controller, CheckBoxController }" -.br -.ti -1c -.BI "enum \fBToggleState\fR { Off, NoChange, On }" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListViewItem * parent, const QString & text, const QPixmap & p )" -.br -.ti -1c -.BI "\fBQCheckListItem\fR ( QListView * parent, const QString & text, const QPixmap & p )" -.br -.ti -1c -.BI "\fB~QCheckListItem\fR ()" -.br -.ti -1c -.BI "virtual void \fBpaintCell\fR ( QPainter * p, const QColorGroup & cg, int column, int width, int align )" -.br -.ti -1c -.BI "virtual void \fBpaintFocus\fR ( QPainter * p, const QColorGroup & cg, const QRect & r )" -.br -.ti -1c -.BI "virtual void \fBsetOn\fR ( bool b )" -.br -.ti -1c -.BI "bool \fBisOn\fR () const" -.br -.ti -1c -.BI "Type \fBtype\fR () const" -.br -.ti -1c -.BI "QString \fBtext\fR () const" -.br -.ti -1c -.BI "void \fBsetTristate\fR ( bool b )" -.br -.ti -1c -.BI "bool \fBisTristate\fR () const" -.br -.ti -1c -.BI "ToggleState \fBstate\fR () const" -.br -.ti -1c -.BI "void \fBsetState\fR ( ToggleState s )" -.br -.ti -1c -.BI "virtual int \fBrtti\fR () const" -.br -.in -1c -.SS "Protected Members" -.in +1c -.ti -1c -.BI "virtual void \fBactivate\fR ()" -.br -.ti -1c -.BI "void \fBturnOffChild\fR ()" -.br -.ti -1c -.BI "virtual void \fBstateChange\fR ( bool )" -.br -.in -1c -.SH DESCRIPTION -The QCheckListItem class provides checkable list view items. -.PP -QCheckListItems are used in QListViews to provide QListViewItems that are checkboxes, radio buttons or controllers. -.PP -Checkbox and controller check list items may be inserted at any level in a list view. Radio button check list items must be children of a controller check list item. -.PP -The item can be checked or unchecked with setOn(). Its type can be retrieved with type() and its text retrieved with text(). -.PP -
-.ce 1 -.B "[Image Omitted]" -.PP -
-.PP -See also QListViewItem, QListView, and Advanced Widgets. -.SS "Member Type Documentation" -.SH "QCheckListItem::ToggleState" -This enum specifies a QCheckListItem's toggle state. -.TP -\fCQCheckListItem::Off\fR -.TP -\fCQCheckListItem::NoChange\fR -.TP -\fCQCheckListItem::On\fR -.SH "QCheckListItem::Type" -This enum type specifies a QCheckListItem's type: -.TP -\fCQCheckListItem::RadioButton\fR -.TP -\fCQCheckListItem::CheckBox\fR -.TP -\fCQCheckListItem::Controller\fR - \fIobsolete\fR (use RadioButtonController instead) -.TP -\fCQCheckListItem::RadioButtonController\fR -.TP -\fCQCheckListItem::CheckBoxController\fR -.SH MEMBER FUNCTION DOCUMENTATION -.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. -.SH "QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, and with text \fItext\fR and of type \fItt\fR. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that this item must \fInot\fR be a RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )" -Constructs a checkable item with parent \fIparent\fR, which is after \fIafter\fR in the parent's list of children, with text \fItext\fR and of type \fItt\fR. Note that \fItt\fR must \fInot\fR be RadioButton. Radio buttons must be children of a RadioButtonController. -.SH "QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )" -Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. -.SH "QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )" -Constructs a RadioButtonController item with parent \fIparent\fR, text \fItext\fR and pixmap \fIp\fR. -.SH "QCheckListItem::~QCheckListItem ()" -Destroys the item, and all its children to any depth, freeing up all allocated resources. -.SH "void QCheckListItem::activate ()\fC [virtual protected]\fR" -Toggle check box or set radio button to on. -.PP -Reimplemented from QListViewItem. -.SH "bool QCheckListItem::isOn () const" -Returns TRUE if the item is toggled on; otherwise returns FALSE. -.SH "bool QCheckListItem::isTristate () const" -Returns TRUE if the item is tristate; otherwise returns FALSE. -.PP -See also setTristate(). -.SH "void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )\fC [virtual]\fR" -Paints the item using the painter \fIp\fR and the color group \fIcg\fR. The item is in column \fIcolumn\fR, has width \fIwidth\fR and has alignment \fIalign\fR. (See Qt::AlignmentFlags for valid alignments.) -.PP -Reimplemented from QListViewItem. -.SH "void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r )\fC [virtual]\fR" -Draws the focus rectangle \fIr\fR using the color group \fIcg\fR on the painter \fIp\fR. -.PP -Reimplemented from QListViewItem. -.SH "int QCheckListItem::rtti () const\fC [virtual]\fR" -Returns 1. -.PP -Make your derived classes return their own values for rtti(), and you can distinguish between list view items. You should use values greater than 1000, to allow for extensions to this class. -.PP -Reimplemented from QListViewItem. -.SH "void QCheckListItem::setOn ( bool b )\fC [virtual]\fR" -Sets the button on if \fIb\fR is TRUE, otherwise sets it off. Maintains radio button exclusivity. -.SH "void QCheckListItem::setState ( ToggleState s )" -Sets the toggle state of the checklistitem to \fIs\fR. \fIs\fR can be Off, NoChange or On. -.PP -Tristate can only be enabled for CheckBox or CheckBoxController, therefore the NoChange only applies to them. -.PP -Setting the state to On or Off on a CheckBoxController will recursivly set the states of its children to the same state. -.PP -Setting the state to NoChange on a CheckBoxController will make it recursivly recall the previous stored state of its children. If there was no previous stored state the children are all set to On. -.SH "void QCheckListItem::setTristate ( bool b )" -Sets tristate to \fIb\fR if the Type is either a CheckBoxController or a CheckBox. -.PP -\fCCheckBoxControllers\fR are tristate by default. -.PP -See also state() and isTristate(). -.SH "ToggleState QCheckListItem::state () const" -Returns the state of the item. -.PP -See also QCheckListItem::ToggleState. -.SH "void QCheckListItem::stateChange ( bool )\fC [virtual protected]\fR" -This virtual function is called when the item changes its state. NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so use state() to determine if the state is actually Off or NoChange. -.SH "QString QCheckListItem::text () const" -Returns the item's text. -.SH "void QCheckListItem::turnOffChild ()\fC [protected]\fR" -If this is a RadioButtonController that has RadioButton children, turn off the child that is on. -.SH "Type QCheckListItem::type () const" -Returns the type of this item. - -.SH "SEE ALSO" -.BR http://doc.trolltech.com/qchecklistitem.html -.BR http://www.trolltech.com/faq/tech.html -.SH COPYRIGHT -Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the -license file included in the distribution for a complete license -statement. -.SH AUTHOR -Generated automatically from the source code. -.SH BUGS -If you find a bug in Qt, please report it as described in -.BR http://doc.trolltech.com/bughowto.html . -Good bug reports help us to help you. Thank you. -.P -The definitive Qt documentation is provided in HTML format; it is -located at $QTDIR/doc/html and can be read using Qt Assistant or with -a web browser. This man page is provided as a convenience for those -users who prefer man pages, although this format is not officially -supported by Trolltech. -.P -If you find errors in this manual page, please report them to -.BR qt-bugs@trolltech.com . -Please include the name of the manual page (qchecklistitem.3qt) and the Qt -version (3.3.8). diff --git a/examples/checklists/checklists.cpp b/examples/checklists/checklists.cpp new file mode 100644 index 0000000..fd17d09 --- /dev/null +++ b/examples/checklists/checklists.cpp @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. 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( 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( "Items" ); + lv1->setRootIsDecorated( TRUE ); + + // create a list with 4 ListViewItems which will be parent items of other ListViewItems + QValueList parentList; + + parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) ); + parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) ); + + QListViewItem *item = 0; + unsigned int num = 1; + // go through the list of parent items... + for ( QValueList::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox ); + } + + // Create another widget for layouting + QVBoxLayout *tmp = new QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create a pushbutton + QPushButton *copy1 = new QPushButton( " -> ", 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 + QVBoxLayout *vbox2 = new QVBoxLayout( lay ); + vbox2->setMargin( 5 ); + + // and another label + vbox2->addWidget( new QLabel( "Check one item!", this ) ); + + // create the second listview + lv2 = new QListView( this ); + vbox2->addWidget( lv2 ); + lv2->addColumn( "Items" ); + lv2->setRootIsDecorated( TRUE ); + + // another widget needed for layouting only + tmp = new QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // create another pushbutton... + QPushButton *copy2 = new QPushButton( " -> ", 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 QVBoxLayout( lay ); + tmp->setMargin( 5 ); + + // and create a label which will be at the right of the window + label = new QLabel( "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 + QListViewItemIterator 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! + QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() ) + // ...insert a Radio-ListViewItem with the same text into the second ListView + (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton ); + + if ( item->firstChild() ) + ( ( QCheckListItem* )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 + QListViewItemIterator 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 ( ( (QCheckListItem*)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 new file mode 100644 index 0000000..417afe6 --- /dev/null +++ b/examples/checklists/checklists.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/checklists/checklists.h b/examples/checklists/checklists.h new file mode 100644 index 0000000..e6cdd1d --- /dev/null +++ b/examples/checklists/checklists.h @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef CHECKLISTS_H +#define CHECKLISTS_H + +#include + +class QListView; +class QLabel; + +class CheckLists : public QWidget +{ + Q_OBJECT + +public: + CheckLists( QWidget *parent = 0, const char *name = 0 ); + +protected: + QListView *lv1, *lv2; + QLabel *label; + +protected slots: + void copy1to2(); + void copy2to3(); + +}; + +#endif diff --git a/examples/checklists/checklists.pro b/examples/checklists/checklists.pro new file mode 100644 index 0000000..a1a6f12 --- /dev/null +++ b/examples/checklists/checklists.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/checklists/main.cpp b/examples/checklists/main.cpp new file mode 100644 index 0000000..2aa2559 --- /dev/null +++ b/examples/checklists/main.cpp @@ -0,0 +1,24 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "checklists.h" +#include + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + + CheckLists checklists; + checklists.resize( 650, 350 ); + checklists.setCaption( "Qt Example - CheckLists" ); + a.setMainWidget( &checklists ); + checklists.show(); + + return a.exec(); +} diff --git a/examples/chectdelists/chectdelists.cpp b/examples/chectdelists/chectdelists.cpp deleted file mode 100644 index fd17d09..0000000 --- a/examples/chectdelists/chectdelists.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 Qt. 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( 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( "Items" ); - lv1->setRootIsDecorated( TRUE ); - - // create a list with 4 ListViewItems which will be parent items of other ListViewItems - QValueList parentList; - - parentList.append( new QCheckListItem( lv1, "Parent Item 1", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 2", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 3", QCheckListItem::CheckBoxController ) ); - parentList.append( new QCheckListItem( lv1, "Parent Item 4", QCheckListItem::CheckBoxController ) ); - - QListViewItem *item = 0; - unsigned int num = 1; - // go through the list of parent items... - for ( QValueList::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 QCheckListItem( item, QString( "%1. Child of Parent %2" ).arg( i ).arg( num ), QCheckListItem::CheckBox ); - } - - // Create another widget for layouting - QVBoxLayout *tmp = new QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create a pushbutton - QPushButton *copy1 = new QPushButton( " -> ", 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 - QVBoxLayout *vbox2 = new QVBoxLayout( lay ); - vbox2->setMargin( 5 ); - - // and another label - vbox2->addWidget( new QLabel( "Check one item!", this ) ); - - // create the second listview - lv2 = new QListView( this ); - vbox2->addWidget( lv2 ); - lv2->addColumn( "Items" ); - lv2->setRootIsDecorated( TRUE ); - - // another widget needed for layouting only - tmp = new QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // create another pushbutton... - QPushButton *copy2 = new QPushButton( " -> ", 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 QVBoxLayout( lay ); - tmp->setMargin( 5 ); - - // and create a label which will be at the right of the window - label = new QLabel( "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 - QListViewItemIterator 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! - QCheckListItem *item = new QCheckListItem( lv2, "Controller", QCheckListItem::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 ( ( (QCheckListItem*)it.current() )->isOn() ) - // ...insert a Radio-ListViewItem with the same text into the second ListView - (void)new QCheckListItem( item, it.current()->text( 0 ), QCheckListItem::RadioButton ); - - if ( item->firstChild() ) - ( ( QCheckListItem* )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 - QListViewItemIterator 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 ( ( (QCheckListItem*)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 deleted file mode 100644 index 417afe6..0000000 --- a/examples/chectdelists/chectdelists.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/chectdelists/chectdelists.h b/examples/chectdelists/chectdelists.h deleted file mode 100644 index e6cdd1d..0000000 --- a/examples/chectdelists/chectdelists.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 Qt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#ifndef CHECKLISTS_H -#define CHECKLISTS_H - -#include - -class QListView; -class QLabel; - -class CheckLists : public QWidget -{ - Q_OBJECT - -public: - CheckLists( QWidget *parent = 0, const char *name = 0 ); - -protected: - QListView *lv1, *lv2; - QLabel *label; - -protected slots: - void copy1to2(); - void copy2to3(); - -}; - -#endif diff --git a/examples/chectdelists/chectdelists.pro b/examples/chectdelists/chectdelists.pro deleted file mode 100644 index a1a6f12..0000000 --- a/examples/chectdelists/chectdelists.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/chectdelists/main.cpp b/examples/chectdelists/main.cpp deleted file mode 100644 index 2aa2559..0000000 --- a/examples/chectdelists/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 Qt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include "checklists.h" -#include - -int main( int argc, char **argv ) -{ - QApplication a( argc, argv ); - - CheckLists checklists; - checklists.resize( 650, 350 ); - checklists.setCaption( "Qt Example - CheckLists" ); - a.setMainWidget( &checklists ); - checklists.show(); - - return a.exec(); -} -- cgit v1.2.1 From 5df139de988197954c554b832e8bc6fcf48f54a1 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 3 Feb 2013 22:55:56 -0600 Subject: Rename KStyle to TDEStyle to avoid conflicts with KDE4 --- changes-3.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes-3.5 b/changes-3.5 index 3e5a920..9aee75a 100644 --- a/changes-3.5 +++ b/changes-3.5 @@ -31,7 +31,7 @@ sizeFromContents styleHint stylePixmap visualRect -drawKStylePrimitive +drawTDEStylePrimitive polish unPolish -- cgit v1.2.1 From 5aa389f311cae593530b0d0f500d67b10f7dd494 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 12 Feb 2013 18:15:11 -0600 Subject: Fix GTK threading deadlock --- src/kernel/qeventloop_glib_p.h | 3 +++ src/kernel/qeventloop_x11_glib.cpp | 32 ++++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/kernel/qeventloop_glib_p.h b/src/kernel/qeventloop_glib_p.h index 663f20e..3fa3593 100644 --- a/src/kernel/qeventloop_glib_p.h +++ b/src/kernel/qeventloop_glib_p.h @@ -100,6 +100,8 @@ public: exitloop = FALSE; shortcut = FALSE; singletoolkit = TRUE; + ctx = 0; + ctx_is_default = false; } int looplevel; @@ -129,6 +131,7 @@ public: // main context GMainContext *ctx; + bool ctx_is_default; }; #endif // QEVENTLOOP_GLIB_P_H diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp index 877ff44..d37fbee 100644 --- a/src/kernel/qeventloop_x11_glib.cpp +++ b/src/kernel/qeventloop_x11_glib.cpp @@ -79,8 +79,7 @@ static GSourceFuncs qt_gsource_funcs = { // forward main loop callbacks to QEventLoop methods! -static gboolean qt_gsource_prepare ( GSource *source, - gint *timeout ) +static gboolean qt_gsource_prepare ( GSource *source, gint *timeout ) { QtGSource * qtGSource = (QtGSource*) source; QEventLoop* candidateEventLoop = qtGSource->qeventLoop; @@ -95,7 +94,7 @@ static gboolean qt_gsource_prepare ( GSource *source, } } -static gboolean qt_gsource_check ( GSource *source ) +static gboolean qt_gsource_check ( GSource *source ) { QtGSource * qtGSource = (QtGSource*) source; QEventLoop* candidateEventLoop = qtGSource->qeventLoop; @@ -110,8 +109,7 @@ static gboolean qt_gsource_check ( GSource *source ) } } -static gboolean qt_gsource_dispatch ( GSource *source, - GSourceFunc callback, gpointer user_data ) +static gboolean qt_gsource_dispatch ( GSource *source, GSourceFunc callback, gpointer user_data ) { Q_UNUSED(callback); Q_UNUSED(user_data); @@ -215,6 +213,7 @@ void QEventLoop::init() // new main context for thread d->ctx = g_main_context_new(); g_main_context_push_thread_default(d->ctx); + d->ctx_is_default = true; // new GSource QtGSource * qtGSource = (QtGSource*) g_source_new(&qt_gsource_funcs, sizeof(QtGSource)); @@ -241,9 +240,9 @@ void QEventLoop::init() d->threadPipe_gPollFD.fd = d->thread_pipe[0]; d->threadPipe_gPollFD.events = G_IO_IN | G_IO_HUP | G_IO_ERR; - g_source_add_poll(d->gSource, &d->threadPipe_gPollFD); + g_source_add_poll(d->gSource, &d->threadPipe_gPollFD); -#ifdef DEBUG_QT_GLIBMAINLOOP +#ifdef DEBUG_QT_GLIBMAINLOOP printf("inside init(2)\n"); #endif @@ -375,7 +374,7 @@ bool QEventLoop::processX11Events() } -bool QEventLoop::gsourcePrepare(GSource *gs, int * timeout) +bool QEventLoop::gsourcePrepare(GSource *gs, int * timeout) { Q_UNUSED(gs); @@ -428,7 +427,7 @@ bool QEventLoop::gsourcePrepare(GSource *gs, int * timeout) #ifdef DEBUG_QT_GLIBMAINLOOP printf("inside gsourcePrepare(2) canwait=%d\n", canWait); -#endif +#endif if ( canWait ) { emit aboutToBlock(); @@ -440,7 +439,7 @@ bool QEventLoop::gsourcePrepare(GSource *gs, int * timeout) (**it)(); } -#ifdef DEBUG_QT_GLIBMAINLOOP +#ifdef DEBUG_QT_GLIBMAINLOOP printf("inside gsourcePrepare(2.1) canwait=%d\n", canWait); #endif @@ -649,4 +648,17 @@ void QEventLoop::appClosingDown() void QEventLoop::setSingleToolkitEventHandling(bool enabled) { d->singletoolkit = enabled; + + if (!d->singletoolkit) { + if (d->ctx_is_default) { + d->ctx_is_default = false; + g_main_context_pop_thread_default(d->ctx); + } + } + else { + if (!d->ctx_is_default) { + g_main_context_push_thread_default(d->ctx); + d->ctx_is_default = true; + } + } } \ No newline at end of file -- cgit v1.2.1 From c47f5e14e4231c872828374d05815d59a045cb2c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 13 Feb 2013 20:35:23 -0600 Subject: Fix CLI application failure when glib event loop is used --- src/kernel/qeventloop_glib_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kernel/qeventloop_glib_p.h b/src/kernel/qeventloop_glib_p.h index 3fa3593..4dfc02c 100644 --- a/src/kernel/qeventloop_glib_p.h +++ b/src/kernel/qeventloop_glib_p.h @@ -90,6 +90,9 @@ public: xfd = -1; x_gPollFD.fd = -1; #endif // Q_WS_X11 + singletoolkit = TRUE; + ctx = 0; + ctx_is_default = false; reset(); } @@ -99,11 +102,8 @@ public: quitnow = FALSE; exitloop = FALSE; shortcut = FALSE; - singletoolkit = TRUE; - ctx = 0; - ctx_is_default = false; } - + int looplevel; int quitcode; unsigned int quitnow : 1; -- cgit v1.2.1 From 5015438cc486e83eec69d7a8800b23316727eed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 17 Feb 2013 12:00:56 +0100 Subject: Fix unintended rename of LOCKFILE --- src/3rdparty/sqlite/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/sqlite/os.c b/src/3rdparty/sqlite/os.c index a85810f..b4ae7a1 100644 --- a/src/3rdparty/sqlite/os.c +++ b/src/3rdparty/sqlite/os.c @@ -1340,7 +1340,7 @@ int sqliteOsReadLock(OsFile *id){ ovlp.Offset = FIRST_LOCKBYTE+1; ovlp.OffsetHigh = 0; ovlp.hEvent = 0; - res = LockFileEx(id->h, LOCTDEFILE_FAIL_IMMEDIATELY, + res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, 0, N_LOCKBYTE, 0, &ovlp); }else{ res = LockFile(id->h, FIRST_LOCKBYTE+lk, 0, 1, 0); -- cgit v1.2.1 From 82b71e49603bf3a53240076c395864addd869267 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 18 Feb 2013 20:35:59 -0600 Subject: Doublebuffer QIconView to reduce flicker This closes Bug 1408 --- src/iconview/qiconview.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++- src/iconview/qiconview.h | 1 + 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 66fa498..9fd3022 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -214,6 +214,7 @@ public: QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, *startDragItem, *pressedItem, *selectAnchor, *renamingItem; QRect *rubber; + QPixmap *backBuffer; QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer, *fullRedrawTimer; int rastX, rastY, spacing; @@ -2800,6 +2801,7 @@ QIconView::QIconView( QWidget *parent, const char *name, WFlags f ) d->currentItem = 0; d->highlightedItem = 0; d->rubber = 0; + d->backBuffer = 0; d->scrollTimer = 0; d->startDragItem = 0; d->tmpCurrentItem = 0; @@ -2953,6 +2955,8 @@ QIconView::~QIconView() delete item; item = tmp; } + delete d->backBuffer; + d->backBuffer = 0; delete d->fm; d->fm = 0; #ifndef QT_NO_TOOLTIP @@ -4972,6 +4976,47 @@ void QIconView::contentsDropEvent( QDropEvent *e ) } #endif +/*! + This function grabs all paintevents that otherwise would have been + processed by the QScrollView::viewportPaintEvent(). Here we use a + doublebuffer to reduce 'on-paint' flickering on QIconView + (and of course its children). + + \sa QScrollView::viewportPaintEvent(), QIconView::drawContents() +*/ + +void QIconView::bufferedPaintEvent( QPaintEvent* pe ) +{ + QWidget* vp = viewport(); + QRect r = pe->rect() & vp->rect(); + int ex = r.x() + contentsX(); + int ey = r.y() + contentsY(); + int ew = r.width(); + int eh = r.height(); + + if ( !d->backBuffer ) + d->backBuffer = new QPixmap(vp->size()); + if ( d->backBuffer->size() != vp->size() ) { + // Resize function (with hysteresis). Uses a good compromise between memory + // consumption and speed (number) of resizes. + float newWidth = (float)vp->width(); + float newHeight = (float)vp->height(); + if ( newWidth > d->backBuffer->width() || newHeight > d->backBuffer->height() ) + { + newWidth *= 1.1892; + newHeight *= 1.1892; + d->backBuffer->resize( (int)newWidth, (int)newHeight ); + } else if ( 1.5*newWidth < d->backBuffer->width() || 1.5*newHeight < d->backBuffer->height() ) + d->backBuffer->resize( (int)newWidth, (int)newHeight ); + } + + QPainter p; + p.begin(d->backBuffer, vp); + drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh); + p.end(); + bitBlt(vp, r.x(), r.y(), d->backBuffer, r.x(), r.y(), ew, eh); +} + /*! \reimp */ @@ -5756,7 +5801,7 @@ bool QIconView::eventFilter( QObject * o, QEvent * e ) if ( !d->rubber ) drawDragShapes( d->oldDragPos ); } - viewportPaintEvent( (QPaintEvent*)e ); + bufferedPaintEvent( (QPaintEvent*)e ); if ( d->dragging ) { if ( !d->rubber ) drawDragShapes( d->oldDragPos ); diff --git a/src/iconview/qiconview.h b/src/iconview/qiconview.h index 97780d8..109779f 100644 --- a/src/iconview/qiconview.h +++ b/src/iconview/qiconview.h @@ -452,6 +452,7 @@ protected: void contentsDropEvent( QDropEvent *e ); #endif + void bufferedPaintEvent( QPaintEvent* ); void resizeEvent( QResizeEvent* e ); void keyPressEvent( QKeyEvent *e ); void focusInEvent( QFocusEvent *e ); -- cgit v1.2.1 From 89af6f8007568a86132c9b4cc0a21356572a8bda Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 24 Feb 2013 02:27:31 -0600 Subject: Restore expected qApp->exit() behaviour when called from a non-GUI thread --- src/kernel/qapplication.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index 5b43301..591fc8d 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -2931,7 +2931,14 @@ int QApplication::exec() */ void QApplication::exit( int retcode ) { - qApp->eventLoop()->exit( retcode ); + QThread* thread = qApp->guiThread(); + if (thread) { + if (thread->d) { + if (thread->d->eventLoop) { + thread->d->eventLoop->exit( retcode ); + } + } + } } /*! -- cgit v1.2.1 From d10d2321a34ab6c157bdf2a2e900c0ee52f1bd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 1 Mar 2013 23:18:23 -0600 Subject: Fix textbox trails introduced with GIT commit 82b71e49 This resolves Bug 1408 --- src/iconview/qiconview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 9fd3022..2272f83 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -5800,11 +5800,11 @@ bool QIconView::eventFilter( QObject * o, QEvent * e ) if ( d->dragging ) { if ( !d->rubber ) drawDragShapes( d->oldDragPos ); - } - bufferedPaintEvent( (QPaintEvent*)e ); - if ( d->dragging ) { + viewportPaintEvent( (QPaintEvent*)e ); if ( !d->rubber ) drawDragShapes( d->oldDragPos ); + } else { + bufferedPaintEvent( (QPaintEvent*)e ); } } return TRUE; -- cgit v1.2.1