Is this a normal widget or does it use OpenGL?
Is this a normal widget or does it use OpenGL?
it's a normal widget derived from qlabel:
class PaintTest : public QLabel
{
public:
PaintTest( const QString & text, QWidget * parent = 0, Qt::WFlags f = 0 )
: QLabel(text,parent,f)
{
setAttribute(Qt::WA_PaintOutsidePaintEvent,true);
}
protected:
void ppp()
{
QPainter p(this);
// setAttribute(Qt::WA_PaintOutsidePaintEvent,true);
QPen pen(Qt:ashLine);
pen.setColor(Qt::red);
// p.s0etCompositionMode(QPainter::CompositionMode_Xo r);
p.setPen( pen );
p.drawLine(QPoint(0,0),QPoint(50,70));
p.drawLine(0,0,100,100);
printf("jdhfjkdshfjkhds\n");
fflush(stdout);
}
void paintEvent(QPaintEvent *e)
{
QLabel:aintEvent(e);
QPainter p(this);
p.setPen(QColor(146, 146, 146));
p.drawRect(0, 0, width() - 5, height() - 5);
printf("paintEvent\n");
fflush(stdout);
}
virtual void mouseMoveEvent ( QMouseEvent * e )
{
setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
QPainter p(this);
QPen pen;
pen.setColor(QColor(200,100,30));
p.setPen( pen );
p.drawLine(QPoint(0,0),e->pos());
p.drawLine(0,0,100,60);
// repaint(10,10,50,60);
printf("mouseMoveEvent\n");
fflush(stdout);
}
};
jh
It seems to work on my system (PLD Linux, Qt 4.1.0). See the attached image.
PS. Please, use [ code ] tags to make your code readable.
hm ...
linux / win32 - OpSystem problem ?? strange.
if anybody gets this working on win32, let me know!
jh
Yes, looks like a Qt bug.Originally Posted by jh
http://www.trolltech.com/developer/t...entry&id=83522
ok, so it's not due to my incompetence![]()
i'll wait till 4.1.1
thanx for the hint.
jh
Bookmarks