summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-04-27 18:37:28 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:51 +0200
commit9c8734dccb90804673c7464c5ce44da615c3ac86 (patch)
treeb6a16fd7839752fe2f0a8456203547a08f46b13a /src/gui
parent138cf4373b093e42c9bc9a713a34bc14a9776c5b (diff)
Fixes warnings about unused variables
Reviewed-by: Samuel (cherry picked from commit 28061caa38d94de85db9aec743d1efba33c1e46f)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp4
-rw-r--r--src/gui/itemviews/qtableview.cpp1
-rw-r--r--src/gui/kernel/qgesturemanager.cpp1
-rw-r--r--src/gui/kernel/qwidget_x11.cpp4
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp1
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/util/qflickgesture.cpp4
-rw-r--r--src/gui/util/qscroller.cpp3
9 files changed, 6 insertions, 18 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index 48cbec3d62..78918cc086 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -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:
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 45800551cb..63d7298024 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -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));
}
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 59a3d15a62..e70f3569aa 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -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();
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 5359fb37e8..7aa7dffd9b 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -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]);
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 5ece7d65c6..241a13f842 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -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();
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 130f012639..f3dc975259 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -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();
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 8499e0bc51..1280b4650b 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -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);
diff --git a/src/gui/util/qflickgesture.cpp b/src/gui/util/qflickgesture.cpp
index fdd2a95333..f87c84ccef 100644
--- a/src/gui/util/qflickgesture.cpp
+++ b/src/gui/util/qflickgesture.cpp
@@ -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;
diff --git a/src/gui/util/qscroller.cpp b/src/gui/util/qscroller.cpp
index db128c136a..870d56fcb7 100644
--- a/src/gui/util/qscroller.cpp
+++ b/src/gui/util/qscroller.cpp
@@ -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;