summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qcolumnview.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-08 13:12:08 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-08 13:12:08 (GMT)
commit19a824cfe36458732f12e6374848df37cd92eed8 (patch)
tree78f4bd9aa3327e655ea09a9da906e03e146d1f22 /src/gui/itemviews/qcolumnview.cpp
parent12dc33d0e7191dbabb03db989b0f56372de731e3 (diff)
downloadQt-19a824cfe36458732f12e6374848df37cd92eed8.zip
Qt-19a824cfe36458732f12e6374848df37cd92eed8.tar.gz
Qt-19a824cfe36458732f12e6374848df37cd92eed8.tar.bz2
Animations: fix compilation with QT_NO_ANIMATION
Diffstat (limited to 'src/gui/itemviews/qcolumnview.cpp')
-rw-r--r--src/gui/itemviews/qcolumnview.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/itemviews/qcolumnview.cpp b/src/gui/itemviews/qcolumnview.cpp
index fc89967..c544394 100644
--- a/src/gui/itemviews/qcolumnview.cpp
+++ b/src/gui/itemviews/qcolumnview.cpp
@@ -107,10 +107,13 @@ void QColumnViewPrivate::initialize()
{
Q_Q(QColumnView);
q->setTextElideMode(Qt::ElideMiddle);
+#ifndef QT_NO_ANIMATION
QObject::connect(&currentAnimation, SIGNAL(finished()), q, SLOT(_q_changeCurrentColumn()));
currentAnimation.setDuration(ANIMATION_DURATION_MSEC);
currentAnimation.setTargetObject(hbar);
+ currentAnimation.setPropertyName("value");
currentAnimation.setEasingCurve(QEasingCurve::InOutQuad);
+#endif //QT_NO_ANIMATION
delete itemDelegate;
q->setItemDelegate(new QColumnViewDelegate(q));
}
@@ -260,10 +263,12 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
if (!index.isValid() || d->columns.isEmpty())
return;
+#ifndef QT_NO_ANIMATION
if (d->currentAnimation.state() == QPropertyAnimation::Running)
return;
d->currentAnimation.stop();
+#endif //QT_NO_ANIMATION
// Fill up what is needed to get to index
d->closeColumns(index, true);
@@ -326,8 +331,12 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
}
}
+#ifndef QT_NO_ANIMATION
d->currentAnimation.setEndValue(newScrollbarValue);
d->currentAnimation.start();
+#else
+ horizontalScrollBar()->setValue(newScrollbarValue);
+#endif //QT_NO_ANIMATION
}
/*!
@@ -396,8 +405,10 @@ void QColumnView::resizeEvent(QResizeEvent *event)
void QColumnViewPrivate::updateScrollbars()
{
Q_Q(QColumnView);
+#ifndef QT_NO_ANIMATION
if (currentAnimation.state() == QPropertyAnimation::Running)
return;
+#endif //QT_NO_ANIMATION
// find the total horizontal length of the laid out columns
int horizontalLength = 0;
@@ -1031,7 +1042,6 @@ QColumnViewPrivate::QColumnViewPrivate()
: QAbstractItemViewPrivate()
,showResizeGrips(true)
,offset(0)
-,currentAnimation(0, "value") // will set the target later
,previewWidget(0)
,previewColumn(0)
{