qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] Drawing rectangular

Subject: Re: [Qt-interest] Drawing rectangular
From: Srdjan Todorovic
Date: Mon, 21 Sep 2009 16:27:30 +0100
On 21/09/2009, Yuvaraj R <yuvaraj@xxxxxxxxxxx> wrote:
> Thanks for your reply
>
> I want to draw the rounded rectangular around the the particular text of
> text browser.

You could use:
void QPainter::drawRoundedRect ( const QRectF & rect, qreal xRadius,
qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize )

and pass the string's bounding rect as the first parameter. You would
have to manually calculate the bounding rectangle I think.

http://doc.trolltech.com/4.5/qpainter.html#boundingRect
Might help with finding out what size the rectangle has to be.

Srdjan

> On Mon, Sep 21, 2009 at 8:36 PM, Srdjan Todorovic <
> todorovic.s@xxxxxxxxxxxxxx> wrote:
>
>> On 21/09/2009, Yuvaraj R <yuvaraj@xxxxxxxxxxx> wrote:
>>
>> > Can u please help how i paint the textbrowser Text ?
>>
>> Like so:
>>
>> QString h("hello!");
>> painter.drawText ( 50, 50, h );
>>
>> yes?
>>
>> Srdjan
>>
>
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>