OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Qt/Qtopia => Topic started by: china_cup on July 22, 2004, 10:02:51 am

Title: why cannot I drawtext on the widget??
Post by: china_cup on July 22, 2004, 10:02:51 am
I used the following codes:
QWdiget *widget=new QWidget(this);
QPainter painter(widget);
QRect rect=painter.window();
painter.eraseRect(rect);
QString text="Hello!";
painter.setBackgroundColor(QColor("white"));
painter.setPen(QColor("black"));
painter.drawText(rect,AlignHCenter,text);

but cannot see any word on the widget,I don't know why.
Title: why cannot I drawtext on the widget??
Post by: Mickeyl on July 22, 2004, 10:26:27 am
You should read more of the fine documents at http://doc.trolltech.com (http://doc.trolltech.com).

Overwrite paintEvent.