Hi,
i am using Qt4.1. I have a Q3ListBox, and i want to align the items in the box, to the right or to the center.
Please reply me.
regards,
sree
Hi,
i am using Qt4.1. I have a Q3ListBox, and i want to align the items in the box, to the right or to the center.
Please reply me.
regards,
sree
Inherit Q3ListBoxItem and override:
void Q3ListBoxItem:aint ( QPainter * p ) [pure virtual protected]
In paint(), you can draw aligned text with:
void QPainter::drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() )
by supplying a QTextOption whose text aligment has been set to your like.
Thanks a lot it works fine
The same can be done also with
void QPainter::drawText ( const QRect & r, int flags, const QString & str, QRect * br = 0 )
where the flags can be used for alignment
sree
Bookmarks