# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KListViewItem Class Reference

A listview item with support for alternate background colors. listview item with alternate background color support. More...

`#include <klistview.h>`

Inheritance diagram for KListViewItem:

[legend]
Collaboration diagram for KListViewItem:

[legend]
List of all members.

## Public Member Functions

| KListViewItem (QListView *parent)
| KListViewItem (QListViewItem *parent)
| KListViewItem (QListView *parent, QListViewItem *after)
| KListViewItem (QListViewItem *parent, QListViewItem *after)
| KListViewItem (QListView *parent, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null)
| KListViewItem (QListViewItem *parent, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null)
| KListViewItem (QListView *parent, QListViewItem *after, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null)
| KListViewItem (QListViewItem *parent, QListViewItem *after, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null)
virtual void | insertItem (QListViewItem *item)
virtual void | takeItem (QListViewItem *item)
bool | isAlternate ()
const QColor & | backgroundColor () KDE_DEPRECATED
QColor | backgroundColor (int column)
virtual void | paintCell (QPainter *p, const QColorGroup &cg, int column, int width, int alignment)

## Friends

class | KListView

## Detailed Description

A listview item with support for alternate background colors. listview item with alternate background color support.

It is a drop-in replacement for QListViewItem

Definition at line 1009 of file klistview.h.

## Constructor & Destructor Documentation

KListViewItem::KListViewItem | ( | QListView * | parent | ) |

| constructors. The semantics remain as in QListViewItem. Although they accept a QListViewItem as parent, please don't mix KListViewItem (or subclasses) with QListViewItem (or subclasses). Definition at line 2129 of file klistview.cpp.

## Member Function Documentation

bool KListViewItem::isAlternate | ( |  | ) |

returns true if this item is to be drawn with the alternate background

Definition at line 2246 of file klistview.cpp.

References KListView::alternateBackground, KListView::d, QListView::firstChild(), QColor::isValid(), QListViewItem::itemAbove(), QListViewItem::itemBelow(), QListViewItem::listView(), m_known, m_odd, QListViewItem::nextSibling(), and QListViewItem::parent().

Referenced by backgroundColor().

const QColor & KListViewItem::backgroundColor | ( |  | ) |

| returns the background color for this item Definition at line 2213 of file klistview.cpp. References isAlternate(), and QListViewItem::listView().

QColor KListViewItem::backgroundColor | ( | int | column | ) |

returns the background color for this item at given column This can be different in the column which is sorted due to shading ### could be merged with above (column = -1) to be source compatible ### but will only work if sort-shading is not used or the listView has ### only 1 column

Since:
  3.4

Definition at line 2220 of file klistview.cpp.

References KListView::alternateBackground, QListView::columns(), KListView::columnSorted(), QColor::dark(), isAlternate(), QColor::light(), QListViewItem::listView(), and KListView::shadeSortColumn.

The documentation for this class was generated from the following files:

- klistview.h
- klistview.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:21:35 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003