[Qt-interest] Custom QTreeView header
Malyushytsky, Alex
alex at wai.com
Wed Jun 9 23:59:14 CEST 2010
Try the following:
QPainter painter( this->viewport ());
QHeaderView is derived from QAbstractScrollArea, so you probably should paint on viewport.
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Fabio Dago
Sent: Tuesday, June 08, 2010 11:16 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Custom QTreeView header
Hi.
I'm trying to create a custom header for QTreeView.
The QHeaderView documentation says that using a delegate for custom
painting has no effect, so I subclass QHeaderView and reimplement
paintEvent()...
void MyHeaderView::paintEvent(QPaintEvent* e)
{
QPainter painter(this);
//...
//...
}
I dont't know why, but this doesn't work, and the QPainter contructor
outputs: " QPainter::begin: Paint device returned engine == 0, type: 1 "
What's wrong?
Thanks.
Fabio.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
“Please consider our environment before printing this email.”
More information about the Qt-interest-old
mailing list