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?
brush.setStyle(Qt::BDiagPattern);
brush.setMatrix(myMatrix);
{
qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (Qt::blue));
qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (brush);
}
QBrush brush;
brush.setStyle(Qt::BDiagPattern);
QMatrix myMatrix(99,0,99,0,0,0);
brush.setMatrix(myMatrix);
foreach(QGraphicsItem *item ,Parentrect->childItems())
{
qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (Qt::blue));
qgraphicsitem_cast <QGraphicsRectItem * >(item)->setBrush (brush);
}
To copy to clipboard, switch view to plain text mode
Bookmarks