Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3ListBoxItem

Q3ListBoxItem Class

TheQ3ListBoxItem class is the base class of all list box items.More...

Header:#include <Q3ListBoxItem>
Inherited By:

Q3ListBoxPixmap andQ3ListBoxText

Public Functions

Q3ListBoxItem(Q3ListBox * listbox = 0)
Q3ListBoxItem(Q3ListBox * listbox, Q3ListBoxItem * after)
virtual~Q3ListBoxItem()
boolcurrent() const
virtual intheight(const Q3ListBox * lb) const
boolisCurrent() const
boolisSelectable() const
boolisSelected() const
Q3ListBox *listBox() const
Q3ListBoxItem *next() const
virtual const QPixmap *pixmap() const
Q3ListBoxItem *prev() const
virtual intrtti() const
boolselected() const
voidsetSelectable(bool b)
virtual QStringtext() const
virtual intwidth(const Q3ListBox * lb) const

Protected Functions

virtual voidpaint(QPainter * p) = 0
voidsetCustomHighlighting(bool b)
virtual voidsetText(const QString & text)

Detailed Description

TheQ3ListBoxItem class is the base class of all list box items.

This class is an abstract base class used for all list box items. If you need to insert customized items into aQ3ListBox you must inherit this class and reimplementpaint(),height() andwidth().

See alsoQ3ListBox.

Member Function Documentation

Q3ListBoxItem::Q3ListBoxItem(Q3ListBox * listbox = 0)

Constructs an empty list box item in the list boxlistbox.

Q3ListBoxItem::Q3ListBoxItem(Q3ListBox * listbox,Q3ListBoxItem * after)

Constructs an empty list box item in the list boxlistbox and inserts it after the itemafter or at the beginning ifafter is 0.

[virtual]Q3ListBoxItem::~Q3ListBoxItem()

Destroys the list box item.

bool Q3ListBoxItem::current() const

UseisCurrent() instead. Returns true ifisCurrent() returns true.

[virtual]int Q3ListBoxItem::height(constQ3ListBox * lb) const

Implement this function to return the height of your item. Thelb parameter is the same aslistBox() and is provided for convenience and compatibility.

The default implementation returnsQApplication::globalStrut()'s height.

See alsopaint() andwidth().

bool Q3ListBoxItem::isCurrent() const

Returns true if the item is the current item; otherwise returns false.

See alsoQ3ListBox::currentItem(),Q3ListBox::item(), andisSelected().

bool Q3ListBoxItem::isSelectable() const

Returns true if this item is selectable (the default); otherwise returns false.

See alsosetSelectable().

bool Q3ListBoxItem::isSelected() const

Returns true if the item is selected; otherwise returns false.

See alsoQ3ListBox::isSelected() andisCurrent().

Q3ListBox * Q3ListBoxItem::listBox() const

Returns a pointer to the list box containing this item.

Q3ListBoxItem * Q3ListBoxItem::next() const

Returns the item that comes after this in the list box. If this is the last item, 0 is returned.

See alsoprev().

[pure virtual protected]void Q3ListBoxItem::paint(QPainter * p)

Implement this function to draw your item. The painter,p, is already open for painting.

See alsoheight() andwidth().

[virtual]constQPixmap * Q3ListBoxItem::pixmap() const

Returns the pixmap associated with the item, or 0 if there isn't one.

The default implementation returns 0.

Q3ListBoxItem * Q3ListBoxItem::prev() const

Returns the item which comes before this in the list box. If this is the first item, 0 is returned.

See alsonext().

[virtual]int Q3ListBoxItem::rtti() const

Returns 0.

Make your derived classes return their own values for rtti(), and you can distinguish between listbox items. You should use values greater than 1000 preferably a large random number, to allow for extensions to this class.

bool Q3ListBoxItem::selected() const

UseisSelected() instead. Returns true ifisSelected() returns true.

[protected]void Q3ListBoxItem::setCustomHighlighting(bool b)

Defines whether the list box item is responsible for drawing itself in a highlighted state when being selected.

Ifb is false (the default), the list box will draw some default highlight indicator before callingpaint().

See alsoisSelected() andpaint().

void Q3ListBoxItem::setSelectable(bool b)

Ifb is true (the default) then this item can be selected by the user; otherwise this item cannot be selected by the user.

See alsoisSelectable().

[virtual protected]void Q3ListBoxItem::setText(constQString & text)

Sets the text of theQ3ListBoxItem totext. Thistext is also used for sorting. The text is not shown unless explicitly drawn inpaint().

See alsotext().

[virtual]QString Q3ListBoxItem::text() const

Returns the text of the item. This text is also used for sorting.

See alsosetText().

[virtual]int Q3ListBoxItem::width(constQ3ListBox * lb) const

Reimplement this function to return the width of your item. Thelb parameter is the same aslistBox() and is provided for convenience and compatibility.

The default implementation returnsQApplication::globalStrut()'s width.

See alsopaint() andheight().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp