Mercurial > hg > easyhg
comparison panner.cpp @ 48:996b3c4037ef
* Add IndirectPainting opt flag, makes a big difference to rendering Panner; rename project
| author | Chris Cannam |
|---|---|
| date | Wed, 10 Nov 2010 22:07:03 +0000 |
| parents | bd3accba9b3f |
| children | 3c46b2ac45d3 |
comparison
equal
deleted
inserted
replaced
| 47:24efab584ee5 | 48:996b3c4037ef |
|---|---|
| 35 m_clicked(false) | 35 m_clicked(false) |
| 36 { | 36 { |
| 37 // setViewport(new QGLWidget()); | 37 // setViewport(new QGLWidget()); |
| 38 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | 38 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
| 39 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | 39 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
| 40 setOptimizationFlags(QGraphicsView::DontSavePainterState); | 40 setOptimizationFlags(QGraphicsView::DontSavePainterState | |
| 41 QGraphicsView::IndirectPainting); | |
| 41 setMouseTracking(true); | 42 setMouseTracking(true); |
| 42 setInteractive(false); | 43 setInteractive(false); |
| 43 } | 44 } |
| 44 | 45 |
| 45 void | 46 void |
| 129 Panner::drawItems(QPainter *painter, int numItems, | 130 Panner::drawItems(QPainter *painter, int numItems, |
| 130 QGraphicsItem *items[], | 131 QGraphicsItem *items[], |
| 131 const QStyleOptionGraphicsItem options[]) | 132 const QStyleOptionGraphicsItem options[]) |
| 132 { | 133 { |
| 133 if (m_cache.size() != viewport()->size()) { | 134 if (m_cache.size() != viewport()->size()) { |
| 135 | |
| 136 std::cerr << "Panner: recreating cache" << std::endl; | |
| 134 | 137 |
| 135 QGraphicsScene *s = scene(); | 138 QGraphicsScene *s = scene(); |
| 136 if (!s) return; | 139 if (!s) return; |
| 137 PannerScene *ps = static_cast<PannerScene *>(s); | 140 PannerScene *ps = static_cast<PannerScene *>(s); |
| 138 | 141 |
