##// END OF EJS Templates
Fix wrong intialization of QPointF with QPoint
Michal Klocek -
r1773:5d5f1f8b87bd
parent child
Show More
@@ -144,10 +144,10 QVariant SplineAnimation::interpolated(const QVariant &start, const QVariant &en
144 continue;
144 continue;
145 x = startPair.second[i * 2].x() + ((endPair.second[i * 2].x() - startPair.second[i * 2].x()) * progress);
145 x = startPair.second[i * 2].x() + ((endPair.second[i * 2].x() - startPair.second[i * 2].x()) * progress);
146 y = startPair.second[i * 2].y() + ((endPair.second[i * 2].y() - startPair.second[i * 2].y()) * progress);
146 y = startPair.second[i * 2].y() + ((endPair.second[i * 2].y() - startPair.second[i * 2].y()) * progress);
147 result.second << QPoint(x,y);
147 result.second << QPointF(x,y);
148 x = startPair.second[i * 2 + 1].x() + ((endPair.second[i * 2 + 1].x() - startPair.second[i * 2 + 1].x()) * progress);
148 x = startPair.second[i * 2 + 1].x() + ((endPair.second[i * 2 + 1].x() - startPair.second[i * 2 + 1].x()) * progress);
149 y = startPair.second[i * 2 + 1].y() + ((endPair.second[i * 2 + 1].y() - startPair.second[i * 2 + 1].y()) * progress);
149 y = startPair.second[i * 2 + 1].y() + ((endPair.second[i * 2 + 1].y() - startPair.second[i * 2 + 1].y()) * progress);
150 result.second << QPoint(x,y);
150 result.second << QPointF(x,y);
151 }
151 }
152
152
153 }
153 }
@@ -119,7 +119,7 void LegendLayout::setAttachedGeometry(const QRectF& rect)
119 QPointF point(0,0);
119 QPointF point(0,0);
120 foreach (LegendMarker* marker, m_legend->d_ptr->markers()) {
120 foreach (LegendMarker* marker, m_legend->d_ptr->markers()) {
121 if (marker->isVisible()) {
121 if (marker->isVisible()) {
122 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
122 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
123 marker->setPos(point.x(),rect.height()/2 - marker->boundingRect().height()/2);
123 marker->setPos(point.x(),rect.height()/2 - marker->boundingRect().height()/2);
124 const QRectF& rect = marker->boundingRect();
124 const QRectF& rect = marker->boundingRect();
125 size = size.expandedTo(rect.size());
125 size = size.expandedTo(rect.size());
@@ -143,7 +143,7 void LegendLayout::setAttachedGeometry(const QRectF& rect)
143 QPointF point(0,0);
143 QPointF point(0,0);
144 foreach (LegendMarker* marker, m_legend->d_ptr->markers()) {
144 foreach (LegendMarker* marker, m_legend->d_ptr->markers()) {
145 if (marker->isVisible()) {
145 if (marker->isVisible()) {
146 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
146 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
147 marker->setPos(point);
147 marker->setPos(point);
148 const QRectF& rect = marker->boundingRect();
148 const QRectF& rect = marker->boundingRect();
149 qreal h = rect.height();
149 qreal h = rect.height();
@@ -195,7 +195,7 void LegendLayout::setDettachedGeometry(const QRectF& rect)
195 for (int i=0; i<markers.count(); i++) {
195 for (int i=0; i<markers.count(); i++) {
196 LegendMarker *marker = markers.at(i);
196 LegendMarker *marker = markers.at(i);
197 if (marker->isVisible()) {
197 if (marker->isVisible()) {
198 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
198 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
199 marker->setPos(point.x(),point.y());
199 marker->setPos(point.x(),point.y());
200 const QRectF& boundingRect = marker->boundingRect();
200 const QRectF& boundingRect = marker->boundingRect();
201 qreal w = boundingRect.width();
201 qreal w = boundingRect.width();
@@ -228,7 +228,7 void LegendLayout::setDettachedGeometry(const QRectF& rect)
228 for (int i=0; i<markers.count(); i++) {
228 for (int i=0; i<markers.count(); i++) {
229 LegendMarker *marker = markers.at(i);
229 LegendMarker *marker = markers.at(i);
230 if (marker->isVisible()) {
230 if (marker->isVisible()) {
231 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
231 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
232 const QRectF& boundingRect = marker->boundingRect();
232 const QRectF& boundingRect = marker->boundingRect();
233 qreal w = boundingRect.width();
233 qreal w = boundingRect.width();
234 qreal h = boundingRect.height();
234 qreal h = boundingRect.height();
@@ -262,7 +262,7 void LegendLayout::setDettachedGeometry(const QRectF& rect)
262 for (int i=0; i<markers.count(); i++) {
262 for (int i=0; i<markers.count(); i++) {
263 LegendMarker *marker = markers.at(i);
263 LegendMarker *marker = markers.at(i);
264 if (marker->isVisible()) {
264 if (marker->isVisible()) {
265 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
265 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
266 const QRectF& boundingRect = marker->boundingRect();
266 const QRectF& boundingRect = marker->boundingRect();
267 qreal w = boundingRect.width();
267 qreal w = boundingRect.width();
268 qreal h = boundingRect.height();
268 qreal h = boundingRect.height();
@@ -298,7 +298,7 void LegendLayout::setDettachedGeometry(const QRectF& rect)
298 for (int i=0; i<markers.count(); i++) {
298 for (int i=0; i<markers.count(); i++) {
299 LegendMarker *marker = markers.at(i);
299 LegendMarker *marker = markers.at(i);
300 if (marker->isVisible()) {
300 if (marker->isVisible()) {
301 marker->setGeometry(QRectF(QPoint(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
301 marker->setGeometry(QRectF(QPointF(0,0),marker->effectiveSizeHint(Qt::PreferredSize)));
302 const QRectF& boundingRect = marker->boundingRect();
302 const QRectF& boundingRect = marker->boundingRect();
303 qreal w = boundingRect.width();
303 qreal w = boundingRect.width();
304 qreal h = boundingRect.height();
304 qreal h = boundingRect.height();
@@ -55,7 +55,7 void Scroller::mousePressEvent(QGraphicsSceneMouseEvent* event)
55 case Scroll:
55 case Scroll:
56 {
56 {
57 m_state = Stop;
57 m_state = Stop;
58 m_speed = QPoint(0, 0);
58 m_speed = QPointF(0, 0);
59 m_offset = offset();
59 m_offset = offset();
60 m_press = event->pos();
60 m_press = event->pos();
61 event->accept();
61 event->accept();
General Comments 0
You need to be logged in to leave comments. Login now