summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-17 03:49:53 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-17 03:49:53 (GMT)
commit815a5f08161f7add4a8b9d71f95bed0f45fbbe41 (patch)
tree33d2e68038826ea0f5fec402303a585403b0be21 /src/declarative
parent5872a38a2f2ccc67b590d580a258e110ee2d80dc (diff)
parent467face42d2db216860dade5f5d817a8cddb86f3 (diff)
downloadQt-815a5f08161f7add4a8b9d71f95bed0f45fbbe41.zip
Qt-815a5f08161f7add4a8b9d71f95bed0f45fbbe41.tar.gz
Qt-815a5f08161f7add4a8b9d71f95bed0f45fbbe41.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxgridview.cpp12
-rw-r--r--src/declarative/fx/qfxlistview.cpp8
-rw-r--r--src/declarative/qml/qmlrewrite.cpp4
3 files changed, 12 insertions, 12 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 448a41a..6c5a712 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -1095,8 +1095,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() - d->columns;
setCurrentIndex(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Down)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Right)) {
if (currentIndex() < d->model->count() - d->columns || d->wrap) {
@@ -1104,8 +1104,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()+d->columns;
setCurrentIndex(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Left)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Up)) {
if (currentIndex() > 0 || d->wrap) {
@@ -1113,8 +1113,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() - 1;
setCurrentIndex(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Right)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || d->wrap) {
@@ -1122,13 +1122,13 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() + 1;
setCurrentIndex(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
}
}
d->moveReason = QFxGridViewPrivate::Other;
- if (!event->isAccepted())
- QFxFlickable::keyPressEvent(event);
+ event->ignore();
+ QFxFlickable::keyPressEvent(event);
}
/*!
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index cb74910..0232717 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -1339,8 +1339,8 @@ void QFxListView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()-1;
d->updateCurrent(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->orient == Qt::Horizontal && event->key() == Qt::Key_Right)
|| (d->orient == Qt::Vertical && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || d->wrap) {
@@ -1348,13 +1348,13 @@ void QFxListView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()+1;
d->updateCurrent(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
}
}
d->moveReason = QFxListViewPrivate::Other;
- if (!event->isAccepted())
- QFxFlickable::keyPressEvent(event);
+ event->ignore();
+ QFxFlickable::keyPressEvent(event);
}
void QFxListView::componentComplete()
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp
index c708418..3f35160 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qmlrewrite.cpp
@@ -73,8 +73,8 @@ QString RewriteBinding::rewrite(QString code, unsigned position,
unsigned startOfStatement = node->firstSourceLocation().begin() - _position;
unsigned endOfStatement = node->lastSourceLocation().end() - _position;
- _writer->replace(startOfStatement, 0, QLatin1String("function() {\n"));
- _writer->replace(endOfStatement, 0, QLatin1String("\n}"));
+ _writer->replace(startOfStatement, 0, QLatin1String("(function() {\n"));
+ _writer->replace(endOfStatement, 0, QLatin1String("\n})"));
w.write(&code);