I download the video from ICSNetwork from QGraphicsView e /Co from a slow... slow server! 3H. time download...

Now i understand to speed QGraphicsView i need to not repaint item that's not in Vieport..
logic ... and not launch event wo is not on view...


I have a text edit QGraphicsItem x 10 many text layer and each layer on edit modus having his blink cursor....

I try to discovery from item the exact area from the view:

QList<QGraphicsView *> QGraphicsScene::views () const
Returns a list of all the views that display this scene.

and the line..
QList<QGraphicsView *> rectolist = scene()->views();

crash the full application... why?

if i call:

const QRect viewRe = viewport()->rect();
on QGraphicsView it display the correct area...
and how i can stop blink cursor/or update event if i can not discovery viewport()?


Qt Code:
  1. /* TextLayer = QGraphicsItem update only area from blink cursor */
  2. void TextLayer::updatearea( const QRectF areas )
  3. {
  4. const qreal limits = boundingRect().width();
  5. if (areas.width() > limits) {
  6. return;
  7. }
  8. evesum++;
  9. /* discovery if areas is on viewport or not! */
  10. QList<QGraphicsView *> rectolist = scene()->views(); /* !!crash!! */
  11. QRect simprect = areas.toRect();
  12. qDebug() << "### area " << areas.width() << "x" << areas.height() << "|" << evesum;
  13. qDebug() << "### updatearea " << simprect;
  14. qDebug() << "### size rects " << rectolist.size();
  15. update(areas);
  16. }
To copy to clipboard, switch view to plain text mode