Q3ListBoxText Class

The Q3ListBoxText class provides list box items that display text. 更多...

头: #include <Q3ListBoxText>
继承: Q3ListBoxItem

公共函数

Q3ListBoxText (Q3ListBox * listbox , const QString & text = QString())
Q3ListBoxText (const QString & text = QString())
Q3ListBoxText (Q3ListBox * listbox , const QString & text , Q3ListBoxItem * after )
~Q3ListBoxText ()

重实现公共函数

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

重实现保护函数

virtual void paint (QPainter * painter )

详细描述

The Q3ListBoxText class provides list box items that display text.

The text is drawn in the widget's current font. If you need several different fonts, you must implement your own subclass of Q3ListBoxItem .

另请参阅 Q3ListBox and Q3ListBoxItem .

成员函数文档编制

Q3ListBoxText:: Q3ListBoxText ( Q3ListBox * listbox , const QString & text = QString())

Constructs a list box item in list box listbox showing the text text .

Q3ListBoxText:: Q3ListBoxText (const QString & text = QString())

Constructs a list box item showing the text text .

Q3ListBoxText:: Q3ListBoxText ( Q3ListBox * listbox , const QString & text , Q3ListBoxItem * after )

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

Q3ListBoxText:: ~Q3ListBoxText ()

Destroys the item.

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

重实现自 Q3ListBoxItem::height ().

Returns the height of a line of text in list box lb .

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

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

重实现自 Q3ListBoxItem::paint ().

Draws the text using painter .

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

重实现自 Q3ListBoxItem::rtti ().

Returns 1.

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 Q3ListBoxText:: width (const Q3ListBox * lb ) const

重实现自 Q3ListBoxItem::width ().

Returns the width of this line in list box lb .

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