| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 2 | |
Hello, I'm trying to create a composed shape with my painter : QRect rectangleLeftUserName(option.rect.x() + 10, option.rect.y(), 20, 20); QRect rectangleUserName(option.rect.x() + 20, option.rect.y(), 100, 20); QRect rectangleRightUserName(option.rect.x() + 110, option.rect.y(), 20, 20); painter->drawEllipse(rectangleLeftUserName); painter->drawRect(rectangleUserName); painter->drawEllipse(rectangleRightUserName); It's creating three different standalone shapes, is there a way to merge thoses 3 shapes in one graphical element ? Thanks. Ben.
Attachment:
Attachment:
howTo.jpg
Description: JPEG image
Message 2 in thread
bunjeee wrote:
> Hello,
>
> I'm trying to create a composed shape with my painter :
> QRect rectangleLeftUserName(option.rect.x() + 10, option.rect.y(),
> 20, 20);
>
> QRect rectangleUserName(option.rect.x() + 20, option.rect.y(),
> 100, 20);
>
> QRect rectangleRightUserName(option.rect.x() + 110, option.rect.y(),
> 20, 20);
>
> painter->drawEllipse(rectangleLeftUserName);
>
> painter->drawRect(rectangleUserName);
>
> painter->drawEllipse(rectangleRightUserName);
>
>
>
> It's creating three different standalone shapes,
>
> is there a way to merge thoses 3 shapes in one graphical element ?
>
>
I think you want to use a QPainterPath. Then have QPainter draw, stroke
or fill that path.
--Justin
begin:vcard
begin:vcard
fn:Justin Noel
n:Noel;Justin
org:ICS;Engineering
adr:;;54B Middlesex Trpk;Bedford;MA;01730;USA
email;internet:justin@xxxxxxx
title:Sr. Consulting Engineer / Certified Qt Instructor
tel;work:(617) 621-0060
url:http://www.ics.com
version:2.1
end:vcard