PDA

View Full Version : subclassing QHeaderView



chemstar
17th May 2006, 19:21
Hi,

i'm trying to rotate header items (text) in my qtablewidget.
i#m on the way to subclass qheaderview and the paintsection and paintevent methods inside.

but i don#t understand the meaning of ex. Q_D or other macros inside the cpp file. can anyone explain me this issue.

thx in advice

miro

jpn
17th May 2006, 19:25
See jacek's explanation (http://www.qtcentre.org/forum/showthread.php?t=1307#6).

chemstar
17th May 2006, 19:37
thx

is it posible to subclass it and if yes then how?

wysota
17th May 2006, 20:11
Maybe it would be enough to provide an own item delegate for the header view?

jpn
17th May 2006, 20:50
Maybe it would be enough to provide an own item delegate for the header view?
This was kind of a surprise to me, but I just yesterday noticed that QHeaderView doesn't use delegates for anything at all.

Overriding just

void QHeaderView::paintSection ( QPainter * painter, const QRect & rect, int logicalIndex ) const [virtual protected]
might be enough and is most probably the best way to go..

chemstar
18th May 2006, 13:39
thanks.

i#m now able to rotate the header items. but the size of the gray colored background (behind the header) is still the same. where is this painted?

lauranger
22nd May 2006, 09:17
sizzHint method to re-implement ?

chemstar
22nd May 2006, 13:34
already done!

thanks