summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/QmlChanges.txt3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp61
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h7
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h3
-rw-r--r--src/declarative/qml/qdeclarativeinfo.h2
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp5
-rw-r--r--src/declarative/qml/qdeclarativestringconverters.cpp4
-rw-r--r--src/declarative/qml/qdeclarativestringconverters_p.h2
-rw-r--r--src/declarative/util/qdeclarativestate.cpp2
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager.cpp2
23 files changed, 134 insertions, 46 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 3eed8d6..142920c 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,6 +1,9 @@
=============================================================================
The changes below are pre Qt 4.7.0 RC
+TextInput and TextEdit:
+ - showInputPanelOnFocus property added
+ - openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
Flickable:
- overShoot is replaced by boundsBehavior enumeration
- flickingHorizontally and flickingVertically properties added
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index 32a6321..a05e426 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -263,7 +263,9 @@ void QDeclarativeAnimatedImage::movieRequestFinished()
d->_movie = new QMovie(d->reply);
if (!d->_movie->isValid()){
+#ifndef QT_NO_DEBUG_STREAM
qmlInfo(this) << "Error Reading Animated Image File " << d->url;
+#endif
delete d->_movie;
d->_movie = 0;
return;
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 1dde510..10dc0f8 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -160,6 +160,7 @@ void QDeclarativeFlickablePrivate::init()
q->setFiltersChildEvents(true);
QDeclarativeItemPrivate *viewportPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(viewport));
viewportPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ lastPosTime.invalidate();
}
/*
@@ -656,7 +657,7 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_Q(QDeclarativeFlickable);
- if (!interactive || lastPosTime.isNull())
+ if (!interactive || !lastPosTime.isValid())
return;
bool rejectY = false;
bool rejectX = false;
@@ -752,7 +753,7 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
stealMouse = false;
q->setKeepMouseGrab(false);
pressed = false;
- if (lastPosTime.isNull())
+ if (!lastPosTime.isValid())
return;
if (QDeclarativeItemPrivate::elapsed(lastPosTime) > 100) {
@@ -780,7 +781,7 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
fixupX();
}
- lastPosTime = QTime();
+ lastPosTime.invalidate();
if (!timeline.isActive())
q->movementEnding();
@@ -1218,8 +1219,8 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
}
return stealThisEvent || d->delayedPressEvent;
- } else if (!d->lastPosTime.isNull()) {
- d->lastPosTime = QTime();
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
}
if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
d->clearDelayedPress();
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index b467ed2..66d2678 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -140,13 +140,13 @@ public:
bool stealMouse : 1;
bool pressed : 1;
bool interactive : 1;
- QTime lastPosTime;
+ QElapsedTimer lastPosTime;
QPointF lastPos;
QPointF pressPos;
- QTime pressTime;
+ QElapsedTimer pressTime;
qreal deceleration;
qreal maxVelocity;
- QTime velocityTime;
+ QElapsedTimer velocityTime;
QPointF lastFlickablePosition;
qreal reportedVelocitySmoothing;
QGraphicsSceneMouseEvent *delayedPressEvent;
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 2841ac3..134bd6d 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -3131,6 +3131,7 @@ bool QDeclarativeItem::event(QEvent *ev)
return QGraphicsObject::event(ev);
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, QDeclarativeItem *item)
{
if (!item) {
@@ -3144,42 +3145,58 @@ QDebug operator<<(QDebug debug, QDeclarativeItem *item)
<< ", z =" << item->zValue() << ')';
return debug;
}
+#endif
-int QDeclarativeItemPrivate::consistentTime = -1;
-void QDeclarativeItemPrivate::setConsistentTime(int t)
+qint64 QDeclarativeItemPrivate::consistentTime = -1;
+void QDeclarativeItemPrivate::setConsistentTime(qint64 t)
{
consistentTime = t;
}
-QTime QDeclarativeItemPrivate::currentTime()
+class QElapsedTimerConsistentTimeHack
{
- if (consistentTime == -1)
- return QTime::currentTime();
- else
- return QTime(0, 0).addMSecs(consistentTime);
-}
+public:
+ void start() {
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ }
+ qint64 elapsed() {
+ return QDeclarativeItemPrivate::consistentTime - t1;
+ }
+ qint64 restart() {
+ qint64 val = QDeclarativeItemPrivate::consistentTime - t1;
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ return val;
+ }
+
+private:
+ qint64 t1;
+ qint64 t2;
+};
-void QDeclarativeItemPrivate::start(QTime &t)
+void QDeclarativeItemPrivate::start(QElapsedTimer &t)
{
- t = currentTime();
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ t.start();
+ else
+ ((QElapsedTimerConsistentTimeHack*)&t)->start();
}
-int QDeclarativeItemPrivate::elapsed(QTime &t)
+qint64 QDeclarativeItemPrivate::elapsed(QElapsedTimer &t)
{
- int n = t.msecsTo(currentTime());
- if (n < 0) // passed midnight
- n += 86400 * 1000;
- return n;
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.elapsed();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->elapsed();
}
-int QDeclarativeItemPrivate::restart(QTime &t)
+qint64 QDeclarativeItemPrivate::restart(QElapsedTimer &t)
{
- QTime time = currentTime();
- int n = t.msecsTo(time);
- if (n < 0) // passed midnight
- n += 86400*1000;
- t = time;
- return n;
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.restart();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->restart();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index 29fd241..77e316b 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -209,7 +209,9 @@ T qobject_cast(QGraphicsItem *item)
return qobject_cast<T>(o);
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, QDeclarativeItem *item);
+#endif
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 15b34f0..184d6f1 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -305,12 +305,11 @@ public:
virtual void focusChanged(bool);
- static int consistentTime;
- static QTime currentTime();
- static void setConsistentTime(int t);
- static void start(QTime &);
- static int elapsed(QTime &);
- static int restart(QTime &);
+ static qint64 consistentTime;
+ static void setConsistentTime(qint64 t);
+ static void start(QElapsedTimer &);
+ static qint64 elapsed(QElapsedTimer &);
+ static qint64 restart(QElapsedTimer &);
};
/*
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 151a9e9..0be8dac 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -112,9 +112,11 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativePathPercent>("Qt",4,7,"PathPercent");
qmlRegisterType<QDeclarativePathQuad>("Qt",4,7,"PathQuad");
qmlRegisterType<QDeclarativePathView>("Qt",4,7,"PathView");
+#ifndef QT_NO_VALIDATOR
qmlRegisterType<QIntValidator>("Qt",4,7,"IntValidator");
qmlRegisterType<QDoubleValidator>("Qt",4,7,"DoubleValidator");
qmlRegisterType<QRegExpValidator>("Qt",4,7,"RegExpValidator");
+#endif
qmlRegisterType<QDeclarativeRectangle>("Qt",4,7,"Rectangle");
qmlRegisterType<QDeclarativeRepeater>("Qt",4,7,"Repeater");
qmlRegisterType<QGraphicsRotation>("Qt",4,7,"Rotation");
@@ -138,7 +140,9 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativePathElement>();
qmlRegisterType<QDeclarativeCurve>();
qmlRegisterType<QDeclarativeScaleGrid>();
+#ifndef QT_NO_VALIDATOR
qmlRegisterType<QValidator>();
+#endif
qmlRegisterType<QDeclarativeVisualModel>();
#ifndef QT_NO_ACTION
qmlRegisterType<QAction>();
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 3a69f44..448ec06 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -948,7 +948,7 @@ void QDeclarativePathView::mousePressEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativePathView);
- if (!d->interactive || d->lastPosTime.isNull())
+ if (!d->interactive || !d->lastPosTime.isValid())
return;
if (!d->stealMouse) {
@@ -982,7 +982,7 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Q_D(QDeclarativePathView);
d->stealMouse = false;
setKeepMouseGrab(false);
- if (!d->interactive || d->lastPosTime.isNull())
+ if (!d->interactive || !d->lastPosTime.isValid())
return;
qreal elapsed = qreal(d->lastElapsed + QDeclarativeItemPrivate::elapsed(d->lastPosTime)) / 1000.;
@@ -1017,7 +1017,7 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
d->fixOffset();
}
- d->lastPosTime = QTime();
+ d->lastPosTime.invalidate();
ungrabMouse();
}
@@ -1059,8 +1059,8 @@ bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
grabMouse();
return d->stealMouse;
- } else if (!d->lastPosTime.isNull()) {
- d->lastPosTime = QTime();
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
}
return false;
}
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
index 3abb2f4..a0d2610 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -97,6 +97,7 @@ public:
q->setFlag(QGraphicsItem::ItemIsFocusScope);
q->setFiltersChildEvents(true);
q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked()));
+ lastPosTime.invalidate();
}
void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
@@ -154,7 +155,7 @@ public:
bool autoHighlight : 1;
bool highlightUp : 1;
bool layoutScheduled : 1;
- QTime lastPosTime;
+ QElapsedTimer lastPosTime;
QPointF lastPos;
qreal dragMargin;
qreal deceleration;
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 2c1eb67..55cef8b 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -318,7 +318,11 @@ void QDeclarativeText::setText(const QString &n)
if (d->richText) {
if (isComponentComplete()) {
d->ensureDoc();
+#ifndef QT_NO_TEXTHTMLPARSER
d->doc->setHtml(n);
+#else
+ d->doc->setPlainText(n);
+#endif
}
}
@@ -605,7 +609,11 @@ void QDeclarativeText::setTextFormat(TextFormat format)
} else if (!wasRich && d->richText) {
if (isComponentComplete()) {
d->ensureDoc();
+#ifndef QT_NO_TEXTHTMLPARSER
d->doc->setHtml(d->text);
+#else
+ d->doc->setPlainText(d->text);
+#endif
}
d->updateLayout();
d->markImgDirty();
@@ -991,7 +999,11 @@ void QDeclarativeText::reloadWithResources()
Q_D(QDeclarativeText);
if (!d->richText)
return;
+#ifndef QT_NO_TEXTHTMLPARSER
d->doc->setHtml(d->text);
+#else
+ d->doc->setPlainText(d->text);
+#endif
d->updateLayout();
d->markImgDirty();
}
@@ -1121,7 +1133,11 @@ void QDeclarativeText::componentComplete()
if (d->dirty) {
if (d->richText) {
d->ensureDoc();
+#ifndef QT_NO_TEXTHTMLPARSER
d->doc->setHtml(d->text);
+#else
+ d->doc->setPlainText(d->text);
+#endif
}
d->updateLayout();
d->dirty = false;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 167db77..997c666 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -120,9 +120,11 @@ QString QDeclarativeTextEdit::text() const
{
Q_D(const QDeclarativeTextEdit);
+#ifndef QT_NO_TEXTHTMLPARSER
if (d->richText)
return d->document->toHtml();
else
+#endif
return d->document->toPlainText();
}
@@ -253,7 +255,11 @@ void QDeclarativeTextEdit::setText(const QString &text)
d->text = text;
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
+#ifndef QT_NO_TEXTHTMLPARSER
d->control->setHtml(text);
+#else
+ d->control->setPlainText(text);
+#endif
} else {
d->control->setPlainText(text);
}
@@ -318,7 +324,11 @@ void QDeclarativeTextEdit::setTextFormat(TextFormat format)
d->control->setPlainText(d->text);
updateSize();
} else if (!wasRich && d->richText) {
+#ifndef QT_NO_TEXTHTMLPARSER
d->control->setHtml(d->text);
+#else
+ d->control->setPlainText(d->text);
+#endif
updateSize();
}
d->format = format;
@@ -1335,7 +1345,7 @@ void QDeclarativeTextEdit::setShowInputPanelOnFocus(bool showOnFocus)
void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
openSoftwareInputPanel();
}
QDeclarativePaintedItem::focusInEvent(event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 18e3595..305540f 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -648,6 +648,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
\sa acceptableInput, inputMask
*/
+#ifndef QT_NO_VALIDATOR
QValidator* QDeclarativeTextInput::validator() const
{
Q_D(const QDeclarativeTextInput);
@@ -669,6 +670,7 @@ void QDeclarativeTextInput::setValidator(QValidator* v)
emit validatorChanged();
}
+#endif // QT_NO_VALIDATOR
/*!
\qmlproperty string TextInput::inputMask
@@ -1282,7 +1284,7 @@ void QDeclarativeTextInput::setShowInputPanelOnFocus(bool showOnFocus)
void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
openSoftwareInputPanel();
}
QDeclarativePaintedItem::focusInEvent(event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 438293a..3dba844 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -79,7 +79,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength NOTIFY maximumLengthChanged)
+#ifndef QT_NO_VALIDATOR
Q_PROPERTY(QValidator* validator READ validator WRITE setValidator NOTIFY validatorChanged)
+#endif
Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask NOTIFY inputMaskChanged)
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
@@ -156,9 +158,10 @@ public:
int maxLength() const;
void setMaxLength(int ml);
+#ifndef QT_NO_VALIDATOR
QValidator * validator() const;
void setValidator(QValidator* v);
-
+#endif
QString inputMask() const;
void setInputMask(const QString &im);
@@ -248,10 +251,12 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QDeclarativeTextInput)
+#ifndef QT_NO_VALIDATOR
QML_DECLARE_TYPE(QValidator)
QML_DECLARE_TYPE(QIntValidator)
QML_DECLARE_TYPE(QDoubleValidator)
QML_DECLARE_TYPE(QRegExpValidator)
+#endif
QT_END_HEADER
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index d27aced..80a1093 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -240,6 +240,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: color expected"));
}
break;
+#ifndef QT_NO_TEXTDATE
case QVariant::Date:
{
bool ok;
@@ -261,6 +262,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: datetime expected"));
}
break;
+#endif // QT_NO_TEXTDATE
case QVariant::Point:
case QVariant::PointF:
{
@@ -414,6 +416,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
instr.storeColor.value = c.rgba();
}
break;
+#ifndef QT_NO_TEXTDATE
case QVariant::Date:
{
QDate d = QDeclarativeStringConverters::dateFromString(string);
@@ -447,6 +450,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
instr.storeDateTime.valueIndex = index;
}
break;
+#endif // QT_NO_TEXTDATE
case QVariant::Point:
case QVariant::PointF:
{
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 8679e76..2f2ee08 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -284,10 +284,12 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr
qtObject.setProperty(QLatin1String("tint"), newFunction(QDeclarativeEnginePrivate::tint, 2));
}
+#ifndef QT_NO_TEXTDATE
//date/time formatting
qtObject.setProperty(QLatin1String("formatDate"),newFunction(QDeclarativeEnginePrivate::formatDate, 2));
qtObject.setProperty(QLatin1String("formatTime"),newFunction(QDeclarativeEnginePrivate::formatTime, 2));
qtObject.setProperty(QLatin1String("formatDateTime"),newFunction(QDeclarativeEnginePrivate::formatDateTime, 2));
+#endif
//misc methods
qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1));
@@ -1219,6 +1221,7 @@ QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEn
\qmlmethod string Qt::formatDate(datetime date, variant format)
Returns the string representation of \c date, formatted according to \c format.
*/
+#ifndef QT_NO_TEXTDATE
QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine)
{
int argCount = ctxt->argumentCount();
@@ -1356,6 +1359,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
}
return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
}
+#endif // QT_NO_TEXTDATE
/*!
\qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 804476c..3269e98 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -302,10 +302,11 @@ public:
static QScriptValue consoleLog(QScriptContext*, QScriptEngine*);
static QScriptValue quit(QScriptContext*, QScriptEngine*);
+#ifndef QT_NO_TEXTDATE
static QScriptValue formatDate(QScriptContext*, QScriptEngine*);
static QScriptValue formatTime(QScriptContext*, QScriptEngine*);
static QScriptValue formatDateTime(QScriptContext*, QScriptEngine*);
-
+#endif
static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { return &e->d_func()->scriptEngine; }
static QDeclarativeEngine *getEngine(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p->q_func(); }
static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); }
diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h
index 2ac28f4..b41abd8 100644
--- a/src/declarative/qml/qdeclarativeinfo.h
+++ b/src/declarative/qml/qdeclarativeinfo.h
@@ -81,7 +81,9 @@ public:
inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; }
inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; }
inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; }
+#ifndef QT_NO_DEBUG_STREAM
inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; }
+#endif
private:
friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me);
diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp
index b86d082..0f7b09d 100644
--- a/src/declarative/qml/qdeclarativeinstruction.cpp
+++ b/src/declarative/qml/qdeclarativeinstruction.cpp
@@ -49,6 +49,10 @@ QT_BEGIN_NAMESPACE
void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
{
+#ifdef QT_NO_DEBUG_STREAM
+ Q_UNUSED(instr)
+ Q_UNUSED(idx)
+#else
QByteArray lineNumber = QByteArray::number(instr->line);
if (instr->line == (unsigned short)-1)
lineNumber = "NA";
@@ -217,6 +221,7 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKOWN INSTRUCTION" << "\t" << instr->type;
break;
}
+#endif // QT_NO_DEBUG_STREAM
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp
index bbcc00b..8bd2cf1 100644
--- a/src/declarative/qml/qdeclarativestringconverters.cpp
+++ b/src/declarative/qml/qdeclarativestringconverters.cpp
@@ -106,12 +106,14 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int p
return QVariant(uint(qRound(s.toDouble(ok))));
case QMetaType::QColor:
return QVariant::fromValue(colorFromString(s, ok));
+#ifndef QT_NO_TEXTDATE
case QMetaType::QDate:
return QVariant::fromValue(dateFromString(s, ok));
case QMetaType::QTime:
return QVariant::fromValue(timeFromString(s, ok));
case QMetaType::QDateTime:
return QVariant::fromValue(dateTimeFromString(s, ok));
+#endif // QT_NO_TEXTDATE
case QMetaType::QPointF:
return QVariant::fromValue(pointFFromString(s, ok));
case QMetaType::QPoint:
@@ -150,6 +152,7 @@ QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok)
}
}
+#ifndef QT_NO_TEXTDATE
QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok)
{
QDate d = QDate::fromString(s, Qt::ISODate);
@@ -170,6 +173,7 @@ QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, boo
if (ok) *ok = d.isValid();
return d;
}
+#endif // QT_NO_TEXTDATE
//expects input of "x,y"
QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok)
diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h
index 97f72fc..842d1b3 100644
--- a/src/declarative/qml/qdeclarativestringconverters_p.h
+++ b/src/declarative/qml/qdeclarativestringconverters_p.h
@@ -73,9 +73,11 @@ namespace QDeclarativeStringConverters
QVariant Q_DECLARATIVE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0);
QColor Q_DECLARATIVE_EXPORT colorFromString(const QString &, bool *ok = 0);
+#ifndef QT_NO_TEXTDATE
QDate Q_DECLARATIVE_EXPORT dateFromString(const QString &, bool *ok = 0);
QTime Q_DECLARATIVE_EXPORT timeFromString(const QString &, bool *ok = 0);
QDateTime Q_DECLARATIVE_EXPORT dateTimeFromString(const QString &, bool *ok = 0);
+#endif
QPointF Q_DECLARATIVE_EXPORT pointFFromString(const QString &, bool *ok = 0);
QSizeF Q_DECLARATIVE_EXPORT sizeFFromString(const QString &, bool *ok = 0);
QRectF Q_DECLARATIVE_EXPORT rectFFromString(const QString &, bool *ok = 0);
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index b5f7900..dc2b2cc 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -486,6 +486,7 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
// All the local reverts now become part of the ongoing revertList
d->revertList << additionalReverts;
+#ifndef QT_NO_DEBUG_STREAM
// Output for debugging
if (stateChangeDebug()) {
foreach(const QDeclarativeAction &action, applyList) {
@@ -497,6 +498,7 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
<< "To:" << action.toValue;
}
}
+#endif
d->transitionManager.transition(applyList, trans);
}
diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp
index 368d484..9f198e4 100644
--- a/src/declarative/util/qdeclarativetransitionmanager.cpp
+++ b/src/declarative/util/qdeclarativetransitionmanager.cpp
@@ -233,6 +233,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
action.property.write(action.toValue);
}
}
+#ifndef QT_NO_DEBUG_STREAM
if (stateChangeDebug()) {
foreach(const QDeclarativeAction &action, applyList) {
if (action.event)
@@ -243,6 +244,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
<< "To:" << action.toValue;
}
}
+#endif
if (!transition)
d->applyBindings();
}