Fixes warnings about unused variables
authorOlivier Goffart <olivier.goffart@nokia.com>
Wed, 27 Apr 2011 16:37:28 +0000 (18:37 +0200)
committerOlivier Goffart <olivier.goffart@nokia.com>
Tue, 10 May 2011 10:54:51 +0000 (12:54 +0200)
Reviewed-by: Samuel
(cherry picked from commit 28061caa38d94de85db9aec743d1efba33c1e46f)

src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
src/gui/graphicsview/qgraphicswidget_p.cpp
src/gui/itemviews/qtableview.cpp
src/gui/kernel/qgesturemanager.cpp
src/gui/kernel/qwidget_x11.cpp
src/gui/text/qtextdocumentlayout.cpp
src/gui/text/qtextlayout.cpp
src/gui/util/qflickgesture.cpp
src/gui/util/qscroller.cpp

index 48cbec3..78918cc 100644 (file)
@@ -451,8 +451,8 @@ static QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> getFactor(qreal valu
 static qreal interpolate(const QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> &factor,
                          qreal min, qreal minPref, qreal pref, qreal maxPref, qreal max)
 {
-    qreal lower;
-    qreal upper;
+    qreal lower = 0;
+    qreal upper = 0;
 
     switch (factor.first) {
     case QGraphicsAnchorLayoutPrivate::MinimumToMinPreferred:
index 4580055..63d7298 100644 (file)
@@ -857,8 +857,6 @@ void QGraphicsWidgetPrivate::setWidth(qreal w)
     if (q->geometry().width() == w)
         return;
 
-    QRectF oldGeom = q->geometry();
-
     q->setGeometry(QRectF(q->x(), q->y(), w, height()));
 }
 
@@ -882,8 +880,6 @@ void QGraphicsWidgetPrivate::setHeight(qreal h)
     if (q->geometry().height() == h)
         return;
 
-    QRectF oldGeom = q->geometry();
-
     q->setGeometry(QRectF(q->x(), q->y(), width(), h));
 }
 
index 59a3d15..e70f356 100644 (file)
@@ -1300,7 +1300,6 @@ void QTableView::paintEvent(QPaintEvent *event)
     const QPen gridPen = QPen(gridColor, 0, d->gridStyle);
     const QHeaderView *verticalHeader = d->verticalHeader;
     const QHeaderView *horizontalHeader = d->horizontalHeader;
-    const QStyle::State state = option.state;
     const bool alternate = d->alternatingColors;
     const bool rightToLeft = isRightToLeft();
 
index 5359fb3..7aa7dff 100644 (file)
@@ -566,7 +566,6 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures,
                         = w->d_func()->gestureContext.find(type);
                 if (it != w->d_func()->gestureContext.end()) {
                     // i.e. 'w' listens to gesture 'type'
-                    Qt::GestureFlags flags = it.value();
                     if (!(it.value() & Qt::DontStartGestureOnChildren) && w != widget) {
                         // conflicting gesture!
                         (*conflicts)[widget].append(gestures[widget]);
index 5ece7d6..241a13f 100644 (file)
@@ -486,8 +486,6 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
 
     bool topLevel = (flags & Qt::Window);
     bool popup = (type == Qt::Popup);
-    bool dialog = (type == Qt::Dialog
-                   || type == Qt::Sheet);
     bool desktop = (type == Qt::Desktop);
     bool tool = (type == Qt::Tool || type == Qt::SplashScreen
                  || type == Qt::ToolTip || type == Qt::Drawer);
@@ -553,7 +551,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
     int sh = DisplayHeight(dpy,scr);
 
     if (desktop) {                                // desktop widget
-        dialog = popup = false;                        // force these flags off
+        popup = false;                        // force these flags off
         data.crect.setRect(0, 0, sw, sh);
     } else if (topLevel && !q->testAttribute(Qt::WA_Resized)) {
         QDesktopWidget *desktopWidget = qApp->desktop();
index 130f012..f3dc975 100644 (file)
@@ -3090,6 +3090,7 @@ void QTextDocumentLayoutPrivate::ensureLayouted(QFixed y) const
     if (currentLazyLayoutPosition == -1)
         return;
     const QSizeF oldSize = q->dynamicDocumentSize();
+    Q_UNUSED(oldSize);
 
     if (checkPoints.isEmpty())
         layoutStep();
index 8499e0b..1280b46 100644 (file)
@@ -1211,8 +1211,6 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
         d->itemize();
 
     QPointF position = pos + d->position;
-    QFixed pos_x = QFixed::fromReal(position.x());
-    QFixed pos_y = QFixed::fromReal(position.y());
 
     cursorPosition = qBound(0, cursorPosition, d->layoutData->string.length());
     int line = d->lineNumberForTextPosition(cursorPosition);
index fdd2a95..f87c84c 100644 (file)
@@ -218,10 +218,10 @@ public:
             mouseTarget = 0;
         } else if (mouseTarget) {
             // we did send a press, so we need to fake a release now
-            Qt::MouseButtons mouseButtons = QApplication::mouseButtons();
 
             // release all pressed mouse buttons
-            /*for (int i = 0; i < 32; ++i) {
+            /* Qt::MouseButtons mouseButtons = QApplication::mouseButtons();
+            for (int i = 0; i < 32; ++i) {
                 if (mouseButtons & (1 << i)) {
                     Qt::MouseButton b = static_cast<Qt::MouseButton>(1 << i);
                     mouseButtons &= ~b;
index db128c1..870d56f 100644 (file)
@@ -1777,10 +1777,7 @@ void QScrollerPrivate::setState(QScroller::State newstate)
 */
 void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos)
 {
-    Q_Q(QScroller);
-    QPointF ppm = q->pixelPerMeter();
     const QScrollerPropertiesPrivate *sp = properties.d.data();
-    QPointF v = q->velocity();
 
     if (sp->overshootDragResistanceFactor)
         overshootPosition /= sp->overshootDragResistanceFactor;