[Qt-interest] qDebug() << this->palette() not working

Neel Basu neel.basu.z at gmail.com
Mon Jun 15 09:21:26 CEST 2009


Here goes my Code

void Widget::paintEvent(QPaintEvent*){
	QPainter painter(this);
	painter.translate(width() / 2, height() / 2);
	painter.drawLine(0, 0, width(), height());
	QPalette p = this->palette();
	qDebug() << this->palette();
	qDrawShadePanel(&painter, QRect(50, 50, 50, 50), p);
}

I get the Following error message from the above code

error: no match for ‘operator<<’ in ‘qDebug()() << ((Widget*)this)-
>Widget::<anonymous>.QWidget::palette()’

But If I comment out the qDebug() line no Compilation error occurs.
and qDrawShadePanel takes that p as its QPalette argument.


Neel




More information about the Qt-interest-old mailing list