Hi, it should be a simple error but I'm not able to find it.
Basically, I have a QGraphicsScene with a QGraphicsView with some QGraphicsPixmap items and QGraphicsTextitems, but I want to display some QGraphicsRectItems and they are not shown. They exist where they are supposed to be and they work fine, they react and they do what they should, but they are invisible.
I'm lost... I don't know what can be happening.
thanks!
Relevant code
Code:class CFinishRec : public QGraphicsRectItem { public: CFinishRec(bool bIsGood, QPointF ptPosition, qreal rW, qreal rH); ~CFinishRec(); bool getIsGood(); private: bool m_bIsGood;Code:CFinishRec::CFinishRec(bool bIsGood, QPointF ptPosition, qreal rW, qreal rH) { m_bIsGood = bIsGood; setPos(ptPosition); QRectF recAux = rect(); recAux.setWidth(rW); recAux.setHeight(rH); setVisible(false); //later on is set as visible, as shown in the next piece of code. setRect(recAux); //Color QBrush brushAux; QPen penAux; if(bIsGood) brushAux.setColor(QColor::fromRgb(0, 255, 0)); else brushAux.setColor(QColor::fromRgb(255, 0, 0)); penAux.setBrush(brushAux); setPen(penAux); setBrush(brushAux); }
Code://In another class. CFinishRec* pRecBottomGood = new CFinishRec(true, QPointF(50, 190), 50, 10); pRecBottomGood->setVisible(true); m_pScene->addItem(pRecBottomGood);



