[Qt-interest] Fwd: Re: adding another item in QGraphicsItem
chandrasekar wagmare
sekarwagmare at gmail.com
Sun Apr 26 09:28:54 CEST 2009
thanks for reply ...
sorry but i cant get ...
*why not simply call the QGraphicsRectItem::paint() function? May as
well since you are inheriting from it.*
On Sat, Apr 25, 2009 at 8:24 PM, Sean Harmer <
sean.harmer at maps-technology.com> wrote:
> Hi,
>
> On Saturday 25 April 2009 12:14:47 you wrote:
> > ProgressItem::ProgressItem(const QRectF &rect)
> >
> > : QGraphicsRectItem(rect)
> >
> > {
> > textItem = new QGraphicsTextItem(this);
> >
> > textItem->setPos(10, 4);
> > textItem->setPlainText("In Progress");
> >
> > }
> >
> >
> > void ProgressItem::paint(QPainter *painter, const
> QStyleOptionGraphicsItem
> > *o, QWidget *widget)
> > {
> > QBrush brush(QColor(Qt::yellow));
> > painter->setBrush(QBrush(QColor(21, 155, 210, 255)));
> > painter->drawRect(rect());
> >
> > }
> >
> > i tried this one and its working .... the only problem is the text color
> Good. But, why not simply call the QGraphicsRectItem::paint() function? May
> as
> well since you are inheriting from it.
>
> Sean
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
CHANDRU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090426/50760b1d/attachment.html
More information about the Qt-interest-old
mailing list