Q3ListBoxPixmap Class

The Q3ListBoxPixmap class provides list box items with a pixmap and optional text. 更多...

头: #include <Q3ListBoxPixmap>
继承: Q3ListBoxItem

公共函数

Q3ListBoxPixmap (Q3ListBox * listbox , const QPixmap & pixmap )
Q3ListBoxPixmap (const QPixmap & pixmap )
Q3ListBoxPixmap (Q3ListBox * listbox , const QPixmap & pixmap , Q3ListBoxItem * after )
Q3ListBoxPixmap (Q3ListBox * listbox , const QPixmap & pix , const QString & text )
Q3ListBoxPixmap (const QPixmap & pix , const QString & text )
Q3ListBoxPixmap (Q3ListBox * listbox , const QPixmap & pix , const QString & text , Q3ListBoxItem * after )
~Q3ListBoxPixmap ()

重实现公共函数

virtual int height (const Q3ListBox * lb ) const
virtual const QPixmap * pixmap () const
virtual int rtti () const
virtual int width (const Q3ListBox * lb ) const

重实现保护函数

virtual void paint (QPainter * painter )

详细描述

The Q3ListBoxPixmap class provides list box items with a pixmap and optional text.

Items of this class are drawn with the pixmap on the left with the optional text to the right of the pixmap.

另请参阅 Q3ListBox and Q3ListBoxItem .

成员函数文档编制

Q3ListBoxPixmap:: Q3ListBoxPixmap ( Q3ListBox * listbox , const QPixmap & pixmap )

Constructs a new list box item in list box listbox showing the pixmap pixmap .

Q3ListBoxPixmap:: Q3ListBoxPixmap (const QPixmap & pixmap )

Constructs a new list box item showing the pixmap pixmap .

Q3ListBoxPixmap:: Q3ListBoxPixmap ( Q3ListBox * listbox , const QPixmap & pixmap , Q3ListBoxItem * after )

Constructs a new list box item in list box listbox showing the pixmap pixmap . The item gets inserted after the item after , or at the beginning if after 为 0。

Q3ListBoxPixmap:: Q3ListBoxPixmap ( Q3ListBox * listbox , const QPixmap & pix , const QString & text )

Constructs a new list box item in list box listbox showing the pixmap pix 和文本 text .

Q3ListBoxPixmap:: Q3ListBoxPixmap (const QPixmap & pix , const QString & text )

Constructs a new list box item showing the pixmap pix and the text to text .

Q3ListBoxPixmap:: Q3ListBoxPixmap ( Q3ListBox * listbox , const QPixmap & pix , const QString & text , Q3ListBoxItem * after )

Constructs a new list box item in list box listbox showing the pixmap pix and the string text . The item gets inserted after the item after , or at the beginning if after 为 0。

Q3ListBoxPixmap:: ~Q3ListBoxPixmap ()

Destroys the item.

[虚拟] int Q3ListBoxPixmap:: height (const Q3ListBox * lb ) const

重实现自 Q3ListBoxItem::height ().

Returns the height of the pixmap in list box lb .

另请参阅 paint () 和 width ().

[virtual protected] void Q3ListBoxPixmap:: paint ( QPainter * painter )

重实现自 Q3ListBoxItem::paint ().

Draws the pixmap using painter .

[虚拟] const QPixmap * Q3ListBoxPixmap:: pixmap () const

重实现自 Q3ListBoxItem::pixmap ().

Returns the pixmap associated with the item.

[虚拟] int Q3ListBoxPixmap:: rtti () const

重实现自 Q3ListBoxItem::rtti ().

Returns 2.

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.

[虚拟] int Q3ListBoxPixmap:: width (const Q3ListBox * lb ) const

重实现自 Q3ListBoxItem::width ().

Returns the width of the pixmap plus some margin in list box lb .

另请参阅 paint () 和 height ().