hi,can some one please tell me i just want my QGraphicsRectItems background should be blue color and top of that one i want the "BDiagPattern"..with my code i am getting only pattern inside the rectitem i want color also ...plese tell me how to do it?

Qt Code:
  1. QBrush brush;
  2. brush.setStyle(Qt::BDiagPattern);
  3. QMatrix myMatrix(99,0,99,0,0,0);
  4. brush.setMatrix(myMatrix);
  5. foreach(QGraphicsItem *item ,Parentrect->childItems())
  6. {
  7. qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (Qt::blue));
  8. qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (brush);
  9. }
To copy to clipboard, switch view to plain text mode