diff options
Diffstat (limited to 'src/declarative')
88 files changed, 2750 insertions, 1569 deletions
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp index 7855f3e..15e257e 100644 --- a/src/declarative/extra/qfxparticles.cpp +++ b/src/declarative/extra/qfxparticles.cpp @@ -603,7 +603,6 @@ QFxParticles::QFxParticles(QFxItem *parent) { Q_D(QFxParticles); d->init(); - setFlag(QGraphicsItem::ItemHasNoContents, false); } QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent) @@ -611,7 +610,6 @@ QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent) { Q_D(QFxParticles); d->init(); - setFlag(QGraphicsItem::ItemHasNoContents, false); } QFxParticles::~QFxParticles() diff --git a/src/declarative/extra/qmlfontloader.cpp b/src/declarative/extra/qmlfontloader.cpp index 5373d02..4497384 100644 --- a/src/declarative/extra/qmlfontloader.cpp +++ b/src/declarative/extra/qmlfontloader.cpp @@ -175,15 +175,17 @@ QmlFontLoader::Status QmlFontLoader::status() const void QmlFontLoader::replyFinished() { Q_D(QmlFontLoader); - if (!d->reply->error()) { - QByteArray ba = d->reply->readAll(); - d->addFontToDatabase(ba); - } else { - d->status = Error; - emit statusChanged(); + if (d->reply) { + if (!d->reply->error()) { + QByteArray ba = d->reply->readAll(); + d->addFontToDatabase(ba); + } else { + d->status = Error; + emit statusChanged(); + } + d->reply->deleteLater(); + d->reply = 0; } - d->reply->deleteLater(); - d->reply = 0; } void QmlFontLoaderPrivate::addFontToDatabase(const QByteArray &ba) diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp index d199d5d..3bc76da 100644 --- a/src/declarative/fx/qfxborderimage.cpp +++ b/src/declarative/fx/qfxborderimage.cpp @@ -65,7 +65,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,BorderImage,QFxBorderImage) /*! \internal \class QFxBorderImage BorderImage - \brief The QFxBorderImage class provides an image item that you can add to a QFxView. + \brief The QFxBorderImage class provides an image item that you can add to a QmlView. */ QFxBorderImage::QFxBorderImage(QFxItem *parent) @@ -386,11 +386,9 @@ void QFxBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge if (d->smooth) p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth); - QPixmap pix = d->pix; - QMargins margins(border()->top(), border()->left(), border()->bottom(), border()->right()); QTileRules rules((Qt::TileRule)d->horizontalTileMode, (Qt::TileRule)d->verticalTileMode); - qDrawBorderPixmap(p, QRect(0, 0, (int)d->width, (int)d->height), margins, pix, pix.rect(), margins, rules); + qDrawBorderPixmap(p, QRect(0, 0, (int)d->width, (int)d->height), margins, d->pix, d->pix.rect(), margins, rules); if (d->smooth) { p->setRenderHint(QPainter::Antialiasing, oldAA); p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth); diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp index 1e6ad5a..5c1cccf 100644 --- a/src/declarative/fx/qfxflickable.cpp +++ b/src/declarative/fx/qfxflickable.cpp @@ -587,16 +587,16 @@ void QFxFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event) stealMouse = false; pressed = true; timeline.clear(); - velocityX = -1; - velocityY = -1; + velocityX = 0; + velocityY = 0; lastPos = QPoint(); - lastPosTime.start(); + QFxItemPrivate::start(lastPosTime); pressPos = event->pos(); pressX = _moveX.value(); pressY = _moveY.value(); flicked = false; - pressTime.start(); - velocityTime.start(); + QFxItemPrivate::start(pressTime); + QFxItemPrivate::start(velocityTime); } void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event) @@ -610,7 +610,7 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event) if (q->yflick()) { int dy = int(event->pos().y() - pressPos.y()); - if (qAbs(dy) > DragThreshold || pressTime.elapsed() > 200) { + if (qAbs(dy) > DragThreshold || QFxItemPrivate::elapsed(pressTime) > 200) { qreal newY = dy + pressY; const qreal minY = q->minYExtent(); const qreal maxY = q->maxYExtent(); @@ -630,7 +630,7 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event) if (q->xflick()) { int dx = int(event->pos().x() - pressPos.x()); - if (qAbs(dx) > DragThreshold || pressTime.elapsed() > 200) { + if (qAbs(dx) > DragThreshold || QFxItemPrivate::elapsed(pressTime) > 200) { qreal newX = dx + pressX; const qreal minX = q->minXExtent(); const qreal maxX = q->maxXExtent(); @@ -649,17 +649,21 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event) } if (!lastPos.isNull()) { - qreal elapsed = qreal(lastPosTime.restart()) / 1000.; + qreal elapsed = qreal(QFxItemPrivate::restart(lastPosTime)) / 1000.; if (elapsed <= 0) elapsed = 1; if (q->yflick()) { qreal diff = event->pos().y() - lastPos.y(); - velocityY = diff / elapsed; + // average to reduce the effect of spurious moves + velocityY += diff / elapsed; + velocityY /= 2; } if (q->xflick()) { qreal diff = event->pos().x() - lastPos.x(); - velocityX = diff / elapsed; + // average to reduce the effect of spurious moves + velocityX += diff / elapsed; + velocityX /= 2; } } @@ -681,6 +685,12 @@ void QFxFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *even if (lastPosTime.isNull()) return; + if (QFxItemPrivate::elapsed(lastPosTime) > 100) { + // if we drag then pause before release we should not cause a flick. + velocityX = 0.0; + velocityY = 0.0; + } + vTime = timeline.time(); if (qAbs(velocityY) > 10 && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold) flickY(velocityY); @@ -792,7 +802,7 @@ void QFxFlickable::viewportMoved() { Q_D(QFxFlickable); - int elapsed = d->velocityTime.elapsed(); + int elapsed = QFxItemPrivate::elapsed(d->velocityTime); if (elapsed) { qreal prevY = d->lastFlickablePosition.x(); @@ -817,7 +827,7 @@ void QFxFlickable::viewportMoved() } d->lastFlickablePosition = QPointF(d->_moveY.value(), d->_moveX.value()); - d->velocityTime.restart(); + QFxItemPrivate::restart(d->velocityTime); d->updateBeginningEnd(); if (d->flicked) { @@ -1200,7 +1210,8 @@ void QFxFlickable::movementEnding() void QFxFlickablePrivate::updateVelocity() { Q_Q(QFxFlickable); - emit q->velocityChanged(q->horizontalVelocity(), q->verticalVelocity()); + emit q->horizontalVelocityChanged(); + emit q->verticalVelocityChanged(); } QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxflickable.h b/src/declarative/fx/qfxflickable.h index b3339b0..aaf4e0f 100644 --- a/src/declarative/fx/qfxflickable.h +++ b/src/declarative/fx/qfxflickable.h @@ -143,7 +143,8 @@ Q_SIGNALS: void flickStarted(); void flickEnded(); void reportedVelocitySmoothingChanged(int); - void velocityChanged(qreal, qreal); + void horizontalVelocityChanged(); + void verticalVelocityChanged(); void isAtBoundaryChanged(); void pageChanged(); diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 3ac3f3c..860af66 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -113,7 +113,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage) /*! \internal \class QFxImage Image - \brief The QFxImage class provides an image item that you can add to a QFxView. + \brief The QFxImage class provides an image item that you can add to a QmlView. \ingroup group_coreitems diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index a2c744e..7f4e6b1 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -56,7 +56,7 @@ #include "qmlstate.h" #include "qlistmodelinterface.h" -#include "qfxview.h" +#include "qmlview.h" #include "qmlstategroup.h" #include "qfxitem_p.h" @@ -262,6 +262,8 @@ void QFxContents::calcHeight() QList<QGraphicsItem *> children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast<QFxItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QFxItem graphicsobjects? + continue; qreal y = child->y(); if (y + child->height() > bottom) bottom = y + child->height(); @@ -288,6 +290,8 @@ void QFxContents::calcWidth() QList<QGraphicsItem *> children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast<QFxItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QFxItem graphicsobjects? + continue; qreal x = child->x(); if (x + child->width() > right) right = x + child->width(); @@ -309,6 +313,8 @@ void QFxContents::setItem(QFxItem *item) QList<QGraphicsItem *> children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast<QFxItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QFxItem graphicsobjects? + continue; connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight())); connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight())); connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth())); @@ -1210,7 +1216,7 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj) /*! \class QFxItem Item - \brief The QFxItem class is a generic QFxView item. It is the base class for all other view items. + \brief The QFxItem class is a generic QmlView item. It is the base class for all other view items. \qmltext All visual items in Qt Declarative inherit from QFxItem. Although QFxItem @@ -2575,7 +2581,7 @@ bool QFxItem::sceneEvent(QEvent *event) if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) { - activeFocusChanged(hasActiveFocus()); + focusChanged(hasFocus()); } return rv; @@ -2688,9 +2694,23 @@ void QFxItem::setWidth(qreal w) QRectF(x(), y(), oldWidth, height())); } +void QFxItem::resetWidth() +{ + Q_D(QFxItem); + d->widthValid = false; + setImplicitWidth(implicitWidth()); +} + +qreal QFxItem::implicitWidth() const +{ + Q_D(const QFxItem); + return d->implicitWidth; +} + void QFxItem::setImplicitWidth(qreal w) { Q_D(QFxItem); + d->implicitWidth = w; if (d->width == w || widthValid()) return; @@ -2733,9 +2753,23 @@ void QFxItem::setHeight(qreal h) QRectF(x(), y(), width(), oldHeight)); } +void QFxItem::resetHeight() +{ + Q_D(QFxItem); + d->heightValid = false; + setImplicitHeight(implicitHeight()); +} + +qreal QFxItem::implicitHeight() const +{ + Q_D(const QFxItem); + return d->implicitHeight; +} + void QFxItem::setImplicitHeight(qreal h) { Q_D(QFxItem); + d->implicitHeight = h; if (d->height == h || heightValid()) return; @@ -2756,39 +2790,33 @@ bool QFxItem::heightValid() const } /*! - \qmlproperty bool Item::focus - This property indicates whether the item has has an active focus request. Set this - property to true to request active focus. -*/ + \qmlproperty bool Item::wantsFocus -bool QFxItem::hasFocus() const -{ - Q_D(const QFxItem); - return d->itemIsFocusedInScope; -} - -void QFxItem::setFocus(bool focus) -{ - if (focus) QGraphicsItem::setFocus(Qt::OtherFocusReason); - else QGraphicsItem::clearFocus(); -} - -void QFxItemPrivate::focusedInScopeChanged() + This property indicates whether the item has has an active focus request. +*/ +bool QFxItem::wantsFocus() const { - Q_Q(QFxItem); - q->focusChanged(q->hasFocus()); + return focusItem() != 0; } /*! - \qmlproperty bool Item::activeFocus - This property indicates whether the item has the active focus. + \qmlproperty bool Item::focus + This property indicates whether the item has keyboard input focus. Set this + property to true to request focus. */ - -bool QFxItem::hasActiveFocus() const +bool QFxItem::hasFocus() const { return QGraphicsItem::hasFocus(); } +void QFxItem::setFocus(bool focus) +{ + if (focus) + QGraphicsItem::setFocus(Qt::OtherFocusReason); + else + QGraphicsItem::clearFocus(); +} + /*! \reimp */ @@ -2818,6 +2846,43 @@ QDebug operator<<(QDebug debug, QFxItem *item) return debug; } +int QFxItemPrivate::consistentTime = -1; +void QFxItemPrivate::setConsistentTime(int t) +{ + consistentTime = t; +} + +QTime QFxItemPrivate::currentTime() +{ + if (consistentTime == -1) + return QTime::currentTime(); + else + return QTime(0, 0).addMSecs(consistentTime); +} + +void QFxItemPrivate::start(QTime &t) +{ + t = currentTime(); +} + +int QFxItemPrivate::elapsed(QTime &t) +{ + int n = t.msecsTo(currentTime()); + if (n < 0) // passed midnight + n += 86400 * 1000; + return n; +} + +int QFxItemPrivate::restart(QTime &t) +{ + QTime time = currentTime(); + int n = t.msecsTo(time); + if (n < 0) // passed midnight + n += 86400*1000; + t = time; + return n; +} + QT_END_NAMESPACE QML_DECLARE_TYPE(QFxKeysAttached) diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index c6a5311..b309cb3 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -75,8 +75,8 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QGraphicsObject, public QmlParserSta Q_PROPERTY(QmlList<QmlState *>* states READ states DESIGNABLE false) Q_PROPERTY(QmlList<QmlTransition *>* transitions READ transitions DESIGNABLE false) Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) - Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL) - Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL) + Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged RESET resetWidth FINAL) + Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged RESET resetHeight FINAL) Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL) Q_PROPERTY(QFxAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL) Q_PROPERTY(QFxAnchorLine left READ left CONSTANT FINAL) @@ -89,7 +89,7 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QGraphicsObject, public QmlParserSta Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) Q_PROPERTY(bool clip READ clip WRITE setClip) // ### move to QGI/QGO, NOTIFY Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL) - Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged FINAL) + Q_PROPERTY(bool wantsFocus READ wantsFocus NOTIFY wantsFocusChanged) Q_PROPERTY(QmlList<QGraphicsTransform *>* transform READ transform DESIGNABLE false FINAL) Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin) Q_PROPERTY(bool smooth READ smoothTransform WRITE setSmoothTransform) @@ -134,9 +134,13 @@ public: qreal width() const; void setWidth(qreal); + void resetWidth(); + qreal implicitWidth() const; qreal height() const; void setHeight(qreal); + void resetHeight(); + qreal implicitHeight() const; TransformOrigin transformOrigin() const; void setTransformOrigin(TransformOrigin); @@ -147,9 +151,9 @@ public: QRectF boundingRect() const; virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - virtual bool hasFocus() const; + bool wantsFocus() const; + bool hasFocus() const; void setFocus(bool); - bool hasActiveFocus() const; bool keepMouseGrab() const; void setKeepMouseGrab(bool); @@ -161,6 +165,7 @@ Q_SIGNALS: void baselineOffsetChanged(); void stateChanged(const QString &); void focusChanged(); + void wantsFocusChanged(); void activeFocusChanged(); void parentChanged(); diff --git a/src/declarative/fx/qfxitem_p.h b/src/declarative/fx/qfxitem_p.h index 054bdc7..2c7440f 100644 --- a/src/declarative/fx/qfxitem_p.h +++ b/src/declarative/fx/qfxitem_p.h @@ -108,7 +108,7 @@ public: widthValid(false), heightValid(false), _componentComplete(true), _keepMouse(false), smooth(false), keyHandler(0), - width(0), height(0) + width(0), height(0), implicitWidth(0), implicitHeight(0) {} ~QFxItemPrivate() { delete _anchors; } @@ -213,6 +213,8 @@ public: qreal width; qreal height; + qreal implicitWidth; + qreal implicitHeight; QPointF computeTransformOrigin() const; @@ -224,8 +226,18 @@ public: q->geometryChanged(QRectF(this->pos.x(), this->pos.y(), width, height), oldGeometry); } - // Inherited from QGraphcisItemPrivate - virtual void focusedInScopeChanged(); + // Reimplemented from QGraphicsItemPrivate + virtual void subFocusItemChange() + { + emit q_func()->wantsFocusChanged(); + } + + static int consistentTime; + static QTime currentTime(); + static void Q_DECLARATIVE_EXPORT setConsistentTime(int t); + static void start(QTime &); + static int elapsed(QTime &); + static int restart(QTime &); }; QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 6fa1172..5de9bf3 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -570,13 +570,7 @@ void QFxListViewPrivate::layout() return; q->refill(); updateHighlight(); - if (orient == Qt::Vertical) { - fixupY(); - q->setViewportHeight(endPosition() - startPosition()); - } else { - fixupX(); - q->setViewportWidth(endPosition() - startPosition()); - } + fixupPosition(); updateUnrequestedPositions(); } @@ -837,8 +831,9 @@ void QFxListViewPrivate::fixupX() \inherits Flickable \brief The ListView item provides a list view of items provided by a model. - The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML. - The items are laid out vertically or horizontally and may be flicked to scroll. + The model is typically provided by a QAbstractListModel "C++ model object", + but can also be created directly in QML. The items are laid out vertically + or horizontally and may be flicked to scroll. The below example creates a very simple vertical list, using a QML model. \image trivialListView.png @@ -877,9 +872,10 @@ QFxListView::~QFxListView() The model provides a set of data that is used to create the items for the view. For large or dynamic datasets the model is usually provided by a C++ model object. The C++ model object must be a \l - {QAbstractItemModel} subclass, a VisualModel, or a simple list. + {QAbstractItemModel} subclass or a simple list. - Models can also be created directly in QML, using a \l{ListModel} or \l{XmlListModel}. + Models can also be created directly in QML, using a \l{ListModel}, + \l{XmlListModel} or \l{VisualItemModel}. */ QVariant QFxListView::model() const { @@ -1076,9 +1072,9 @@ void QFxListView::setHighlightFollowsCurrentItem(bool autoHighlight) } /*! - \qmlproperty real preferredHighlightBegin - \qmlproperty real preferredHighlightEnd - \qmlproperty bool strictlyEnforceHighlightRange + \qmlproperty real ListView::preferredHighlightBegin + \qmlproperty real ListView::preferredHighlightEnd + \qmlproperty bool ListView::strictlyEnforceHighlightRange These properties set the preferred range of the highlight (current item) within the view. @@ -1131,7 +1127,7 @@ void QFxListView::setStrictlyEnforceHighlightRange(bool strict) } /*! - \qmlproperty int ListView::spacing + \qmlproperty real ListView::spacing This property holds the spacing to leave between items. */ diff --git a/src/declarative/fx/qfxlistview.h b/src/declarative/fx/qfxlistview.h index e5c3138..cc3d910 100644 --- a/src/declarative/fx/qfxlistview.h +++ b/src/declarative/fx/qfxlistview.h @@ -62,7 +62,6 @@ class Q_DECLARATIVE_EXPORT QFxListView : public QFxFlickable Q_OBJECT Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxListView) - Q_ENUMS(CurrentItemPositioning) Q_PROPERTY(QVariant model READ model WRITE setModel) Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) diff --git a/src/declarative/fx/qfxloader.cpp b/src/declarative/fx/qfxloader.cpp index 668faa4..d0c2690 100644 --- a/src/declarative/fx/qfxloader.cpp +++ b/src/declarative/fx/qfxloader.cpp @@ -361,10 +361,8 @@ void QFxLoaderPrivate::_q_updateSize() return; switch (resizeMode) { case QFxLoader::SizeLoaderToItem: - if (!q->widthValid()) - q->setImplicitWidth(item->width()); - if (!q->heightValid()) - q->setImplicitHeight(item->height()); + q->setImplicitWidth(item->width()); + q->setImplicitHeight(item->height()); break; case QFxLoader::SizeItemToLoader: item->setWidth(q->width()); diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp index 5471e1b..27f3ca6 100644 --- a/src/declarative/fx/qfxpainteditem.cpp +++ b/src/declarative/fx/qfxpainteditem.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE /*! \class QFxPaintedItem - \brief The QFxPaintedItem class is an abstract base class for QFxView items that want cached painting. + \brief The QFxPaintedItem class is an abstract base class for QmlView items that want cached painting. \ingroup group_coreitems This is a convenience class for implementing items that paint their contents @@ -101,7 +101,7 @@ void QFxPaintedItem::dirtyCache(const QRect& rect) QFxPaintedItemPrivate::ImageCacheItem *c = d->imagecache[i]; QRect isect = (c->area & rect) | c->dirty; if (isect == c->area && !inpaint) { - d->imagecache.removeAt(i); + delete d->imagecache.takeAt(i); } else { c->dirty = isect; ++i; @@ -231,6 +231,7 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge QPainter qp(&d->imagecache[i]->image); qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smooth); qp.translate(-area.x(), -area.y()); + qp.eraseRect(d->imagecache[i]->dirty); if (d->fillColor.isValid()) qp.fillRect(d->imagecache[i]->dirty,d->fillColor); qp.setClipRect(d->imagecache[i]->dirty); diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 62f9db0..86bc9a2 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -414,7 +414,7 @@ void QFxPathView::mousePressEvent(QGraphicsSceneMouseEvent *event) d->stealMouse = false; d->lastElapsed = 0; d->lastDist = 0; - d->lastPosTime.start(); + QFxItemPrivate::start(d->lastPosTime); d->tl.clear(); } @@ -443,7 +443,7 @@ void QFxPathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) else if (diff < -50) diff += 100; - d->lastElapsed = d->lastPosTime.restart(); + d->lastElapsed = QFxItemPrivate::restart(d->lastPosTime); d->lastDist = diff; d->startPc = newPc; } @@ -456,7 +456,7 @@ void QFxPathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *) if (d->lastPosTime.isNull()) return; - qreal elapsed = qreal(d->lastElapsed + d->lastPosTime.elapsed()) / 1000.; + qreal elapsed = qreal(d->lastElapsed + QFxItemPrivate::elapsed(d->lastPosTime)) / 1000.; qreal velocity = elapsed > 0. ? d->lastDist / elapsed : 0; if (d->model && d->model->count() && qAbs(velocity) > 5) { if (velocity > 100) diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index fbd7ee8..1a41b5d 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -52,7 +52,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient) /*! \internal \class QFxPen - \brief The QFxPen class provides a pen used for drawing rectangle borders on a QFxView. + \brief The QFxPen class provides a pen used for drawing rectangle borders on a QmlView. By default, the pen is invalid and nothing is drawn. You must either set a color (then the default width is 1) or a width (then the default color is black). @@ -69,14 +69,17 @@ void QFxPen::setColor(const QColor &c) { _color = c; _valid = _color.alpha() ? true : false; - emit updated(); + emit penChanged(); } void QFxPen::setWidth(int w) { + if (_width == w) + return; + _width = w; _valid = (_width < 1) ? false : true; - emit updated(); + emit penChanged(); } @@ -172,7 +175,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rectangle,QFxRect) /*! \internal \class QFxRect - \brief The QFxRect class provides a rectangle item that you can add to a QFxView. + \brief The QFxRect class provides a rectangle item that you can add to a QmlView. */ QFxRect::QFxRect(QFxItem *parent) : QFxItem(*(new QFxRectPrivate), parent) @@ -293,6 +296,7 @@ void QFxRect::setRadius(qreal radius) d->radius = radius; d->rectImage = QPixmap(); update(); + emit radiusChanged(); } /*! @@ -326,6 +330,7 @@ void QFxRect::setColor(const QColor &c) d->color = c; d->rectImage = QPixmap(); update(); + emit colorChanged(); } void QFxRect::generateRoundedRect() @@ -395,7 +400,7 @@ void QFxRect::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) void QFxRect::drawRect(QPainter &p) { Q_D(QFxRect); - if (d->gradient && d->gradient->gradient() /*|| p.usingQt() */) { + if (d->gradient && d->gradient->gradient()) { // XXX This path is still slower than the image path // Image path won't work for gradients though bool oldAA = p.testRenderHint(QPainter::Antialiasing); diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h index 439cc65..e5bb8d3 100644 --- a/src/declarative/fx/qfxrect.h +++ b/src/declarative/fx/qfxrect.h @@ -55,8 +55,8 @@ class Q_DECLARATIVE_EXPORT QFxPen : public QObject { Q_OBJECT - Q_PROPERTY(int width READ width WRITE setWidth) - Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(int width READ width WRITE setWidth NOTIFY penChanged) + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged) public: QFxPen(QObject *parent=0) : QObject(parent), _width(1), _color("#000000"), _valid(false) @@ -71,7 +71,7 @@ public: bool isValid() { return _valid; }; Q_SIGNALS: - void updated(); + void penChanged(); private: int _width; @@ -135,10 +135,10 @@ class Q_DECLARATIVE_EXPORT QFxRect : public QFxItem { Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QFxGradient *gradient READ gradient WRITE setGradient) - Q_PROPERTY(QFxPen * border READ border) - Q_PROPERTY(qreal radius READ radius WRITE setRadius) + Q_PROPERTY(QFxPen * border READ border CONSTANT) + Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) public: QFxRect(QFxItem *parent=0); @@ -157,6 +157,10 @@ public: void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); +Q_SIGNALS: + void colorChanged(); + void radiusChanged(); + private Q_SLOTS: void doUpdate(); diff --git a/src/declarative/fx/qfxrect_p.h b/src/declarative/fx/qfxrect_p.h index 8eb074a..c055b76 100644 --- a/src/declarative/fx/qfxrect_p.h +++ b/src/declarative/fx/qfxrect_p.h @@ -85,7 +85,7 @@ public: if (!pen) { Q_Q(QFxRect); pen = new QFxPen; - QObject::connect(pen, SIGNAL(updated()), q, SLOT(doUpdate())); + QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); } return pen; } diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp index e6ee242..84804ce 100644 --- a/src/declarative/fx/qfxrepeater.cpp +++ b/src/declarative/fx/qfxrepeater.cpp @@ -42,12 +42,13 @@ #include "qfxrepeater.h" #include "qfxrepeater_p.h" #include "qmllistaccessor.h" +#include "qfxvisualitemmodel.h" #include <qlistmodelinterface.h> QT_BEGIN_NAMESPACE QFxRepeaterPrivate::QFxRepeaterPrivate() -: component(0), count(0) +: model(0), ownModel(false) { } @@ -55,38 +56,21 @@ QFxRepeaterPrivate::~QFxRepeaterPrivate() { } -QFxItem *QFxRepeaterPrivate::addItem(QmlContext *ctxt, QFxItem *lastItem) -{ - Q_UNUSED(lastItem) - Q_Q(QFxRepeater); - QObject *nobj = component->create(ctxt); - QFxItem *item = qobject_cast<QFxItem *>(nobj); - if (item) { - item->setParent(q->parentItem()); -// item->stackUnder(lastItem); - deletables << nobj; - } else { - delete nobj; - } - - return item; -} - QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater) /*! \qmlclass Repeater \inherits Item - \brief The Repeater item allows you to repeat a component based on a data source. + \brief The Repeater item allows you to repeat a component based on a model. The Repeater item is used when you want to create a large number of - similar items. For each entry in the data source, an item is instantiated - in a context seeded with data from the data source. If the repeater will + similar items. For each entry in the model, an item is instantiated + in a context seeded with data from the model. If the repeater will be instantiating a large number of instances, it may be more efficient to use one of Qt Declarative's \l {xmlViews}{view items}. - The data source may be either an object list, a string list or a Qt model. + The model may be either an object list, a string list, a number or a Qt model. In each case, the data element and the index is exposed to each instantiated component. The index is always exposed as an accessible \c index property. In the case of an object or string list, the data element (of type string @@ -147,7 +131,7 @@ QFxRepeater::~QFxRepeater() The model providing data for the repeater. - The model may be either an object list, a string list or a Qt model. + The model may be either an object list, a string list, a number or a Qt model. In each case, the data element and the index is exposed to each instantiated component. The index is always exposed as an accessible \c index property. In the case of an object or string list, the data element (of type string @@ -166,11 +150,47 @@ QVariant QFxRepeater::model() const return d->dataSource; } -void QFxRepeater::setModel(const QVariant &v) +void QFxRepeater::setModel(const QVariant &model) { Q_D(QFxRepeater); - d->dataSource = v; - regenerate(); + clear(); + /* + if (d->model) { + disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); + disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); + disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); + disconnect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*))); + disconnect(d->model, SIGNAL(destroyingItem(QFxItem*)), this, SLOT(destroyingItem(QFxItem*))); + } + */ + d->dataSource = model; + QObject *object = qvariant_cast<QObject*>(model); + QFxVisualModel *vim = 0; + if (object && (vim = qobject_cast<QFxVisualModel *>(object))) { + if (d->ownModel) { + delete d->model; + d->ownModel = false; + } + d->model = vim; + } else { + if (!d->ownModel) { + d->model = new QFxVisualDataModel(qmlContext(this)); + d->ownModel = true; + } + if (QFxVisualDataModel *dataModel = qobject_cast<QFxVisualDataModel*>(d->model)) + dataModel->setModel(model); + } + if (d->model) { + /* + connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); + connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); + connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); + connect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*))); + connect(d->model, SIGNAL(destroyingItem(QFxItem*)), this, SLOT(destroyingItem(QFxItem*))); + */ + regenerate(); + emit countChanged(); + } } /*! @@ -182,14 +202,25 @@ void QFxRepeater::setModel(const QVariant &v) QmlComponent *QFxRepeater::delegate() const { Q_D(const QFxRepeater); - return d->component; + if (d->model) { + if (QFxVisualDataModel *dataModel = qobject_cast<QFxVisualDataModel*>(d->model)) + return dataModel->delegate(); + } + + return 0; } -void QFxRepeater::setDelegate(QmlComponent *_c) +void QFxRepeater::setDelegate(QmlComponent *delegate) { Q_D(QFxRepeater); - d->component = _c; - regenerate(); + if (!d->ownModel) { + d->model = new QFxVisualDataModel(qmlContext(this)); + d->ownModel = true; + } + if (QFxVisualDataModel *dataModel = qobject_cast<QFxVisualDataModel*>(d->model)) { + dataModel->setDelegate(delegate); + regenerate(); + } } /*! @@ -200,7 +231,9 @@ void QFxRepeater::setDelegate(QmlComponent *_c) int QFxRepeater::count() const { Q_D(const QFxRepeater); - return d->count; + if (d->model) + return d->model->count(); + return 0; } @@ -227,6 +260,16 @@ QVariant QFxRepeater::itemChange(GraphicsItemChange change, return rv; } +void QFxRepeater::clear() +{ + Q_D(QFxRepeater); + if (d->model) { + foreach (QFxItem *item, d->deletables) + d->model->release(item); + } + d->deletables.clear(); +} + /*! \internal */ @@ -234,152 +277,19 @@ void QFxRepeater::regenerate() { Q_D(QFxRepeater); - qDeleteAll(d->deletables); - d->deletables.clear(); - if (!d->component || !parentItem() || !isComponentComplete()) - return; - - QFxItem *lastItem = this; - - int count = 0; - - if (d->dataSource.type() == QVariant::StringList) { - QStringList sl = qvariant_cast<QStringList>(d->dataSource); - - count = sl.size(); - for (int ii = 0; ii < count; ++ii) { - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; + clear(); - ctxt->setContextProperty(QLatin1String("index"), ii); - ctxt->setContextProperty(QLatin1String("modelData"), sl.at(ii)); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; - } - } else if (d->dataSource.type() == QMetaType::QVariantList) { - QVariantList sl = qvariant_cast<QVariantList>(d->dataSource); - - count = sl.size(); - for (int ii = 0; ii < count; ++ii) { - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), ii); - ctxt->setContextProperty(QLatin1String("modelData"), sl.at(ii)); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; - } - } else if (QmlMetaType::isList(d->dataSource)) { - count = QmlMetaType::listCount(d->dataSource); - if (count <= 0) - return; - - for (int ii = 0; ii < count; ++ii) { - QVariant v = QmlMetaType::listAt(d->dataSource, ii); - QObject *o = QmlMetaType::toQObject(v); - - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), ii); - ctxt->setContextProperty(QLatin1String("modelData"), o); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; - } - } else if (QListModelInterface *model = qobject_cast<QListModelInterface*>(d->dataSource.value<QObject*>())) { - count = model->count(); - if (count <= 0) - return; - - for (int ii = 0; ii < count; ++ii) { - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), ii); - - QList<int> roles = model->roles(); - QHash<int,QVariant> data = model->data(ii,roles); - for (int j = 0; j < roles.size(); ++j) { - ctxt->setContextProperty(model->toString(roles.at(j)), data.value(roles.at(j))); - } - - //for compatability with other lists, assign data if there is only a single role - if (roles.size() == 1) - ctxt->setContextProperty(QLatin1String("modelData"), data.value(roles.at(0))); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; - } - } else if (QAbstractItemModel *model = qobject_cast<QAbstractItemModel*>(d->dataSource.value<QObject*>())) { - count = model->rowCount(); - if (count <= 0) - return; - - for (int ii = 0; ii < count; ++ii) { - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), ii); - - QList<int> roles; - QStringList roleNames; - QHash<int,QVariant> data; - for (QHash<int,QByteArray>::const_iterator it = model->roleNames().begin(); - it != model->roleNames().end(); ++it) { - roles.append(it.key()); - roleNames.append(QLatin1String(*it)); - } + if (!d->model || !d->model->count() || !d->model->isValid() || !parentItem() || !isComponentComplete()) + return; - QModelIndex index = model->index(ii, 0); - for (int j = 0; j < roles.size(); ++j) { - ctxt->setContextProperty(roleNames.at(j), model->data(index, roles.at(j))); + if (d->model) { + for (int ii = 0; ii < count(); ++ii) { + QFxItem *item = d->model->item(ii); + if (item) { + item->setParent(parentItem()); + d->deletables << item; } - - //for compatability with other lists, assign data if there is only a single role - if (roles.size() == 1) - ctxt->setContextProperty(QLatin1String("modelData"), data.value(roles.at(0))); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; - } - } else if (QObject *object = d->dataSource.value<QObject*>()) { - // A single object (i.e. list of size 1). - // Properties are the roles (excluding objectName). - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), QVariant(0)); - count = object->metaObject()->propertyCount(); - for (int ii = 1; ii < count; ++ii) { - const QMetaProperty &prop = object->metaObject()->property(ii); - ctxt->setContextProperty(QLatin1String(prop.name()), prop.read(object)); - } - - //for compatability with other lists, assign data if there is only a single role (excluding objectName) - if (count == 2) { - const QMetaProperty &prop = object->metaObject()->property(1); - ctxt->setContextProperty(QLatin1String("modelData"), prop.read(object)); - } - - d->addItem(ctxt, lastItem); - - } else if (d->dataSource.canConvert(QVariant::Int)){ - - count = qvariant_cast<int>(d->dataSource); - - for (int ii = 0; ii < count; ++ii) { - QmlContext *ctxt = new QmlContext(qmlContext(this), this); - d->deletables << ctxt; - - ctxt->setContextProperty(QLatin1String("index"), ii); - - if (QFxItem *item = d->addItem(ctxt, lastItem)) - lastItem = item; } } - d->count = count; } QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxrepeater.h b/src/declarative/fx/qfxrepeater.h index 43afd63..7d64d86 100644 --- a/src/declarative/fx/qfxrepeater.h +++ b/src/declarative/fx/qfxrepeater.h @@ -72,7 +72,11 @@ public: int count() const; +Q_SIGNALS: + void countChanged(); + private: + void clear(); void regenerate(); protected: diff --git a/src/declarative/fx/qfxrepeater_p.h b/src/declarative/fx/qfxrepeater_p.h index 65b0973..a4eb96d 100644 --- a/src/declarative/fx/qfxrepeater_p.h +++ b/src/declarative/fx/qfxrepeater_p.h @@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE class QmlContext; +class QFxVisualModel; class QFxRepeaterPrivate : public QFxItemPrivate { Q_DECLARE_PUBLIC(QFxRepeater) @@ -69,13 +70,11 @@ public: QFxRepeaterPrivate(); ~QFxRepeaterPrivate(); - QFxItem *addItem(QmlContext *ctxt, QFxItem *lastItem); - + QFxVisualModel *model; QVariant dataSource; - QmlComponent *component; - int count; + bool ownModel; - QList<QPointer<QObject> > deletables; + QList<QPointer<QFxItem> > deletables; }; QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 5b10289..c26ed2c 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -84,7 +84,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Text,QFxText) \qmlclass Text \ingroup group_coreitems - \brief The QFxText class provides a formatted text item that you can add to a QFxView. + \brief The QFxText class provides a formatted text item that you can add to a QmlView. Text was designed for read-only text; it does not allow for any text editing. It can display both plain and rich text. For example: @@ -467,8 +467,12 @@ void QFxTextPrivate::updateSize() Q_Q(QFxText); if (q->isComponentComplete()) { QFontMetrics fm(font); - int dy = q->height(); + if (text.isEmpty()) { + q->setImplicitHeight(fm.height()); + return; + } + int dy = q->height(); QString tmp; QSize size(0, 0); @@ -513,17 +517,9 @@ void QFxTextPrivate::updateSize() } q->setBaselineOffset(fm.ascent() + yoff); - if (!q->widthValid()) { - int newWidth = (richText ? (int)doc->idealWidth() : size.width()); - q->setImplicitWidth(newWidth); - } - if (!q->heightValid()) { - if (richText) { - q->setImplicitHeight((int)doc->size().height()); - } else { - q->setImplicitHeight(size.height()); - } - } + //### need to comfirm cost of always setting these for richText + q->setImplicitWidth(richText ? (int)doc->idealWidth() : size.width()); + q->setImplicitHeight(richText ? (int)doc->size().height() : size.height()); } else { dirty = true; } @@ -754,7 +750,7 @@ void QFxText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) if (needClip) { p->save(); - p->setClipRect(boundingRect()); + p->setClipRect(boundingRect(), Qt::IntersectClip); } p->drawPixmap(x, y, d->imgCache); if (needClip) diff --git a/src/declarative/fx/qfxtext_p.h b/src/declarative/fx/qfxtext_p.h index 95b566c..8b24c66 100644 --- a/src/declarative/fx/qfxtext_p.h +++ b/src/declarative/fx/qfxtext_p.h @@ -71,7 +71,7 @@ public: QFxTextPrivate() : color((QRgb)0), style(QFxText::Normal), imgDirty(true), hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(Qt::ElideNone), - dirty(false), wrap(false), richText(false), singleline(false), control(0), doc(0), + dirty(true), wrap(false), richText(false), singleline(false), control(0), doc(0), format(QFxText::AutoText) { } diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 72f12cc..f7b92a4 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -84,7 +84,7 @@ TextEdit { \qmlclass TextEdit \ingroup group_coreitems - \brief The QFxTextEdit class provides an editable formatted text item that you can add to a QFxView. + \brief The QFxTextEdit class provides an editable formatted text item that you can add to a QmlView. It can display both plain and rich text. @@ -455,7 +455,6 @@ void QFxTextEdit::setCursorDelegate(QmlComponent* c) { Q_D(QFxTextEdit); if(d->cursorComponent){ - delete d->cursorComponent; if(d->cursor){ disconnect(d->control, SIGNAL(cursorPositionChanged()), this, SLOT(moveCursorDelegate())); @@ -1044,18 +1043,18 @@ void QFxTextEdit::updateSize() yoff = dy/2; } setBaselineOffset(fm.ascent() + yoff + d->textMargin); - if (!widthValid()) { - int newWidth = (int)d->document->idealWidth(); - d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set - setImplicitWidth(newWidth); - } - if (!heightValid()) { - if (d->text.isEmpty()) { - setImplicitHeight(fm.height()); - } else { - setImplicitHeight((int)d->document->size().height()); - } - } + + //### need to comfirm cost of always setting these + int newWidth = (int)d->document->idealWidth(); + d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well? + int cursorWidth = 1; + if(d->cursor) + cursorWidth = d->cursor->width(); + newWidth += cursorWidth; + newWidth += 3;// ### Need a better way of ensuring cursor is in width + setImplicitWidth(newWidth); + setImplicitHeight(d->text.isEmpty() ? fm.height() : (int)d->document->size().height()); + setContentsSize(QSize(width(), height())); } else { d->dirty = true; diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index d9da308..b7b155a 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -41,6 +41,7 @@ #include "qfxtextinput.h" #include "qfxtextinput_p.h" +#include "qmlinfo.h" #include <QValidator> #include <QApplication> #include <QFontMetrics> @@ -130,9 +131,7 @@ void QFxTextInput::setFont(const QFont &font) d->cursorItem->setHeight(QFontMetrics(d->font).height()); moveCursor(); } - //updateSize(); - updateAll();//TODO: Only necessary updates - update(); + updateSize(); } /*! @@ -171,7 +170,9 @@ void QFxTextInput::setSelectionColor(const QColor &color) return; d->selectionColor = color; - //TODO: implement + QPalette p = d->control->palette(); + p.setColor(QPalette::Highlight, d->selectionColor); + d->control->setPalette(p); } /*! @@ -192,7 +193,9 @@ void QFxTextInput::setSelectedTextColor(const QColor &color) return; d->selectedTextColor = color; - //TODO: implement + QPalette p = d->control->palette(); + p.setColor(QPalette::HighlightedText, d->selectedTextColor); + d->control->setPalette(p); } /*! @@ -267,7 +270,7 @@ void QFxTextInput::setCursorVisible(bool on) return; d->cursorVisible = on; d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0); - updateAll();//TODO: Only update cursor rect + //d->control should emit the cursor update regions } /*! @@ -485,8 +488,6 @@ QmlComponent* QFxTextInput::cursorDelegate() const void QFxTextInput::setCursorDelegate(QmlComponent* c) { Q_D(QFxTextInput); - if(d->cursorComponent) - delete d->cursorComponent; d->cursorComponent = c; d->startCreatingCursor(); } @@ -507,14 +508,20 @@ void QFxTextInputPrivate::startCreatingCursor() q->connect(cursorComponent, SIGNAL(statusChanged(int)), q, SLOT(createCursor())); }else{//isError - qWarning() << "You could really use the error checking for QFxTextInput. We'll implement it soon.";//TODO:better error handling + qmlInfo(q) << "Could not load cursor delegate"; + qWarning() << cursorComponent->errors(); } } void QFxTextInput::createCursor() { Q_D(QFxTextInput); - //Handle isError too + if(d->cursorComponent->isError()){ + qmlInfo(this) << "Could not load cursor delegate"; + qWarning() << d->cursorComponent->errors(); + return; + } + if(!d->cursorComponent->isReady()) return; @@ -522,7 +529,8 @@ void QFxTextInput::createCursor() delete d->cursorItem; d->cursorItem = qobject_cast<QFxItem*>(d->cursorComponent->create()); if(!d->cursorItem){ - qWarning() << "You could really use the error reporting for QFxTextInput. We'll implement it soon.";//TODO:better error handling + qmlInfo(this) << "Could not instantiate cursor delegate"; + //The failed instantiation should print its own error messages return; } @@ -583,14 +591,17 @@ bool QFxTextInput::event(QEvent* ev) { Q_D(QFxTextInput); //Anything we don't deal with ourselves, pass to the control + bool handled = false; switch(ev->type()){ case QEvent::KeyPress: case QEvent::GraphicsSceneMousePress: break; default: - return d->control->processEvent(ev); + handled = d->control->processEvent(ev); } - return false; + if(!handled) + return QFxPaintedItem::event(ev); + return true; } void QFxTextInput::geometryChanged(const QRectF &newGeometry, @@ -610,10 +621,13 @@ void QFxTextInput::drawContents(QPainter *p, const QRect &r) int flags = QLineControl::DrawText; if(!isReadOnly() && d->cursorVisible && !d->cursorItem) flags |= QLineControl::DrawCursor; - if (d->control->hasSelectedText()) + if (d->control->hasSelectedText()){ flags |= QLineControl::DrawSelections; + } - d->control->draw(p, QPoint(0,0), r, flags); + QPoint offset = QPoint(0,0); + QRect clipRect = r; + d->control->draw(p, offset, clipRect, flags); p->restore(); } @@ -656,13 +670,13 @@ void QFxTextInputPrivate::init() q, SLOT(q_textChanged())); q->connect(control, SIGNAL(accepted()), q, SIGNAL(accepted())); - q->connect(control, SIGNAL(updateNeeded(const QRect &)), - // q, SLOT(dirtyCache(const QRect &))); - q, SLOT(updateAll())); + q->connect(control, SIGNAL(updateNeeded(QRect)), + q, SLOT(updateRect(QRect))); q->connect(control, SIGNAL(cursorPositionChanged(int,int)), - q, SLOT(updateAll())); + q, SLOT(updateRect()));//TODO: Only update rect between pos's q->connect(control, SIGNAL(selectionChanged()), - q, SLOT(updateAll())); + q, SLOT(updateRect()));//TODO: Only update rect in selection + //Note that above TODOs probably aren't that big a savings q->updateSize(); oldValidity = control->hasAcceptableInput(); lastSelectionStart = 0; @@ -708,7 +722,7 @@ void QFxTextInput::selectionChanged() void QFxTextInput::q_textChanged() { Q_D(QFxTextInput); - updateAll(); + updateSize(); emit textChanged(); if(hasAcceptableInput() != d->oldValidity){ d->oldValidity = hasAcceptableInput(); @@ -716,23 +730,32 @@ void QFxTextInput::q_textChanged() } } -//### Please replace this function with proper updating -void QFxTextInput::updateAll() +void QFxTextInput::updateRect(const QRect &r) { - clearCache(); - updateSize(); + if(r == QRect()) + clearCache(); + else + dirtyCache(r); update(); } -void QFxTextInput::updateSize() +void QFxTextInput::updateSize(bool needsRedraw) { Q_D(QFxTextInput); + int w = width(); + int h = height(); setImplicitHeight(d->control->height()); - //d->control->width() is max width, not current width - QFontMetrics fm = QFontMetrics(d->font); - setImplicitWidth(fm.width(d->control->text())+1); - //setImplicitWidth(d->control->naturalWidth());//### This fn should be coming into 4.6 shortly, and might be faster - setContentsSize(QSize(width(), height())); + int cursorWidth = d->control->cursorWidth(); + if(d->cursorItem) + cursorWidth = d->cursorItem->width(); + //### Is QFontMetrics too slow? + QFontMetricsF fm(d->font); + setImplicitWidth(fm.width(d->control->displayText())+cursorWidth); + setContentsSize(QSize(width(), height()));//Repaints if changed + if(w==width() && h==height() && needsRedraw){ + clearCache(); + update(); + } } QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxtextinput.h b/src/declarative/fx/qfxtextinput.h index 4fa4100..b1e8b14 100644 --- a/src/declarative/fx/qfxtextinput.h +++ b/src/declarative/fx/qfxtextinput.h @@ -184,13 +184,13 @@ public Q_SLOTS: void selectAll(); private Q_SLOTS: - void updateSize(); + void updateSize(bool needsRedraw = true); void q_textChanged(); void selectionChanged(); - void updateAll(); void createCursor(); void moveCursor(); void cursorPosChanged(); + void updateRect(const QRect &r = QRect()); private: Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxTextInput); diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index 81fbafa..45166de 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -243,14 +243,34 @@ public: QmlComponent *m_delegate; QmlContext *m_context; QList<int> m_roles; - QHash<int,QString> m_roleNames; + QHash<QString,int> m_roleNames; void ensureRoles() { - if (m_roles.isEmpty()) { + if (m_roleNames.isEmpty()) { if (m_listModelInterface) { m_roles = m_listModelInterface->roles(); - for (int ii = 0; ii < m_roles.count(); ++ii) - m_roleNames.insert(m_roles.at(ii), - m_listModelInterface->toString(m_roles.at(ii))); + for (int ii = 0; ii < m_roles.count(); ++ii) + m_roleNames.insert(m_listModelInterface->toString(m_roles.at(ii)), m_roles.at(ii)); + if (m_roles.count() == 1) + m_roleNames.insert(QLatin1String("modelData"), m_roles.at(0)); + } else if (m_abstractItemModel) { + 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()); + } + if (m_roles.count() == 1) + m_roleNames.insert(QLatin1String("modelData"), m_roles.at(0)); + } else if (m_modelList) { + m_roleNames.insert(QLatin1String("modelData"), 0); + if (m_modelList->type() == QmlListAccessor::Instance) { + if (QObject *object = m_modelList->at(0).value<QObject*>()) { + int count = object->metaObject()->propertyCount(); + for (int ii = 1; ii < count; ++ii) { + const QMetaProperty &prop = object->metaObject()->property(ii); + m_roleNames.insert(prop.name(), 0); + } + } + } } } } @@ -382,17 +402,14 @@ int QFxVisualDataModelDataMetaObject::createProperty(const char *name, const cha if ((!data->m_model->m_listModelInterface || !data->m_model->m_abstractItemModel) && data->m_model->m_modelList) { - if (!qstrcmp(name, "modelData")) + data->m_model->ensureRoles(); + if (data->m_model->m_roleNames.contains(QLatin1String(name))) return QmlOpenMetaObject::createProperty(name, type); } else { - const QLatin1String sname(name); data->m_model->ensureRoles(); - for (QHash<int, QString>::ConstIterator iter = data->m_model->m_roleNames.begin(); - iter != data->m_model->m_roleNames.end(); ++iter) { - - if (*iter == sname) - return QmlOpenMetaObject::createProperty(name, type); - } + const QLatin1String sname(name); + if (data->m_model->m_roleNames.contains(sname)) + return QmlOpenMetaObject::createProperty(name, type); } return -1; } @@ -407,31 +424,42 @@ QFxVisualDataModelDataMetaObject::propertyCreated(int, QMetaPropertyBuilder &pro QString name = QLatin1String(prop.name()); if ((!data->m_model->m_listModelInterface || !data->m_model->m_abstractItemModel) && data->m_model->m_modelList) { - return data->m_model->m_modelList->at(data->m_index); + if (name == QLatin1String("modelData")) { + if (data->m_model->m_modelList->type() == QmlListAccessor::Instance) { + QObject *object = data->m_model->m_modelList->at(0).value<QObject*>(); + return object->metaObject()->property(1).read(object); // the first property after objectName + } + return data->m_model->m_modelList->at(data->m_index); + } else { + // return any property of a single object instance. + QObject *object = data->m_model->m_modelList->at(0).value<QObject*>(); + return object->property(prop.name()); + } } else if (data->m_model->m_listModelInterface) { data->m_model->ensureRoles(); - for (QHash<int, QString>::ConstIterator iter = data->m_model->m_roleNames.begin(); - iter != data->m_model->m_roleNames.end(); ++iter) { - - if (*iter == name) { - roles.append(iter.key()); - QHash<int,QVariant> values = data->m_model->m_listModelInterface->data(data->m_index, QList<int>() << iter.key()); - if (values.isEmpty()) - return QVariant(); - else - return values.value(iter.key()); - } + QHash<QString,int>::const_iterator it = data->m_model->m_roleNames.find(name); + if (it != data->m_model->m_roleNames.end()) { + roles.append(*it); + QHash<int,QVariant> values = data->m_model->m_listModelInterface->data(data->m_index, QList<int>() << *it); + if (values.isEmpty()) + return QVariant(); + else + return values.value(*it); + } else if (data->m_model->m_roles.count() == 1 && name == QLatin1String("modelData")) { + //for compatability with other lists, assign modelData if there is only a single role + QHash<int,QVariant> values = data->m_model->m_listModelInterface->data(data->m_index, QList<int>() << data->m_model->m_roles.first()); + if (values.isEmpty()) + return QVariant(); + else + return *values.begin(); } } else if (data->m_model->m_abstractItemModel) { data->m_model->ensureRoles(); - for (QHash<int, QString>::ConstIterator iter = data->m_model->m_roleNames.begin(); - iter != data->m_model->m_roleNames.end(); ++iter) { - - if (*iter == name) { - roles.append(iter.key()); - QModelIndex index = data->m_model->m_abstractItemModel->index(data->m_index, 0); - return data->m_model->m_abstractItemModel->data(index, iter.key()); - } + QHash<QString,int>::const_iterator it = data->m_model->m_roleNames.find(name); + if (it != data->m_model->m_roleNames.end()) { + roles.append(*it); + QModelIndex index = data->m_model->m_abstractItemModel->index(data->m_index, 0); + return data->m_model->m_abstractItemModel->data(index, *it); } } Q_ASSERT(!"Can never be reached"); @@ -505,10 +533,10 @@ QFxVisualDataModelPrivate::QFxVisualDataModelPrivate(QmlContext *ctxt) QFxVisualDataModelData *QFxVisualDataModelPrivate::data(QObject *item) { - QList<QFxVisualDataModelData *> dataList = - item->findChildren<QFxVisualDataModelData *>(); - Q_ASSERT(dataList.count() == 1); - return dataList.first(); + QFxVisualDataModelData *dataItem = + item->findChild<QFxVisualDataModelData *>(); + Q_ASSERT(dataItem); + return dataItem; } QFxVisualDataModel::QFxVisualDataModel() @@ -537,6 +565,8 @@ QVariant QFxVisualDataModel::model() const void QFxVisualDataModel::setModel(const QVariant &model) { Q_D(QFxVisualDataModel); + delete d->m_modelList; + d->m_modelList = 0; d->m_modelVariant = model; if (d->m_listModelInterface) { // Assume caller has released all items. @@ -570,11 +600,11 @@ void QFxVisualDataModel::setModel(const QVariant &model) d->m_visualItemModel = 0; } + d->m_roles.clear(); + d->m_roleNames.clear(); + QObject *object = qvariant_cast<QObject *>(model); if (object && (d->m_listModelInterface = qobject_cast<QListModelInterface *>(object))) { - d->m_roles.clear(); - d->m_roleNames.clear(); - QObject::connect(d->m_listModelInterface, SIGNAL(itemsChanged(int,int,QList<int>)), this, SLOT(_q_itemsChanged(int,int,QList<int>))); QObject::connect(d->m_listModelInterface, SIGNAL(itemsInserted(int,int)), @@ -583,18 +613,10 @@ void QFxVisualDataModel::setModel(const QVariant &model) this, SLOT(_q_itemsRemoved(int,int))); QObject::connect(d->m_listModelInterface, SIGNAL(itemsMoved(int,int,int)), this, SLOT(_q_itemsMoved(int,int,int))); - if (d->m_delegate && d->m_listModelInterface->count()) emit itemsInserted(0, d->m_listModelInterface->count()); return; } else if (object && (d->m_abstractItemModel = qobject_cast<QAbstractItemModel *>(object))) { - d->m_roles.clear(); - d->m_roleNames.clear(); - for (QHash<int,QByteArray>::const_iterator it = d->m_abstractItemModel->roleNames().begin(); - it != d->m_abstractItemModel->roleNames().end(); ++it) { - d->m_roles.append(it.key()); - d->m_roleNames.insert(it.key(), QLatin1String(*it)); - } QObject::connect(d->m_abstractItemModel, SIGNAL(rowsInserted(const QModelIndex &,int,int)), this, SLOT(_q_rowsInserted(const QModelIndex &,int,int))); QObject::connect(d->m_abstractItemModel, SIGNAL(rowsRemoved(const QModelIndex &,int,int)), @@ -616,9 +638,8 @@ void QFxVisualDataModel::setModel(const QVariant &model) this, SLOT(_q_destroyingPackage(QmlPackage*))); return; } - if (!d->m_modelList) - d->m_modelList = new QmlListAccessor; - d->m_modelList->setList(model); + d->m_modelList = new QmlListAccessor; + d->m_modelList->setList(model, d->m_context?d->m_context->engine():qmlEngine(this)); if (d->m_delegate && d->modelCount()) { emit itemsInserted(0, d->modelCount()); emit countChanged(); diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index bcbedfb..a06e294 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -241,7 +241,7 @@ public: /*! \internal \class QFxWebView - \brief The QFxWebView class allows you to add web content to a QFxView. + \brief The QFxWebView class allows you to add web content to a QmlView. A WebView renders web content base on a URL. diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri index 1f553f6..986b146 100644 --- a/src/declarative/qml/parser/parser.pri +++ b/src/declarative/qml/parser/parser.pri @@ -10,7 +10,8 @@ HEADERS += $$PWD/qmljsast_p.h \ $$PWD/qmljslexer_p.h \ $$PWD/qmljsmemorypool_p.h \ $$PWD/qmljsnodepool_p.h \ - $$PWD/qmljsparser_p.h + $$PWD/qmljsparser_p.h \ + $$PWD/qmljsglobal_p.h SOURCES += $$PWD/qmljsast.cpp \ $$PWD/qmljsastvisitor.cpp \ diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g index 4ed75e8..3c5db0b 100644 --- a/src/declarative/qml/parser/qmljs.g +++ b/src/declarative/qml/parser/qmljs.g @@ -212,15 +212,15 @@ #ifndef QMLJSPARSER_P_H #define QMLJSPARSER_P_H +#include "qmljsglobal_p.h" #include "qmljsgrammar_p.h" #include "qmljsast_p.h" #include "qmljsengine_p.h" #include <QtCore/QList> +#include <QtCore/QString> -QT_BEGIN_NAMESPACE - -class QString; +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -388,7 +388,7 @@ protected: using namespace QmlJS; -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE void Parser::reallocateStack() { @@ -850,6 +850,21 @@ case $rule_number: { } break; ./ +UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; +UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT T_IDENTIFIER T_SEMICOLON ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval); + node->typeModifier = sym(2).sval; + node->propertyToken = loc(1); + node->typeModifierToken = loc(2); + node->typeToken = loc(4); + node->identifierToken = loc(6); + node->semicolonToken = loc(7); + sym(1).Node = node; +} break; +./ + UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_SEMICOLON ; /. @@ -3022,12 +3037,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; return false; } -QT_END_NAMESPACE +QT_QML_END_NAMESPACE ./ /: -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qmljsast.cpp b/src/declarative/qml/parser/qmljsast.cpp index 11a98b6..64fe99c 100644 --- a/src/declarative/qml/parser/qmljsast.cpp +++ b/src/declarative/qml/parser/qmljsast.cpp @@ -42,7 +42,7 @@ #include "qmljsast_p.h" #include "qmljsastvisitor_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { namespace AST { @@ -940,6 +940,6 @@ void UiSourceElement::accept0(Visitor *visitor) } } // namespace QmlJS::AST -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qmljsast_p.h b/src/declarative/qml/parser/qmljsast_p.h index 2c08877..2d37097 100644 --- a/src/declarative/qml/parser/qmljsast_p.h +++ b/src/declarative/qml/parser/qmljsast_p.h @@ -54,9 +54,10 @@ // #include "qmljsastvisitor_p.h" +#include "qmljsglobal_p.h" #include <QtCore/QString> -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE #define QMLJS_DECLARE_AST_NODE(name) \ enum { K = Kind_##name }; @@ -2480,13 +2481,13 @@ public: UiPublicMember(NameId *memberType, NameId *name) - : type(Property), memberType(memberType), name(name), expression(0), isDefaultMember(false), isReadonlyMember(false), parameters(0) + : type(Property), typeModifier(0), memberType(memberType), name(name), expression(0), isDefaultMember(false), isReadonlyMember(false), parameters(0) { kind = K; } UiPublicMember(NameId *memberType, NameId *name, ExpressionNode *expression) - : type(Property), memberType(memberType), name(name), expression(expression), isDefaultMember(false), isReadonlyMember(false), parameters(0) + : type(Property), typeModifier(0), memberType(memberType), name(name), expression(expression), isDefaultMember(false), isReadonlyMember(false), parameters(0) { kind = K; } virtual SourceLocation firstSourceLocation() const @@ -2508,6 +2509,7 @@ public: // attributes enum { Signal, Property } type; + NameId *typeModifier; NameId *memberType; NameId *name; ExpressionNode *expression; @@ -2517,6 +2519,7 @@ public: SourceLocation defaultToken; SourceLocation readonlyToken; SourceLocation propertyToken; + SourceLocation typeModifierToken; SourceLocation typeToken; SourceLocation identifierToken; SourceLocation colonToken; @@ -2666,6 +2669,6 @@ public: -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif diff --git a/src/declarative/qml/parser/qmljsastfwd_p.h b/src/declarative/qml/parser/qmljsastfwd_p.h index a6fee1d..fcb97ad 100644 --- a/src/declarative/qml/parser/qmljsastfwd_p.h +++ b/src/declarative/qml/parser/qmljsastfwd_p.h @@ -43,6 +43,7 @@ #define QMLJSAST_FWD_P_H #include <QtCore/qglobal.h> +#include "qmljsglobal_p.h" // // W A R N I N G @@ -55,7 +56,7 @@ // We mean it. // -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { namespace AST { @@ -182,6 +183,6 @@ class UiSignature; } } // namespace AST -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif diff --git a/src/declarative/qml/parser/qmljsastvisitor_p.h b/src/declarative/qml/parser/qmljsastvisitor_p.h index 237640f..eea492a 100644 --- a/src/declarative/qml/parser/qmljsastvisitor_p.h +++ b/src/declarative/qml/parser/qmljsastvisitor_p.h @@ -54,8 +54,9 @@ // #include "qmljsastfwd_p.h" +#include "qmljsglobal_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { namespace AST { @@ -329,6 +330,6 @@ public: } } // namespace AST -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif // QMLJSASTVISITOR_P_H diff --git a/src/declarative/qml/parser/qmljsengine_p.cpp b/src/declarative/qml/parser/qmljsengine_p.cpp index eab8944..7d4d6d7 100644 --- a/src/declarative/qml/parser/qmljsengine_p.cpp +++ b/src/declarative/qml/parser/qmljsengine_p.cpp @@ -39,12 +39,13 @@ ** ****************************************************************************/ +#include "qmljsglobal_p.h" #include "qmljsengine_p.h" #include "qmljsnodepool_p.h" #include <qnumeric.h> #include <QHash> -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -206,4 +207,4 @@ void Engine::setNodePool(NodePool *nodePool) } // end of namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qmljsengine_p.h b/src/declarative/qml/parser/qmljsengine_p.h index 877fff2..8627a99 100644 --- a/src/declarative/qml/parser/qmljsengine_p.h +++ b/src/declarative/qml/parser/qmljsengine_p.h @@ -56,9 +56,10 @@ #include <QString> #include <QSet> +#include "qmljsglobal_p.h" #include "qmljsastfwd_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { class NameId @@ -167,6 +168,6 @@ public: } // end of namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif // QMLJSENGINE_P_H diff --git a/src/declarative/qml/parser/qmljsglobal_p.h b/src/declarative/qml/parser/qmljsglobal_p.h new file mode 100644 index 0000000..99bb19f --- /dev/null +++ b/src/declarative/qml/parser/qmljsglobal_p.h @@ -0,0 +1,14 @@ +#ifndef QMLJSGLOBAL_P_H +#define QMLJSGLOBAL_P_H + +#include <QtCore/qglobal.h> + +#ifdef QT_CREATOR +#define QT_QML_BEGIN_NAMESPACE +#define QT_QML_END_NAMESPACE +#else // !QT_CREATOR +#define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE +#define QT_QML_END_NAMESPACE QT_END_NAMESPACE +#endif // QT_CREATOR + +#endif // QMLJSGLOBAL_P_H diff --git a/src/declarative/qml/parser/qmljsgrammar.cpp b/src/declarative/qml/parser/qmljsgrammar.cpp index 60edb0a..4188633 100644 --- a/src/declarative/qml/parser/qmljsgrammar.cpp +++ b/src/declarative/qml/parser/qmljsgrammar.cpp @@ -2,6 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -21,10 +22,9 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -51,150 +51,150 @@ const char *const QmlJSGrammar::spell [] = { "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch", "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", - "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "public", "import", - "as", 0, 0, 0, 0, 0}; + "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", "public", + "import", "as", 0, 0, 0, 0, 0}; const int QmlJSGrammar::lhs [] = { - 96, 96, 96, 97, 100, 100, 103, 103, 105, 104, - 104, 104, 104, 104, 104, 104, 104, 107, 102, 101, - 110, 110, 112, 112, 113, 113, 109, 111, 111, 111, - 111, 111, 111, 111, 119, 119, 119, 120, 120, 121, - 121, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 108, 108, 108, - 108, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 114, - 126, 126, 126, 126, 125, 125, 128, 128, 130, 130, - 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 132, 132, 106, 106, 106, - 106, 106, 135, 135, 136, 136, 136, 136, 134, 134, - 137, 137, 138, 138, 139, 139, 139, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, - 141, 142, 142, 142, 143, 143, 143, 143, 144, 144, - 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, - 145, 146, 146, 146, 146, 146, 147, 147, 147, 147, - 147, 148, 148, 149, 149, 150, 150, 151, 151, 152, + 97, 97, 97, 98, 101, 101, 104, 104, 106, 105, + 105, 105, 105, 105, 105, 105, 105, 108, 103, 102, + 111, 111, 113, 113, 114, 114, 110, 112, 112, 112, + 112, 112, 112, 112, 120, 120, 120, 121, 121, 122, + 122, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 109, + 109, 109, 109, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 115, 127, 127, 127, 127, 126, 126, 129, 129, + 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 133, 133, 107, + 107, 107, 107, 107, 136, 136, 137, 137, 137, 137, + 135, 135, 138, 138, 139, 139, 140, 140, 140, 141, + 141, 141, 141, 141, 141, 141, 141, 141, 141, 142, + 142, 142, 142, 143, 143, 143, 144, 144, 144, 144, + 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, + 146, 146, 146, 147, 147, 147, 147, 147, 148, 148, + 148, 148, 148, 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, - 157, 158, 158, 159, 159, 129, 129, 160, 160, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 99, 99, 162, 162, 163, 163, 164, 164, 98, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 98, 98, 98, 98, 115, 176, 176, 175, 175, 123, - 123, 177, 177, 178, 178, 180, 180, 179, 181, 184, - 182, 182, 185, 183, 183, 116, 117, 117, 118, 118, - 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, - 166, 167, 167, 167, 167, 168, 168, 169, 171, 186, - 186, 189, 189, 187, 187, 190, 188, 170, 170, 170, - 172, 172, 173, 173, 173, 191, 192, 174, 174, 122, - 133, 196, 196, 193, 193, 194, 194, 197, 198, 198, - 199, 199, 195, 195, 127, 127, 200}; + 157, 158, 158, 159, 159, 160, 160, 130, 130, 161, + 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 100, 100, 163, 163, 164, 164, 165, + 165, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 116, 177, 177, 176, + 176, 124, 124, 178, 178, 179, 179, 181, 181, 180, + 182, 185, 183, 183, 186, 184, 184, 117, 118, 118, + 119, 119, 166, 166, 166, 166, 166, 166, 166, 167, + 167, 167, 167, 168, 168, 168, 168, 169, 169, 170, + 172, 187, 187, 190, 190, 188, 188, 191, 189, 171, + 171, 171, 173, 173, 174, 174, 174, 192, 193, 175, + 175, 123, 134, 197, 197, 194, 194, 195, 195, 198, + 199, 199, 200, 200, 196, 196, 128, 128, 201}; const int QmlJSGrammar:: rhs[] = { 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 3, 3, 5, 5, 4, 4, 2, 0, 1, 1, 2, 1, 3, 2, 3, 2, 1, 5, 4, 3, 3, 3, 3, 1, 1, 1, 0, 1, 2, - 4, 6, 6, 3, 3, 4, 4, 5, 5, 6, - 6, 7, 7, 7, 7, 1, 1, 1, 1, 1, + 4, 6, 6, 3, 3, 7, 7, 4, 4, 5, + 5, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 3, 3, 4, 5, 3, 4, 3, 1, - 1, 2, 3, 4, 1, 2, 3, 5, 1, 1, + 1, 1, 1, 2, 3, 3, 4, 5, 3, 4, + 3, 1, 1, 2, 3, 4, 1, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, - 3, 5, 1, 2, 4, 4, 4, 3, 0, 1, - 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, - 3, 1, 3, 3, 1, 3, 3, 3, 1, 3, - 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, - 3, 1, 3, 3, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, + 1, 4, 3, 5, 1, 2, 4, 4, 4, 3, + 0, 1, 1, 3, 1, 1, 1, 2, 2, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, + 3, 3, 3, 1, 3, 3, 1, 3, 3, 3, + 1, 3, 3, 3, 3, 3, 3, 1, 3, 3, + 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, + 3, 3, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 5, 1, 5, 1, 3, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 2, 0, 1, 3, - 3, 1, 1, 1, 3, 1, 3, 2, 2, 2, - 0, 1, 2, 0, 1, 1, 2, 2, 7, 5, - 7, 7, 5, 9, 10, 7, 8, 2, 2, 3, - 3, 2, 2, 3, 3, 3, 3, 5, 5, 3, - 5, 1, 2, 0, 1, 4, 3, 3, 3, 3, - 3, 3, 3, 3, 4, 5, 2, 2, 2, 8, - 8, 1, 3, 0, 1, 0, 1, 1, 1, 2, - 1, 1, 0, 1, 0, 1, 2}; + 1, 1, 1, 1, 1, 1, 3, 1, 2, 0, + 1, 3, 3, 1, 1, 1, 3, 1, 3, 2, + 2, 2, 0, 1, 2, 0, 1, 1, 2, 2, + 7, 5, 7, 7, 5, 9, 10, 7, 8, 2, + 2, 3, 3, 2, 2, 3, 3, 3, 3, 5, + 5, 3, 5, 1, 2, 0, 1, 4, 3, 3, + 3, 3, 3, 3, 3, 3, 4, 5, 2, 2, + 2, 8, 8, 1, 3, 0, 1, 0, 1, 1, + 1, 2, 1, 1, 0, 1, 0, 1, 2}; const int QmlJSGrammar::action_default [] = { - 0, 0, 0, 19, 0, 165, 232, 196, 204, 200, - 144, 216, 192, 3, 129, 63, 145, 208, 212, 133, - 162, 143, 148, 128, 182, 169, 0, 70, 71, 66, - 333, 58, 335, 0, 0, 0, 0, 68, 0, 0, - 64, 67, 0, 0, 59, 61, 60, 69, 62, 0, - 65, 0, 0, 158, 0, 0, 145, 164, 147, 146, - 0, 0, 0, 160, 161, 159, 163, 0, 193, 0, - 0, 0, 0, 183, 0, 0, 0, 0, 0, 0, - 173, 0, 0, 0, 167, 168, 166, 171, 175, 174, - 172, 170, 185, 184, 186, 0, 201, 0, 197, 0, - 0, 139, 126, 138, 127, 95, 96, 97, 122, 98, - 123, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 124, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 125, 0, 0, 137, 233, - 140, 0, 141, 0, 142, 136, 0, 229, 222, 220, - 227, 228, 226, 225, 231, 224, 223, 221, 230, 217, - 0, 205, 0, 0, 209, 0, 0, 213, 0, 0, - 139, 131, 0, 130, 0, 135, 149, 0, 334, 324, - 325, 0, 322, 0, 323, 0, 326, 240, 247, 246, - 254, 242, 0, 243, 327, 0, 332, 244, 245, 250, - 248, 329, 328, 331, 251, 0, 262, 0, 0, 0, - 0, 333, 58, 0, 335, 59, 234, 276, 60, 0, - 0, 0, 263, 0, 0, 252, 253, 0, 241, 249, - 277, 278, 321, 330, 0, 292, 293, 294, 295, 0, - 288, 289, 290, 291, 318, 319, 0, 0, 0, 0, - 0, 281, 282, 238, 236, 198, 206, 202, 218, 194, - 239, 0, 145, 210, 214, 187, 176, 0, 0, 195, - 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, - 180, 178, 181, 179, 177, 190, 189, 191, 0, 203, - 0, 199, 0, 237, 145, 0, 219, 234, 235, 0, - 234, 0, 0, 284, 0, 0, 0, 286, 0, 207, - 0, 0, 211, 0, 0, 215, 274, 0, 266, 275, - 269, 0, 273, 0, 234, 267, 0, 234, 0, 0, - 285, 0, 0, 0, 287, 334, 324, 0, 0, 326, - 0, 320, 0, 310, 0, 0, 0, 280, 0, 279, - 0, 336, 0, 94, 256, 259, 0, 95, 262, 98, - 123, 100, 101, 66, 105, 106, 58, 107, 110, 64, - 67, 59, 234, 60, 69, 113, 62, 115, 65, 117, - 118, 263, 120, 121, 125, 0, 87, 0, 0, 89, - 93, 91, 78, 90, 92, 0, 88, 77, 257, 255, - 133, 134, 139, 0, 132, 0, 309, 0, 296, 297, - 0, 308, 0, 0, 0, 299, 304, 302, 305, 0, - 0, 303, 304, 0, 300, 0, 301, 258, 307, 0, - 258, 306, 0, 311, 312, 0, 258, 313, 314, 0, - 0, 315, 0, 0, 0, 316, 317, 151, 150, 0, - 0, 0, 283, 0, 0, 0, 298, 271, 264, 0, - 272, 268, 0, 270, 260, 0, 261, 265, 81, 0, - 0, 85, 72, 0, 74, 83, 0, 75, 84, 86, - 76, 82, 73, 0, 79, 155, 153, 157, 154, 152, - 156, 2, 5, 0, 7, 0, 6, 0, 1, 18, + 0, 0, 0, 19, 0, 167, 234, 198, 206, 202, + 146, 218, 194, 3, 131, 65, 147, 210, 214, 135, + 164, 145, 150, 130, 184, 171, 0, 72, 73, 68, + 335, 60, 337, 0, 0, 0, 0, 70, 0, 0, + 66, 69, 0, 0, 61, 63, 62, 71, 64, 0, + 67, 0, 0, 160, 0, 0, 147, 166, 149, 148, + 0, 0, 0, 162, 163, 161, 165, 0, 195, 0, + 0, 0, 0, 185, 0, 0, 0, 0, 0, 0, + 175, 0, 0, 0, 169, 170, 168, 173, 177, 176, + 174, 172, 187, 186, 188, 0, 203, 0, 199, 0, + 0, 141, 128, 140, 129, 97, 98, 99, 124, 100, + 125, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 126, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 127, 0, 0, 139, 235, + 142, 0, 143, 0, 144, 138, 0, 231, 224, 222, + 229, 230, 228, 227, 233, 226, 225, 223, 232, 219, + 0, 207, 0, 0, 211, 0, 0, 215, 0, 0, + 141, 133, 0, 132, 0, 137, 151, 0, 336, 326, + 327, 0, 324, 0, 325, 0, 328, 242, 249, 248, + 256, 244, 0, 245, 329, 0, 334, 246, 247, 252, + 250, 331, 330, 333, 253, 0, 264, 0, 0, 0, + 0, 335, 60, 0, 337, 61, 236, 278, 62, 0, + 0, 0, 265, 0, 0, 254, 255, 0, 243, 251, + 279, 280, 323, 332, 0, 294, 295, 296, 297, 0, + 290, 291, 292, 293, 320, 321, 0, 0, 0, 0, + 0, 283, 284, 240, 238, 200, 208, 204, 220, 196, + 241, 0, 147, 212, 216, 189, 178, 0, 0, 197, + 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, + 182, 180, 183, 181, 179, 192, 191, 193, 0, 205, + 0, 201, 0, 239, 147, 0, 221, 236, 237, 0, + 236, 0, 0, 286, 0, 0, 0, 288, 0, 209, + 0, 0, 213, 0, 0, 217, 276, 0, 268, 277, + 271, 0, 275, 0, 236, 269, 0, 236, 0, 0, + 287, 0, 0, 0, 289, 336, 326, 0, 0, 328, + 0, 322, 0, 312, 0, 0, 0, 282, 0, 281, + 0, 338, 0, 96, 258, 261, 0, 97, 264, 100, + 125, 102, 103, 68, 107, 108, 60, 109, 112, 66, + 69, 61, 236, 62, 71, 115, 64, 117, 67, 119, + 120, 265, 122, 123, 127, 0, 89, 0, 0, 91, + 95, 93, 80, 92, 94, 0, 90, 79, 259, 257, + 135, 136, 141, 0, 134, 0, 311, 0, 298, 299, + 0, 310, 0, 0, 0, 301, 306, 304, 307, 0, + 0, 305, 306, 0, 302, 0, 303, 260, 309, 0, + 260, 308, 0, 313, 314, 0, 260, 315, 316, 0, + 0, 317, 0, 0, 0, 318, 319, 153, 152, 0, + 0, 0, 285, 0, 0, 0, 300, 273, 266, 0, + 274, 270, 0, 272, 262, 0, 263, 267, 83, 0, + 0, 87, 74, 0, 76, 85, 0, 77, 86, 88, + 78, 84, 75, 0, 81, 157, 155, 159, 156, 154, + 158, 2, 5, 0, 7, 0, 6, 0, 1, 18, 9, 0, 0, 0, 10, 0, 11, 0, 16, 17, - 0, 12, 13, 0, 14, 15, 8, 80, 20, 0, - 4, 0, 27, 56, 0, 59, 25, 61, 60, 28, - 21, 0, 0, 57, 0, 37, 36, 35, 0, 0, - 48, 0, 49, 0, 54, 55, 0, 0, 46, 0, - 47, 0, 50, 51, 0, 0, 0, 0, 0, 52, - 53, 0, 44, 38, 45, 39, 0, 0, 0, 0, - 41, 0, 42, 43, 40, 26, 22, 0, 31, 32, - 33, 34, 133, 258, 0, 0, 95, 262, 98, 123, - 100, 101, 66, 105, 106, 58, 107, 110, 64, 67, - 59, 234, 60, 69, 113, 62, 115, 65, 117, 118, - 263, 120, 121, 125, 133, 0, 23, 0, 29, 24, - 30, 337}; + 0, 12, 13, 0, 14, 15, 8, 82, 20, 0, + 4, 0, 27, 58, 0, 61, 25, 63, 62, 28, + 21, 0, 0, 59, 0, 37, 36, 35, 0, 0, + 50, 0, 51, 0, 56, 57, 37, 0, 0, 0, + 0, 0, 46, 47, 0, 48, 0, 49, 0, 52, + 53, 0, 0, 0, 0, 0, 54, 55, 0, 44, + 38, 45, 39, 0, 0, 0, 0, 41, 0, 42, + 43, 40, 26, 22, 0, 31, 32, 33, 34, 135, + 260, 0, 0, 97, 264, 100, 125, 102, 103, 68, + 107, 108, 60, 109, 112, 66, 69, 61, 236, 62, + 71, 115, 64, 117, 67, 119, 120, 265, 122, 123, + 127, 135, 0, 23, 0, 29, 24, 30, 339}; const int QmlJSGrammar::goto_default [] = { 4, 498, 354, 192, 497, 520, 492, 496, 494, 499, - 19, 495, 15, 529, 531, 530, 615, 522, 519, 187, - 191, 193, 197, 546, 566, 565, 196, 228, 23, 470, + 19, 495, 15, 529, 531, 530, 622, 522, 519, 187, + 191, 193, 197, 547, 573, 572, 196, 228, 23, 470, 469, 352, 351, 6, 350, 353, 103, 14, 141, 21, 10, 140, 16, 22, 53, 20, 5, 25, 24, 265, 12, 259, 7, 255, 9, 257, 8, 256, 17, 263, @@ -205,213 +205,219 @@ const int QmlJSGrammar::goto_default [] = { 180, 194, 202, 201, 0}; const int QmlJSGrammar::action_index [] = { - 111, 1025, 2004, -36, 50, 73, -96, 57, -6, -69, - 231, -96, 307, 1, -96, -96, 485, 29, 71, 232, - 212, -96, -96, -96, 473, 286, 1025, -96, -96, -96, - 280, -96, 1820, 1460, 1025, 1025, 1025, -96, 684, 1025, - -96, -96, 1025, 1025, -96, -96, -96, -96, -96, 1025, - -96, 1025, 1025, -96, 1025, 1025, 98, 219, -96, -96, - 1025, 1025, 1025, -96, -96, -96, 200, 1025, 255, 1025, - 1025, 1025, 1025, 434, 1025, 1025, 1025, 1025, 1025, 1025, - 286, 1025, 1025, 1025, 129, 102, 103, 286, 207, 286, - 286, 213, 408, 418, 398, 1025, 30, 1025, 63, 1728, - 1025, 1025, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, 114, 1025, -96, -96, - 18, -38, -96, 1025, -96, -96, 1025, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - 1025, -47, 1025, 1025, 35, 125, 1025, -96, 1728, 1025, - 1025, -96, 118, -96, -46, -96, -96, 56, -96, 294, - 87, 51, -96, 301, -96, 38, 2096, -96, -96, -96, - -96, -96, 199, -96, -96, 11, -96, -96, -96, -96, - -96, -96, 2096, -96, -96, 348, -96, 507, 97, 2004, - 31, 275, 92, 67, 2280, 90, 1025, -96, 79, 64, - 1025, 61, -96, 55, 65, -96, -96, 270, -96, -96, - -96, -96, -96, -96, 85, -96, -96, -96, -96, 101, - -96, -96, -96, -96, -96, -96, 43, 49, 1025, 104, - 83, -96, -96, 1199, -96, 77, 41, -7, -96, 338, - 68, 32, 600, 78, 134, 440, 286, 283, 1025, 260, - 1025, 1025, 1025, 1025, 440, 1025, 1025, 1025, 1025, 1025, - 286, 286, 286, 286, 286, 341, 356, 362, 1025, -10, - 1025, 80, 1025, -96, 503, 1025, -96, 1025, 62, 16, - 1025, 14, 2004, -96, 1025, 121, 2004, -96, 1025, 58, - 1025, 1025, 82, 81, 1025, -96, 66, 131, 59, -96, - -96, 1025, -96, 251, 1025, -96, -41, 1025, -42, 2004, - -96, 1025, 140, 2004, -96, -17, 227, -37, -8, 2096, - -28, -96, 2004, -96, 1025, 108, 2004, 5, 2004, -96, - -5, -4, -55, -96, -96, 2004, -22, 433, 47, 425, - 116, 1025, 2004, 40, 20, 360, 52, 26, 760, 48, - 42, -96, 1114, -96, 27, 2, 23, 1025, 22, 6, - 1025, 37, 1025, 9, 7, 1025, -96, 1912, 28, -96, - -96, -96, -96, -96, -96, 1025, -96, -96, -96, -96, - 228, -96, 1025, -3, -96, 2004, -96, 99, -96, -96, - 2004, -96, 1025, 96, -25, -96, 36, -96, 36, 95, - 1025, -96, 36, -2, -96, 10, -96, 2004, -96, 107, - 2004, -96, 188, -96, -96, 215, 2004, 12, -96, 25, - 15, -96, 261, -9, 19, -96, -96, -96, -96, 1025, - 123, 2004, -96, 1025, 133, 2004, -96, -1, -96, 144, - -96, -96, 1025, -96, -96, 248, -96, -96, -96, 120, - 1372, -96, -96, 1636, -96, -96, 1548, -96, -96, -96, - -96, -96, -96, 127, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 768, -96, 241, 45, 656, -96, -96, - 115, 768, 179, 204, -96, 128, -96, 105, -96, -96, - 304, -96, -96, 76, -96, -96, -96, 93, -96, 54, - -96, 854, -96, -96, 44, 150, -96, 70, 34, -96, - -96, 940, 100, -96, 153, -96, -96, -96, -26, 168, - -96, 1025, -96, 147, -96, -96, 46, 192, -96, 1025, - -96, 149, -96, -96, 162, 53, 72, 1025, 165, -96, - -96, 161, -96, 169, -96, 60, 13, 230, 166, 254, - -96, 110, -96, -96, -96, -96, -96, 1284, -96, -96, - -96, -96, 274, 2188, 1460, 69, 417, 91, 507, 124, - 1025, 2004, 89, -19, 345, 8, -24, 684, 21, 17, - -96, 1114, -96, 4, -30, 0, 1025, 39, 3, 1025, - 33, 1025, -23, 24, 367, 109, -96, 578, -96, -96, - -96, -96, + 136, 1173, 2163, -89, 8, 112, -97, 51, 13, -35, + 267, -97, 367, 33, -97, -97, 658, 27, 92, 205, + 232, -97, -97, -97, 564, 261, 1173, -97, -97, -97, + 307, -97, 1977, 1438, 1173, 1173, 1173, -97, 913, 1173, + -97, -97, 1173, 1173, -97, -97, -97, -97, -97, 1173, + -97, 1173, 1173, -97, 1173, 1173, 90, 237, -97, -97, + 1173, 1173, 1173, -97, -97, -97, 252, 1173, 349, 1173, + 1173, 1173, 1173, 450, 1173, 1173, 1173, 1173, 1173, 1173, + 245, 1173, 1173, 1173, 134, 141, 132, 334, 241, 238, + 207, 334, 440, 564, 422, 1173, -1, 1173, 81, 1884, + 1173, 1173, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, 143, 1173, -97, -97, + 57, -43, -97, 1173, -97, -97, 1173, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + 1173, 22, 1173, 1173, 37, 30, 1173, -97, 1884, 1173, + 1173, -97, 128, -97, -53, -97, -97, -12, -97, 287, + 7, -50, -97, 264, -97, 68, 2256, -97, -97, -97, + -97, -97, 230, -97, -97, 67, -97, -97, -97, -97, + -97, -97, 2256, -97, -97, 449, -97, 462, 127, 2163, + 62, 276, 77, 58, 2442, 72, 1173, -97, 73, 47, + 1173, 52, -97, 50, 76, -97, -97, 273, -97, -97, + -97, -97, -97, -97, 105, -97, -97, -97, -97, 109, + -97, -97, -97, -97, -97, -97, 38, 45, 1173, 95, + 79, -97, -97, 1259, -97, 66, 24, -8, -97, 289, + 61, 32, 577, 74, 146, 398, 334, 258, 1173, 332, + 1173, 1173, 1173, 1173, 490, 1173, 1173, 1173, 1173, 1173, + 334, 334, 334, 334, 210, 490, 490, 391, 1173, -8, + 1173, 91, 1173, -97, 540, 1173, -97, 1173, 87, 64, + 1173, 54, 2163, -97, 1173, 151, 2163, -97, 1173, 69, + 1173, 1173, 180, 84, 1173, -97, 80, 99, 71, -97, + -97, 1173, -97, 290, 1173, -97, 78, 1173, 44, 2163, + -97, 1173, 101, 2163, -97, -22, 246, -48, -24, 2256, + -34, -97, 2163, -97, 1173, 113, 2163, 6, 2163, -97, + -7, -6, -49, -97, -97, 2163, -51, 470, 12, 400, + 133, 1173, 2163, 48, 17, 375, 42, 15, 701, 49, + 56, -97, 1349, -97, 55, 21, 53, 1173, 41, 14, + 1173, 25, 1173, -2, -3, 1173, -97, 2070, 36, -97, + -97, -97, -97, -97, -97, 1173, -97, -97, -97, -97, + 270, -97, 1173, -25, -97, 2163, -97, 88, -97, -97, + 2163, -97, 1173, 108, -28, -97, 85, -97, 85, 110, + 1173, -97, 85, 4, -97, -39, -97, 2163, -97, 111, + 2163, -97, 189, -97, -97, 93, 2163, 20, -97, 0, + -5, -97, 316, -29, 26, -97, -97, -97, -97, 1173, + 130, 2163, -97, 1173, 149, 2163, -97, 3, -97, 197, + -97, -97, 1173, -97, -97, 281, -97, -97, -97, 102, + 1613, -97, -97, 1702, -97, -97, 1791, -97, -97, -97, + -97, -97, -97, 115, -97, -97, -97, -97, -97, -97, + -97, -97, -97, 828, -97, 341, -16, 743, -97, -97, + 176, 743, 262, 340, -97, 145, -97, 116, -97, -97, + 298, -97, -97, 118, -97, -97, -97, 122, -97, 31, + -97, 1087, -97, -97, 34, 140, -97, 40, 39, -97, + -97, 1000, 121, -97, 185, -97, -97, -97, 29, 191, + -97, 1173, -97, 200, -97, -97, -10, 82, 198, 63, + 60, 83, -97, -97, 155, -97, 1173, -97, 193, -97, + -97, 194, 46, 70, 1173, 195, -97, -97, 157, -97, + 147, -97, 65, 28, 323, 192, 331, -97, 125, -97, + -97, -97, -97, -97, 1524, -97, -97, -97, -97, 416, + 2349, 1438, 75, 436, 89, 427, 86, 1173, 2163, 59, + -23, 351, 11, -11, 820, 16, -4, -97, 1349, -97, + 19, 18, 43, 1173, 23, 5, 1173, 35, 1173, 10, + 9, 416, 97, -97, 611, -97, -97, -97, -97, - -105, 8, 11, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -50, -105, -105, -105, - -105, -105, -105, -105, -105, -105, 104, -105, -105, -105, - 35, -105, -105, -4, 34, 85, 75, -105, 164, 167, - -105, -105, 171, 170, -105, -105, -105, -105, -105, 160, - -105, 166, 163, -105, 154, 177, -105, -105, -105, -105, - 174, 108, 116, -105, -105, -105, -105, 122, -105, 121, - 114, 109, 111, -105, 123, 124, 143, 147, 153, 151, - -105, 146, 138, 131, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, 137, -105, 126, -105, 90, - 52, 41, -105, -105, -105, -105, -105, -105, -105, -105, + -105, 11, 15, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -54, -105, -105, -105, + -105, -105, -105, -105, -105, -105, 79, -105, -105, -105, + 12, -105, -105, 4, 26, 98, 161, -105, 186, 158, + -105, -105, 173, 169, -105, -105, -105, -105, -105, 131, + -105, 127, 124, -105, 122, 118, -105, -105, -105, -105, + 148, 143, 139, -105, -105, -105, -105, 65, -105, 138, + 134, 151, 146, -105, 130, 115, 123, 114, 167, 174, + -105, 164, 103, 162, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, 97, -105, 95, -105, 85, + -1, 5, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, 58, -105, -105, - -105, -105, -105, 59, -105, -105, 38, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, 50, -105, -105, + -105, -105, -105, 9, -105, -105, 35, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - 175, -105, 139, -26, -105, -105, 37, -105, 227, 29, - 76, -105, -105, -105, -105, -105, -105, -105, -105, -10, - -105, -105, -105, 30, -105, -105, 4, -105, -105, -105, + 71, -105, 61, 48, -105, -105, 36, -105, 242, 53, + 68, -105, -105, -105, -105, -105, -105, -105, -105, -11, + -105, -105, -105, 47, -105, -105, 56, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, 83, -105, -105, 39, -105, 54, -105, 60, - -105, 49, -105, -105, -105, -105, 46, -105, -105, -105, - 65, 68, -105, -105, -105, -105, -105, 9, -105, -105, + -105, -105, 109, -105, -105, 39, -105, 37, -105, 42, + -105, 73, -105, -105, -105, -105, 72, -105, -105, -105, + 70, 60, -105, -105, -105, -105, -105, -6, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, -105, 24, -105, - -105, -105, -105, 107, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, 21, 223, -105, - 219, 211, 230, 234, -105, 96, 93, 74, 95, 97, - -105, -105, -105, -105, -105, -105, -105, -105, 179, -105, - 183, -105, 195, -105, -105, 209, -105, 184, -105, -105, - 101, -105, 7, -105, 16, -105, 15, -105, 191, -105, - 193, 185, -105, -105, 182, -105, -105, -105, -105, -105, - -105, 233, -105, 91, 203, -105, -105, 198, -105, 62, - -105, 57, -105, 173, -105, -105, 86, -105, -105, 84, - -105, -105, 56, -105, 45, -105, 55, -105, 80, -105, - -105, -105, -105, -105, -105, 77, -105, 12, -105, 63, - -105, 82, 61, -105, -105, 47, -105, -105, 102, -105, - -105, -105, 13, -105, -105, -105, -105, 36, -105, 22, - 71, -105, 92, -105, -105, -33, -105, -24, -105, -105, - -105, -105, -105, -105, -105, -19, -105, -105, -105, -105, - -105, -105, 73, -105, -105, 3, -105, -105, -105, -105, - 70, -105, 42, -105, -105, -105, -105, -105, -58, -105, - 64, -105, -56, -105, -105, -105, -105, -45, -105, -105, - -41, -105, -105, -105, -105, -105, -105, -31, -105, -105, - 50, -105, 66, -105, 69, -105, -105, -105, -105, 81, - -105, 44, -105, 53, -105, 51, -105, -105, -105, -105, - -105, -105, 48, -105, -105, 78, -105, -105, -105, -105, - 40, -105, -105, 249, -105, -105, 43, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, 17, -105, + -105, -105, -105, 111, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, 10, 214, -105, + 224, 194, 210, 204, -105, 96, 83, 89, 82, 62, + -105, -105, -105, -105, -105, -105, -105, -105, 182, -105, + 216, -105, 184, -105, -105, 251, -105, 141, -105, -105, + 125, -105, 23, -105, 6, -105, 93, -105, 192, -105, + 176, 191, -105, -105, 180, -105, -105, -105, -105, -105, + -105, 198, -105, 147, 88, -105, -105, 113, -105, 80, + -105, 75, -105, 74, -105, -105, 77, -105, -105, 86, + -105, -105, 78, -105, 81, -105, 30, -105, 46, -105, + -105, -105, -105, -105, -105, 52, -105, 33, -105, 28, + -105, 153, 34, -105, -105, 43, -105, -105, 116, -105, + -105, -105, 59, -105, -105, -105, -105, 69, -105, 45, + 104, -105, 90, -105, -105, 38, -105, 40, -105, -105, + -105, -105, -105, -105, -105, 44, -105, -105, -105, -105, + -105, -105, 84, -105, -105, 55, -105, -105, -105, -105, + 58, -105, 63, -105, -105, -105, -105, -105, -24, -105, + 64, -105, -28, -105, -105, -105, -105, -14, -105, -105, + -18, -105, -105, -105, -105, -105, -105, -57, -105, -105, + 31, -105, 29, -105, 27, -105, -105, -105, -105, 32, + -105, 41, -105, 49, -105, 51, -105, -105, -105, -105, + -105, -105, 14, -105, -105, 106, -105, -105, -105, -105, + 54, -105, -105, 67, -105, -105, 57, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, 67, -105, -105, 72, 110, -105, -105, - -105, 2, -105, 6, -105, -105, -105, -105, -105, -105, - 10, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, 344, -105, -105, -105, -105, -105, -105, -105, -105, - -105, 274, -105, -105, -22, -105, -105, -105, -105, -105, - -105, 1, -105, -105, -105, -105, -105, -105, -105, 5, - -105, -105, -105, -105, -20, -105, -105, 17, -105, -105, - -105, -105, -105, 31, -105, -105, -105, 28, 27, 32, - -105, -105, -105, -105, -105, -105, -105, 284, -105, -105, - -105, -105, -105, -105, 210, 26, 14, -105, 18, -105, - 88, 23, -105, -105, 19, -105, -105, 79, -105, -105, - -105, 25, -105, -105, -105, -105, 20, -105, 33, 103, - -105, 89, -105, -105, -105, -105, -105, 87, -105, -105, - -105, -105}; + -105, -105, -105, 76, -105, -105, -3, 188, -105, -105, + -105, -10, -105, -9, -105, -105, -105, -105, -105, -105, + 22, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, 346, -105, -105, -105, -105, -105, -105, -105, -105, + -105, 257, -105, -105, -19, -105, -105, -105, -105, -105, + -105, 24, -105, -105, -105, -105, -105, -105, 3, -105, + -105, -105, -105, -105, -105, -105, 20, -105, -105, -105, + -105, -5, -105, -105, 25, -105, -105, -105, -105, -105, + -16, -105, -105, -105, 19, 7, 21, -105, -105, -105, + -105, -105, -105, -105, 269, -105, -105, -105, -105, -105, + -105, 237, -2, 0, -105, 1, -105, 66, 8, -105, + -105, -4, -105, -105, 102, -105, -105, -105, 13, -105, + -105, -105, -105, 16, -105, 2, 108, -105, 91, -105, + -105, -105, -105, -105, 92, -105, -105, -105, -105}; const int QmlJSGrammar::action_info [] = { - 397, 95, 385, 539, 387, 427, 412, -114, 416, 137, - 97, -92, 344, 449, 175, -89, 462, 253, 329, 336, - 327, 348, 145, 338, -93, 339, 143, 341, -111, -116, - -114, 160, 440, 399, -92, 395, 436, 160, 412, 436, - -119, 420, 95, 453, -119, 449, -116, -103, 436, -93, - 621, 444, 436, 493, -122, -111, 253, 404, 67, -89, - 453, 442, 344, 561, 67, 426, 232, 253, 568, 290, - 137, 186, 290, 571, 302, 547, 292, 300, 268, 557, - 308, 268, 556, 321, 308, 248, 410, 521, 314, 288, - 331, 449, 179, 297, 436, 183, -103, 405, -122, 342, - 412, 453, 521, 344, 137, 423, 288, 577, 168, 97, - 534, 185, 137, 54, 430, 137, 137, 617, 0, 0, - 247, 162, 137, 0, 55, 163, 137, 169, 473, 137, - 168, 137, 166, 521, 493, 137, 554, 515, 514, 323, - 58, 137, 54, 54, 252, 251, 238, 237, 137, 169, - 424, 59, 465, 55, 55, 137, 414, 137, 245, 244, - 409, 408, 243, 242, 250, 618, 509, 508, 346, 54, - 138, 573, 572, 137, 173, 541, 474, 245, 244, 535, - 55, 306, 535, 451, 310, 245, 244, 484, 311, 512, - 511, 535, 324, 455, 168, 535, 137, 563, 535, 549, - 333, 0, 3, 2, 1, 466, 464, 137, 545, 544, - 553, 552, 60, 169, 0, 402, 0, 0, 510, 0, - 0, 439, 564, 562, 60, 537, 560, 559, 537, 542, - 540, 60, 81, 31, 82, 440, 536, 537, 81, 536, - 82, 537, 0, 168, 537, 83, 99, 168, 536, 434, - 433, 83, 536, 550, 548, 536, 31, 61, 0, 31, - 231, 230, 169, 62, 402, 100, 169, 101, 170, 61, - 44, 46, 45, 69, 70, 62, 61, 31, 270, 271, - 31, 0, 62, 31, 0, 0, 0, 0, 505, 168, - 31, 0, 0, 44, 46, 45, 44, 46, 45, 31, - 71, 72, 506, 504, 31, 272, 273, -80, 169, 31, - 170, 81, 31, 82, 44, 46, 45, 44, 46, 45, - 44, 46, 45, 31, 83, 69, 70, 44, 46, 45, - 31, 503, 0, 31, 0, 0, 44, 46, 45, 0, - 0, 44, 46, 45, 0, 0, 44, 46, 45, 44, - 46, 45, 71, 72, 0, 0, 270, 271, 0, 0, - 44, 46, 45, 0, 275, 276, 0, 44, 46, 45, - 44, 46, 45, 277, 31, 0, 278, 31, 279, 275, - 276, -333, 168, 272, 273, 275, 276, 0, 277, 31, - 0, 278, 0, 279, 277, 0, -333, 278, 0, 279, - -80, 169, 0, 170, 0, 0, 0, 0, 0, 236, - 235, 44, 46, 45, 44, 46, 45, 0, 0, 0, - 0, 74, 75, 0, 0, 0, 44, 46, 45, 76, - 77, 74, 75, 78, 0, 79, 0, 0, 0, 76, - 77, 74, 75, 78, 0, 79, 31, 0, 0, 76, - 77, 0, 0, 78, 31, 79, 0, 74, 75, 0, - 0, 0, 31, 275, 276, 76, 77, 0, 0, 78, - 0, 79, 277, 0, 0, 278, 0, 279, 236, 235, - 0, 0, 0, 44, 46, 45, 241, 240, 147, 0, - 0, 44, 46, 45, 236, 235, 74, 75, 148, 44, - 46, 45, 149, 0, 76, 77, 147, 0, 78, 0, - 79, 150, 0, 151, 0, 0, 148, 0, 0, 0, - 149, 0, 0, 0, 152, 0, 153, 58, 0, 150, - 0, 151, 0, 0, 154, 0, 31, 155, 59, 0, - 0, 0, 152, 156, 153, 58, 0, 0, 0, 157, - 0, 0, 154, 0, 0, 155, 59, 0, 0, 0, - 0, 156, 0, 0, 0, 158, 0, 157, 241, 240, - 0, 0, 0, 44, 46, 45, 0, 0, 0, 0, - 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 0, 0, 147, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 148, 34, 0, 0, 149, 0, 0, - 0, 501, 0, 0, 0, 41, 150, 0, 151, 0, - 0, 304, 0, 0, 0, 0, 0, 0, 0, 152, - 0, 153, 58, 47, 44, 46, 45, 0, 48, 154, - 0, 0, 155, 59, 0, 0, 0, 0, 156, 40, - 50, 29, 0, 0, 157, 37, 0, 0, 27, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, - 158, 0, 0, 0, 0, 31, 0, 0, 0, 32, - 33, 0, 34, 0, 0, 0, 27, 28, 0, 501, - 0, 0, 0, 41, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, - 34, 47, 44, 46, 45, 0, 48, 38, 0, 0, - 0, 41, 0, 0, 0, 0, 0, 40, 50, 29, - 0, 0, 0, 37, 0, 0, 0, 0, 0, 47, - 44, 46, 45, 0, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 50, 29, 0, 0, - 0, 37, 27, 28, 0, 0, 0, 0, 0, 0, + 385, 493, 387, -95, 399, 416, 397, 175, 628, 339, + 185, 427, 338, 253, 336, 183, 426, 145, -91, -124, + 462, 341, 348, -113, 179, 344, -94, 548, 436, 160, + -118, 444, -121, 453, 449, 404, 442, 166, 436, 160, + 440, 137, -121, 395, 97, 453, 449, 436, -118, -91, + -116, 344, 67, 253, 412, -105, -113, 412, 539, 436, + -116, 95, -94, -95, 521, 143, -105, 268, 568, 292, + 95, 290, 288, 575, 493, 563, 308, 564, 97, 405, + 410, 248, 67, 412, 342, 436, 449, 550, 578, 551, + 420, 314, 268, 297, 344, 137, -124, 321, 253, 439, + 534, 186, 331, 137, 329, 624, 561, 323, 521, 137, + 473, 554, 453, 440, 302, 247, 137, 288, 430, 137, + 423, 137, 232, 137, 0, 300, 0, 0, 584, 0, + 0, 0, 58, 0, 0, 0, 137, 168, 137, 327, + 252, 251, 162, 59, 553, 552, 163, 245, 244, 409, + 408, 137, 54, 625, 521, 250, 169, 137, 474, 137, + 324, 333, 556, 55, 0, 424, 238, 237, 414, 546, + 243, 242, 54, 346, 54, 484, 535, 509, 508, 515, + 514, 54, 308, 55, 173, 55, 580, 579, 245, 244, + 451, 168, 55, 570, 245, 244, 310, 137, 541, 138, + 311, 137, 0, 137, 0, 465, 512, 511, 137, 455, + 169, 306, 0, 0, 535, 537, 557, 555, 571, 569, + 168, 535, 537, 535, 0, 0, 536, 535, 3, 2, + 1, 0, 81, 536, 82, 81, 510, 82, 137, 169, + 0, 170, 0, 0, 60, 83, 0, 0, 83, 60, + 434, 433, 542, 540, 560, 559, 567, 566, 466, 464, + 537, 545, 544, 81, 60, 82, 81, 537, 82, 537, + 81, 536, 82, 537, 0, 31, 83, 168, 536, 83, + 536, 0, 99, 83, 536, 168, 81, 31, 82, 61, + 0, 231, 230, 31, 61, 62, 169, 0, 402, 83, + 62, 100, 31, 101, 169, 31, 402, 270, 271, 61, + 31, 0, 44, 46, 45, 62, 31, 0, 0, 31, + 0, 0, 0, 0, 44, 46, 45, 31, 0, 0, + 44, 46, 45, 0, 272, 273, 31, 0, 0, 44, + 46, 45, 44, 46, 45, 31, 0, 44, 46, 45, + 270, 271, 31, 44, 46, 45, 44, 46, 45, 81, + 31, 82, 0, 0, 44, 46, 45, 69, 70, 31, + 0, 0, 83, 44, 46, 45, 0, 272, 273, 0, + 31, 0, 44, 46, 45, 69, 70, -335, 505, 44, + 46, 45, 0, 0, 71, 72, 0, 44, 46, 45, + 0, 0, 506, 504, 31, 0, 44, 46, 45, 0, + 0, -335, 71, 72, 275, 276, 0, 44, 46, 45, + 0, 275, 276, 277, 0, 0, 278, 0, 279, 31, + 277, 168, 503, 278, 0, 279, 0, 0, 0, 0, + 0, 44, 46, 45, 0, 74, 75, 0, 0, -82, + 169, 0, 170, 76, 77, 0, 31, 78, 0, 79, + 0, 241, 240, 74, 75, 31, 44, 46, 45, 0, + 0, 76, 77, 74, 75, 78, 0, 79, 31, 0, + 0, 76, 77, 0, 0, 78, 0, 79, 241, 240, + 0, 31, 0, 44, 46, 45, 0, 236, 235, 31, + 0, 0, 44, 46, 45, 0, 0, 0, 0, 0, + 236, 235, 0, 275, 276, 44, 46, 45, 0, 0, + 0, 0, 277, 241, 240, 278, 0, 279, 44, 46, + 45, 236, 235, 0, 0, 0, 44, 46, 45, 0, + 0, 0, 0, 147, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 0, 0, 0, 149, 0, 0, + 0, 0, 0, 0, 0, 0, 150, 0, 151, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, + 147, 153, 58, 0, 0, 0, 0, 74, 75, 154, + 148, 0, 155, 59, 149, 76, 77, 0, 156, 78, + 0, 79, 0, 150, 157, 151, 0, 0, 304, 0, + 0, 0, 0, 0, 0, 0, 152, 0, 153, 58, + 158, 0, 0, 27, 28, 0, 154, 0, 0, 155, + 59, 0, 0, 30, 0, 156, 0, 0, 0, 0, + 31, 157, 0, 0, 32, 33, 0, 34, 0, 0, + 0, 0, 0, 0, 501, 0, 0, 158, 41, 0, + 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 148, 0, 0, 0, 149, 47, 44, 46, 45, + 0, 48, 0, 0, 150, 0, 151, 0, 0, 0, + 0, 0, 40, 50, 29, 0, 0, 152, 37, 153, + 58, 0, 0, 0, 0, 0, 0, 154, 0, 0, + 155, 59, 0, 27, 28, 0, 156, 0, 0, 0, + 0, 0, 157, 30, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 32, 33, 0, 34, 158, 0, + 0, 0, 0, 0, 38, 0, 0, 0, 41, 0, + 0, 0, 0, 0, 0, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 47, 44, 46, 45, + 0, 48, 31, 0, 0, 0, 32, 33, 0, 34, + 0, 0, 40, 50, 29, 0, 501, 0, 37, 0, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 47, 44, + 46, 45, 0, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, + 37, 0, 27, 28, 0, 0, 0, 0, 0, 0, 27, 28, 30, 0, 0, 0, 0, 0, 0, 31, 30, 0, 0, 32, 33, 0, 34, 31, 0, 0, 0, 32, 33, 38, 34, 0, 0, 41, 0, 0, @@ -420,41 +426,41 @@ const int QmlJSGrammar::action_info [] = { 48, 0, 0, 47, 44, 46, 45, 0, 48, 0, 0, 40, 50, 29, 0, 0, 0, 37, 0, 40, 50, 29, 0, 0, 0, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 524, 0, 27, 28, 0, 0, - 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, - 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, - 34, 0, 0, 0, 0, 0, 0, 501, 0, 0, - 0, 41, 0, 0, 0, 0, 0, 0, 0, 526, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, - 525, 528, 527, 0, 48, 0, 0, 0, 0, 222, - 0, 0, 0, 0, 0, 40, 50, 29, 206, 0, - 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, + 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 47, 44, + 46, 45, 0, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 0, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, 41, 0, 0, - 0, 0, 0, 0, 0, 575, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 525, 528, 527, 0, 48, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 40, 50, 29, 206, 0, 0, 37, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 27, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 0, 32, 33, - 0, 34, 0, 0, 0, 35, 0, 36, 38, 39, - 0, 0, 41, 0, 0, 0, 42, 0, 43, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 44, 46, 45, 0, 48, 0, 49, 0, 51, - 0, 52, 0, 0, 0, 0, 40, 50, 29, 0, - 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, - 0, -112, 0, 0, 0, 26, 27, 28, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, - 34, 0, 0, 0, 35, 0, 36, 38, 39, 0, - 0, 41, 0, 0, 0, 42, 0, 43, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, - 44, 46, 45, 0, 48, 0, 49, 0, 51, 0, - 52, 0, 0, 0, 0, 40, 50, 29, 0, 0, - 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 524, 0, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 211, + 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, + 32, 33, 0, 34, 0, 0, 0, 0, 0, 0, + 501, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 526, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 47, 525, 528, 527, 0, 48, 0, 0, + 0, 0, 222, 0, 0, 0, 0, 0, 40, 50, + 29, 206, 0, 0, 37, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 26, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, + 0, 0, 0, 35, 0, 36, 38, 39, 0, 0, + 41, 0, 0, 0, 42, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 47, 44, + 46, 45, 0, 48, 0, 49, 0, 51, 0, 52, + 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, 0, 0, 0, 35, @@ -463,87 +469,97 @@ const int QmlJSGrammar::action_info [] = { 0, 0, 0, 0, 47, 44, 46, 45, 0, 48, 0, 49, 0, 51, 267, 52, 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -114, 0, 0, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 0, 0, 0, 0, 0, 0, 31, 0, + 0, 0, 32, 33, 0, 34, 0, 0, 0, 35, + 0, 36, 38, 39, 0, 0, 41, 0, 0, 0, + 42, 0, 43, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 47, 44, 46, 45, 0, 48, + 0, 49, 0, 51, 0, 52, 0, 0, 0, 0, + 40, 50, 29, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 471, 0, 0, 26, + 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 31, 0, 0, + 0, 32, 33, 0, 34, 0, 0, 0, 35, 0, + 36, 38, 39, 0, 0, 41, 0, 0, 0, 42, + 0, 43, 0, 0, 472, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 44, 46, 45, 0, 48, 0, + 49, 0, 51, 0, 52, 0, 0, 0, 0, 40, + 50, 29, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 31, 213, 0, 0, 583, 584, 0, + 0, 0, 0, 31, 213, 0, 0, 590, 591, 0, 34, 0, 0, 0, 35, 0, 36, 38, 39, 0, 0, 41, 0, 0, 0, 42, 0, 43, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 47, 44, 46, 45, 0, 48, 0, 49, 0, 51, 0, 52, 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, - 479, 0, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 479, 0, 0, 26, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, + 0, 0, 0, 35, 0, 36, 38, 39, 0, 0, + 41, 0, 0, 0, 42, 0, 43, 0, 0, 482, + 0, 0, 0, 0, 0, 0, 0, 0, 47, 44, + 46, 45, 0, 48, 0, 49, 0, 51, 0, 52, + 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 471, 0, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, 34, 0, 0, 0, 35, 0, 36, 38, 39, 0, 0, 41, - 0, 0, 0, 42, 0, 43, 0, 0, 482, 0, + 0, 0, 0, 42, 0, 43, 0, 0, 477, 0, 0, 0, 0, 0, 0, 0, 0, 47, 44, 46, 45, 0, 48, 0, 49, 0, 51, 0, 52, 0, 0, 0, 0, 40, 50, 29, 0, 0, 0, 37, - 0, 0, 0, 0, 0, 0, 0, 0, 471, 0, - 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, - 0, 0, 30, 0, 0, 0, 0, 0, 0, 31, - 0, 0, 0, 32, 33, 0, 34, 0, 0, 0, - 35, 0, 36, 38, 39, 0, 0, 41, 0, 0, - 0, 42, 0, 43, 0, 0, 472, 0, 0, 0, - 0, 0, 0, 0, 0, 47, 44, 46, 45, 0, - 48, 0, 49, 0, 51, 0, 52, 0, 0, 0, - 0, 40, 50, 29, 0, 0, 0, 37, 0, 0, - 0, 0, 0, 0, 0, 0, 479, 0, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 34, 0, 0, 0, 35, 0, - 36, 38, 39, 0, 0, 41, 0, 0, 0, 42, - 0, 43, 0, 0, 480, 0, 0, 0, 0, 0, - 0, 0, 0, 47, 44, 46, 45, 0, 48, 0, - 49, 0, 51, 0, 52, 0, 0, 0, 0, 40, - 50, 29, 0, 0, 0, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 471, 0, 0, 26, 27, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, - 0, 0, 0, 0, 0, 31, 0, 0, 0, 32, - 33, 0, 34, 0, 0, 0, 35, 0, 36, 38, - 39, 0, 0, 41, 0, 0, 0, 42, 0, 43, - 0, 0, 477, 0, 0, 0, 0, 0, 0, 0, - 0, 47, 44, 46, 45, 0, 48, 0, 49, 0, - 51, 0, 52, 0, 0, 0, 0, 40, 50, 29, - 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, - 0, 0, 105, 106, 107, 0, 0, 109, 111, 112, - 0, 0, 113, 0, 114, 0, 0, 0, 116, 117, - 118, 0, 0, 0, 0, 0, 0, 31, 119, 120, - 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, - 0, 0, 0, 0, 44, 46, 45, 126, 127, 128, - 0, 130, 131, 132, 133, 134, 135, 0, 0, 123, - 129, 115, 108, 110, 124, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 479, + 0, 0, 26, 27, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 32, 33, 0, 34, 0, 0, + 0, 35, 0, 36, 38, 39, 0, 0, 41, 0, + 0, 0, 42, 0, 43, 0, 0, 480, 0, 0, + 0, 0, 0, 0, 0, 0, 47, 44, 46, 45, + 0, 48, 0, 49, 0, 51, 0, 52, 0, 0, + 0, 0, 40, 50, 29, 0, 0, 0, 37, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, + 107, 0, 0, 109, 111, 112, 0, 0, 113, 0, + 114, 0, 0, 0, 116, 117, 118, 0, 0, 0, + 0, 0, 0, 31, 119, 120, 121, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, + 44, 46, 45, 126, 127, 128, 0, 130, 131, 132, + 133, 134, 135, 0, 0, 123, 129, 115, 108, 110, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 105, 106, 107, 0, 0, 109, 111, 112, 0, + 0, 113, 0, 114, 0, 0, 0, 116, 117, 118, + 0, 0, 0, 0, 0, 0, 389, 119, 120, 121, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 122, 0, 0, 0, 390, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, + 0, 0, 394, 391, 393, 0, 126, 127, 128, 0, + 130, 131, 132, 133, 134, 135, 0, 0, 123, 129, + 115, 108, 110, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 107, 0, 0, 109, 111, 112, 0, 0, 113, 0, 114, 0, 0, 0, 116, 117, 118, 0, 0, 0, 0, 0, 0, 389, 119, 120, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 390, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, + 0, 0, 0, 0, 0, 392, 0, 0, 0, 125, 0, 0, 0, 0, 0, 394, 391, 393, 0, 126, 127, 128, 0, 130, 131, 132, 133, 134, 135, 0, 0, 123, 129, 115, 108, 110, 124, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 105, 106, 107, 0, - 0, 109, 111, 112, 0, 0, 113, 0, 114, 0, - 0, 0, 116, 117, 118, 0, 0, 0, 0, 0, - 0, 389, 119, 120, 121, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 122, 0, 0, 0, 390, - 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, - 0, 125, 0, 0, 0, 0, 0, 394, 391, 393, - 0, 126, 127, 128, 0, 130, 131, 132, 133, 134, - 135, 0, 0, 123, 129, 115, 108, 110, 124, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, - 0, 0, 0, 207, 0, 26, 27, 28, 209, 0, - 0, 0, 0, 0, 0, 210, 30, 0, 0, 0, - 0, 0, 0, 212, 213, 0, 0, 214, 33, 0, - 34, 0, 0, 0, 35, 0, 36, 38, 39, 0, - 0, 41, 0, 0, 0, 42, 0, 43, 0, 0, - 0, 0, 0, 216, 0, 217, 0, 0, 0, 47, - 215, 218, 45, 219, 48, 220, 49, 221, 51, 222, - 52, 223, 224, 0, 0, 40, 50, 29, 206, 208, - 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 205, 0, 0, + 0, 0, 207, 0, 26, 27, 28, 209, 0, 0, + 0, 0, 0, 0, 210, 30, 0, 0, 0, 0, + 0, 0, 212, 213, 0, 0, 214, 33, 0, 34, + 0, 0, 0, 35, 0, 36, 38, 39, 0, 0, + 41, 0, 0, 0, 42, 0, 43, 0, 0, 0, + 0, 0, 216, 0, 217, 0, 0, 0, 47, 215, + 218, 45, 219, 48, 220, 49, 221, 51, 222, 52, + 223, 224, 0, 0, 40, 50, 29, 206, 208, 0, + 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 207, 0, 26, 27, 28, 209, 0, 0, 0, 0, 0, 0, 210, 211, 0, 0, 0, 0, 0, 0, 212, 213, 0, 0, 214, @@ -553,151 +569,158 @@ const int QmlJSGrammar::action_info [] = { 0, 47, 215, 218, 45, 219, 48, 220, 49, 221, 51, 222, 52, 223, 224, 0, 0, 40, 50, 29, 206, 208, 0, 37, 0, 0, 0, 0, 0, 0, - 0, 0, 586, 106, 107, 0, 0, 588, 111, 590, - 27, 28, 591, 0, 114, 0, 0, 0, 116, 593, - 594, 0, 0, 0, 0, 0, 0, 595, 596, 120, - 121, 214, 33, 0, 34, 0, 0, 0, 35, 0, - 36, 597, 39, 0, 0, 599, 0, 0, 0, 42, - 0, 43, 0, 0, 0, 0, 0, 601, 0, 217, - 0, 0, 0, 603, 600, 602, 45, 604, 605, 606, - 49, 608, 609, 610, 611, 612, 613, 0, 0, 598, - 607, 592, 587, 589, 124, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 357, 106, 107, 0, 0, 359, - 111, 361, 27, 28, 362, 0, 114, 0, 0, 0, - 116, 364, 365, 0, 0, 0, 0, 0, 0, 366, - 367, 120, 121, 214, 33, 0, 34, 0, 0, 0, - 35, 0, 36, 368, 39, 0, 0, 370, 0, 0, - 0, 42, 0, 43, 0, -258, 0, 0, 0, 372, - 0, 217, 0, 0, 0, 374, 371, 373, 45, 375, - 376, 377, 49, 379, 380, 381, 382, 383, 384, 0, - 0, 369, 378, 363, 358, 360, 124, 37, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 593, 106, 107, 0, 0, 595, 111, + 597, 27, 28, 598, 0, 114, 0, 0, 0, 116, + 600, 601, 0, 0, 0, 0, 0, 0, 602, 603, + 120, 121, 214, 33, 0, 34, 0, 0, 0, 35, + 0, 36, 604, 39, 0, 0, 606, 0, 0, 0, + 42, 0, 43, 0, 0, 0, 0, 0, 608, 0, + 217, 0, 0, 0, 610, 607, 609, 45, 611, 612, + 613, 49, 615, 616, 617, 618, 619, 620, 0, 0, + 605, 614, 599, 594, 596, 124, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 357, 106, 107, 0, + 0, 359, 111, 361, 27, 28, 362, 0, 114, 0, + 0, 0, 116, 364, 365, 0, 0, 0, 0, 0, + 0, 366, 367, 120, 121, 214, 33, 0, 34, 0, + 0, 0, 35, 0, 36, 368, 39, 0, 0, 370, + 0, 0, 0, 42, 0, 43, 0, -260, 0, 0, + 0, 372, 0, 217, 0, 0, 0, 374, 371, 373, + 45, 375, 376, 377, 49, 379, 380, 381, 382, 383, + 384, 0, 0, 369, 378, 363, 358, 360, 124, 37, + 0, 0, 0, 0, 0, 0, 0, 0, 0, - 386, 538, 182, 555, 543, 406, 203, 165, 551, 303, - 388, 13, 502, 491, 396, 146, 298, 307, 507, 305, - 558, 457, 513, 432, 234, 246, 234, 249, 298, 468, - 239, 178, 172, 316, 428, 425, 421, 483, 431, 432, - 574, 435, 184, 620, 570, 413, 452, 178, 345, 298, - 569, 234, 435, 456, 567, 136, 454, 347, 343, 178, - 332, 335, 246, 246, 330, 441, 239, 429, 432, 446, - 167, 159, 411, 481, 142, 239, 478, 500, 443, 398, - 516, 463, 349, 0, 450, 203, 203, 435, 445, 400, - 457, 139, 144, 0, 0, 0, 0, 517, 182, 0, - 619, 0, 102, 316, 298, 0, 142, 0, 0, 142, - 0, 403, 400, 56, 174, 447, 56, 56, 401, 486, - 517, 282, 0, 518, 56, 104, 176, 56, 0, 485, - 56, 56, 176, 448, 56, 56, 448, 56, 56, 56, - 281, 401, 283, 280, 284, 56, 56, 447, 176, 262, - 56, 56, 64, 56, 266, 0, 56, 93, 56, 94, - 65, 467, 92, 56, 56, 56, 56, 301, 56, 73, - 80, 87, 68, 56, 400, 334, 325, 86, 98, 56, - 56, 56, 340, 337, 85, 56, 233, 298, 56, 56, - 88, 96, 84, 56, 89, 56, 56, 164, 91, 57, - 90, 298, 56, 401, 490, 56, 298, 448, 56, 56, - 447, 487, 56, 56, 489, 488, 56, 56, 63, 56, - 614, 56, 66, 616, 294, 56, 266, 294, 0, 266, - 266, 161, 266, 56, 289, 56, 291, 294, 266, 102, - 266, 0, 266, 468, 0, 0, 315, 0, 309, 313, - 299, 294, 312, 56, 0, 0, 266, 0, 266, 293, - 285, 56, 104, 171, 328, 56, 266, 0, 274, 326, - 266, 0, 56, 296, 269, 294, 56, 266, 476, 286, - 266, 266, 475, 287, 517, 0, 0, 0, 0, 576, - 0, 0, 532, 0, 582, 0, 0, 322, 0, 0, - 523, 533, 585, 578, 579, 580, 581, 0, 0, 0, + 502, 182, 136, 507, 538, 516, 457, 574, 178, 305, + 246, 146, 234, 239, 13, 627, 298, 491, 562, 432, + 249, 435, 316, 558, 178, 303, 549, 543, 565, 483, + 576, 581, 347, 577, 513, 450, 246, 468, 142, 441, + 239, 443, 144, 452, 246, 234, 445, 463, 349, 239, + 446, 234, 454, 456, 398, 178, 172, 406, 203, 184, + 411, 431, 298, 425, 435, 428, 413, 429, 159, 167, + 421, 386, 432, 432, 388, 298, 334, 396, 332, 435, + 343, 165, 330, 139, 345, 335, 500, 481, 203, 182, + 478, 298, 0, 0, 0, 307, 476, 102, 0, 0, + 475, 142, 517, 56, 56, 626, 174, 56, 56, 284, + 176, 203, 400, 56, 0, 68, 298, 142, 457, 164, + 104, 56, 403, 176, 56, 56, 400, 161, 298, 283, + 281, 56, 56, 56, 448, 448, 282, 56, 56, 56, + 56, 401, 485, 280, 298, 56, 56, 98, 447, 85, + 56, 96, 447, 262, 326, 401, 56, 56, 266, 316, + 56, 89, 87, 66, 56, 56, 56, 57, 448, 56, + 88, 447, 56, 56, 337, 490, 56, 80, 0, 328, + 56, 56, 92, 65, 340, 56, 73, 64, 56, 467, + 56, 301, 63, 56, 94, 56, 400, 176, 517, 93, + 56, 518, 487, 56, 56, 486, 56, 299, 86, 56, + 84, 56, 233, 489, 90, 56, 56, 488, 56, 0, + 0, 91, 294, 266, 56, 401, 294, 266, 0, 266, + 0, 266, 325, 294, 56, 312, 56, 289, 266, 266, + 294, 266, 0, 285, 315, 266, 56, 621, 293, 309, + 623, 266, 56, 287, 102, 313, 56, 266, 56, 286, + 0, 266, 322, 266, 0, 269, 56, 517, 0, 291, + 468, 266, 583, 274, 0, 532, 0, 104, 171, 589, + 0, 0, 0, 523, 533, 0, 0, 592, 585, 586, + 587, 588, 0, 294, 0, 0, 0, 0, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 0, 0, 0, 0, 0, - 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, - 523, 533, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 517, 0, 0, 0, + 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, + 0, 0, 523, 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0}; const int QmlJSGrammar::action_check [] = { - 55, 48, 7, 29, 8, 7, 36, 7, 33, 8, - 79, 7, 36, 36, 60, 7, 17, 36, 60, 36, - 61, 16, 60, 60, 7, 33, 8, 55, 7, 7, - 7, 2, 20, 55, 7, 7, 33, 2, 36, 33, - 7, 5, 48, 36, 7, 36, 7, 7, 33, 7, - 0, 60, 33, 89, 7, 7, 36, 60, 1, 7, - 36, 36, 36, 29, 1, 55, 55, 36, 8, 79, - 8, 33, 79, 60, 60, 29, 8, 61, 1, 7, - 2, 1, 29, 17, 2, 36, 7, 33, 7, 48, - 31, 36, 36, 61, 33, 8, 7, 7, 7, 7, - 36, 36, 33, 36, 8, 10, 48, 7, 15, 79, - 66, 60, 8, 40, 7, 8, 8, 8, -1, -1, - 77, 50, 8, -1, 51, 54, 8, 34, 8, 8, - 15, 8, 7, 33, 89, 8, 66, 61, 62, 8, - 42, 8, 40, 40, 61, 62, 61, 62, 8, 34, - 55, 53, 8, 51, 51, 8, 60, 8, 61, 62, - 61, 62, 61, 62, 60, 56, 61, 62, 60, 40, - 56, 61, 62, 8, 56, 7, 56, 61, 62, 29, - 51, 60, 29, 60, 50, 61, 62, 60, 54, 61, - 62, 29, 61, 60, 15, 29, 8, 36, 29, 7, - 60, -1, 91, 92, 93, 61, 62, 8, 61, 62, - 61, 62, 12, 34, -1, 36, -1, -1, 90, -1, - -1, 6, 61, 62, 12, 75, 61, 62, 75, 61, - 62, 12, 25, 29, 27, 20, 86, 75, 25, 86, - 27, 75, -1, 15, 75, 38, 15, 15, 86, 61, - 62, 38, 86, 61, 62, 86, 29, 57, -1, 29, - 61, 62, 34, 63, 36, 34, 34, 36, 36, 57, - 66, 67, 68, 18, 19, 63, 57, 29, 18, 19, - 29, -1, 63, 29, -1, -1, -1, -1, 47, 15, - 29, -1, -1, 66, 67, 68, 66, 67, 68, 29, - 45, 46, 61, 62, 29, 45, 46, 33, 34, 29, - 36, 25, 29, 27, 66, 67, 68, 66, 67, 68, - 66, 67, 68, 29, 38, 18, 19, 66, 67, 68, - 29, 90, -1, 29, -1, -1, 66, 67, 68, -1, - -1, 66, 67, 68, -1, -1, 66, 67, 68, 66, - 67, 68, 45, 46, -1, -1, 18, 19, -1, -1, - 66, 67, 68, -1, 23, 24, -1, 66, 67, 68, - 66, 67, 68, 32, 29, -1, 35, 29, 37, 23, - 24, 36, 15, 45, 46, 23, 24, -1, 32, 29, - -1, 35, -1, 37, 32, -1, 36, 35, -1, 37, - 33, 34, -1, 36, -1, -1, -1, -1, -1, 61, - 62, 66, 67, 68, 66, 67, 68, -1, -1, -1, - -1, 23, 24, -1, -1, -1, 66, 67, 68, 31, - 32, 23, 24, 35, -1, 37, -1, -1, -1, 31, - 32, 23, 24, 35, -1, 37, 29, -1, -1, 31, - 32, -1, -1, 35, 29, 37, -1, 23, 24, -1, - -1, -1, 29, 23, 24, 31, 32, -1, -1, 35, - -1, 37, 32, -1, -1, 35, -1, 37, 61, 62, - -1, -1, -1, 66, 67, 68, 61, 62, 3, -1, - -1, 66, 67, 68, 61, 62, 23, 24, 13, 66, - 67, 68, 17, -1, 31, 32, 3, -1, 35, -1, - 37, 26, -1, 28, -1, -1, 13, -1, -1, -1, - 17, -1, -1, -1, 39, -1, 41, 42, -1, 26, - -1, 28, -1, -1, 49, -1, 29, 52, 53, -1, - -1, -1, 39, 58, 41, 42, -1, -1, -1, 64, - -1, -1, 49, -1, -1, 52, 53, -1, -1, -1, - -1, 58, -1, -1, -1, 80, -1, 64, 61, 62, - -1, -1, -1, 66, 67, 68, -1, -1, -1, -1, - -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, 3, -1, -1, -1, 29, -1, -1, - -1, 33, 34, 13, 36, -1, -1, 17, -1, -1, - -1, 43, -1, -1, -1, 47, 26, -1, 28, -1, - -1, 31, -1, -1, -1, -1, -1, -1, -1, 39, - -1, 41, 42, 65, 66, 67, 68, -1, 70, 49, - -1, -1, 52, 53, -1, -1, -1, -1, 58, 81, - 82, 83, -1, -1, 64, 87, -1, -1, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, - 80, -1, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, -1, -1, -1, 12, 13, -1, 43, - -1, -1, -1, 47, -1, -1, 22, -1, -1, -1, - -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, - 36, 65, 66, 67, 68, -1, 70, 43, -1, -1, - -1, 47, -1, -1, -1, -1, -1, 81, 82, 83, - -1, -1, -1, 87, -1, -1, -1, -1, -1, 65, - 66, 67, 68, -1, 70, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 81, 82, 83, -1, -1, - -1, 87, 12, 13, -1, -1, -1, -1, -1, -1, + 7, 90, 8, 7, 55, 33, 55, 60, 0, 33, + 60, 7, 60, 36, 36, 8, 55, 60, 7, 7, + 17, 55, 16, 7, 36, 36, 7, 37, 33, 2, + 7, 60, 7, 36, 36, 60, 36, 7, 33, 2, + 20, 8, 7, 7, 79, 36, 36, 33, 7, 7, + 7, 36, 1, 36, 36, 7, 7, 36, 29, 33, + 7, 48, 7, 7, 33, 8, 7, 1, 29, 8, + 48, 79, 48, 8, 90, 29, 2, 7, 79, 7, + 7, 36, 1, 36, 7, 33, 36, 24, 60, 29, + 5, 7, 1, 61, 36, 8, 7, 17, 36, 6, + 66, 33, 31, 8, 60, 8, 66, 8, 33, 8, + 8, 29, 36, 20, 60, 77, 8, 48, 7, 8, + 10, 8, 55, 8, -1, 61, -1, -1, 7, -1, + -1, -1, 42, -1, -1, -1, 8, 15, 8, 61, + 61, 62, 50, 53, 61, 62, 54, 61, 62, 61, + 62, 8, 40, 56, 33, 60, 34, 8, 56, 8, + 61, 60, 7, 51, -1, 55, 61, 62, 60, 29, + 61, 62, 40, 60, 40, 60, 29, 61, 62, 61, + 62, 40, 2, 51, 56, 51, 61, 62, 61, 62, + 60, 15, 51, 36, 61, 62, 50, 8, 7, 56, + 54, 8, -1, 8, -1, 8, 61, 62, 8, 60, + 34, 60, -1, -1, 29, 75, 61, 62, 61, 62, + 15, 29, 75, 29, -1, -1, 86, 29, 92, 93, + 94, -1, 25, 86, 27, 25, 91, 27, 8, 34, + -1, 36, -1, -1, 12, 38, -1, -1, 38, 12, + 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, + 75, 61, 62, 25, 12, 27, 25, 75, 27, 75, + 25, 86, 27, 75, -1, 29, 38, 15, 86, 38, + 86, -1, 15, 38, 86, 15, 25, 29, 27, 57, + -1, 61, 62, 29, 57, 63, 34, -1, 36, 38, + 63, 34, 29, 36, 34, 29, 36, 18, 19, 57, + 29, -1, 66, 67, 68, 63, 29, -1, -1, 29, + -1, -1, -1, -1, 66, 67, 68, 29, -1, -1, + 66, 67, 68, -1, 45, 46, 29, -1, -1, 66, + 67, 68, 66, 67, 68, 29, -1, 66, 67, 68, + 18, 19, 29, 66, 67, 68, 66, 67, 68, 25, + 29, 27, -1, -1, 66, 67, 68, 18, 19, 29, + -1, -1, 38, 66, 67, 68, -1, 45, 46, -1, + 29, -1, 66, 67, 68, 18, 19, 36, 47, 66, + 67, 68, -1, -1, 45, 46, -1, 66, 67, 68, + -1, -1, 61, 62, 29, -1, 66, 67, 68, -1, + -1, 36, 45, 46, 23, 24, -1, 66, 67, 68, + -1, 23, 24, 32, -1, -1, 35, -1, 37, 29, + 32, 15, 91, 35, -1, 37, -1, -1, -1, -1, + -1, 66, 67, 68, -1, 23, 24, -1, -1, 33, + 34, -1, 36, 31, 32, -1, 29, 35, -1, 37, + -1, 61, 62, 23, 24, 29, 66, 67, 68, -1, + -1, 31, 32, 23, 24, 35, -1, 37, 29, -1, + -1, 31, 32, -1, -1, 35, -1, 37, 61, 62, + -1, 29, -1, 66, 67, 68, -1, 61, 62, 29, + -1, -1, 66, 67, 68, -1, -1, -1, -1, -1, + 61, 62, -1, 23, 24, 66, 67, 68, -1, -1, + -1, -1, 32, 61, 62, 35, -1, 37, 66, 67, + 68, 61, 62, -1, -1, -1, 66, 67, 68, -1, + -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 13, -1, -1, -1, 17, -1, -1, + -1, -1, -1, -1, -1, -1, 26, -1, 28, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, + 3, 41, 42, -1, -1, -1, -1, 23, 24, 49, + 13, -1, 52, 53, 17, 31, 32, -1, 58, 35, + -1, 37, -1, 26, 64, 28, -1, -1, 31, -1, + -1, -1, -1, -1, -1, -1, 39, -1, 41, 42, + 80, -1, -1, 12, 13, -1, 49, -1, -1, 52, + 53, -1, -1, 22, -1, 58, -1, -1, -1, -1, + 29, 64, -1, -1, 33, 34, -1, 36, -1, -1, + -1, -1, -1, -1, 43, -1, -1, 80, 47, -1, + -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 13, -1, -1, -1, 17, 65, 66, 67, 68, + -1, 70, -1, -1, 26, -1, 28, -1, -1, -1, + -1, -1, 81, 82, 83, -1, -1, 39, 87, 41, + 42, -1, -1, -1, -1, -1, -1, 49, -1, -1, + 52, 53, -1, 12, 13, -1, 58, -1, -1, -1, + -1, -1, 64, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, 80, -1, + -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 65, 66, 67, 68, + -1, 70, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, 81, 82, 83, -1, 43, -1, 87, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, + 87, -1, 12, 13, -1, -1, -1, -1, -1, -1, 12, 13, 22, -1, -1, -1, -1, -1, -1, 29, 22, -1, -1, 33, 34, -1, 36, 29, -1, -1, -1, 33, 34, 43, 36, -1, -1, 47, -1, -1, @@ -706,15 +729,15 @@ const int QmlJSGrammar::action_check [] = { 70, -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, - -1, -1, -1, -1, 10, -1, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, - -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, - 36, -1, -1, -1, -1, -1, -1, 43, -1, -1, - -1, 47, -1, -1, -1, -1, -1, -1, -1, 55, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, - 66, 67, 68, -1, 70, -1, -1, -1, -1, 75, - -1, -1, -1, -1, -1, 81, 82, 83, 84, -1, - -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, + 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, @@ -723,24 +746,24 @@ const int QmlJSGrammar::action_check [] = { -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, 81, 82, 83, 84, -1, -1, 87, -1, -1, - -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, - -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, - -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, - -1, 7, -1, -1, -1, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, - -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, - 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, - -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, - 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, - 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, - -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 10, -1, 12, + 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, + -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, + 33, 34, -1, 36, -1, -1, -1, -1, -1, -1, + 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, + -1, -1, 75, -1, -1, -1, -1, -1, 81, 82, + 83, 84, -1, -1, 87, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, + -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, + 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, @@ -749,6 +772,24 @@ const int QmlJSGrammar::action_check [] = { -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, 75, 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, + -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, + 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, + 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, + -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, + 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, + -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, + -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, + 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, + 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, 33, 34, -1, @@ -758,6 +799,15 @@ const int QmlJSGrammar::action_check [] = { 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 8, -1, -1, 11, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, 56, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, + -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, + 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, @@ -766,70 +816,53 @@ const int QmlJSGrammar::action_check [] = { -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, 87, - -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, - -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, - -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, -1, 56, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, - 70, -1, 72, -1, 74, -1, 76, -1, -1, -1, - -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, - -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, - 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, - 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, - -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, - -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, - 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, - 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, - -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, - -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, - -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, - 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, - -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, - -1, 73, 74, 75, 76, 77, 78, -1, -1, 81, - 82, 83, 84, 85, 86, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, + -1, 70, -1, 72, -1, 74, -1, 76, -1, -1, + -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, + 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, + 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, + -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, + 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, + 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, + 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, + -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, + -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, + -1, -1, 65, 66, 67, -1, 69, 70, 71, -1, + 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, + 83, 84, 85, 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, 86, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, - -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, - -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, - -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, - -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, - 78, -1, -1, 81, 82, 83, 84, 85, 86, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, - -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, - -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, -1, -1, 33, 34, -1, - 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, - -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, - -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, - -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, + -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, + -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, + -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, -1, -1, 81, 82, 83, 84, 85, -1, + 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, 33, @@ -839,69 +872,70 @@ const int QmlJSGrammar::action_check [] = { -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, -1, 87, -1, -1, -1, -1, -1, -1, - -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, - 12, 13, 14, -1, 16, -1, -1, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, - -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, -1, - -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, - 10, 11, 12, 13, 14, -1, 16, -1, -1, -1, - 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, - 30, 31, 32, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, 55, -1, -1, -1, 59, - -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, - -1, 81, 82, 83, 84, 85, 86, 87, -1, -1, - -1, -1, -1, -1, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, 12, 13, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, 59, -1, + 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, + 81, 82, 83, 84, 85, 86, 87, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, + -1, 9, 10, 11, 12, 13, 14, -1, 16, -1, + -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, + -1, 29, 30, 31, 32, 33, 34, -1, 36, -1, + -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, + -1, -1, -1, 51, -1, 53, -1, 55, -1, -1, + -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, -1, -1, 81, 82, 83, 84, 85, 86, 87, + -1, -1, -1, -1, -1, -1, -1, -1, -1, - 33, 23, 12, 23, 3, 2, 2, 33, 3, 2, - 34, 3, 10, 2, 33, 65, 3, 2, 12, 3, - 3, 12, 12, 3, 12, 2, 12, 3, 3, 33, - 12, 12, 3, 12, 79, 91, 94, 3, 79, 3, - 12, 19, 12, 17, 12, 3, 2, 12, 3, 3, - 23, 12, 19, 2, 23, 3, 3, 2, 2, 12, - 3, 12, 2, 2, 2, 96, 12, 3, 3, 19, - 33, 33, 2, 33, 33, 12, 33, 10, 12, 2, - 8, 33, 2, -1, 3, 2, 2, 19, 19, 10, - 12, 33, 33, -1, -1, -1, -1, 10, 12, -1, - 13, -1, 12, 12, 3, -1, 33, -1, -1, 33, - -1, 38, 10, 42, 38, 44, 42, 42, 39, 44, - 10, 47, -1, 13, 42, 35, 44, 42, -1, 44, - 42, 42, 44, 44, 42, 42, 44, 42, 42, 42, - 47, 39, 47, 47, 47, 42, 42, 44, 44, 42, - 42, 42, 44, 42, 47, -1, 42, 48, 42, 48, - 44, 83, 48, 42, 42, 42, 42, 66, 42, 48, - 47, 47, 50, 42, 10, 2, 85, 46, 52, 42, - 42, 42, 98, 97, 46, 42, 103, 3, 42, 42, - 47, 54, 46, 42, 47, 42, 42, 58, 47, 45, - 47, 3, 42, 39, 44, 42, 3, 44, 42, 42, - 44, 44, 42, 42, 44, 44, 42, 42, 44, 42, - 10, 42, 45, 13, 42, 42, 47, 42, -1, 47, - 47, 56, 47, 42, 55, 42, 53, 42, 47, 12, - 47, -1, 47, 33, -1, -1, 64, -1, 57, 64, - 66, 42, 59, 42, -1, -1, 47, -1, 47, 64, - 49, 42, 35, 36, 66, 42, 47, -1, 49, 66, - 47, -1, 42, 64, 51, 42, 42, 47, 29, 49, - 47, 47, 33, 49, 10, -1, -1, -1, -1, 15, - -1, -1, 18, -1, 10, -1, -1, 64, -1, -1, - 26, 27, 18, 19, 20, 21, 22, -1, -1, -1, + 10, 12, 3, 12, 23, 8, 12, 23, 12, 3, + 2, 65, 12, 12, 3, 17, 3, 2, 23, 3, + 3, 19, 12, 3, 12, 2, 23, 3, 3, 3, + 23, 12, 2, 12, 12, 3, 2, 33, 33, 96, + 12, 12, 33, 2, 2, 12, 19, 33, 2, 12, + 19, 12, 3, 2, 2, 12, 3, 2, 2, 12, + 2, 79, 3, 91, 19, 79, 3, 3, 33, 33, + 94, 33, 3, 3, 34, 3, 2, 33, 3, 19, + 2, 33, 2, 33, 3, 12, 10, 33, 2, 12, + 33, 3, -1, -1, -1, 2, 29, 12, -1, -1, + 33, 33, 10, 42, 42, 13, 38, 42, 42, 47, + 44, 2, 10, 42, -1, 50, 3, 33, 12, 58, + 35, 42, 38, 44, 42, 42, 10, 56, 3, 47, + 47, 42, 42, 42, 44, 44, 47, 42, 42, 42, + 42, 39, 44, 47, 3, 42, 42, 52, 44, 46, + 42, 54, 44, 42, 66, 39, 42, 42, 47, 12, + 42, 47, 47, 45, 42, 42, 42, 45, 44, 42, + 47, 44, 42, 42, 97, 44, 42, 47, -1, 66, + 42, 42, 48, 44, 98, 42, 48, 44, 42, 83, + 42, 66, 44, 42, 48, 42, 10, 44, 10, 48, + 42, 13, 44, 42, 42, 44, 42, 66, 46, 42, + 46, 42, 103, 44, 47, 42, 42, 44, 42, -1, + -1, 47, 42, 47, 42, 39, 42, 47, -1, 47, + -1, 47, 85, 42, 42, 59, 42, 55, 47, 47, + 42, 47, -1, 49, 64, 47, 42, 10, 64, 57, + 13, 47, 42, 49, 12, 64, 42, 47, 42, 49, + -1, 47, 64, 47, -1, 51, 42, 10, -1, 53, + 33, 47, 15, 49, -1, 18, -1, 35, 36, 10, + -1, -1, -1, 26, 27, -1, -1, 18, 19, 20, + 21, 22, -1, 42, -1, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, - -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, - 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1}; + -1}; diff --git a/src/declarative/qml/parser/qmljsgrammar_p.h b/src/declarative/qml/parser/qmljsgrammar_p.h index b597f4f..57fcccc 100644 --- a/src/declarative/qml/parser/qmljsgrammar_p.h +++ b/src/declarative/qml/parser/qmljsgrammar_p.h @@ -2,6 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -21,10 +22,9 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -59,18 +59,19 @@ class QmlJSGrammar public: enum { EOF_SYMBOL = 0, - REDUCE_HERE = 95, - SHIFT_THERE = 94, + REDUCE_HERE = 96, + SHIFT_THERE = 95, T_AND = 1, T_AND_AND = 2, T_AND_EQ = 3, - T_AS = 90, + T_AS = 91, T_AUTOMATIC_SEMICOLON = 62, T_BREAK = 4, T_CASE = 5, T_CATCH = 6, T_COLON = 7, T_COMMA = 8, + T_COMMENT = 88, T_CONST = 84, T_CONTINUE = 9, T_DEBUGGER = 85, @@ -85,9 +86,9 @@ public: T_EQ_EQ = 18, T_EQ_EQ_EQ = 19, T_FALSE = 83, - T_FEED_JS_EXPRESSION = 93, - T_FEED_JS_STATEMENT = 92, - T_FEED_UI_PROGRAM = 91, + T_FEED_JS_EXPRESSION = 94, + T_FEED_JS_STATEMENT = 93, + T_FEED_UI_PROGRAM = 92, T_FINALLY = 20, T_FOR = 21, T_FUNCTION = 22, @@ -99,7 +100,7 @@ public: T_GT_GT_GT_EQ = 28, T_IDENTIFIER = 29, T_IF = 30, - T_IMPORT = 89, + T_IMPORT = 90, T_IN = 31, T_INSTANCEOF = 32, T_LBRACE = 33, @@ -126,7 +127,7 @@ public: T_PLUS_EQ = 52, T_PLUS_PLUS = 53, T_PROPERTY = 66, - T_PUBLIC = 88, + T_PUBLIC = 89, T_QUESTION = 54, T_RBRACE = 55, T_RBRACKET = 56, @@ -155,15 +156,15 @@ public: T_XOR = 79, T_XOR_EQ = 80, - ACCEPT_STATE = 621, - RULE_COUNT = 337, - STATE_COUNT = 622, - TERMINAL_COUNT = 96, + ACCEPT_STATE = 628, + RULE_COUNT = 339, + STATE_COUNT = 629, + TERMINAL_COUNT = 97, NON_TERMINAL_COUNT = 105, - GOTO_INDEX_OFFSET = 622, - GOTO_INFO_OFFSET = 2376, - GOTO_CHECK_OFFSET = 2376 + GOTO_INDEX_OFFSET = 629, + GOTO_INFO_OFFSET = 2539, + GOTO_CHECK_OFFSET = 2539 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/qmljslexer.cpp b/src/declarative/qml/parser/qmljslexer.cpp index f302733..f71b92f 100644 --- a/src/declarative/qml/parser/qmljslexer.cpp +++ b/src/declarative/qml/parser/qmljslexer.cpp @@ -43,6 +43,7 @@ #include "config.h" #endif +#include "qmljsglobal_p.h" #include "qmljsengine_p.h" #include "qmljslexer_p.h" #include "qmljsgrammar_p.h" @@ -52,7 +53,7 @@ #include <stdio.h> #include <string.h> -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE extern double qstrtod(const char *s00, char const **se, bool *ok); @@ -1147,6 +1148,6 @@ void Lexer::syncProhibitAutomaticSemicolon() } } -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qmljslexer_p.h b/src/declarative/qml/parser/qmljslexer_p.h index 6cca45d..50f7c4b 100644 --- a/src/declarative/qml/parser/qmljslexer_p.h +++ b/src/declarative/qml/parser/qmljslexer_p.h @@ -55,9 +55,9 @@ #include <QtCore/QString> +#include "qmljsglobal_p.h" - -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -244,8 +244,6 @@ private: } // namespace QmlJS -QT_END_NAMESPACE - - +QT_QML_END_NAMESPACE #endif diff --git a/src/declarative/qml/parser/qmljsmemorypool_p.h b/src/declarative/qml/parser/qmljsmemorypool_p.h index 6bd21f8..70e7737 100644 --- a/src/declarative/qml/parser/qmljsmemorypool_p.h +++ b/src/declarative/qml/parser/qmljsmemorypool_p.h @@ -57,7 +57,9 @@ #include <QtCore/qshareddata.h> #include <string.h> -QT_BEGIN_NAMESPACE +#include "qmljsglobal_p.h" + +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -125,6 +127,6 @@ private: } // namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif diff --git a/src/declarative/qml/parser/qmljsnodepool_p.h b/src/declarative/qml/parser/qmljsnodepool_p.h index e2f0a3c..dfe3bac 100644 --- a/src/declarative/qml/parser/qmljsnodepool_p.h +++ b/src/declarative/qml/parser/qmljsnodepool_p.h @@ -56,9 +56,10 @@ #include <QtCore/QHash> #include <QtCore/QString> +#include "qmljsglobal_p.h" #include "qmljsmemorypool_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -133,6 +134,6 @@ private: } // namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE #endif diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp index f7d483f..c08e2af 100644 --- a/src/declarative/qml/parser/qmljsparser.cpp +++ b/src/declarative/qml/parser/qmljsparser.cpp @@ -62,7 +62,7 @@ using namespace QmlJS; -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE void Parser::reallocateStack() { @@ -400,6 +400,17 @@ case 44: { } break; case 46: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval); + node->typeModifier = sym(2).sval; + node->propertyToken = loc(1); + node->typeModifierToken = loc(2); + node->typeToken = loc(4); + node->identifierToken = loc(6); + node->semicolonToken = loc(7); + sym(1).Node = node; +} break; + +case 48: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -408,7 +419,7 @@ case 46: { sym(1).Node = node; } break; -case 48: { +case 50: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -419,7 +430,7 @@ case 48: { sym(1).Node = node; } break; -case 50: { +case 52: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -430,7 +441,7 @@ case 50: { sym(1).Node = node; } break; -case 52: { +case 54: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isReadonlyMember = true; @@ -443,7 +454,7 @@ case 52: { sym(1).Node = node; } break; -case 54: { +case 56: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -456,75 +467,75 @@ case 54: { sym(1).Node = node; } break; -case 55: { +case 57: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 56: { +case 58: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 58: { +case 60: { QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 59: { +case 61: { QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 60: { +case 62: { QString s = QLatin1String(QmlJSGrammar::spell[T_READONLY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 61: { +case 63: { AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 62: { +case 64: { AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 63: { +case 65: { AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 64: { +case 66: { AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 65: { +case 67: { AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 66: { +case 68: { AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 67: -case 68: { +case 69: +case 70: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 69: { +case 71: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -535,7 +546,7 @@ case 69: { sym(1).Node = node; } break; -case 70: { +case 72: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -546,28 +557,28 @@ case 70: { sym(1).Node = node; } break; -case 71: { +case 73: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0); node->lbracketToken = loc(1); node->rbracketToken = loc(2); sym(1).Node = node; } break; -case 72: { +case 74: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 73: { +case 75: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 74: { +case 76: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), (AST::Elision *) 0); node->lbracketToken = loc(1); @@ -576,7 +587,7 @@ case 74: { sym(1).Node = node; } break; -case 75: { +case 77: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision->finish()); node->lbracketToken = loc(1); @@ -585,7 +596,7 @@ case 75: { sym(1).Node = node; } break; -case 76: { +case 78: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), @@ -597,7 +608,7 @@ case 76: { sym(1).Node = node; } break; -case 77: { +case 79: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -605,14 +616,14 @@ case 77: { sym(1).Node = node; } break; -case 78: { +case 80: { AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 79: { +case 81: { if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken, QLatin1String("Ignored annotation"))); @@ -632,48 +643,48 @@ case 79: { } } break; -case 80: { +case 82: { sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression); } break; -case 81: { +case 83: { sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression); } break; -case 82: { +case 84: { AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, (AST::Elision *) 0, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 83: { +case 85: { AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(), sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 84: { +case 86: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 85: { +case 87: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 86: { +case 88: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 87: { +case 89: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -681,40 +692,36 @@ case 87: { sym(1).Node = node; } break; -case 88: { +case 90: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 89: -case 90: { +case 91: +case 92: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 91: { +case 93: { AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 92: { +case 94: { AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 93: { +case 95: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 94: - -case 95: - case 96: case 97: @@ -772,25 +779,29 @@ case 122: case 123: case 124: + +case 125: + +case 126: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 129: { +case 131: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 130: { +case 132: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 131: { +case 133: { AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -798,316 +809,309 @@ case 131: { sym(1).Node = node; } break; -case 133: { +case 135: { AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 136: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 135: { +case 137: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 136: { +case 138: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 137: { +case 139: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 138: { +case 140: { sym(1).Node = 0; } break; -case 139: { +case 141: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 140: { +case 142: { sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression); } break; -case 141: { +case 143: { AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 147: { AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 148: { AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 148: { +case 150: { AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 149: { +case 151: { AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 150: { +case 152: { AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 151: { +case 153: { AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 152: { +case 154: { AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 153: { +case 155: { AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 154: { +case 156: { AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 155: { +case 157: { AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 156: { +case 158: { AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 158: { +case 160: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 159: { +case 161: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 162: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 164: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 165: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 167: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +case 168: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +case 169: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 169: { +case 171: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 172: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 171: { +case 173: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 174: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 173: { +case 175: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +case 176: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +case 178: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 177: { +case 179: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 178: { +case 180: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 179: { +case 181: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 182: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +case 184: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 183: { +case 185: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +case 186: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 185: { +case 187: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 187: { +case 189: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 188: { +case 190: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 189: { +case 191: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 190: { - AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::StrictNotEqual, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - case 192: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1121,7 +1125,7 @@ case 194: { case 196: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1135,7 +1139,7 @@ case 198: { case 200: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1149,7 +1153,7 @@ case 202: { case 204: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1163,7 +1167,7 @@ case 206: { case 208: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1176,6 +1180,13 @@ case 210: { } break; case 212: { + AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 214: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1183,7 +1194,7 @@ case 212: { sym(1).Node = node; } break; -case 214: { +case 216: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1191,112 +1202,112 @@ case 214: { sym(1).Node = node; } break; -case 216: { +case 218: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 218: { +case 220: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 219: { +case 221: { sym(1).ival = QSOperator::Assign; } break; -case 220: { +case 222: { sym(1).ival = QSOperator::InplaceMul; } break; -case 221: { +case 223: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 222: { +case 224: { sym(1).ival = QSOperator::InplaceMod; } break; -case 223: { +case 225: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 224: { +case 226: { sym(1).ival = QSOperator::InplaceSub; } break; -case 225: { +case 227: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 226: { +case 228: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 227: { +case 229: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 228: { +case 230: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 229: { +case 231: { sym(1).ival = QSOperator::InplaceXor; } break; -case 230: { +case 232: { sym(1).ival = QSOperator::InplaceOr; } break; -case 232: { +case 234: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 233: { +case 235: { sym(1).Node = 0; } break; -case 236: { +case 238: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 237: { +case 239: { sym(1).Node = 0; } break; -case 254: { +case 256: { AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 255: { +case 257: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement); } break; -case 256: { +case 258: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 257: { +case 259: { sym(1).Node = 0; } break; -case 258: { +case 260: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 260: { +case 262: { AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1304,76 +1315,76 @@ case 260: { sym(1).Node = node; } break; -case 261: { +case 263: { sym(1).ival = T_CONST; } break; -case 262: { +case 264: { sym(1).ival = T_VAR; } break; -case 263: { +case 265: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 264: { +case 266: { AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 265: { +case 267: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 266: { +case 268: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 267: { +case 269: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 268: { +case 270: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 269: { +case 271: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 270: { +case 272: { sym(1).Node = 0; } break; -case 272: { +case 274: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 273: { +case 275: { sym(1).Node = 0; } break; -case 275: { +case 277: { AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 277: { +case 279: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 278: { +case 280: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1382,7 +1393,7 @@ case 278: { sym(1).Node = node; } break; -case 279: { +case 281: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1390,7 +1401,7 @@ case 279: { sym(1).Node = node; } break; -case 281: { +case 283: { AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1400,7 +1411,7 @@ case 281: { sym(1).Node = node; } break; -case 282: { +case 284: { AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1408,7 +1419,7 @@ case 282: { sym(1).Node = node; } break; -case 283: { +case 285: { AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1419,7 +1430,7 @@ case 283: { sym(1).Node = node; } break; -case 284: { +case 286: { AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1432,7 +1443,7 @@ case 284: { sym(1).Node = node; } break; -case 285: { +case 287: { AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1442,7 +1453,7 @@ case 285: { sym(1).Node = node; } break; -case 286: { +case 288: { AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1453,14 +1464,14 @@ case 286: { sym(1).Node = node; } break; -case 288: { +case 290: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 290: { +case 292: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1468,14 +1479,14 @@ case 290: { sym(1).Node = node; } break; -case 292: { +case 294: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 294: { +case 296: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1483,14 +1494,14 @@ case 294: { sym(1).Node = node; } break; -case 296: { +case 298: { AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 297: { +case 299: { AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1498,7 +1509,7 @@ case 297: { sym(1).Node = node; } break; -case 298: { +case 300: { AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1506,90 +1517,90 @@ case 298: { sym(1).Node = node; } break; -case 299: { +case 301: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 300: { +case 302: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 301: { +case 303: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause); } break; -case 302: { +case 304: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 303: { +case 305: { sym(1).Node = 0; } break; -case 304: { +case 306: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 305: { +case 307: { AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 306: { +case 308: { AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 307: -case 308: { +case 309: +case 310: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 309: { +case 311: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 311: { +case 313: { AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 312: { +case 314: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 313: { +case 315: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 314: { +case 316: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 315: { +case 317: { AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1598,20 +1609,20 @@ case 315: { sym(1).Node = node; } break; -case 316: { +case 318: { AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 318: { +case 320: { AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 319: { +case 321: { AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1622,7 +1633,7 @@ case 319: { sym(1).Node = node; } break; -case 320: { +case 322: { AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1634,56 +1645,56 @@ case 320: { sym(1).Node = node; } break; -case 321: { +case 323: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 322: { +case 324: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 323: { +case 325: { sym(1).Node = 0; } break; -case 324: { +case 326: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 325: { +case 327: { sym(1).Node = 0; } break; -case 327: { +case 329: { sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 328: { +case 330: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement); } break; -case 329: { +case 331: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 330: { +case 332: { sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement); } break; -case 331: { +case 333: { sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 332: { +case 334: { sym(1).sval = 0; } break; -case 334: { +case 336: { sym(1).Node = 0; } break; @@ -1803,6 +1814,6 @@ case 334: { return false; } -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qmljsparser_p.h b/src/declarative/qml/parser/qmljsparser_p.h index 1db6086..46d5952 100644 --- a/src/declarative/qml/parser/qmljsparser_p.h +++ b/src/declarative/qml/parser/qmljsparser_p.h @@ -60,15 +60,15 @@ #ifndef QMLJSPARSER_P_H #define QMLJSPARSER_P_H +#include "qmljsglobal_p.h" #include "qmljsgrammar_p.h" #include "qmljsast_p.h" #include "qmljsengine_p.h" #include <QtCore/QList> +#include <QtCore/QString> -QT_BEGIN_NAMESPACE - -class QString; +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -222,11 +222,11 @@ protected: -#define J_SCRIPT_REGEXPLITERAL_RULE1 69 +#define J_SCRIPT_REGEXPLITERAL_RULE1 71 -#define J_SCRIPT_REGEXPLITERAL_RULE2 70 +#define J_SCRIPT_REGEXPLITERAL_RULE2 72 -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp index 58ee454..e7a7591 100644 --- a/src/declarative/qml/qmetaobjectbuilder.cpp +++ b/src/declarative/qml/qmetaobjectbuilder.cpp @@ -264,7 +264,11 @@ public: QList<QByteArray> classInfoNames; QList<QByteArray> classInfoValues; QList<QMetaEnumBuilderPrivate> enumerators; +#ifdef Q_NO_DATA_RELOCATION + QList<QMetaObjectAccessor> relatedMetaObjects; +#else QList<const QMetaObject *> relatedMetaObjects; +#endif int flags; }; @@ -688,7 +692,11 @@ int QMetaObjectBuilder::addClassInfo(const QByteArray& name, const QByteArray& v \sa relatedMetaObjectCount(), relatedMetaObject() \sa removeRelatedMetaObject() */ +#ifdef Q_NO_DATA_RELOCATION +int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObjectAccessor &meta) +#else int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObject *meta) +#endif { Q_ASSERT(meta); int index = d->relatedMetaObjects.size(); @@ -761,10 +769,15 @@ void QMetaObjectBuilder::addMetaObject } if ((members & RelatedMetaObjects) != 0) { +#ifdef Q_NO_DATA_RELOCATION + const QMetaObjectAccessor *objects = 0; +#else const QMetaObject **objects; if (priv(prototype->d.data)->revision < 2) { objects = (const QMetaObject **)(prototype->d.extradata); - } else { + } else +#endif + { const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata); if (extra) objects = extra->objects; @@ -855,7 +868,11 @@ QMetaEnumBuilder QMetaObjectBuilder::enumerator(int index) const const QMetaObject *QMetaObjectBuilder::relatedMetaObject(int index) const { if (index >= 0 && index < d->relatedMetaObjects.size()) +#ifdef Q_NO_DATA_RELOCATION + return &((*(d->relatedMetaObjects[index]))()); +#else return d->relatedMetaObjects[index]; +#endif else return 0; } @@ -1390,8 +1407,13 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf, reinterpret_cast<QMetaObjectExtraData *>(buf + size); size += sizeof(QMetaObjectExtraData); ALIGN(size, QMetaObject *); +#ifdef Q_NO_DATA_RELOCATION + QMetaObjectAccessor *objects = + reinterpret_cast<QMetaObjectAccessor *>(buf + size); +#else const QMetaObject **objects = reinterpret_cast<const QMetaObject **>(buf + size); +#endif if (buf) { if (d->relatedMetaObjects.size() > 0) { extra->objects = objects; @@ -1588,10 +1610,14 @@ void QMetaObjectBuilder::serialize(QDataStream& stream) const } // Write the related meta objects. +#ifdef Q_NO_DATA_RELOCATION + //### What do we do here? +#else for (index = 0; index < d->relatedMetaObjects.size(); ++index) { const QMetaObject *meta = d->relatedMetaObjects[index]; stream << QByteArray(meta->className()); } +#endif // Add an extra empty QByteArray for additional data in future versions. // This should help maintain backwards compatibility, allowing older @@ -1764,6 +1790,9 @@ void QMetaObjectBuilder::deserialize } // Read the related meta objects. +#ifdef Q_NO_DATA_RELOCATION + //### What do we do here +#else for (index = 0; index < relatedMetaObjectCount; ++index) { if (stream.status() != QDataStream::Ok) return; @@ -1775,6 +1804,7 @@ void QMetaObjectBuilder::deserialize } addRelatedMetaObject(cl); } +#endif // Read the extra data block, which is reserved for future use. stream >> name; diff --git a/src/declarative/qml/qmetaobjectbuilder_p.h b/src/declarative/qml/qmetaobjectbuilder_p.h index c0b7426..fc26c11 100644 --- a/src/declarative/qml/qmetaobjectbuilder_p.h +++ b/src/declarative/qml/qmetaobjectbuilder_p.h @@ -135,7 +135,11 @@ public: int addClassInfo(const QByteArray& name, const QByteArray& value); +#ifdef Q_NO_DATA_RELOCATION + int addRelatedMetaObject(const QMetaObjectAccessor &meta); +#else int addRelatedMetaObject(const QMetaObject *meta); +#endif void addMetaObject(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers); @@ -180,7 +184,7 @@ public: #endif private: - Q_DISABLE_COPY(QMetaObjectBuilder); + Q_DISABLE_COPY(QMetaObjectBuilder) QMetaObjectBuilderPrivate *d; diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 5df6532..b72c019 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -32,7 +32,8 @@ SOURCES += qml/qmlparser.cpp \ qml/qmlvaluetype.cpp \ qml/qmlbindingoptimizations.cpp \ qml/qmlxmlhttprequest.cpp \ - qml/qmetaobjectbuilder.cpp \ + qml/qmlsqldatabase.cpp \ + qml/qmetaobjectbuilder.cpp \ qml/qmlwatcher.cpp HEADERS += qml/qmlparser_p.h \ @@ -82,6 +83,7 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlvaluetype_p.h \ qml/qmlbindingoptimizations_p.h \ qml/qmlxmlhttprequest_p.h \ + qml/qmlsqldatabase_p.h \ qml/qmetaobjectbuilder_p.h \ qml/qmlwatcher_p.h diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index f9c9561..454369b 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -131,7 +131,7 @@ void QmlBinding::update() value = qVariantFromValue(QmlStringConverters::vector3DFromString(value.toString())); } - d->property.write(value); + d->property.write(value, QmlMetaProperty::Binding); } d->updating = false; @@ -180,7 +180,7 @@ QString QmlBinding::expression() const } QmlAbstractBinding::QmlAbstractBinding() -: m_mePtr(0), m_prevBinding(0), m_nextBinding(0) +: m_object(0), m_mePtr(0), m_prevBinding(0), m_nextBinding(0) { } @@ -193,24 +193,35 @@ QmlAbstractBinding::~QmlAbstractBinding() void QmlAbstractBinding::addToObject(QObject *object) { + Q_ASSERT(object); + removeFromObject(); - if (object) { - QmlDeclarativeData *data = QmlDeclarativeData::get(object, true); - m_nextBinding = data->bindings; - if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; - m_prevBinding = &data->bindings; - data->bindings = this; - } + Q_ASSERT(!m_prevBinding); + + QmlDeclarativeData *data = QmlDeclarativeData::get(object, true); + m_nextBinding = data->bindings; + if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; + m_prevBinding = &data->bindings; + data->bindings = this; + m_object = object; + + data->setBindingBit(m_object, propertyIndex()); } void QmlAbstractBinding::removeFromObject() { if (m_prevBinding) { + Q_ASSERT(m_object); + *m_prevBinding = m_nextBinding; if (m_nextBinding) m_nextBinding->m_prevBinding = m_prevBinding; m_prevBinding = 0; m_nextBinding = 0; + + QmlDeclarativeData *data = QmlDeclarativeData::get(m_object, false); + if (data) data->clearBindingBit(propertyIndex()); + m_object = 0; } } diff --git a/src/declarative/qml/qmlbinding.h b/src/declarative/qml/qmlbinding.h index 63b8a15..675917d 100644 --- a/src/declarative/qml/qmlbinding.h +++ b/src/declarative/qml/qmlbinding.h @@ -75,6 +75,7 @@ private: friend class QmlMetaProperty; friend class QmlVME; + QObject *m_object; QmlAbstractBinding **m_mePtr; QmlAbstractBinding **m_prevBinding; QmlAbstractBinding *m_nextBinding; diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp index 9af4003..08c3387 100644 --- a/src/declarative/qml/qmlboundsignal.cpp +++ b/src/declarative/qml/qmlboundsignal.cpp @@ -42,6 +42,7 @@ #include "qmlboundsignal_p.h" #include "private/qmetaobjectbuilder_p.h" #include "private/qmlengine_p.h" +#include "private/qmlexpression_p.h" #include "private/qmlcontext_p.h" #include <qfxglobal.h> #include <qmlmetatype.h> @@ -51,41 +52,135 @@ QT_BEGIN_NAMESPACE -int QmlBoundSignal::evaluateIdx = -1; -QmlBoundSignal::QmlBoundSignal(QmlContext *ctxt, const QString &val, QObject *me, int idx, QObject *parent) -: QmlExpression(ctxt, val, me), _idx(idx) +class QmlBoundSignalParameters : public QObject +{ +Q_OBJECT +public: + QmlBoundSignalParameters(const QMetaMethod &, QObject * = 0); + ~QmlBoundSignalParameters(); + + void setValues(void **); + void clearValues(); + +private: + friend class MetaObject; + int metaCall(QMetaObject::Call, int _id, void **); + struct MetaObject : public QAbstractDynamicMetaObject { + MetaObject(QmlBoundSignalParameters *b) + : parent(b) {} + + int metaCall(QMetaObject::Call c, int id, void **a) { + return parent->metaCall(c, id, a); + } + QmlBoundSignalParameters *parent; + }; + + int *types; + void **values; + QMetaObject *myMetaObject; +}; + +static int evaluateIdx = -1; + +QmlAbstractBoundSignal::QmlAbstractBoundSignal(QObject *parent) +: QObject(parent) +{ +} + +QmlAbstractBoundSignal::~QmlAbstractBoundSignal() +{ +} + +QmlBoundSignal::QmlBoundSignal(QObject *scope, const QMetaMethod &signal, + QObject *parent) +: m_expression(0), m_idx(signal.methodIndex()), m_params(0) +{ + // A cached evaluation of the QmlExpression::value() slot index. + // + // This is thread safe. Although it may be updated by two threads, they + // will both set it to the same value - so the worst thing that can happen + // is that they both do the work to figure it out. Boo hoo. + if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); + + QFx_setParent_noEvent(this, parent); + QMetaObject::connect(scope, m_idx, this, evaluateIdx); + + if (!signal.parameterTypes().isEmpty()) + m_params = new QmlBoundSignalParameters(signal, this); +} + +QmlBoundSignal::QmlBoundSignal(QmlContext *ctxt, const QString &val, + QObject *scope, const QMetaMethod &signal, + QObject *parent) +: m_expression(0), m_idx(signal.methodIndex()), m_params(0) { // A cached evaluation of the QmlExpression::value() slot index. // // This is thread safe. Although it may be updated by two threads, they // will both set it to the same value - so the worst thing that can happen // is that they both do the work to figure it out. Boo hoo. - if (evaluateIdx == -1) evaluateIdx = QmlExpression::staticMetaObject.indexOfMethod("value()"); + if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); - setTrackChange(false); QFx_setParent_noEvent(this, parent); - QMetaObject::connect(me, _idx, this, evaluateIdx); + QMetaObject::connect(scope, m_idx, this, evaluateIdx); + + m_expression = new QmlExpression(ctxt, val, scope); + m_expression->setTrackChange(false); + + if (!signal.parameterTypes().isEmpty()) + m_params = new QmlBoundSignalParameters(signal, this); } -QmlBoundSignalProxy::QmlBoundSignalProxy(QmlContext *ctxt, const QString &val, QObject *me, int idx, QObject *parent) -: QmlBoundSignal(ctxt, val, me, idx, parent) +QmlBoundSignal::~QmlBoundSignal() { - QMetaMethod signal = me->metaObject()->method(idx); + delete m_expression; + m_expression = 0; +} - params = new QmlBoundSignalParameters(signal, this); +int QmlBoundSignal::index() const +{ + return m_idx; +} - ctxt->d_func()->addDefaultObject(params, QmlContextPrivate::HighPriority); +/*! + Returns the signal expression. +*/ +QmlExpression *QmlBoundSignal::expression() const +{ + return m_expression; +} + +/*! + Sets the signal expression to \a e. Returns the current signal expression, + or null if there is no signal expression. + + The QmlBoundSignal instance takes ownership of \a e. The caller is + assumes ownership of the returned QmlExpression. +*/ +QmlExpression *QmlBoundSignal::setExpression(QmlExpression *e) +{ + QmlExpression *rv = m_expression; + m_expression = e; + if (m_expression) m_expression->setTrackChange(false); + return rv; } -int QmlBoundSignalProxy::qt_metacall(QMetaObject::Call c, int id, void **a) +QmlBoundSignal *QmlBoundSignal::cast(QObject *o) +{ + QmlAbstractBoundSignal *s = qobject_cast<QmlAbstractBoundSignal*>(o); + return static_cast<QmlBoundSignal *>(s); +} + +int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { - params->setValues(a); - value(); - params->clearValues(); + if (m_params) m_params->setValues(a); + if (m_expression) + QmlExpressionPrivate::get(m_expression)->value(m_params); + if (m_params) m_params->clearValues(); return -1; } else { - return QmlBoundSignal::qt_metacall(c, id, a); + return QObject::qt_metacall(c, id, a); } } @@ -157,3 +252,5 @@ int QmlBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a) } QT_END_NAMESPACE + +#include "qmlboundsignal.moc" diff --git a/src/declarative/qml/qmlboundsignal_p.h b/src/declarative/qml/qmlboundsignal_p.h index de8f91d..51c7155 100644 --- a/src/declarative/qml/qmlboundsignal_p.h +++ b/src/declarative/qml/qmlboundsignal_p.h @@ -58,56 +58,37 @@ QT_BEGIN_NAMESPACE -class QmlBoundSignal : public QmlExpression +class QmlAbstractBoundSignal : public QObject { -Q_OBJECT + Q_OBJECT public: - QmlBoundSignal(QmlContext *, const QString &, QObject *me, int idx, QObject *parent); - - int index() const { return _idx; } -protected: - static int evaluateIdx; -private: - int _idx; + QmlAbstractBoundSignal(QObject *parent = 0); + virtual ~QmlAbstractBoundSignal() = 0; }; -class QmlBoundSignalParameters : public QObject +class QmlBoundSignalParameters; +class QmlBoundSignal : public QmlAbstractBoundSignal { -Q_OBJECT public: - QmlBoundSignalParameters(const QMetaMethod &, QObject * = 0); - ~QmlBoundSignalParameters(); - - void setValues(void **); - void clearValues(); - -private: - friend class MetaObject; - int metaCall(QMetaObject::Call, int _id, void **); - struct MetaObject : public QAbstractDynamicMetaObject { - MetaObject(QmlBoundSignalParameters *b) - : parent(b) {} + QmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent); + QmlBoundSignal(QmlContext *ctxt, const QString &val, QObject *scope, + const QMetaMethod &signal, QObject *parent); + virtual ~QmlBoundSignal(); - int metaCall(QMetaObject::Call c, int id, void **a) { - return parent->metaCall(c, id, a); - } - QmlBoundSignalParameters *parent; - }; + int index() const; - int *types; - void **values; - QMetaObject *myMetaObject; -}; + QmlExpression *expression() const; + QmlExpression *setExpression(QmlExpression *); -class QmlBoundSignalProxy : public QmlBoundSignal -{ -public: - QmlBoundSignalProxy(QmlContext *, const QString &, QObject *me, int idx, QObject *parent); + static QmlBoundSignal *cast(QObject *); protected: virtual int qt_metacall(QMetaObject::Call c, int id, void **a); + private: - QmlBoundSignalParameters *params; + QmlExpression *m_expression; + int m_idx; + QmlBoundSignalParameters *m_params; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index f02dad5..053c6f8 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -53,6 +53,7 @@ #include <QPointF> #include <QSizeF> #include <QRectF> +#include <QAtomicInt> #include <private/qmlstringconverters_p.h> #include <private/qmlengine_p.h> #include <qmlengine.h> @@ -644,11 +645,12 @@ void QmlCompiler::compileTree(Object *tree) output->imports = unit->imports; - if (tree->metatype) + if (tree->metatype) { static_cast<QMetaObject &>(output->root) = *tree->metaObject(); - else + QmlEnginePrivate::get(engine)->registerCompositeType(output); + } else { static_cast<QMetaObject &>(output->root) = *output->types.at(tree->type).metaObject(); - + } } bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt) @@ -1260,7 +1262,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop, COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt)); - } else if (QmlMetaType::isQmlList(prop->type) || + } else if (QmlEnginePrivate::get(engine)->isQmlList(prop->type) || QmlMetaType::isList(prop->type)) { COMPILE_CHECK(buildListProperty(prop, obj, ctxt)); @@ -1306,12 +1308,15 @@ QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns, COMPILE_CHECK(buildAttachedProperty(prop, obj, ctxt)); } + + return true; } void QmlCompiler::genValueProperty(QmlParser::Property *prop, QmlParser::Object *obj) { - if (QmlMetaType::isQmlList(prop->type) || QmlMetaType::isList(prop->type)) { + if (QmlEnginePrivate::get(engine)->isQmlList(prop->type) || + QmlMetaType::isList(prop->type)) { genListProperty(prop, obj); } else { genPropertyAssignment(prop, obj); @@ -1325,10 +1330,10 @@ void QmlCompiler::genListProperty(QmlParser::Property *prop, QmlInstruction::Type storeType; int listType; - if (QmlMetaType::isQmlList(prop->type)) { + if (QmlEnginePrivate::get(engine)->isQmlList(prop->type)) { fetchType = QmlInstruction::FetchQmlList; storeType = QmlInstruction::StoreObjectQmlList; - listType = QmlMetaType::qmlListType(prop->type); + listType = QmlEnginePrivate::get(engine)->qmlListType(prop->type); } else { fetchType = QmlInstruction::FetchQList; storeType = QmlInstruction::StoreObjectQList; @@ -1541,7 +1546,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, Q_ASSERT(prop->type != 0); Q_ASSERT(prop->index != -1); - if (prop->type < QVariant::UserType) { + if (prop->type < (int)QVariant::UserType) { QmlEnginePrivate *ep = static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine)); if (ep->valueTypes[prop->type]) { @@ -1554,7 +1559,8 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, } else { // Load the nested property's meta type - prop->value->metatype = QmlMetaType::metaObjectForType(prop->type); + prop->value->metatype = + QmlEnginePrivate::get(engine)->metaObjectForType(prop->type); if (!prop->value->metatype) COMPILE_EXCEPTION(prop, "Cannot nest non-QObject property" << prop->name); @@ -1627,14 +1633,14 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop, const BindingContext &ctxt) { Q_ASSERT(QmlMetaType::isList(prop->type) || - QmlMetaType::isQmlList(prop->type)); + QmlEnginePrivate::get(engine)->isQmlList(prop->type)); int t = prop->type; obj->addValueProperty(prop); - if (QmlMetaType::isQmlList(t)) { - int listType = QmlMetaType::qmlListType(t); + if (QmlEnginePrivate::get(engine)->isQmlList(t)) { + int listType = QmlEnginePrivate::get(engine)->qmlListType(t); bool listTypeIsInterface = QmlMetaType::isInterface(listType); for (int ii = 0; ii < prop->values.count(); ++ii) { @@ -1768,7 +1774,7 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop, // actual property type before we applied any extensions that might // effect the properties on the type, but don't effect assignability const QMetaObject *propertyMetaObject = - QmlMetaType::rawMetaObjectForType(prop->type); + QmlEnginePrivate::get(engine)->rawMetaObjectForType(prop->type); // Will be true if the assgned type inherits propertyMetaObject bool isAssignable = false; @@ -1902,8 +1908,13 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj) return true; } +static QAtomicInt classIndexCounter; + bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) { + Q_ASSERT(obj); + Q_ASSERT(obj->metatype); + if (obj->dynamicProperties.isEmpty() && obj->dynamicSignals.isEmpty() && obj->dynamicSlots.isEmpty()) @@ -1913,9 +1924,13 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) QByteArray dynamicData(sizeof(QmlVMEMetaData), (char)0); + QByteArray newClassName = obj->metatype->className(); + newClassName.append("_QML_"); + int idx = classIndexCounter.fetchAndAddRelaxed(1); + newClassName.append(QByteArray::number(idx)); + QMetaObjectBuilder builder; - if (obj->metatype) - builder.setClassName(QByteArray(obj->metatype->className()) + "_QML"); + builder.setClassName(newClassName); builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); bool hasAlias = false; @@ -1937,11 +1952,46 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) QByteArray type; int propertyType = 0; + bool readonly = false; switch(p.type) { case Object::DynamicProperty::Alias: hasAlias = true; continue; break; + case Object::DynamicProperty::CustomList: + case Object::DynamicProperty::Custom: + { + QByteArray customTypeName; + QmlType *qmltype = 0; + QUrl url; + QmlEnginePrivate *priv = QmlEnginePrivate::get(engine); + if (!priv->resolveType(unit->imports, p.customType, &qmltype, + &url, 0, 0, 0)) + COMPILE_EXCEPTION(&p, "Invalid property type"); + + if (!qmltype) { + QmlCompositeTypeData *tdata = priv->typeManager.get(url); + Q_ASSERT(tdata); + Q_ASSERT(tdata->status == QmlCompositeTypeData::Complete); + + QmlCompiledData *data = tdata->toCompiledComponent(engine); + customTypeName = data->root.className(); + } else { + customTypeName = qmltype->typeName(); + } + + if (p.type == Object::DynamicProperty::Custom) { + type = customTypeName + "*"; + propertyType = QMetaType::QObjectStar; + } else { + readonly = true; + type = "QmlList<"; + type.append(customTypeName); + type.append("*>*"); + propertyType = qMetaTypeId<QmlList<QObject*>* >(); + } + } + break; case Object::DynamicProperty::Variant: propertyType = -1; type = "QVariant"; @@ -1981,7 +2031,10 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) dynamicData.append((char *)&propertyData, sizeof(propertyData)); builder.addSignal(p.name + "Changed()"); - builder.addProperty(p.name, type, ii).setScriptable(true); + QMetaPropertyBuilder propBuilder = + builder.addProperty(p.name, type, ii); + propBuilder.setScriptable(true); + propBuilder.setWritable(!readonly); } if (mode == ResolveAliases) { @@ -2251,7 +2304,8 @@ bool QmlCompiler::completeComponentBuild() */ bool QmlCompiler::canCoerce(int to, QmlParser::Object *from) { - const QMetaObject *toMo = QmlMetaType::rawMetaObjectForType(to); + const QMetaObject *toMo = + QmlEnginePrivate::get(engine)->rawMetaObjectForType(to); const QMetaObject *fromMo = from->metaObject(); while (fromMo) { @@ -2268,8 +2322,10 @@ bool QmlCompiler::canCoerce(int to, QmlParser::Object *from) */ bool QmlCompiler::canCoerce(int to, int from) { - const QMetaObject *toMo = QmlMetaType::rawMetaObjectForType(to); - const QMetaObject *fromMo = QmlMetaType::rawMetaObjectForType(from); + const QMetaObject *toMo = + QmlEnginePrivate::get(engine)->rawMetaObjectForType(to); + const QMetaObject *fromMo = + QmlEnginePrivate::get(engine)->rawMetaObjectForType(from); while (fromMo) { if (fromMo == toMo) diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 83c415c..7f5e98f 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -231,9 +231,9 @@ private: int componentTypeRef(); static int findSignalByName(const QMetaObject *, const QByteArray &name); - static bool canCoerce(int to, QmlParser::Object *from); - static bool canCoerce(int to, int from); static QmlType *toQmlType(QmlParser::Object *from); + bool canCoerce(int to, QmlParser::Object *from); + bool canCoerce(int to, int from); QStringList deferredProperties(QmlParser::Object *); diff --git a/src/declarative/qml/qmldeclarativedata_p.h b/src/declarative/qml/qmldeclarativedata_p.h index a316c0c..ade961f 100644 --- a/src/declarative/qml/qmldeclarativedata_p.h +++ b/src/declarative/qml/qmldeclarativedata_p.h @@ -70,6 +70,12 @@ public: QmlContext *context; QmlAbstractBinding *bindings; + int bindingBitsSize; + quint32 *bindingBits; + bool hasBindingBit(int) const; + void clearBindingBit(int); + void setBindingBit(QObject *obj, int); + QmlContext *outerContext; // Can't this be found from context? ushort lineNumber; ushort columnNumber; diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 9e12485..ce1bb93 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -151,7 +151,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl d->errors.clear(); d->imports.clear(); - QmlCompiledData component; + QmlCompiledData *component = new QmlCompiledData; QmlCompiler compiler; QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url); @@ -159,20 +159,23 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl if(td->status == QmlCompositeTypeData::Error) { d->errors = td->errors; td->release(); + component->release(); return false; } else if(td->status == QmlCompositeTypeData::Waiting) { QmlError error; error.setDescription(QLatin1String("QmlDomDocument supports local types only")); d->errors << error; td->release(); + component->release(); return false; } - compiler.compile(engine, td, &component); + compiler.compile(engine, td, component); if (compiler.isError()) { d->errors = compiler.errors(); td->release(); + component->release(); return false; } @@ -196,6 +199,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl d->root->addref(); } + component->release(); return true; } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index e3d4840..0efb5c8 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -82,6 +82,13 @@ #include <private/qmlenginedebug_p.h> #include <private/qmlstringconverters_p.h> #include <private/qmlxmlhttprequest_p.h> +#include <private/qmlsqldatabase_p.h> + +#ifdef Q_OS_WIN // for %APPDATA% +#include "qt_windows.h" +#include "qlibrary.h" +#define CSIDL_APPDATA 0x001a // <username>\Application Data +#endif Q_DECLARE_METATYPE(QmlMetaProperty) Q_DECLARE_METATYPE(QList<QObject *>); @@ -107,10 +114,49 @@ QScriptValue desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e) return e->newVariant(QVariant(ret)); } +// XXX Something like this should be exported by Qt. +static QString userLocalDataPath(const QString& app) +{ + QString result; + +#ifdef Q_OS_WIN +#ifndef Q_OS_WINCE + QLibrary library(QLatin1String("shell32")); +#else + QLibrary library(QLatin1String("coredll")); +#endif // Q_OS_WINCE + typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL); + GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW"); + if (SHGetSpecialFolderPath) { + wchar_t path[MAX_PATH]; + SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE); + result = QString::fromWCharArray(path); + } +#endif // Q_OS_WIN + +#ifdef Q_OS_MAC + result = QLatin1String(qgetenv("HOME")); + result += "/Library/Application Support"; +#else + if (result.isEmpty()) { + // Fallback: UNIX style + result = QLatin1String(qgetenv("XDG_DATA_HOME")); + if (result.isEmpty()) { + result = QLatin1String(qgetenv("HOME")); + result += QLatin1String("/.local/share"); + } + } +#endif + + result += QLatin1Char('/'); + result += app; + return result; +} + QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) : rootContext(0), currentExpression(0), isDebugging(false), contextClass(0), objectClass(0), valueTypeClass(0), - nodeListClass(0), namedNodeMapClass(0), scriptEngine(this), rootComponent(0), + nodeListClass(0), namedNodeMapClass(0), sqlQueryClass(0), scriptEngine(this), rootComponent(0), networkAccessManager(0), typeManager(e), uniqueId(1) { QScriptValue qtObject = @@ -120,7 +166,9 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) qtObject.setProperty(QLatin1String("DesktopServices"), desktopObject); scriptEngine.globalObject().setProperty(QLatin1String("Qt"), qtObject); + offlineStoragePath = userLocalDataPath(QLatin1String("Nokia/Qt/QML/OfflineStorage")); qt_add_qmlxmlhttprequest(&scriptEngine); + qt_add_qmlsqldatabase(&scriptEngine); //types qtObject.setProperty(QLatin1String("rgba"), scriptEngine.newFunction(QmlEnginePrivate::rgba, 4)); @@ -154,11 +202,15 @@ QmlEnginePrivate::~QmlEnginePrivate() nodeListClass = 0; delete namedNodeMapClass; namedNodeMapClass = 0; + delete sqlQueryClass; + sqlQueryClass = 0; for(int ii = 0; ii < bindValues.count(); ++ii) clear(bindValues[ii]); for(int ii = 0; ii < parserStatus.count(); ++ii) clear(parserStatus[ii]); + for(QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter) + (*iter)->release(); } void QmlEnginePrivate::clear(SimpleList<QmlAbstractBinding> &bvs) @@ -198,8 +250,6 @@ void QmlEnginePrivate::init() scriptEngine.newFunction(QmlEnginePrivate::createQmlObject, 1)); scriptEngine.globalObject().setProperty(QLatin1String("createComponent"), scriptEngine.newFunction(QmlEnginePrivate::createComponent, 1)); - scriptEngine.globalObject().setProperty(QLatin1String("vector"), - scriptEngine.newFunction(QmlEnginePrivate::vector, 3)); if (QCoreApplication::instance()->thread() == q->thread() && QmlEngineDebugServer::isDebuggingEnabled()) { @@ -648,7 +698,9 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre } QmlDeclarativeData::QmlDeclarativeData(QmlContext *ctxt) -: context(ctxt), bindings(0), deferredComponent(0), attachedProperties(0) +: context(ctxt), bindings(0), bindingBitsSize(0), bindingBits(0), + outerContext(0), lineNumber(0), columnNumber(0), deferredComponent(0), + deferredIdx(0), attachedProperties(0) { } @@ -670,9 +722,47 @@ void QmlDeclarativeData::destroyed(QObject *object) binding = next; } + if (bindingBits) + free(bindingBits); + delete this; } +bool QmlDeclarativeData::hasBindingBit(int bit) const +{ + if (bindingBitsSize >= bit) + return bindingBits[bit / 32] & (1 << (bit % 32)); + else + return false; +} + +void QmlDeclarativeData::clearBindingBit(int bit) +{ + if (bindingBitsSize >= bit) + bindingBits[bit / 32] &= ~(1 << (bit % 32)); +} + +void QmlDeclarativeData::setBindingBit(QObject *obj, int bit) +{ + if (bindingBitsSize < bit) { + int props = obj->metaObject()->propertyCount(); + Q_ASSERT(bit < props); + + int arraySize = (props + 31) / 32; + int oldArraySize = bindingBitsSize / 32; + + bindingBits = (quint32 *)realloc(bindingBits, + arraySize * sizeof(quint32)); + memset(bindingBits + oldArraySize, + sizeof(quint32) * (arraySize - oldArraySize), + 0x00); + + bindingBitsSize = arraySize * 32; + } + + bindingBits[bit / 32] |= (1 << (bit % 32)); +} + /*! Creates a QScriptValue allowing you to use \a object in QML script. \a engine is the QmlEngine it is to be created in. @@ -1468,8 +1558,9 @@ public: bool found = false; foreach (QString p, importPath) { QString dir = p+QLatin1Char('/')+url; - if (QFile::exists(dir+QLatin1String("/qmldir"))) { - url = QLatin1String("file://")+dir; + QFileInfo fi(dir+QLatin1String("/qmldir")); + if (fi.isFile()) { + url = QUrl::fromLocalFile(fi.absolutePath()).toString(); found = true; break; } @@ -1596,6 +1687,32 @@ void QmlEngine::addImportPath(const QString& path) } /*! + \property QmlEngine::offlineStoragePath + \brief the directory for storing offline user data + + Returns the directory where SQL and other offline + storage is placed. + + QFxWebView and the SQL databases created with openDatabase() + are stored here. + + The default is Nokia/Qt/QML/Databases/ in the platform-standard + user application data directory. +*/ +void QmlEngine::setOfflineStoragePath(const QString& dir) +{ + Q_D(QmlEngine); + d->offlineStoragePath = dir; +} + +QString QmlEngine::offlineStoragePath() const +{ + Q_D(const QmlEngine); + return d->offlineStoragePath; +} + + +/*! \internal Adds information to \a imports such that subsequent calls to resolveType() @@ -1670,4 +1787,75 @@ void QmlEnginePrivate::resolveTypeInNamespace(ImportedNamespace* ns, const QByte ns->find(type,vmaj,vmin,type_return,url_return); } +static void voidptr_destructor(void *v) +{ + void **ptr = (void **)v; + delete ptr; +} + +static void *voidptr_constructor(const void *v) +{ + if (!v) { + return new void*; + } else { + return new void*(*(void **)v); + } +} + +void QmlEnginePrivate::registerCompositeType(QmlCompiledData *data) +{ + QByteArray name = data->root.className(); + + QByteArray ptr = name + "*"; + QByteArray lst = "QmlList<" + ptr + ">*"; + + int ptr_type = QMetaType::registerType(ptr.constData(), voidptr_destructor, + voidptr_constructor); + int lst_type = QMetaType::registerType(lst.constData(), voidptr_destructor, + voidptr_constructor); + + m_qmlLists.insert(lst_type, ptr_type); + m_compositeTypes.insert(ptr_type, data); + data->addref(); +} + +bool QmlEnginePrivate::isQmlList(int t) const +{ + return m_qmlLists.contains(t) || QmlMetaType::isQmlList(t); +} + +bool QmlEnginePrivate::isObject(int t) +{ + return m_compositeTypes.contains(t) || QmlMetaType::isObject(t); +} + +int QmlEnginePrivate::qmlListType(int t) const +{ + QHash<int, int>::ConstIterator iter = m_qmlLists.find(t); + if (iter != m_qmlLists.end()) + return *iter; + else + return QmlMetaType::qmlListType(t); +} + +const QMetaObject *QmlEnginePrivate::rawMetaObjectForType(int t) const +{ + QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); + if (iter != m_compositeTypes.end()) { + return &(*iter)->root; + } else { + return QmlMetaType::rawMetaObjectForType(t); + } +} + +const QMetaObject *QmlEnginePrivate::metaObjectForType(int t) const +{ + QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); + if (iter != m_compositeTypes.end()) { + return &(*iter)->root; + } else { + return QmlMetaType::metaObjectForType(t); + } +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index 8caa505..b4233e4 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -65,6 +65,7 @@ class QScriptContext; class QNetworkAccessManager; class Q_DECLARATIVE_EXPORT QmlEngine : public QObject { + Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath) Q_OBJECT public: QmlEngine(QObject *p = 0); @@ -79,6 +80,9 @@ public: void setNetworkAccessManager(QNetworkAccessManager *); QNetworkAccessManager *networkAccessManager() const; + void setOfflineStoragePath(const QString& dir); + QString offlineStoragePath() const; + QUrl baseUrl() const; void setBaseUrl(const QUrl &); diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 15ab40d..74e24d4 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -154,6 +154,8 @@ public: // Used by DOM Core 3 API QScriptClass *nodeListClass; QScriptClass *namedNodeMapClass; + // Used by SQL database API + QScriptClass *sqlQueryClass; struct QmlScriptEngine : public QScriptEngine { @@ -199,6 +201,7 @@ public: QmlCompositeTypeManager typeManager; QStringList fileImportPath; + QString offlineStoragePath; mutable quint32 uniqueId; quint32 getUniqueId() const { @@ -239,6 +242,15 @@ public: int *version_major, int *version_minor ) const; + void registerCompositeType(QmlCompiledData *); + bool isQmlList(int) const; + bool isObject(int); + int qmlListType(int) const; + const QMetaObject *rawMetaObjectForType(int) const; + const QMetaObject *metaObjectForType(int) const; + QHash<int, int> m_qmlLists; + QHash<int, QmlCompiledData *> m_compositeTypes; + static QScriptValue qmlScriptObject(QObject*, QmlEngine*); static QScriptValue createComponent(QScriptContext*, QScriptEngine*); static QScriptValue createQmlObject(QScriptContext*, QScriptEngine*); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index f5c1297..7896afe 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -108,11 +108,7 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) if (prop.type() < QVariant::UserType) { rv.type = QmlObjectProperty::Basic; - if (qobject_cast<QmlBoundSignalParameters*>(obj) && prop.name() != QByteArray("objectName")) - // these "properties" only have meaning during signal emission - rv.value = tr("(signal parameter)"); - else - rv.value = prop.read(obj); + rv.value = prop.read(obj); } else if (QmlMetaType::isObject(prop.userType())) { rv.type = QmlObjectProperty::Object; } else if (QmlMetaType::isList(prop.userType()) || diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 845dcf6..db9d39f 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -212,7 +212,7 @@ QVariant QmlExpressionPrivate::evalSSE() return rv; } -QVariant QmlExpressionPrivate::evalQtScript() +QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope) { #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer<QFxPerf::BindValueQt> perfqt; @@ -223,6 +223,9 @@ QVariant QmlExpressionPrivate::evalQtScript() if (me) ctxtPriv->defaultObjects.insert(ctxtPriv->highPriorityCount, me); + if (secondaryScope) + ctxtPriv->defaultObjects.insert(ctxtPriv->highPriorityCount, + secondaryScope); QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); @@ -263,6 +266,8 @@ QVariant QmlExpressionPrivate::evalQtScript() if (me) ctxtPriv->defaultObjects.removeAt(ctxtPriv->highPriorityCount); + if (secondaryScope) + ctxtPriv->defaultObjects.removeAt(ctxtPriv->highPriorityCount); QVariant rv; @@ -306,42 +311,38 @@ QVariant QmlExpressionPrivate::evalQtScript() return rv; } -/*! - Returns the value of the expression, or an invalid QVariant if the - expression is invalid or has an error. -*/ -QVariant QmlExpression::value() +QVariant QmlExpressionPrivate::value(QObject *secondaryScope) { - Q_D(QmlExpression); + Q_Q(QmlExpression); QVariant rv; - if (!engine() || (!d->sse.isValid() && d->expression.isEmpty())) + if (!q->engine() || (!sse.isValid() && expression.isEmpty())) return rv; #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer<QFxPerf::BindValue> perf; #endif - QmlEnginePrivate *ep = QmlEnginePrivate::get(engine()); + QmlEnginePrivate *ep = QmlEnginePrivate::get(q->engine()); QmlExpression *lastCurrentExpression = ep->currentExpression; QPODVector<QmlEnginePrivate::CapturedProperty> lastCapturedProperties; ep->capturedProperties.copyAndClear(lastCapturedProperties); - ep->currentExpression = this; + ep->currentExpression = q; - if (d->sse.isValid()) { - rv = d->evalSSE(); + if (sse.isValid()) { + rv = evalSSE(); } else { - rv = d->evalQtScript(); + rv = evalQtScript(secondaryScope); } ep->currentExpression = lastCurrentExpression; - if ((!trackChange() || !ep->capturedProperties.count()) && d->guardList) { - d->clearGuards(); - } else if(trackChange()) { - d->updateGuards(ep->capturedProperties); + if ((!q->trackChange() || !ep->capturedProperties.count()) && guardList) { + clearGuards(); + } else if(q->trackChange()) { + updateGuards(ep->capturedProperties); } lastCapturedProperties.copyAndClear(ep->capturedProperties); @@ -350,6 +351,16 @@ QVariant QmlExpression::value() } /*! + Returns the value of the expression, or an invalid QVariant if the + expression is invalid or has an error. +*/ +QVariant QmlExpression::value() +{ + Q_D(QmlExpression); + return d->value(); +} + +/*! Returns true if the expression results in a constant value. QmlExpression::value() must have been invoked at least once before the return from this method is valid. diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h index 997bf8d..501e5d8 100644 --- a/src/declarative/qml/qmlexpression_p.h +++ b/src/declarative/qml/qmlexpression_p.h @@ -93,6 +93,7 @@ public: PreTransformedQtScriptData = 2 }; + void init(QmlContext *, const QString &, QObject *); void init(QmlContext *, void *, QmlRefCount *, QObject *); @@ -108,8 +109,9 @@ public: QString fileName; int line; + QVariant value(QObject *secondaryScope = 0); QVariant evalSSE(); - QVariant evalQtScript(); + QVariant evalQtScript(QObject *secondaryScope); struct SignalGuard : public QGuard<QObject> { SignalGuard() : isDuplicate(false), notifyIndex(-1) {} @@ -132,6 +134,10 @@ public: int guardListLength; void updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties); void clearGuards(); + + static QmlExpressionPrivate *get(QmlExpression *expr) { + return static_cast<QmlExpressionPrivate *>(QObjectPrivate::get(expr)); + } }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index e47b4ab..bae1682 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -85,7 +85,11 @@ QmlInfo::QmlInfo(QObject *object) QmlDeclarativeData *ddata = QmlDeclarativeData::get(object); if (ddata) { QString location = QLatin1String("("); - location += ddata->outerContext->baseUrl().toString(); + if (ddata->outerContext) { + location += ddata->outerContext->baseUrl().toString(); + } else { + location += "unknown"; + } location += QLatin1String(":"); location += QString::number(ddata->lineNumber); location += QLatin1String(":"); diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index b305619..91769d3 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -531,6 +531,9 @@ QmlAbstractBinding *QmlMetaProperty::binding() const if (!data) return 0; + if (!data->hasBindingBit(d->coreIdx)) + return 0; + QmlAbstractBinding *binding = data->bindings; while (binding) { // ### This wont work for value types @@ -547,6 +550,9 @@ QmlAbstractBinding *QmlMetaProperty::binding() const \a newBinding will be enabled, and the returned binding (if any) will be disabled. + + Ownership of \a newBinding transfers to QML. Ownership of the return value + is assumed by the caller. */ QmlAbstractBinding * QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding) const @@ -556,20 +562,22 @@ QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding) const QmlDeclarativeData *data = QmlDeclarativeData::get(d->object, true); - QmlAbstractBinding *binding = data->bindings; - while (binding) { - // ### This wont work for value types - if (binding->propertyIndex() == d->coreIdx) { - binding->setEnabled(false); + if (data->hasBindingBit(d->coreIdx)) { + QmlAbstractBinding *binding = data->bindings; + while (binding) { + // ### This wont work for value types + if (binding->propertyIndex() == d->coreIdx) { + binding->setEnabled(false); - if (newBinding) - newBinding->setEnabled(true); + if (newBinding) + newBinding->setEnabled(true); - return binding; // ### QmlAbstractBinding; - } + return binding; // ### QmlAbstractBinding; + } - binding = binding->m_nextBinding; - } + binding = binding->m_nextBinding; + } + } if (newBinding) newBinding->setEnabled(true); @@ -577,6 +585,59 @@ QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding) const return 0; } +/*! + Returns the expression associated with this signal property, or 0 if no + signal expression exists. +*/ +QmlExpression *QmlMetaProperty::signalExpression() const +{ + if (!(type() & SignalProperty)) + return 0; + + const QObjectList &children = d->object->children(); + + for (int ii = 0; ii < children.count(); ++ii) { + QObject *child = children.at(ii); + + QmlBoundSignal *signal = QmlBoundSignal::cast(child); + if (signal && signal->index() == coreIndex()) + return signal->expression(); + } + + return 0; +} + +/*! + Set the signal expression associated with this signal property to \a expr. + Returns the existing signal expression (if any), otherwise 0. + + Ownership of \a expr transfers to QML. Ownership of the return value is + assumed by the caller. +*/ +QmlExpression *QmlMetaProperty::setSignalExpression(QmlExpression *expr) const +{ + if (!(type() & SignalProperty)) + return 0; + + const QObjectList &children = d->object->children(); + + for (int ii = 0; ii < children.count(); ++ii) { + QObject *child = children.at(ii); + + QmlBoundSignal *signal = QmlBoundSignal::cast(child); + if (signal && signal->index() == coreIndex()) + return signal->setExpression(expr); + } + + if (expr) { + QmlBoundSignal *signal = new QmlBoundSignal(d->object, d->signal, + d->object); + return signal->setExpression(expr); + } else { + return 0; + } +} + void QmlMetaPropertyPrivate::findSignalInt(QObject *obj, const QString &name) { const QMetaObject *mo = obj->metaObject(); @@ -617,9 +678,9 @@ QVariant QmlMetaProperty::read() const const QObjectList &children = object()->children(); for (int ii = 0; ii < children.count(); ++ii) { - QmlBoundSignal *sig = qobject_cast<QmlBoundSignal *>(children.at(ii)); + QmlBoundSignal *sig = QmlBoundSignal::cast(children.at(ii)); if (sig && sig->index() == d->coreIdx) - return sig->expression(); + return sig->expression()->expression(); } } else if (type() & Property) { if (type() & Attached) { @@ -653,13 +714,13 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) const QObjectList &children = object->children(); for (int ii = 0; ii < children.count(); ++ii) { - QmlBoundSignal *sig = qobject_cast<QmlBoundSignal *>(children.at(ii)); + QmlBoundSignal *sig = QmlBoundSignal::cast(children.at(ii)); if (sig && sig->index() == coreIdx) { if (expr.isEmpty()) { sig->disconnect(); sig->deleteLater(); } else { - sig->setExpression(expr); + sig->expression()->setExpression(expr); } return; } @@ -667,11 +728,12 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) if (!expr.isEmpty()) { // XXX scope - (void *)new QmlBoundSignal(qmlContext(object), expr, object, coreIdx, object); + (void *)new QmlBoundSignal(qmlContext(object), expr, object, signal, object); } } -void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) +void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value, + QmlMetaProperty::WriteSource source) { QObject *object = this->object; int coreIdx = this->coreIdx; @@ -721,7 +783,8 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) int vt = value.userType(); int category = propertyCategory(); - if (vt == t) { + if (vt == t + && t != QVariant::Url) { // always resolve relative urls void *a[1]; a[0] = (void *)value.constData(); @@ -877,7 +940,10 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) case QVariant::Url: { QUrl u; - if (vt == QVariant::ByteArray) { + if (vt == QVariant::Url) { + u = value.toUrl(); + found = true; + } else if (vt == QVariant::ByteArray) { u = QUrl(QLatin1String(value.toByteArray())); found = true; } else if (vt == QVariant::String) { @@ -927,6 +993,11 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) */ void QmlMetaProperty::write(const QVariant &value) const { + write(value, Other); +} + +void QmlMetaProperty::write(const QVariant &value, WriteSource source) const +{ if (!d->object) return; @@ -936,7 +1007,7 @@ void QmlMetaProperty::write(const QVariant &value) const } else if (d->coreIdx != -1) { - d->writeValueProperty(value); + d->writeValueProperty(value, source); } } diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h index 7b9ff47..8c34ece 100644 --- a/src/declarative/qml/qmlmetaproperty.h +++ b/src/declarative/qml/qmlmetaproperty.h @@ -53,6 +53,7 @@ QT_MODULE(Declarative) class QObject; class QmlAbstractBinding; +class QmlExpression; class QStringList; class QVariant; struct QMetaObject; @@ -87,6 +88,8 @@ public: QVariant read() const; void write(const QVariant &) const; + enum WriteSource { Animation, Binding, Other }; + void write(const QVariant &, WriteSource) const; bool hasChangedNotifier() const; bool needsChangedNotifier() const; @@ -125,6 +128,9 @@ public: QmlAbstractBinding *binding() const; QmlAbstractBinding *setBinding(QmlAbstractBinding *) const; + QmlExpression *signalExpression() const; + QmlExpression *setSignalExpression(QmlExpression *) const; + static QmlMetaProperty createProperty(QObject *, const QString &); int coreIndex() const; diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qmlmetaproperty_p.h index 8e8966e..f2d0039 100644 --- a/src/declarative/qml/qmlmetaproperty_p.h +++ b/src/declarative/qml/qmlmetaproperty_p.h @@ -118,7 +118,7 @@ public: QmlMetaProperty::PropertyCategory propertyCategory() const; void writeSignalProperty(const QVariant &); - void writeValueProperty(const QVariant &); + void writeValueProperty(const QVariant &, QmlMetaProperty::WriteSource); static quint32 saveValueType(int, int); static quint32 saveProperty(int); diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index e102f05..40cdd11 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -153,6 +153,7 @@ QmlParser::Object::DynamicProperty::DynamicProperty() QmlParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o) : isDefaultProperty(o.isDefaultProperty), type(o.type), + customType(o.customType), name(o.name), defaultValue(o.defaultValue), location(o.location) diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 8a92a9f..65223f4 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -172,10 +172,11 @@ namespace QmlParser DynamicProperty(); DynamicProperty(const DynamicProperty &); - enum Type { Variant, Int, Bool, Real, String, Url, Color, Date, Alias }; + enum Type { Variant, Int, Bool, Real, String, Url, Color, Date, Alias, Custom, CustomList }; bool isDefaultProperty; Type type; + QByteArray customType; QByteArray name; QmlParser::Property *defaultValue; LocationSpan location; diff --git a/src/declarative/qml/qmlpropertyvaluesource.cpp b/src/declarative/qml/qmlpropertyvaluesource.cpp index 429080b..529ce37 100644 --- a/src/declarative/qml/qmlpropertyvaluesource.cpp +++ b/src/declarative/qml/qmlpropertyvaluesource.cpp @@ -56,6 +56,10 @@ QmlPropertyValueSource::QmlPropertyValueSource() { } +QmlPropertyValueSource::~QmlPropertyValueSource() +{ +} + /*! \fn void QmlPropertyValueSource::setTarget(const QmlMetaProperty &property) Set the target \a property for the value source. This method will diff --git a/src/declarative/qml/qmlpropertyvaluesource.h b/src/declarative/qml/qmlpropertyvaluesource.h index ee4ea2c..384d2f9 100644 --- a/src/declarative/qml/qmlpropertyvaluesource.h +++ b/src/declarative/qml/qmlpropertyvaluesource.h @@ -55,6 +55,7 @@ class Q_DECLARATIVE_EXPORT QmlPropertyValueSource { public: QmlPropertyValueSource(); + virtual ~QmlPropertyValueSource(); virtual void setTarget(const QmlMetaProperty &) = 0; }; Q_DECLARE_INTERFACE(QmlPropertyValueSource, "com.trolltech.qml.QmlPropertyValueSource") diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 136b247..09efc90 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -524,6 +524,32 @@ bool ProcessAST::visit(AST::UiPublicMember *node) } } + if (!typeFound && memberType.at(0).isUpper()) { + QString typemodifier; + if(node->typeModifier) + typemodifier = node->typeModifier->asString(); + if (typemodifier == QString()) { + type = Object::DynamicProperty::Custom; + } else if(typemodifier == QLatin1String("list")) { + type = Object::DynamicProperty::CustomList; + } else { + QmlError error; + error.setDescription(QCoreApplication::translate("QmlParser","Invalid property type modifier")); + error.setLine(node->typeModifierToken.startLine); + error.setColumn(node->typeModifierToken.startColumn); + _parser->_errors << error; + return false; + } + typeFound = true; + } else if (node->typeModifier) { + QmlError error; + error.setDescription(QCoreApplication::translate("QmlParser","Unexpected property type modifier")); + error.setLine(node->typeModifierToken.startLine); + error.setColumn(node->typeModifierToken.startColumn); + _parser->_errors << error; + return false; + } + if(!typeFound) { QmlError error; error.setDescription(QCoreApplication::translate("QmlParser","Expected property type")); @@ -545,6 +571,12 @@ bool ProcessAST::visit(AST::UiPublicMember *node) Object::DynamicProperty property; property.isDefaultProperty = node->isDefaultMember; property.type = type; + if (type >= Object::DynamicProperty::Custom) { + QmlScriptParser::TypeReference *typeRef = + _parser->findOrCreateType(memberType); + typeRef->refObjects.append(_stateStack.top().object); + property.customType = memberType.toUtf8(); + } property.name = name.toUtf8(); property.location = location(node->firstSourceLocation(), node->lastSourceLocation()); diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp new file mode 100644 index 0000000..5869a56 --- /dev/null +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -0,0 +1,259 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtCore/qobject.h> +#include <QtDeclarative/qmlengine.h> +#include <private/qmlengine_p.h> +#include <QtScript/qscriptvalue.h> +#include <QtScript/qscriptvalueiterator.h> +#include <QtScript/qscriptcontext.h> +#include <QtScript/qscriptengine.h> +#include <QtSql/qsqldatabase.h> +#include <QtSql/qsqlquery.h> +#include <QtSql/qsqlerror.h> +#include <QtSql/qsqlrecord.h> +#include <private/qmlrefcount_p.h> +#include <private/qmlengine_p.h> +#include <QtCore/qstack.h> +#include <QtCore/qcryptographichash.h> +#include "qmlsqldatabase_p.h" +#include <QtCore/qsettings.h> +#include <QtCore/qdir.h> +#include <QtCore/qdebug.h> + +Q_DECLARE_METATYPE(QSqlDatabase) +Q_DECLARE_METATYPE(QSqlQuery) + +class QmlSqlQueryScriptClass: public QScriptClass { +public: + QmlSqlQueryScriptClass(QScriptEngine *engine) : QScriptClass(engine) + { + str_length = engine->toStringHandle(QLatin1String("length")); + str_forwardOnly = engine->toStringHandle(QLatin1String("forwardOnly")); // not in HTML5 (optimization) + } + + QueryFlags queryProperty(const QScriptValue &object, + const QScriptString &name, + QueryFlags flags, uint *id) + { + if (flags & HandlesReadAccess) { + if (name == str_length) { + return HandlesReadAccess; + } else if (name == str_forwardOnly) { + return flags; + } else { + bool ok; + qint32 pos = name.toString().toInt(&ok); + if (pos < 0 || !ok) + return 0; + QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data()); + *id = pos; + if (*id < (uint)query.size()) + return HandlesReadAccess; + } + } + if (flags & HandlesWriteAccess) + if (name == str_forwardOnly) + return flags; + return 0; + } + + QScriptValue property(const QScriptValue &object, + const QScriptString &name, uint id) + { + QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data()); + if (name == str_length) { + int s = query.size(); + if (s<0) { + // Inefficient. + query.last(); + return query.at()+1; + } else { + return s; + } + } else if (name == str_forwardOnly) { + return query.isForwardOnly(); + } else { + if (query.at() == id || query.seek(id)) { // Qt 4.6 doesn't optimize at()==id + QSqlRecord r = query.record(); + QScriptValue row = engine()->newArray(r.count()); + for (int j=0; j<r.count(); ++j) { + // XXX only strings + row.setProperty(j, QScriptValue(engine(),r.value(j).toString())); + } + return row; + } + } + return engine()->undefinedValue(); + } + + void setProperty(QScriptValue &object, + const QScriptString &name, uint, const QScriptValue & value) + { + if (name == str_forwardOnly) { + QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data()); + query.setForwardOnly(value.toBool()); + } + } + +private: + QScriptString str_length; + QScriptString str_forwardOnly; +}; + +static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEngine *engine) +{ + QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject()); + QString sql = context->argument(0).toString(); + QScriptValue values = context->argument(1); + QScriptValue cb = context->argument(2); + QScriptValue cberr = context->argument(3); + QSqlQuery query(db); + bool err = false; + if (query.prepare(sql)) { + if (values.isArray()) { + for (QScriptValueIterator it(values); it.hasNext();) { + it.next(); + query.addBindValue(it.value().toVariant()); + } + } else { + query.bindValue(0,values.toVariant()); + } + if (query.exec()) { + QScriptValue rs = engine->newObject(); + if (!QmlEnginePrivate::get(engine)->sqlQueryClass) + QmlEnginePrivate::get(engine)->sqlQueryClass= new QmlSqlQueryScriptClass(engine); + QScriptValue rows = engine->newObject(QmlEnginePrivate::get(engine)->sqlQueryClass); + rows.setData(engine->newVariant(qVariantFromValue(query))); + rs.setProperty(QLatin1String("rows"),rows); + rs.setProperty(QLatin1String("rowsAffected"),query.numRowsAffected()); + rs.setProperty(QLatin1String("insertId"),query.lastInsertId().toString()); // XXX only string + cb.call(QScriptValue(), QScriptValueList() << context->thisObject() << rs); + } else { + err = true; + } + } else { + err = true; + } + if (err) { + QScriptValue error = engine->newObject(); + error.setProperty(QLatin1String("message"), query.lastError().text()); + cberr.call(QScriptValue(), QScriptValueList() << context->thisObject() << error); + } + return engine->undefinedValue(); +} + +static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptEngine *engine) +{ + QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject()); + if (context->argumentCount() < 1) + return engine->undefinedValue(); + QScriptValue cb = context->argument(0); + if (!cb.isFunction()) + return engine->undefinedValue(); + + // Call synchronously... - XXX could do asynch with threads + QScriptValue instance = engine->newObject(); + instance.setProperty(QLatin1String("executeSql"), engine->newFunction(qmlsqldatabase_executeSql,4)); + QScriptValue tx = engine->newVariant(instance,qVariantFromValue(db)); + + db.transaction(); + cb.call(QScriptValue(), QScriptValueList() << tx); + if (engine->hasUncaughtException()) { + db.rollback(); + QScriptValue cb = context->argument(1); + if (cb.isFunction()) + cb.call(); + } else { + db.commit(); + QScriptValue cb = context->argument(2); + if (cb.isFunction()) + cb.call(); + } + return engine->undefinedValue(); +} + + +static QScriptValue qmlsqldatabase_open(QScriptContext *context, QScriptEngine *engine) +{ + QSqlDatabase database; + + QString dbname = context->argument(0).toString(); + QString dbversion = context->argument(1).toString(); + QString dbdescription = context->argument(2).toString(); + int dbestimatedsize = context->argument(3).toNumber(); + + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(dbname.toUtf8()); + md5.addData(dbversion.toUtf8()); + QString dbid(QLatin1String(md5.result().toHex())); + + // Uses SQLLITE (like HTML5), but any could be used. + + if (QSqlDatabase::connectionNames().contains(dbid)) { + database = QSqlDatabase::database(dbid); + } else { + database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid); + } + if (!database.isOpen()) { + QString basename = QmlEnginePrivate::get(engine)->offlineStoragePath + "/Databases/"; + QDir().mkpath(basename); + basename += dbid; + database.setDatabaseName(basename+QLatin1String(".sqllite")); + QSettings ini(basename+QLatin1String(".ini"),QSettings::IniFormat); + ini.setValue(QLatin1String("Name"), dbname); + ini.setValue(QLatin1String("Version"), dbversion); + ini.setValue(QLatin1String("Description"), dbdescription); + ini.setValue(QLatin1String("EstimatedSize"), dbestimatedsize); + database.open(); + } + + QScriptValue instance = engine->newObject(); + instance.setProperty(QLatin1String("transaction"), engine->newFunction(qmlsqldatabase_transaction,3)); + return engine->newVariant(instance,qVariantFromValue(database)); +} + +void qt_add_qmlsqldatabase(QScriptEngine *engine) +{ + QScriptValue openDatabase = engine->newFunction(qmlsqldatabase_open, 4); + engine->globalObject().setProperty(QLatin1String("openDatabase"), openDatabase); +} + diff --git a/src/declarative/qml/qmlsqldatabase_p.h b/src/declarative/qml/qmlsqldatabase_p.h new file mode 100644 index 0000000..f76a2fd --- /dev/null +++ b/src/declarative/qml/qmlsqldatabase_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSQLDATABASE_P_H +#define QMLSQLDATABASE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +class QScriptEngine; +void qt_add_qmlsqldatabase(QScriptEngine *engine); + +#endif // QMLSQLDATABASE_P_H + diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 4d133e3..606a732 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -537,11 +537,7 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData QMetaMethod signal = target->metaObject()->method(instr.storeSignal.signalIndex); - if (signal.parameterTypes().isEmpty()) { - (void *)new QmlBoundSignal(ctxt, primitives.at(instr.storeSignal.value), target, instr.storeSignal.signalIndex, target); - } else { - (void *)new QmlBoundSignalProxy(new QmlContext(ctxt, target, true), primitives.at(instr.storeSignal.value), target, instr.storeSignal.signalIndex, target); - } + (void *)new QmlBoundSignal(ctxt, primitives.at(instr.storeSignal.value), target, signal, target); } break; @@ -569,9 +565,8 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData QmlBinding *bind = new QmlBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, 0); bindValues.append(bind); bind->m_mePtr = &bindValues.values[bindValues.count - 1]; - bind->addToObject(target); - bind->setTarget(mp); + bind->addToObject(target); } break; diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp index 9ce63b1..f473743 100644 --- a/src/declarative/qml/qmlvmemetaobject.cpp +++ b/src/declarative/qml/qmlvmemetaobject.cpp @@ -74,11 +74,16 @@ QmlVMEMetaObject::QmlVMEMetaObject(QObject *obj, data = new QVariant[metaData->propertyCount]; aConnected.resize(metaData->aliasCount); + int list_type = qMetaTypeId<QmlList<QObject*>* >(); // ### Optimize for (int ii = 0; ii < metaData->propertyCount; ++ii) { int t = (metaData->propertyData() + ii)->propertyType; - if (t != -1) + if (t == list_type) { + listProperties.append(new List(this, ii)); + data[ii] = QVariant::fromValue((QmlList<QObject *>*)listProperties.last()); + } else if (t != -1) { data[ii] = QVariant((QVariant::Type)t); + } } } @@ -88,6 +93,7 @@ QmlVMEMetaObject::~QmlVMEMetaObject() ref->release(); if (parent) delete parent; + qDeleteAll(listProperties); delete [] data; } @@ -137,9 +143,15 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) case QVariant::Date: *reinterpret_cast<QDate *>(a[0]) = data[id].toDate(); break; + case QMetaType::QObjectStar: + *reinterpret_cast<QObject **>(a[0]) = data[id].value<QObject*>(); + break; default: break; } + if (t == qMetaTypeId<QmlList<QObject*>* >()) { + *reinterpret_cast<QmlList<QObject *> **>(a[0]) = data[id].value<QmlList<QObject*>*>(); + } } else if (c == QMetaObject::WriteProperty) { @@ -236,4 +248,9 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) return object->qt_metacall(c, _id, a); } +void QmlVMEMetaObject::listChanged(int id) +{ + activate(object, methodOffset + id, 0); +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlvmemetaobject_p.h b/src/declarative/qml/qmlvmemetaobject_p.h index 931d22c..1c26241 100644 --- a/src/declarative/qml/qmlvmemetaobject_p.h +++ b/src/declarative/qml/qmlvmemetaobject_p.h @@ -118,13 +118,36 @@ private: QVariant *data; QBitArray aConnected; -#if 0 - QList<QString> *slotData; - int slotDataIdx; -#endif - QAbstractDynamicMetaObject *parent; + void listChanged(int); + class List : public QmlConcreteList<QObject*> + { + public: + List(QmlVMEMetaObject *p, int propIdx) + : parent(p), parentProperty(propIdx) { } + + virtual void append(QObject *v) { + QmlConcreteList<QObject*>::append(v); + parent->listChanged(parentProperty); + } + virtual void insert(int i, QObject *v) { + QmlConcreteList<QObject*>::insert(i, v); + parent->listChanged(parentProperty); + } + virtual void clear() { + QmlConcreteList<QObject*>::clear(); + parent->listChanged(parentProperty); + } + virtual void removeAt(int i) { + QmlConcreteList<QObject*>::removeAt(i); + parent->listChanged(parentProperty); + } + private: + QmlVMEMetaObject *parent; + int parentProperty; + }; + QList<List *> listProperties; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlxmlhttprequest.cpp b/src/declarative/qml/qmlxmlhttprequest.cpp index 0cfd794..65c5b16 100644 --- a/src/declarative/qml/qmlxmlhttprequest.cpp +++ b/src/declarative/qml/qmlxmlhttprequest.cpp @@ -913,6 +913,8 @@ public: void open(const QString &, const QUrl &); void addHeader(const QString &, const QString &); + QString header(const QString &name); + QString headers(); void send(const QByteArray &); void abort(); @@ -932,6 +934,11 @@ private: QUrl m_url; QByteArray m_responseEntityBody; + typedef QPair<QByteArray, QByteArray> HeaderPair; + typedef QList<HeaderPair> HeadersList; + HeadersList m_headersList; + void fillHeadersList(); + void dispatchCallback(); QScriptValue m_callback; @@ -1012,6 +1019,42 @@ void QmlXMLHttpRequest::addHeader(const QString &name, const QString &value) } } +QString QmlXMLHttpRequest::header(const QString &name) +{ + QByteArray utfname = name.toUtf8(); + + foreach (const HeaderPair &header, m_headersList) { + if (header.first == utfname) + return QString::fromUtf8(header.second); + } + return QString(); +} + +QString QmlXMLHttpRequest::headers() +{ + QString ret; + + foreach (const HeaderPair &header, m_headersList) { + if (ret.length()) + ret.append(QString::fromUtf8("\r\n")); + ret.append(QString::fromUtf8(header.first)); + ret.append(QString::fromUtf8(": ")); + ret.append(QString::fromUtf8(header.second)); + } + return ret; +} + +void QmlXMLHttpRequest::fillHeadersList() +{ + QList<QByteArray> headerList = m_network->rawHeaderList(); + + m_headersList.clear(); + foreach (const QByteArray &header, headerList) { + HeaderPair pair (header, m_network->rawHeader(header)); + m_headersList << pair; + } +} + void QmlXMLHttpRequest::send(const QByteArray &data) { m_errorFlag = false; @@ -1067,6 +1110,7 @@ void QmlXMLHttpRequest::downloadProgress(qint64 bytes) // ### We assume if this is called the headers are now available if (m_state < HeadersReceived) { m_state = HeadersReceived; + fillHeadersList (); dispatchCallback(); } @@ -1080,6 +1124,11 @@ void QmlXMLHttpRequest::downloadProgress(qint64 bytes) void QmlXMLHttpRequest::error(QNetworkReply::NetworkError error) { + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + m_responseEntityBody = QByteArray(); m_errorFlag = true; m_request = QNetworkRequest(); @@ -1094,8 +1143,14 @@ void QmlXMLHttpRequest::finished() { // ### We need to transparently redirect as dictated by the spec + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + if (m_state < HeadersReceived) { m_state = HeadersReceived; + fillHeadersList (); dispatchCallback(); } m_responseEntityBody.append(m_network->readAll()); @@ -1260,16 +1315,36 @@ static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngi static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context, QScriptEngine *engine) { - // ### Implement + QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject()); + if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object")); - return engine->undefinedValue(); + if (context->argumentCount() != 1) + return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count")); + + if (request->readyState() != QmlXMLHttpRequest::Loading && + request->readyState() != QmlXMLHttpRequest::Done && + request->readyState() != QmlXMLHttpRequest::HeadersReceived) + return context->throwError(INVALID_STATE_ERR, "Invalid state"); + + QString headerName = context->argument(0).toString(); + + return QScriptValue(request->header(headerName)); } static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *context, QScriptEngine *engine) { - // ### Implement + QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject()); + if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object")); - return engine->undefinedValue(); + if (context->argumentCount() != 0) + return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count")); + + if (request->readyState() != QmlXMLHttpRequest::Loading && + request->readyState() != QmlXMLHttpRequest::Done && + request->readyState() != QmlXMLHttpRequest::HeadersReceived) + return context->throwError(INVALID_STATE_ERR, "Invalid state"); + + return QScriptValue(request->headers()); } // XMLHttpRequest properties diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp index ed45f16..1248a1c 100644 --- a/src/declarative/qml/rewriter/rewriter.cpp +++ b/src/declarative/qml/rewriter/rewriter.cpp @@ -42,7 +42,7 @@ #include "rewriter_p.h" #include "qmljsast_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE using namespace QmlJS; @@ -98,4 +98,4 @@ void Rewriter::move(int pos, int length, int to) textWriter.move(pos, length, to); } -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h index 44f3cce..ae59226 100644 --- a/src/declarative/qml/rewriter/rewriter_p.h +++ b/src/declarative/qml/rewriter/rewriter_p.h @@ -49,7 +49,7 @@ #include "qmljsastvisitor_p.h" QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -146,7 +146,7 @@ private: } // end of namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE QT_END_HEADER #endif // REWRITER_H diff --git a/src/declarative/qml/rewriter/textwriter.cpp b/src/declarative/qml/rewriter/textwriter.cpp index fbbdb2bbab..1ec0675 100644 --- a/src/declarative/qml/rewriter/textwriter.cpp +++ b/src/declarative/qml/rewriter/textwriter.cpp @@ -41,7 +41,7 @@ #include "textwriter_p.h" -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE using namespace QmlJS; @@ -214,4 +214,4 @@ void TextWriter::write_helper() cursor->endEditBlock(); } -QT_END_NAMESPACE +QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/declarative/qml/rewriter/textwriter_p.h index 3041e04..5894e6c 100644 --- a/src/declarative/qml/rewriter/textwriter_p.h +++ b/src/declarative/qml/rewriter/textwriter_p.h @@ -46,8 +46,10 @@ #include <QtCore/QList> #include <QtGui/QTextCursor> +#include "qmljsglobal_p.h" + QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE +QT_QML_BEGIN_NAMESPACE namespace QmlJS { @@ -93,7 +95,7 @@ public: } // end of namespace QmlJS -QT_END_NAMESPACE +QT_QML_END_NAMESPACE QT_END_HEADER #endif // TEXTWRITER_H diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp index 6dca2d1..c77d0f6 100644 --- a/src/declarative/util/qmlconnection.cpp +++ b/src/declarative/util/qmlconnection.cpp @@ -187,10 +187,7 @@ void QmlConnection::connectIfValid() return; } - if (sigparams.isEmpty()) - d->boundsignal = new QmlBoundSignal(qmlContext(this), d->script, sender, sigIdx, this); - else - d->boundsignal = new QmlBoundSignalProxy(new QmlContext(qmlContext(this),this), d->script, sender, sigIdx, this); + d->boundsignal = new QmlBoundSignal(qmlContext(this), d->script, sender, mo->method(sigIdx), this); } } @@ -238,7 +235,7 @@ void QmlConnection::setScript(const QString& script) } else { // must exist - update d->script = script; - d->boundsignal->setExpression(script); + d->boundsignal->expression()->setExpression(script); } } else { d->script = script; diff --git a/src/declarative/util/qmleasefollow.cpp b/src/declarative/util/qmleasefollow.cpp index b58ad14..860c63a 100644 --- a/src/declarative/util/qmleasefollow.cpp +++ b/src/declarative/util/qmleasefollow.cpp @@ -242,6 +242,8 @@ Rectangle { Keys.onDownPressed: Rect1.y = Rect1.y + 100 } \endcode + + \sa SpringFollow */ QmlEaseFollow::QmlEaseFollow(QObject *parent) diff --git a/src/declarative/util/qmllistaccessor.cpp b/src/declarative/util/qmllistaccessor.cpp index 0332b9e..ef21ebf 100644 --- a/src/declarative/util/qmllistaccessor.cpp +++ b/src/declarative/util/qmllistaccessor.cpp @@ -44,10 +44,13 @@ #include <qmlmetatype.h> #include <QtCore/qdebug.h> +// ### Remove me +#include <private/qmlengine_p.h> + QT_BEGIN_NAMESPACE QmlListAccessor::QmlListAccessor() -: type(Invalid) +: m_type(Invalid) { } @@ -60,36 +63,44 @@ QVariant QmlListAccessor::list() const return d; } -void QmlListAccessor::setList(const QVariant &v) +void QmlListAccessor::setList(const QVariant &v, QmlEngine *engine) { d = v; + QmlEnginePrivate *enginePrivate = engine?QmlEnginePrivate::get(engine):0; + if (!d.isValid()) { - type = Invalid; + m_type = Invalid; } else if (d.type() == QVariant::StringList) { - type = StringList; + m_type = StringList; } else if (d.type() == QMetaType::QVariantList) { - type = VariantList; + m_type = VariantList; + } else if (d.canConvert(QVariant::Int)) { + qDebug() << "integer"; + m_type = Integer; } else if (d.type() != QVariant::UserType) { - type = Instance; - } else if (QmlMetaType::isObject(d.userType())) { + m_type = Instance; + } else if ((!enginePrivate && QmlMetaType::isObject(d.userType())) || + (enginePrivate && enginePrivate->isObject(d.userType()))) { QObject *data = 0; data = *(QObject **)v.constData(); d = QVariant::fromValue(data); - type = Instance; - } else if (QmlMetaType::isQmlList(d.userType())) { - type = QmlList; + m_type = Instance; + } else if ((!enginePrivate && QmlMetaType::isQmlList(d.userType())) || + (enginePrivate && enginePrivate->isQmlList(d.userType()))) { + m_type = QmlList; } else if (QmlMetaType::isList(d.userType())) { - type = QList; + qDebug() << "list"; + m_type = QList; } else { - type = Invalid; + m_type = Invalid; d = QVariant(); } } int QmlListAccessor::count() const { - switch(type) { + switch(m_type) { case Invalid: return 0; case StringList: @@ -105,6 +116,8 @@ int QmlListAccessor::count() const return QmlMetaType::listCount(d); case Instance: return 1; + case Integer: + return d.toInt(); } return 0; @@ -113,7 +126,7 @@ int QmlListAccessor::count() const QVariant QmlListAccessor::at(int idx) const { Q_ASSERT(idx >= 0 && idx < count()); - switch(type) { + switch(m_type) { case Invalid: return QVariant(); case StringList: @@ -131,6 +144,8 @@ QVariant QmlListAccessor::at(int idx) const return QmlMetaType::listAt(d, idx); case Instance: return d; + case Integer: + return QVariant(); } return QVariant(); @@ -138,7 +153,7 @@ QVariant QmlListAccessor::at(int idx) const void QmlListAccessor::append(const QVariant &value) { - switch(type) { + switch(m_type) { case Invalid: break; case StringList: @@ -162,6 +177,7 @@ void QmlListAccessor::append(const QVariant &value) QmlMetaType::append(d, value); break; case Instance: + case Integer: //do nothing break; } @@ -169,7 +185,7 @@ void QmlListAccessor::append(const QVariant &value) void QmlListAccessor::insert(int index, const QVariant &value) { - switch(type) { + switch(m_type) { case Invalid: break; case StringList: @@ -198,12 +214,14 @@ void QmlListAccessor::insert(int index, const QVariant &value) if (index == 0) setList(value); break; + case Integer: + break; } } void QmlListAccessor::removeAt(int index) { - switch(type) { + switch(m_type) { case Invalid: break; case StringList: @@ -227,12 +245,14 @@ void QmlListAccessor::removeAt(int index) if (index == 0) setList(QVariant()); break; + case Integer: + break; } } void QmlListAccessor::clear() { - switch(type) { + switch(m_type) { case Invalid: break; case StringList: @@ -254,12 +274,14 @@ void QmlListAccessor::clear() //XXX what should we do here? setList(QVariant()); break; + case Integer: + d = 0; } } bool QmlListAccessor::isValid() const { - return type != Invalid; + return m_type != Invalid; } QT_END_NAMESPACE diff --git a/src/declarative/util/qmllistaccessor.h b/src/declarative/util/qmllistaccessor.h index c3017e1..c3ff632 100644 --- a/src/declarative/util/qmllistaccessor.h +++ b/src/declarative/util/qmllistaccessor.h @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QmlEngine; class Q_DECLARATIVE_EXPORT QmlListAccessor { public: @@ -57,7 +58,7 @@ public: virtual ~QmlListAccessor(); QVariant list() const; - void setList(const QVariant &); + void setList(const QVariant &, QmlEngine * = 0); bool isValid() const; @@ -69,9 +70,11 @@ public: virtual void removeAt(int); virtual void clear(); + enum Type { Invalid, StringList, VariantList, QmlList, QList, Instance, Integer }; + Type type() const { return m_type; } + private: - enum Type { Invalid, StringList, VariantList, QmlList, QList, Instance }; - Type type; + Type m_type; QVariant d; }; diff --git a/src/declarative/util/qmlspringfollow.cpp b/src/declarative/util/qmlspringfollow.cpp index 8c902aa..2dae448 100644 --- a/src/declarative/util/qmlspringfollow.cpp +++ b/src/declarative/util/qmlspringfollow.cpp @@ -236,6 +236,8 @@ void QmlSpringFollowPrivate::stop() y: SpringFollow { source: Rect1.y; velocity: 200 } } \endcode + + \sa EaseFollow */ QmlSpringFollow::QmlSpringFollow(QObject *parent) diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qmlview.cpp index 2a38cda..7cce2da 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qmlview.cpp @@ -56,27 +56,86 @@ #include "private/qperformancelog_p.h" #include "private/qfxperf_p.h" -#include "qfxview.h" +#include "qmlview.h" #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcontext.h> #include <QtDeclarative/qmldebug.h> +#include <QtDeclarative/qmldebugservice.h> +#include <QtCore/qabstractanimation.h> QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE) +class QmlViewDebugServer; +class FrameBreakAnimation : public QAbstractAnimation +{ +public: + FrameBreakAnimation(QmlViewDebugServer *s) + : QAbstractAnimation((QObject*)s), server(s) + { + start(); + } + + virtual int duration() const { return -1; } + virtual void updateCurrentTime(int msecs); + +private: + QmlViewDebugServer *server; +}; + +class QmlViewDebugServer : public QmlDebugService +{ +public: + QmlViewDebugServer(QObject *parent = 0) : QmlDebugService(QLatin1String("CanvasFrameRate"), parent), breaks(0) + { + timer.start(); + new FrameBreakAnimation(this); + } + + void addTiming(int pe, int tbf) + { + if (!isEnabled()) + return; + + bool isFrameBreak = breaks > 1; + breaks = 0; + int e = timer.elapsed(); + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << (int)pe << (int)tbf << (int)e + << (bool)isFrameBreak; + sendMessage(data); + } + + void frameBreak() { ++breaks; } + +private: + QTime timer; + int breaks; +}; + +Q_GLOBAL_STATIC(QmlViewDebugServer, qfxViewDebugServer); + +void FrameBreakAnimation::updateCurrentTime(int msecs) +{ + Q_UNUSED(msecs); + server->frameBreak(); +} + + static QVariant stringToKeySequence(const QString &str) { return QVariant::fromValue(QKeySequence(str)); } -class QFxViewPrivate +class QmlViewPrivate { public: - QFxViewPrivate(QFxView *w) + QmlViewPrivate(QmlView *w) : q(w), root(0), component(0), resizable(false) {} - QFxView *q; + QmlView *q; QFxItem *root; QUrl source; @@ -96,16 +155,16 @@ public: }; /*! - \class QFxView - \brief The QFxView class provides a widget for displaying a Qt Declarative user interface. + \class QmlView + \brief The QmlView class provides a widget for displaying a Qt Declarative user interface. - QFxView currently provides a minimal interface for displaying QML + QmlView currently provides a minimal interface for displaying QML files, and connecting between QML and C++ Qt objects. Typical usage: \code ... - QFxView *view = new QFxView(this); + QmlView *view = new QmlView(this); vbox->addWidget(view); QUrl url(fileName); @@ -117,18 +176,18 @@ public: */ /*! - \fn QFxView::QFxView(QWidget *parent) + \fn QmlView::QmlView(QWidget *parent) - Constructs a QFxView with the given \a parent. + Constructs a QmlView with the given \a parent. */ -QFxView::QFxView(QWidget *parent) -: QGraphicsView(parent), d(new QFxViewPrivate(this)) +QmlView::QmlView(QWidget *parent) +: QGraphicsView(parent), d(new QmlViewPrivate(this)) { setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); d->init(); } -void QFxViewPrivate::init() +void QmlViewPrivate::init() { // XXX: These need to be put in a central location for this kind of thing QmlMetaType::registerCustomStringConverter(QVariant::KeySequence, &stringToKeySequence); @@ -159,7 +218,7 @@ void QFxViewPrivate::init() \sa clearItems() */ -QFxView::~QFxView() +QmlView::~QmlView() { clearItems(); delete d; d = 0; @@ -169,7 +228,7 @@ QFxView::~QFxView() Sets the source to the \a url. The QML string is set to empty. */ -void QFxView::setUrl(const QUrl& url) +void QmlView::setUrl(const QUrl& url) { d->source = url; d->qml = QString(); @@ -179,7 +238,7 @@ void QFxView::setUrl(const QUrl& url) Sets the source to the URL from the \a filename, and sets the QML string to \a qml. */ -void QFxView::setQml(const QString &qml, const QString &filename) +void QmlView::setQml(const QString &qml, const QString &filename) { d->source = QUrl::fromLocalFile(filename); d->qml = qml; @@ -188,7 +247,7 @@ void QFxView::setQml(const QString &qml, const QString &filename) /*! Returns the QML string. */ -QString QFxView::qml() const +QString QmlView::qml() const { return d->qml; } @@ -197,7 +256,7 @@ QString QFxView::qml() const Returns a pointer to the QmlEngine used for instantiating QML Components. */ -QmlEngine* QFxView::engine() +QmlEngine* QmlView::engine() { return &d->engine; } @@ -209,7 +268,7 @@ QmlEngine* QFxView::engine() arranged hierarchically and this hierarchy is managed by the QmlEngine. */ -QmlContext* QFxView::rootContext() +QmlContext* QmlView::rootContext() { return d->engine.rootContext(); } @@ -217,7 +276,7 @@ QmlContext* QFxView::rootContext() /*! Displays the Qt Declarative user interface. */ -void QFxView::execute() +void QmlView::execute() { if (d->qml.isEmpty()) { d->component = new QmlComponent(&d->engine, d->source, this); @@ -236,7 +295,7 @@ void QFxView::execute() /*! \internal */ -void QFxView::continueExecute() +void QmlView::continueExecute() { disconnect(d->component, SIGNAL(statusChanged(QmlComponent::Status)), this, SLOT(continueExecute())); @@ -247,10 +306,10 @@ void QFxView::continueExecute() if(d->component->isError()) { QList<QmlError> errorList = d->component->errors(); - emit errors(errorList); foreach (const QmlError &error, errorList) { qWarning() << error; } + emit errors(errorList); return; } @@ -259,10 +318,10 @@ void QFxView::continueExecute() if(d->component->isError()) { QList<QmlError> errorList = d->component->errors(); - emit errors(errorList); foreach (const QmlError &error, errorList) { qWarning() << error; } + emit errors(errorList); return; } @@ -307,18 +366,18 @@ void QFxView::continueExecute() } } -/*! \fn void QFxView::sceneResized(QSize size) +/*! \fn void QmlView::sceneResized(QSize size) This signal is emitted when the view is resized to \a size. */ -/*! \fn void QFxView::errors(const QList<QmlError> &errors) +/*! \fn void QmlView::errors(const QList<QmlError> &errors) This signal is emitted when the qml loaded contains \a errors. */ /*! \internal */ -void QFxView::sizeChanged() +void QmlView::sizeChanged() { // delay, so we catch both width and height changing. d->resizetimer.start(0,this); @@ -328,7 +387,7 @@ void QFxView::sizeChanged() If the \l {QTimerEvent} {timer event} \a e is this view's resize timer, sceneResized() is emitted. */ -void QFxView::timerEvent(QTimerEvent* e) +void QmlView::timerEvent(QTimerEvent* e) { if (!e || e->timerId() == d->resizetimer.timerId()) { if (d->root) { @@ -344,7 +403,7 @@ void QFxView::timerEvent(QTimerEvent* e) // modelled on QScrollArea::widgetResizable /*! - \property QFxView::contentResizable + \property QmlView::contentResizable \brief whether the view should resize the canvas contents If this property is set to false (the default), the view @@ -357,7 +416,7 @@ void QFxView::timerEvent(QTimerEvent* e) is the initial size of the root item. */ -void QFxView::setContentResizable(bool on) +void QmlView::setContentResizable(bool on) { if (d->resizable != on) { d->resizable = on; @@ -373,7 +432,7 @@ void QFxView::setContentResizable(bool on) } } -bool QFxView::contentResizable() const +bool QmlView::contentResizable() const { return d->resizable; } @@ -382,7 +441,7 @@ bool QFxView::contentResizable() const /*! The size hint is the size of the root item. */ -QSize QFxView::sizeHint() const +QSize QmlView::sizeHint() const { if (d->root) { if (d->initialSize.width() <= 0) @@ -399,7 +458,7 @@ QSize QFxView::sizeHint() const \a parent item is provided, it becomes the new item's parent. \a parent should be in this view's item hierarchy. */ -QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent) +QFxItem* QmlView::addItem(const QString &qml, QFxItem* parent) { if (!d->root) return 0; @@ -407,10 +466,10 @@ QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent) QmlComponent component(&d->engine, qml.toUtf8(), QUrl()); if(d->component->isError()) { QList<QmlError> errorList = d->component->errors(); - emit errors(errorList); foreach (const QmlError &error, errorList) { qWarning() << error; } + emit errors(errorList); return 0; } @@ -418,10 +477,10 @@ QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent) QObject *obj = component.create(); if(d->component->isError()) { QList<QmlError> errorList = d->component->errors(); - emit errors(errorList); foreach (const QmlError &error, errorList) { qWarning() << error; } + emit errors(errorList); return 0; } @@ -441,7 +500,7 @@ QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent) Deletes the view's \l {QFxItem} {items} and the \l {QmlEngine} {QML engine's} Component cache. */ -void QFxView::reset() +void QmlView::reset() { clearItems(); d->engine.clearComponentCache(); @@ -451,7 +510,7 @@ void QFxView::reset() /*! Deletes the view's \l {QFxItem} {items}. */ -void QFxView::clearItems() +void QmlView::clearItems() { if (!d->root) return; @@ -462,7 +521,7 @@ void QFxView::clearItems() /*! Returns the view's root \l {QFxItem} {item}. */ -QFxItem *QFxView::root() const +QFxItem *QmlView::root() const { return d->root; } @@ -471,7 +530,7 @@ QFxItem *QFxView::root() const This function handles the \l {QResizeEvent} {resize event} \a e. */ -void QFxView::resizeEvent(QResizeEvent *e) +void QmlView::resizeEvent(QResizeEvent *e) { if (d->resizable && d->root) { d->root->setWidth(width()); @@ -484,33 +543,37 @@ void QFxView::resizeEvent(QResizeEvent *e) /*! \reimp */ -void QFxView::paintEvent(QPaintEvent *event) +void QmlView::paintEvent(QPaintEvent *event) { int time = 0; - if (frameRateDebug()) + if (frameRateDebug() || QmlViewDebugServer::isDebuggingEnabled()) time = d->frameTimer.restart(); QGraphicsView::paintEvent(event); + if (QmlViewDebugServer::isDebuggingEnabled()) + qfxViewDebugServer()->addTiming(d->frameTimer.elapsed(), time); if (frameRateDebug()) qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; } -/*! \fn void QFxView::focusInEvent(QFocusEvent *e) +/*! \fn void QmlView::focusInEvent(QFocusEvent *e) This virtual function does nothing with the event \a e in this class. */ -void QFxView::focusInEvent(QFocusEvent *) +void QmlView::focusInEvent(QFocusEvent *e) { // Do nothing (do not call QWidget::update()) + QGraphicsView::focusInEvent(e); } -/*! \fn void QFxView::focusOutEvent(QFocusEvent *e) +/*! \fn void QmlView::focusOutEvent(QFocusEvent *e) This virtual function does nothing with the event \a e in this class. */ -void QFxView::focusOutEvent(QFocusEvent *) +void QmlView::focusOutEvent(QFocusEvent *e) { // Do nothing (do not call QWidget::update()) + QGraphicsView::focusOutEvent(e); } QT_END_NAMESPACE diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qmlview.h index 25e2997..b54101f 100644 --- a/src/declarative/util/qfxview.h +++ b/src/declarative/util/qmlview.h @@ -59,15 +59,15 @@ class QmlEngine; class QmlContext; class QmlError; -class QFxViewPrivate; -class Q_DECLARATIVE_EXPORT QFxView : public QGraphicsView +class QmlViewPrivate; +class Q_DECLARATIVE_EXPORT QmlView : public QGraphicsView { Q_OBJECT Q_PROPERTY(bool contentResizable READ contentResizable WRITE setContentResizable) public: - explicit QFxView(QWidget *parent = 0); + explicit QmlView(QWidget *parent = 0); - virtual ~QFxView(); + virtual ~QmlView(); void setUrl(const QUrl&); void setQml(const QString &qml, const QString &filename=QString()); @@ -102,8 +102,8 @@ protected: void timerEvent(QTimerEvent*); private: - friend class QFxViewPrivate; - QFxViewPrivate *d; + friend class QmlViewPrivate; + QmlViewPrivate *d; }; QT_END_NAMESPACE diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index 442380a..41c9019 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -1,5 +1,5 @@ SOURCES += \ - util/qfxview.cpp \ + util/qmlview.cpp \ util/qfxperf.cpp \ util/qperformancelog.cpp \ util/qmlconnection.cpp \ @@ -23,7 +23,7 @@ SOURCES += \ util/qmlbind.cpp HEADERS += \ - util/qfxview.h \ + util/qmlview.h \ util/qfxperf_p.h \ util/qfxglobal.h \ util/qperformancelog_p.h \ |