OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> why cannot I drawtext on the widget??
china_cup
post Jul 22 2004, 06:02 AM
Post #1





Group: Members
Posts: 14
Joined: 10-July 04
Member No.: 3,972



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.
Go to the top of the page
 
+Quote Post
Mickeyl
post Jul 22 2004, 06:26 AM
Post #2





Group: Members
Posts: 1,497
Joined: 12-November 03
From: Germany
Member No.: 907



You should read more of the fine documents at http://doc.trolltech.com.

Overwrite paintEvent.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st May 2013 - 12:25 PM