diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | examples/script/qstetrix/main.cpp | 1 | ||||
-rw-r--r-- | src/script/api/qscriptvalueiterator.cpp | 12 | ||||
-rw-r--r-- | src/script/doc/snippets/code/src_script_qscriptengine.cpp | 2 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggeragent.cpp | 2 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggeragent_p_p.h | 4 | ||||
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 19 | ||||
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 2 |
8 files changed, 21 insertions, 23 deletions
diff --git a/.qmake.conf b/.qmake.conf index 1efc04d..a555316 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -3,4 +3,4 @@ android|boot2qt: CONFIG -= headersclean DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.13.0 +MODULE_VERSION = 5.14.0 diff --git a/examples/script/qstetrix/main.cpp b/examples/script/qstetrix/main.cpp index 2d71048..43f32b4 100644 --- a/examples/script/qstetrix/main.cpp +++ b/examples/script/qstetrix/main.cpp @@ -148,7 +148,6 @@ int main(int argc, char *argv[]) ui->resize(550, 370); ui->show(); - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); return app.exec(); //! [4] } diff --git a/src/script/api/qscriptvalueiterator.cpp b/src/script/api/qscriptvalueiterator.cpp index c470664..a1e3b21 100644 --- a/src/script/api/qscriptvalueiterator.cpp +++ b/src/script/api/qscriptvalueiterator.cpp @@ -28,14 +28,14 @@ #include "qscriptengine.h" #include "qscriptengine_p.h" #include "qscriptvalue_p.h" -#include "qlinkedlist.h" - #include "JSObject.h" #include "PropertyNameArray.h" #include "JSArray.h" #include "JSFunction.h" +#include <list> + QT_BEGIN_NAMESPACE /*! @@ -118,16 +118,16 @@ public: JSC::PropertyNameArray::const_iterator propertyNamesIt = propertyNamesArray.begin(); for(; propertyNamesIt != propertyNamesArray.end(); ++propertyNamesIt) { - propertyNames.append(*propertyNamesIt); + propertyNames.push_back(*propertyNamesIt); } it = propertyNames.begin(); initialized = true; } QScriptValue objectValue; - QLinkedList<JSC::Identifier> propertyNames; - QLinkedList<JSC::Identifier>::iterator it; - QLinkedList<JSC::Identifier>::iterator current; + std::list<JSC::Identifier> propertyNames; + std::list<JSC::Identifier>::iterator it; + std::list<JSC::Identifier>::iterator current; bool initialized; }; diff --git a/src/script/doc/snippets/code/src_script_qscriptengine.cpp b/src/script/doc/snippets/code/src_script_qscriptengine.cpp index 8ccd9a0..ae9e35f 100644 --- a/src/script/doc/snippets/code/src_script_qscriptengine.cpp +++ b/src/script/doc/snippets/code/src_script_qscriptengine.cpp @@ -318,7 +318,7 @@ Q_DECLARE_METATYPE(QVector<int>) qScriptRegisterSequenceMetaType<QVector<int> >(engine); ... QVector<int> v = qscriptvalue_cast<QVector<int> >(engine->evaluate("[5, 1, 3, 2]")); -qSort(v.begin(), v.end()); +std::sort(v.begin(), v.end()); QScriptValue a = engine->toScriptValue(v); qDebug() << a.toString(); // outputs "[1, 2, 3, 5]" //! [26] diff --git a/src/scripttools/debugging/qscriptdebuggeragent.cpp b/src/scripttools/debugging/qscriptdebuggeragent.cpp index 5642dfe..7e25304 100644 --- a/src/scripttools/debugging/qscriptdebuggeragent.cpp +++ b/src/scripttools/debugging/qscriptdebuggeragent.cpp @@ -559,7 +559,7 @@ void QScriptDebuggerAgent::positionChange(qint64 scriptId, if (engine()->processEventsInterval() == -1) { // see if it's time to call processEvents() if ((++d->statementCounter % 25000) == 0) { - if (!d->processEventsTimer.isNull()) { + if (d->processEventsTimer.isValid()) { if (d->processEventsTimer.elapsed() > 30) { QCoreApplication::processEvents(); d->processEventsTimer.restart(); diff --git a/src/scripttools/debugging/qscriptdebuggeragent_p_p.h b/src/scripttools/debugging/qscriptdebuggeragent_p_p.h index 2e8be3a..1474032 100644 --- a/src/scripttools/debugging/qscriptdebuggeragent_p_p.h +++ b/src/scripttools/debugging/qscriptdebuggeragent_p_p.h @@ -52,7 +52,7 @@ // #include <QtScript/qscriptvalue.h> -#include <QtCore/qdatetime.h> +#include <QtCore/qelapsedtimer.h> #include <QtCore/qhash.h> #include <QtCore/qmap.h> #include <QtCore/qlist.h> @@ -113,7 +113,7 @@ public: QList<qint64> checkpointContextIdStack; qint64 nextContextId; - QTime processEventsTimer; + QElapsedTimer processEventsTimer; int statementCounter; QScriptDebuggerBackendPrivate *backend; diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 4d59e0d..c4f81d4 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -2091,12 +2091,12 @@ static void fooFromScriptValueV2(const QScriptValue &value, Foo &foo) foo.x = value.toInt32(); } -Q_DECLARE_METATYPE(QLinkedList<QString>) +Q_DECLARE_METATYPE(std::list<QString>) Q_DECLARE_METATYPE(QList<Foo>) Q_DECLARE_METATYPE(QVector<QChar>) Q_DECLARE_METATYPE(QStack<int>) Q_DECLARE_METATYPE(QQueue<char>) -Q_DECLARE_METATYPE(QLinkedList<QStack<int> >) +Q_DECLARE_METATYPE(std::list<QStack<int> >) void tst_QScriptEngine::valueConversion_basic() { @@ -2215,11 +2215,10 @@ void tst_QScriptEngine::valueConversion_customType() void tst_QScriptEngine::valueConversion_sequence() { QScriptEngine eng; - qScriptRegisterSequenceMetaType<QLinkedList<QString> >(&eng); + qScriptRegisterSequenceMetaType<std::list<QString> >(&eng); { - QLinkedList<QString> lst; - lst << QLatin1String("foo") << QLatin1String("bar"); + std::list<QString> lst = {QLatin1String("foo"), QLatin1String("bar")}; QScriptValue lstVal = qScriptValueFromValue(&eng, lst); QCOMPARE(lstVal.isArray(), true); QCOMPARE(lstVal.property("length").toInt32(), 2); @@ -2233,12 +2232,12 @@ void tst_QScriptEngine::valueConversion_sequence() qScriptRegisterSequenceMetaType<QStack<int> >(&eng); qScriptRegisterSequenceMetaType<QVector<QChar> >(&eng); qScriptRegisterSequenceMetaType<QQueue<char> >(&eng); - qScriptRegisterSequenceMetaType<QLinkedList<QStack<int> > >(&eng); + qScriptRegisterSequenceMetaType<std::list<QStack<int> > >(&eng); { - QLinkedList<QStack<int> > lst; - QStack<int> first; first << 13 << 49; lst << first; - QStack<int> second; second << 99999;lst << second; + QStack<int> first; first << 13 << 49; + QStack<int> second; second << 99999; + std::list<QStack<int> > lst = {first, second}; QScriptValue lstVal = qScriptValueFromValue(&eng, lst); QCOMPARE(lstVal.isArray(), true); QCOMPARE(lstVal.property("length").toInt32(), 2); @@ -2251,7 +2250,7 @@ void tst_QScriptEngine::valueConversion_sequence() QCOMPARE(lstVal.property("1").property("0").toInt32(), second.at(0)); QCOMPARE(qscriptvalue_cast<QStack<int> >(lstVal.property("0")), first); QCOMPARE(qscriptvalue_cast<QStack<int> >(lstVal.property("1")), second); - QCOMPARE(qscriptvalue_cast<QLinkedList<QStack<int> > >(lstVal), lst); + QCOMPARE(qscriptvalue_cast<std::list<QStack<int> > >(lstVal), lst); } // pointers diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 195fe0c..35f0555 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -1524,7 +1524,7 @@ void tst_QScriptValue::toDateTime() QDateTime dt = eng.evaluate("new Date(0)").toDateTime(); QVERIFY(dt.isValid()); QCOMPARE(dt.timeSpec(), Qt::LocalTime); - QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0), Qt::UTC)); + QCOMPARE(dt.toUTC(), QDateTime::fromMSecsSinceEpoch(0, Qt::UTC)); QVERIFY(!eng.evaluate("[]").toDateTime().isValid()); QVERIFY(!eng.evaluate("{}").toDateTime().isValid()); |