81{
82
83
84
85
86
87 const QAbstractGraphicsShapeItem * shapeitem = qgraphicsitem_cast<const QAbstractGraphicsShapeItem*>(item);
88 const QGraphicsLineItem * lineitem(0);
89 if (!shapeitem)
90 lineitem = qgraphicsitem_cast<const QGraphicsLineItem*>(item);
91
92 if (shapeitem||lineitem) {
93 std::cout<<"IVP12DViewTransformation::paintItem: INFO: Draws QAbstractGraphicsShapeItem/QGraphicsLineItem"<<std::endl;
94 if (shapeitem) {
95 const QGraphicsSimpleTextItem * simpletextitem = qgraphicsitem_cast<const QGraphicsSimpleTextItem*>(item);
96 if (simpletextitem) {
97 std::cout<<"IVP12DViewTransformation::paintItem: WARNING - does not presently draw QGraphicsSimpleTextItems"<<std::endl;
98 return;
99 }
100 }
102 if (shapeitem) {
103 painter->setPen(shapeitem->pen());
104 painter->setBrush(shapeitem->brush());
106 }
107 else if (lineitem) {
108 painter->setPen(lineitem->pen());
110 }
111 painter->drawPath(path);
112
113
114
115
116
117 return;
118 }
119 const QGraphicsItemGroup * groupitem = qgraphicsitem_cast<const QGraphicsItemGroup*>(item);
120 if (groupitem) {
121 std::cout<<"IVP12DViewTransformation::paintItem: INFO: drawing QGraphicsGroupItem"<<std::endl;
122 return;
123 }
124 const QGraphicsPixmapItem * pixmapitem = qgraphicsitem_cast<const QGraphicsPixmapItem*>(item);
125 if (pixmapitem) {
126 std::cout<<"IVP12DViewTransformation::paintItem: WARNING - does not presently draw QGraphicsPixmapItems"<<std::endl;
127
128
129 return;
130 }
131
132 std::cout<<"IVP12DViewTransformation::paintItem: Can not paint graphics item in transformed view."
133 <<" Please only use items derived from either QAbstractGraphicsShapeItem, QGraphicsLineItem, QGraphicsGroupItem or QGraphicsPixmapItem."<<std::endl;
134 return;
135
136
137}
path
python interpreter configuration --------------------------------------—