summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-12 06:56:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-12 06:56:50 (GMT)
commit7421702dd3202c21f3871171792476f0d2d50abe (patch)
tree5a45e20fd74e23cf0a4ad2aa1a80bd073fa51413 /src/declarative/fx
parent9094a6588de3a7264ec4647a24b94253a7609823 (diff)
parent949e21cdafeec0c0e4ac632ebbf21767479f04e5 (diff)
downloadQt-7421702dd3202c21f3871171792476f0d2d50abe.zip
Qt-7421702dd3202c21f3871171792476f0d2d50abe.tar.gz
Qt-7421702dd3202c21f3871171792476f0d2d50abe.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/qml/qmlcompiler.cpp
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxborderimage.cpp4
-rw-r--r--src/declarative/fx/qfxborderimage.h7
-rw-r--r--src/declarative/fx/qfxgridview.cpp4
-rw-r--r--src/declarative/fx/qfxgridview.h7
-rw-r--r--src/declarative/fx/qfxitem.cpp16
-rw-r--r--src/declarative/fx/qfxitem.h2
-rw-r--r--src/declarative/fx/qfxlistview.cpp1
-rw-r--r--src/declarative/fx/qfxlistview.h5
-rw-r--r--src/declarative/fx/qfxpathview.cpp2
-rw-r--r--src/declarative/fx/qfxpositioners.cpp1
-rw-r--r--src/declarative/fx/qfxpositioners.h3
-rw-r--r--src/declarative/fx/qfxtextedit.cpp2
-rw-r--r--src/declarative/fx/qfxvisualitemmodel.cpp14
-rw-r--r--src/declarative/fx/qfxwebview.cpp7
14 files changed, 31 insertions, 44 deletions
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index 6616912..8f98a11 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -273,7 +273,7 @@ void QFxBorderImage::setHorizontalTileMode(TileMode t)
Q_D(QFxBorderImage);
if (t != d->horizontalTileMode) {
d->horizontalTileMode = t;
- emit tileModeChanged();
+ emit horizontalTileModeChanged();
update();
}
}
@@ -289,7 +289,7 @@ void QFxBorderImage::setVerticalTileMode(TileMode t)
Q_D(QFxBorderImage);
if (t != d->verticalTileMode) {
d->verticalTileMode = t;
- emit tileModeChanged();
+ emit verticalTileModeChanged();
update();
}
}
diff --git a/src/declarative/fx/qfxborderimage.h b/src/declarative/fx/qfxborderimage.h
index eae9bd1..5bc1067 100644
--- a/src/declarative/fx/qfxborderimage.h
+++ b/src/declarative/fx/qfxborderimage.h
@@ -59,8 +59,8 @@ class Q_DECLARATIVE_EXPORT QFxBorderImage : public QFxImageBase
Q_ENUMS(TileMode)
Q_PROPERTY(QFxScaleGrid *border READ border CONSTANT)
- Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY tileModeChanged)
- Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY tileModeChanged)
+ Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged)
+ Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged)
public:
QFxBorderImage(QFxItem *parent=0);
@@ -80,7 +80,8 @@ public:
void setSource(const QUrl &url);
Q_SIGNALS:
- void tileModeChanged();
+ void horizontalTileModeChanged();
+ void verticalTileModeChanged();
protected:
QFxBorderImage(QFxBorderImagePrivate &dd, QFxItem *parent);
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 2d25d56..6abe88e 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -991,7 +991,7 @@ void QFxGridView::setCellWidth(int cellWidth)
if (cellWidth != d->cellWidth && cellWidth > 0) {
d->cellWidth = qMax(1, cellWidth);
d->updateGrid();
- emit cellSizeChanged();
+ emit cellWidthChanged();
d->layout();
}
}
@@ -1008,7 +1008,7 @@ void QFxGridView::setCellHeight(int cellHeight)
if (cellHeight != d->cellHeight && cellHeight > 0) {
d->cellHeight = qMax(1, cellHeight);
d->updateGrid();
- emit cellSizeChanged();
+ emit cellHeightChanged();
d->layout();
}
}
diff --git a/src/declarative/fx/qfxgridview.h b/src/declarative/fx/qfxgridview.h
index 08a7565..7f30f03 100644
--- a/src/declarative/fx/qfxgridview.h
+++ b/src/declarative/fx/qfxgridview.h
@@ -67,8 +67,8 @@ class Q_DECLARATIVE_EXPORT QFxGridView : public QFxFlickable
Q_PROPERTY(Flow flow READ flow WRITE setFlow)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer)
- Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellSizeChanged)
- Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellSizeChanged)
+ Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
+ Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged)
Q_CLASSINFO("DefaultProperty", "data")
public:
@@ -121,7 +121,8 @@ public Q_SLOTS:
Q_SIGNALS:
void countChanged();
void currentIndexChanged();
- void cellSizeChanged();
+ void cellWidthChanged();
+ void cellHeightChanged();
protected:
virtual void viewportMoved();
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index d6534a1..a155d5a 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1257,12 +1257,6 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
*/
/*!
- \fn void QFxItem::activeFocusChanged()
-
- This signal is emitted when this item gains active focus.
-*/
-
-/*!
\fn void QFxItem::baselineOffsetChanged()
This signal is emitted when the baseline offset of the item
@@ -2260,16 +2254,6 @@ void QFxItem::setKeepMouseGrab(bool keep)
}
/*!
- This function emits the \e activeFocusChanged signal.
- \a flag is not used.
- */
-void QFxItem::activeFocusChanged(bool flag)
-{
- Q_UNUSED(flag);
- emit activeFocusChanged();
-}
-
-/*!
This function emits the \e focusChanged signal.
Subclasses overriding this function should call up
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index bde0c9e..b2aefe2 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -166,7 +166,6 @@ Q_SIGNALS:
void stateChanged(const QString &);
void focusChanged();
void wantsFocusChanged();
- void activeFocusChanged();
void parentChanged();
protected:
@@ -183,7 +182,6 @@ protected:
virtual void classBegin();
virtual void componentComplete();
virtual void focusChanged(bool);
- virtual void activeFocusChanged(bool);
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
virtual void inputMethodEvent(QInputMethodEvent *);
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 5afd881..604d16b 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -1169,6 +1169,7 @@ void QFxListView::setOrientation(Qt::Orientation orientation)
setViewportHeight(-1);
d->clear();
refill();
+ emit orientationChanged();
d->updateCurrent(d->currentIndex);
}
}
diff --git a/src/declarative/fx/qfxlistview.h b/src/declarative/fx/qfxlistview.h
index 3cff422..5a83604 100644
--- a/src/declarative/fx/qfxlistview.h
+++ b/src/declarative/fx/qfxlistview.h
@@ -72,7 +72,7 @@ class Q_DECLARATIVE_EXPORT QFxListView : public QFxFlickable
Q_PROPERTY(bool strictlyEnforceHighlightRange READ strictlyEnforceHighlightRange WRITE setStrictlyEnforceHighlightRange)
Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
- Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
+ Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer)
Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged)
@@ -106,7 +106,7 @@ public:
bool strictlyEnforceHighlightRange() const;
void setStrictlyEnforceHighlightRange(bool strict);
-
+
qreal preferredHighlightBegin() const;
void setPreferredHighlightBegin(qreal);
@@ -144,6 +144,7 @@ public Q_SLOTS:
Q_SIGNALS:
void countChanged();
void spacingChanged();
+ void orientationChanged();
void currentIndexChanged();
void currentSectionChanged();
void sectionExpressionChanged();
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index b127f39..c580e98 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -607,7 +607,7 @@ void QFxPathViewPrivate::updateItem(QFxItem *item, qreal percent)
{
if (QObject *obj = QFxPathView::qmlAttachedProperties(item)) {
foreach(const QString &attr, path->attributes())
- static_cast<QFxPathViewAttached *>(obj)->setValue(attr.toLatin1(), path->attributeAt(attr, percent));
+ static_cast<QFxPathViewAttached *>(obj)->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
}
QPointF pf = path->pointAt(percent);
item->setX(pf.x() - item->width()*item->scale()/2);
diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp
index e4500aa..f8e7213 100644
--- a/src/declarative/fx/qfxpositioners.cpp
+++ b/src/declarative/fx/qfxpositioners.cpp
@@ -97,6 +97,7 @@ void QFxBasePositioner::setSpacing(int s)
return;
d->_spacing = s;
prePositioning();
+ emit spacingChanged();
}
QmlTransition *QFxBasePositioner::move() const
diff --git a/src/declarative/fx/qfxpositioners.h b/src/declarative/fx/qfxpositioners.h
index 89a61d7..d62da08 100644
--- a/src/declarative/fx/qfxpositioners.h
+++ b/src/declarative/fx/qfxpositioners.h
@@ -59,7 +59,7 @@ class Q_DECLARATIVE_EXPORT QFxBasePositioner : public QFxItem
{
Q_OBJECT
- Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
+ Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
Q_PROPERTY(QmlTransition *move READ move WRITE setMove)
Q_PROPERTY(QmlTransition *add READ add WRITE setAdd)
Q_PROPERTY(QmlTransition *remove READ remove WRITE setRemove)
@@ -93,6 +93,7 @@ protected:
Q_SIGNALS:
void layoutItemChanged();
+ void spacingChanged();
protected Q_SLOTS:
virtual void doPositioning()=0;
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index 07444bb..ccb8f7e 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -822,7 +822,7 @@ void QFxTextEdit::keyReleaseEvent(QKeyEvent *event)
\overload
Handles changing of the focus property. Focus is applied to the control
even if the edit does not have active focus. This is because things
- like KeyProxy can give the behavior of focus even when activeFocus isn't
+ like KeyProxy can give the behavior of focus even when hasFocus() isn't
true.
*/
void QFxTextEdit::focusChanged(bool hasFocus)
diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp
index 943f909..3a9e5d4 100644
--- a/src/declarative/fx/qfxvisualitemmodel.cpp
+++ b/src/declarative/fx/qfxvisualitemmodel.cpp
@@ -264,7 +264,7 @@ public:
for (QHash<int,QByteArray>::const_iterator it = m_abstractItemModel->roleNames().begin();
it != m_abstractItemModel->roleNames().end(); ++it) {
m_roles.append(it.key());
- m_roleNames.insert(QLatin1String(*it), it.key());
+ m_roleNames.insert(QString::fromUtf8(*it), it.key());
}
if (m_roles.count() == 1)
m_roleNames.insert(QLatin1String("modelData"), m_roles.at(0));
@@ -416,11 +416,11 @@ int QFxVisualDataModelDataMetaObject::createProperty(const char *name, const cha
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
model->ensureRoles();
- if (model->m_roleNames.contains(QLatin1String(name)))
+ if (model->m_roleNames.contains(QString::fromUtf8(name)))
return QmlOpenMetaObject::createProperty(name, type);
} else {
model->ensureRoles();
- const QLatin1String sname(name);
+ QString sname = QString::fromUtf8(name);
if (model->m_roleNames.contains(sname))
return QmlOpenMetaObject::createProperty(name, type);
}
@@ -438,7 +438,7 @@ QFxVisualDataModelDataMetaObject::propertyCreated(int, QMetaPropertyBuilder &pro
Q_ASSERT(data->m_model);
QFxVisualDataModelPrivate *model = QFxVisualDataModelPrivate::get(data->m_model);
- QString name = QLatin1String(prop.name());
+ QString name = QString::fromUtf8(prop.name());
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
if (name == QLatin1String("modelData")) {
if (model->m_listAccessor->type() == QmlListAccessor::Instance) {
@@ -532,7 +532,7 @@ QFxVisualDataModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &pr
QFxVisualDataModel *m = new QFxVisualDataModel;
m->setParent(object());
- m->setPart(QLatin1String(prop.name()));
+ m->setPart(QString::fromUtf8(prop.name()));
m->setModel(QVariant::fromValue(static_cast<QFxVisualDataModelParts *>(object())->model));
QVariant var = QVariant::fromValue((QObject *)m);
@@ -706,7 +706,7 @@ QFxItem *QFxVisualDataModel::item(int index, bool complete)
{
Q_D(QFxVisualDataModel);
if (d->m_visualItemModel)
- return d->m_visualItemModel->item(index, d->m_part.toLatin1(), complete);
+ return d->m_visualItemModel->item(index, d->m_part.toUtf8(), complete);
return item(index, QByteArray(), complete);
}
@@ -790,7 +790,7 @@ QFxItem *QFxVisualDataModel::item(int index, const QByteArray &viewId, bool comp
if (!item) {
QmlPackage *package = qobject_cast<QmlPackage *>(nobj);
if (package) {
- QObject *o = package->part(QLatin1String(viewId));
+ QObject *o = package->part(QString::fromUtf8(viewId));
item = qobject_cast<QFxItem *>(o);
if (item)
d->m_packaged.insertMulti(item, package);
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index a06e294..f7030ca 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -1325,9 +1325,8 @@ public Q_SLOTS:
void qmlLoaded()
{
if (component->isError()) {
- // XXX Could instead give these errors to the WebView to handle.
- foreach (QmlError err, component->errors())
- qWarning(err.toString().toLatin1());
+ // ### Could instead give these errors to the WebView to handle.
+ qWarning() << component->errors();
return;
}
item = qobject_cast<QFxItem*>(component->create(qmlContext(webview)));
@@ -1335,7 +1334,7 @@ public Q_SLOTS:
QString jsObjName;
for (int i=0; i<propertyNames.count(); ++i) {
if (propertyNames[i] != QLatin1String("type") && propertyNames[i] != QLatin1String("data")) {
- item->setProperty(propertyNames[i].toLatin1(),propertyValues[i]);
+ item->setProperty(propertyNames[i].toUtf8(),propertyValues[i]);
if (propertyNames[i] == QLatin1String("objectname"))
jsObjName = propertyValues[i];
}