From 90046a56e8dbf1ee3931ce0caeb606a6f7d2dc45 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 14 Jan 2011 14:14:33 +0100 Subject: Fix out of bounds handling in Mac shaper After ensure space, local QGlyphLayout variable should be updated to the moved address. stringToCMap returns true for success, so stringToCMapFailed should be the reverse of the return value. Out of bounds happened quite often in all situations using the QStackedTextEngine, because the memory allocated at the first time is usually not much, making it easier to trigger out of bounds in shaping. But it can also happen when using normal QTextLayout. Test it by comparing the width returned by normal QTextLayout and the width returned by QTextLayout created from QStackedTextEngine via QFontMetricsF. Task-number: QTBUG-16648 Reviewed-by: Eskil --- src/gui/text/qtextengine_mac.cpp | 5 +++-- tests/auto/qtextlayout/tst_qtextlayout.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp index ce42241..c34bdb3 100644 --- a/src/gui/text/qtextengine_mac.cpp +++ b/src/gui/text/qtextengine_mac.cpp @@ -604,8 +604,9 @@ void QTextEngine::shapeTextMac(int item) const bool stringToCMapFailed = false; if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) { ensureSpace(num_glyphs); - stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, - attributes()); + g = availableGlyphs(&si); + stringToCMapFailed = !fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, + attributes()); } if (!stringToCMapFailed) { diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index d6cf54c..0f1ff66 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -123,7 +123,7 @@ private slots: void testLineBreakingAllSpaces(); void lineWidthFromBOM(); void textWidthVsWIdth(); - + void textWidthWithStackedTextEngine(); private: QFont testFont; @@ -1388,6 +1388,16 @@ void tst_QTextLayout::textWidthVsWIdth() } } +void tst_QTextLayout::textWidthWithStackedTextEngine() +{ + QString text = QString::fromUtf8("คลิก ถัดไป เพื่อดำเนินการต่อ"); + QTextLayout layout(text); + layout.beginLayout(); + QTextLine line = layout.createLine(); + layout.endLayout(); + QFontMetricsF fm(layout.font()); + QCOMPARE(line.naturalTextWidth(), fm.width(text)); +} QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" -- cgit v0.12 From 388c57c0a1f53cd4a98aa12841eac603332dfe54 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 24 Jan 2011 19:09:38 +0100 Subject: Fix cursor position adjustment when removing strings Commit 0ba1b4d0 introduced a regression to QTextDocument: it postponed cursor position adjustment until the move operation is done, but contentsChanged will be triggered by finishEdit() in this move operation, thus cursor positions in this signal handler will be in inconsistent states (normally we should first update cursor position then trigger contentsChanged). In this case we should also postpone finishEdit() handling after cursor positions have been adjusted, then the states expose to applications will be consistent. Task-number: QTBUG-15857 Reviewed-by: Eskil --- src/gui/text/qtextdocument_p.cpp | 4 +++- tests/auto/qtextcursor/tst_qtextcursor.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 498a432..2172f74 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -663,7 +663,8 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O Q_ASSERT(blocks.length() == fragments.length()); - finishEdit(); + if (!blockCursorAdjustment) + finishEdit(); } void QTextDocumentPrivate::remove(int pos, int length, QTextUndoCommand::Operation op) @@ -678,6 +679,7 @@ void QTextDocumentPrivate::remove(int pos, int length, QTextUndoCommand::Operati curs->changed = true; } } + finishEdit(); } void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode) diff --git a/tests/auto/qtextcursor/tst_qtextcursor.cpp b/tests/auto/qtextcursor/tst_qtextcursor.cpp index ee2baef..4d52dd7 100644 --- a/tests/auto/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/qtextcursor/tst_qtextcursor.cpp @@ -134,6 +134,7 @@ private slots: void endOfLine(); void editBlocksDuringRemove(); + void selectAllDuringRemove(); void update_data(); void update(); @@ -1388,6 +1389,17 @@ public slots: ++recordingCount; } + void selectAllContents() + { + // Only test the first time + if (!recordingCount) { + recordingCount++; + cursor->select(QTextCursor::Document); + lastRecordedPosition = cursor->position(); + lastRecordedAnchor = cursor->anchor(); + } + } + private: QTextCursor *cursor; }; @@ -1411,6 +1423,22 @@ void tst_QTextCursor::editBlocksDuringRemove() QVERIFY(doc->toPlainText().isEmpty()); } +void tst_QTextCursor::selectAllDuringRemove() +{ + CursorListener listener(&cursor); + + cursor.insertText("Hello World"); + cursor.movePosition(QTextCursor::End); + + connect(doc, SIGNAL(contentsChanged()), &listener, SLOT(selectAllContents())); + listener.recordingCount = 0; + QTextCursor localCursor = cursor; + localCursor.deletePreviousChar(); + + QCOMPARE(listener.lastRecordedPosition, 10); + QCOMPARE(listener.lastRecordedAnchor, 0); +} + void tst_QTextCursor::update_data() { QTest::addColumn("text"); -- cgit v0.12 From a8a02cf8099f1269bc23495b60841031fbd36b0a Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 24 Feb 2011 10:07:00 +1000 Subject: Fix qmlviewer compilation on old Symbian platforms Task-number: QTBUG-17472 Reviewed-by: Martin Jones --- tools/qml/qml.pri | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri index 2010cc1..cfc74af 100644 --- a/tools/qml/qml.pri +++ b/tools/qml/qml.pri @@ -26,6 +26,8 @@ symbian { !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) { LIBS += -lsensrvclient -lsensrvutil SOURCES += $$PWD/deviceorientation_symbian.cpp + } else { + SOURCES += $$PWD/deviceorientation.cpp } FORMS = $$PWD/recopts.ui \ $$PWD/proxysettings.ui -- cgit v0.12 From 60f84b596476f88a39d0eb2c56dc9468805442aa Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 24 Feb 2011 13:17:13 +1000 Subject: Add a 'CursorPosition' parameter to TextInput.positionAt(). Specifies whether positionAt should resolve to the nearest position between characters or the position of the nearest character. Change-Id: I9eb2db2f8dd2accb2d9844ff204fba0337e71876 Task-number: QTBUG-16070 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativetextinput.cpp | 20 +++++++++++++++++--- .../graphicsitems/qdeclarativetextinput_p.h | 6 ++++++ .../tst_qdeclarativetextinput.cpp | 8 ++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 78f34db..f3c6b93 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -927,8 +927,15 @@ QRectF QDeclarativeTextInput::positionToRectangle(int pos) const cursorRectangle().height()); } +int QDeclarativeTextInput::positionAt(int x) const +{ + Q_D(const QDeclarativeTextInput); + return d->control->xToPos(x + d->hscroll); +} + /*! - \qmlmethod int TextInput::positionAt(int x) + \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters) + \since Quick 1.1 This function returns the character position at x pixels from the left of the textInput. Position 0 is before the @@ -937,11 +944,18 @@ QRectF QDeclarativeTextInput::positionToRectangle(int pos) const This means that for all x values before the first character this function returns 0, and for all x values after the last character this function returns text.length. + + The cursor position type specifies how the cursor position should be resolved. + + \list + \o TextInput.CursorBetweenCharacters - Returns the position between characters that is nearest x. + \o TextInput.CursorOnCharacter - Returns the position before the character that is nearest x. + \endlist */ -int QDeclarativeTextInput::positionAt(int x) const +int QDeclarativeTextInput::positionAt(int x, CursorPosition position) { Q_D(const QDeclarativeTextInput); - return d->control->xToPos(x + d->hscroll); + return d->control->xToPos(x + d->hscroll, QTextLine::CursorPosition(position)); } void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index e1e66a9..c29be26 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -120,8 +120,14 @@ public: SelectWords }; + enum CursorPosition { + CursorBetweenCharacters, + CursorOnCharacter + }; + //Auxilliary functions needed to control the TextInput from QML Q_INVOKABLE int positionAt(int x) const; + Q_INVOKABLE Q_REVISION(1) int positionAt(int x, CursorPosition position); Q_INVOKABLE QRectF positionToRectangle(int pos) const; Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 49a05a3..6cb57a2 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -955,6 +955,10 @@ void tst_qdeclarativetextinput::positionAt() QVERIFY(diff < 5); #endif + int x = textinputObject->positionToRectangle(pos + 1).x() - 1; + QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1); + QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos); + // Check without autoscroll... textinputObject->setAutoScroll(false); pos = textinputObject->positionAt(textinputObject->width()/2); @@ -967,6 +971,10 @@ void tst_qdeclarativetextinput::positionAt() QVERIFY(diff < 5); #endif + x = textinputObject->positionToRectangle(pos + 1).x() - 1; + QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1); + QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos); + delete canvas; } -- cgit v0.12 From fbf73dec65df9c27a3a09ca9b436f5f8cb9f1b0e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 24 Feb 2011 08:56:04 +0100 Subject: QDeclarativeDebug: Export needed symbols on Symbian Allow applications to link against the QDeclarativeDebugService API. This is needed for on-device debugging of QML. (The removal of the symbols was a regression in 4.7.2). Task-number: QTBUG-17503 Reviewed-by: Tom Sutcliffe --- .../debugger/qdeclarativedebugservice_p.h | 2 +- src/s60installs/bwins/QtDeclarativeu.def | 48 +++++++++++----------- src/s60installs/eabi/QtDeclarativeu.def | 44 ++++++++++---------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/declarative/debugger/qdeclarativedebugservice_p.h index 1730d11..5e30350 100644 --- a/src/declarative/debugger/qdeclarativedebugservice_p.h +++ b/src/declarative/debugger/qdeclarativedebugservice_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QDeclarativeDebugServicePrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugService : public QObject +class Q_DECLARATIVE_EXPORT QDeclarativeDebugService : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QDeclarativeDebugService) diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def index 7d0a83e..8b23b63 100644 --- a/src/s60installs/bwins/QtDeclarativeu.def +++ b/src/s60installs/bwins/QtDeclarativeu.def @@ -3,7 +3,7 @@ EXPORTS ?setStored@QMetaPropertyBuilder@@QAEX_N@Z @ 2 NONAME ABSENT ; void QMetaPropertyBuilder::setStored(bool) ?trUtf8@QDeclarativeExpression@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString QDeclarativeExpression::trUtf8(char const *, char const *, int) ?qt_metacast@QDeclarativeComponent@@UAEPAXPBD@Z @ 4 NONAME ; void * QDeclarativeComponent::qt_metacast(char const *) - ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ABSENT ; class QString QDeclarativeDebugService::name(void) const + ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ; class QString QDeclarativeDebugService::name(void) const ?debugId@QDeclarativeDebugObjectReference@@QBEHXZ @ 6 NONAME ABSENT ; int QDeclarativeDebugObjectReference::debugId(void) const ?addPluginPath@QDeclarativeEngine@@QAEXABVQString@@@Z @ 7 NONAME ; void QDeclarativeEngine::addPluginPath(class QString const &) ?name@QMetaPropertyBuilder@@QBE?AVQByteArray@@XZ @ 8 NONAME ABSENT ; class QByteArray QMetaPropertyBuilder::name(void) const @@ -11,7 +11,7 @@ EXPORTS ?propertyOffset@QDeclarativeOpenMetaObjectType@@QBEHXZ @ 10 NONAME ABSENT ; int QDeclarativeOpenMetaObjectType::propertyOffset(void) const ??0QDeclarativeText@@QAE@PAVQDeclarativeItem@@@Z @ 11 NONAME ABSENT ; QDeclarativeText::QDeclarativeText(class QDeclarativeItem *) ?propertyTypeName@QDeclarativeProperty@@QBEPBDXZ @ 12 NONAME ; char const * QDeclarativeProperty::propertyTypeName(void) const - ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void) + ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void) ?setLeft@QDeclarativeAnchors@@QAEXABVQDeclarativeAnchorLine@@@Z @ 14 NONAME ABSENT ; void QDeclarativeAnchors::setLeft(class QDeclarativeAnchorLine const &) ?qt_metacall@QDeclarativeExpression@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 15 NONAME ; int QDeclarativeExpression::qt_metacall(enum QMetaObject::Call, int, void * *) ?staticMetaObject@QDeclarativePen@@2UQMetaObject@@B @ 16 NONAME ABSENT ; struct QMetaObject const QDeclarativePen::staticMetaObject @@ -145,7 +145,7 @@ EXPORTS ?isConnected@QDeclarativeDebugClient@@QBE_NXZ @ 144 NONAME ABSENT ; bool QDeclarativeDebugClient::isConnected(void) const ?enabled@QDeclarativeBinding@@QBE_NXZ @ 145 NONAME ABSENT ; bool QDeclarativeBinding::enabled(void) const ?setSource@QDeclarativeView@@QAEXABVQUrl@@@Z @ 146 NONAME ; void QDeclarativeView::setSource(class QUrl const &) - ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int) + ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int) ??0QDeclarativeDomDynamicProperty@@QAE@ABV0@@Z @ 148 NONAME ABSENT ; QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty(class QDeclarativeDomDynamicProperty const &) ?className@QDeclarativeDebugObjectReference@@QBE?AVQString@@XZ @ 149 NONAME ABSENT ; class QString QDeclarativeDebugObjectReference::className(void) const ?indexOfSlot@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 150 NONAME ABSENT ; int QMetaObjectBuilder::indexOfSlot(class QByteArray const &) @@ -294,7 +294,7 @@ EXPORTS ?attachedPropertiesType@QDeclarativeType@@QBEPBUQMetaObject@@XZ @ 293 NONAME ABSENT ; struct QMetaObject const * QDeclarativeType::attachedPropertiesType(void) const ?setName@QDeclarativeState@@QAEXABVQString@@@Z @ 294 NONAME ; void QDeclarativeState::setName(class QString const &) ?setReversed@QDeclarativeTransition@@QAEX_N@Z @ 295 NONAME ; void QDeclarativeTransition::setReversed(bool) - ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ABSENT ; int QDeclarativeDebugService::idForObject(class QObject *) + ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ; int QDeclarativeDebugService::idForObject(class QObject *) ?qt_metacall@QDeclarativeDebugWatch@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 297 NONAME ABSENT ; int QDeclarativeDebugWatch::qt_metacall(enum QMetaObject::Call, int, void * *) ?fromState@QDeclarativeTransition@@QBE?AVQString@@XZ @ 298 NONAME ; class QString QDeclarativeTransition::fromState(void) const ??1QDeclarativeExpression@@UAE@XZ @ 299 NONAME ; QDeclarativeExpression::~QDeclarativeExpression(void) @@ -332,7 +332,7 @@ EXPORTS ??0QDeclarativeCustomParserNode@@QAE@ABV0@@Z @ 331 NONAME ; QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(class QDeclarativeCustomParserNode const &) ??1QDeclarativeImageProvider@@UAE@XZ @ 332 NONAME ; QDeclarativeImageProvider::~QDeclarativeImageProvider(void) ?sync@QDeclarativeListModel@@QAEXXZ @ 333 NONAME ABSENT ; void QDeclarativeListModel::sync(void) - ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ABSENT ; class QObject * QDeclarativeDebugService::objectForId(int) + ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ; class QObject * QDeclarativeDebugService::objectForId(int) ?hasFocus@QDeclarativeItem@@QBE_NXZ @ 335 NONAME ; bool QDeclarativeItem::hasFocus(void) const ??1QDeclarativeExtensionPlugin@@UAE@XZ @ 336 NONAME ; QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin(void) ?qt_metacall@QDeclarativeBehavior@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 337 NONAME ABSENT ; int QDeclarativeBehavior::qt_metacall(enum QMetaObject::Call, int, void * *) @@ -482,7 +482,7 @@ EXPORTS ?pluginPathList@QDeclarativeEngine@@QBE?AVQStringList@@XZ @ 481 NONAME ; class QStringList QDeclarativeEngine::pluginPathList(void) const ?parentContext@QDeclarativeContext@@QBEPAV1@XZ @ 482 NONAME ; class QDeclarativeContext * QDeclarativeContext::parentContext(void) const ?leftMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 483 NONAME ABSENT ; void QDeclarativeAnchors::leftMarginChanged(void) - ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ABSENT ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject + ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject ?topMargin@QDeclarativeAnchors@@QBEMXZ @ 485 NONAME ABSENT ; float QDeclarativeAnchors::topMargin(void) const ??0QDeclarativeDebugExpressionQuery@@AAE@PAVQObject@@@Z @ 486 NONAME ABSENT ; QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(class QObject *) ??0QPacket@@IAE@ABVQByteArray@@@Z @ 487 NONAME ; QPacket::QPacket(class QByteArray const &) @@ -559,7 +559,7 @@ EXPORTS ?metaObject@QDeclarativeEngine@@UBEPBUQMetaObject@@XZ @ 558 NONAME ; struct QMetaObject const * QDeclarativeEngine::metaObject(void) const ??_EQDeclarativeDebugContextReference@@QAE@I@Z @ 559 NONAME ABSENT ; QDeclarativeDebugContextReference::~QDeclarativeDebugContextReference(unsigned int) ?propertyWrite@QDeclarativeOpenMetaObject@@MAEXH@Z @ 560 NONAME ABSENT ; void QDeclarativeOpenMetaObject::propertyWrite(int) - ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ABSENT ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *) ?setVerticalCenterOffset@QDeclarativeAnchors@@QAEXM@Z @ 562 NONAME ABSENT ; void QDeclarativeAnchors::setVerticalCenterOffset(float) ??1QDeclarativeDebugWatch@@UAE@XZ @ 563 NONAME ABSENT ; QDeclarativeDebugWatch::~QDeclarativeDebugWatch(void) ??1QPacketAutoSend@@UAE@XZ @ 564 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(void) @@ -641,7 +641,7 @@ EXPORTS ?d_func@QDeclarativeItem@@AAEPAVQDeclarativeItemPrivate@@XZ @ 640 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItem::d_func(void) ?binding@QDeclarativeDomValueBinding@@QBE?AVQString@@XZ @ 641 NONAME ABSENT ; class QString QDeclarativeDomValueBinding::binding(void) const ?updateAutoState@QDeclarativeStateGroup@@AAE_NXZ @ 642 NONAME ; bool QDeclarativeStateGroup::updateAutoState(void) - ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *) + ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *) ?tr@QDeclarativeComponent@@SA?AVQString@@PBD0H@Z @ 644 NONAME ; class QString QDeclarativeComponent::tr(char const *, char const *, int) ??1QDeclarativeProperty@@QAE@XZ @ 645 NONAME ; QDeclarativeProperty::~QDeclarativeProperty(void) ?fontChanged@QDeclarativeText@@IAEXABVQFont@@@Z @ 646 NONAME ABSENT ; void QDeclarativeText::fontChanged(class QFont const &) @@ -667,14 +667,14 @@ EXPORTS ?getStaticMetaObject@QDeclarativeListModel@@SAABUQMetaObject@@XZ @ 666 NONAME ABSENT ; struct QMetaObject const & QDeclarativeListModel::getStaticMetaObject(void) ?setStdCppSet@QMetaPropertyBuilder@@QAEX_N@Z @ 667 NONAME ABSENT ; void QMetaPropertyBuilder::setStdCppSet(bool) ??0QDeclarativeItemPrivate@@QAE@XZ @ 668 NONAME ; QDeclarativeItemPrivate::QDeclarativeItemPrivate(void) - ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ABSENT ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *) + ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *) ?load@QDeclarativePixmap@@QAEXPAVQDeclarativeEngine@@ABVQUrl@@_N@Z @ 670 NONAME ABSENT ; void QDeclarativePixmap::load(class QDeclarativeEngine *, class QUrl const &, bool) ??_EQPacketAutoSend@@UAE@I@Z @ 671 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(unsigned int) ?saveValueType@QDeclarativePropertyPrivate@@SA?AVQByteArray@@PBUQMetaObject@@H0H@Z @ 672 NONAME ABSENT ; class QByteArray QDeclarativePropertyPrivate::saveValueType(struct QMetaObject const *, int, struct QMetaObject const *, int) ?resetHeight@QDeclarativeItem@@QAEXXZ @ 673 NONAME ; void QDeclarativeItem::resetHeight(void) ?setVAlign@QDeclarativeText@@QAEXW4VAlignment@1@@Z @ 674 NONAME ABSENT ; void QDeclarativeText::setVAlign(enum QDeclarativeText::VAlignment) - ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(void) - ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int) + ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(void) + ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int) ?elideMode@QDeclarativeText@@QBE?AW4TextElideMode@1@XZ @ 677 NONAME ABSENT ; enum QDeclarativeText::TextElideMode QDeclarativeText::elideMode(void) const ?baseUrl@QDeclarativeContext@@QBE?AVQUrl@@XZ @ 678 NONAME ; class QUrl QDeclarativeContext::baseUrl(void) const ?qt_metacall@QDeclarativeDebugRootContextQuery@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 679 NONAME ABSENT ; int QDeclarativeDebugRootContextQuery::qt_metacall(enum QMetaObject::Call, int, void * *) @@ -849,7 +849,7 @@ EXPORTS ??1QDeclarativeBehavior@@UAE@XZ @ 848 NONAME ABSENT ; QDeclarativeBehavior::~QDeclarativeBehavior(void) ?qmlInfo@@YA?AVQDeclarativeInfo@@PBVQObject@@@Z @ 849 NONAME ; class QDeclarativeInfo qmlInfo(class QObject const *) ?qt_metacall@QDeclarativeDebugClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 850 NONAME ABSENT ; int QDeclarativeDebugClient::qt_metacall(enum QMetaObject::Call, int, void * *) - ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ABSENT ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const + ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const ??1QDeclarativeDebugQuery@@UAE@XZ @ 852 NONAME ABSENT ; QDeclarativeDebugQuery::~QDeclarativeDebugQuery(void) ?data_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 853 NONAME ; void QDeclarativeItemPrivate::data_append(class QDeclarativeListProperty *, class QObject *) ?tr@QDeclarativeState@@SA?AVQString@@PBD0@Z @ 854 NONAME ; class QString QDeclarativeState::tr(char const *, char const *) @@ -1120,7 +1120,7 @@ EXPORTS ?expression@QDeclarativeDebugExpressionQuery@@QBE?AVQVariant@@XZ @ 1119 NONAME ABSENT ; class QVariant QDeclarativeDebugExpressionQuery::expression(void) const ??4QDeclarativeDomList@@QAEAAV0@ABV0@@Z @ 1120 NONAME ABSENT ; class QDeclarativeDomList & QDeclarativeDomList::operator=(class QDeclarativeDomList const &) ?qt_metacall@QDeclarativeComponent@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1121 NONAME ; int QDeclarativeComponent::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *, int) + ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *, int) ?staticMetaObject@QDeclarativeEngine@@2UQMetaObject@@B @ 1123 NONAME ; struct QMetaObject const QDeclarativeEngine::staticMetaObject ?staticMetaObject@QDeclarativeStateOperation@@2UQMetaObject@@B @ 1124 NONAME ; struct QMetaObject const QDeclarativeStateOperation::staticMetaObject ?actions@QDeclarativeStateOperation@@UAE?AV?$QList@VQDeclarativeAction@@@@XZ @ 1125 NONAME ; class QList QDeclarativeStateOperation::actions(void) @@ -1145,7 +1145,7 @@ EXPORTS ?sourceFile@QDeclarativeExpression@@QBE?AVQString@@XZ @ 1144 NONAME ; class QString QDeclarativeExpression::sourceFile(void) const ??_EQDeclarativeAnchors@@UAE@I@Z @ 1145 NONAME ABSENT ; QDeclarativeAnchors::~QDeclarativeAnchors(unsigned int) ?removeNotifySignal@QMetaPropertyBuilder@@QAEXXZ @ 1146 NONAME ABSENT ; void QMetaPropertyBuilder::removeNotifySignal(void) - ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *) + ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *) ?setImportPathList@QDeclarativeEngine@@QAEXABVQStringList@@@Z @ 1148 NONAME ; void QDeclarativeEngine::setImportPathList(class QStringList const &) ?enabledChanged@QDeclarativeDebugService@@MAEX_N@Z @ 1149 NONAME ABSENT ; void QDeclarativeDebugService::enabledChanged(bool) ?addWatch@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugWatch@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1150 NONAME ABSENT ; class QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch(class QDeclarativeDebugObjectReference const &, class QObject *) @@ -1176,7 +1176,7 @@ EXPORTS ?paint@QDeclarativeRectangle@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 1175 NONAME ABSENT ; void QDeclarativeRectangle::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) ??6QDeclarativeState@@QAEAAV0@PAVQDeclarativeStateOperation@@@Z @ 1176 NONAME ; class QDeclarativeState & QDeclarativeState::operator<<(class QDeclarativeStateOperation *) ?destroy@QDeclarativeAbstractBinding@@UAEXXZ @ 1177 NONAME ABSENT ; void QDeclarativeAbstractBinding::destroy(void) - ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ABSENT ; void * QDeclarativeDebugService::qt_metacast(char const *) + ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ; void * QDeclarativeDebugService::qt_metacast(char const *) ?qt_metacast@QDeclarativeValueType@@UAEPAXPBD@Z @ 1179 NONAME ABSENT ; void * QDeclarativeValueType::qt_metacast(char const *) ?childAt@QDeclarativeItem@@QBEPAV1@MM@Z @ 1180 NONAME ; class QDeclarativeItem * QDeclarativeItem::childAt(float, float) const ?paintedWidth@QDeclarativeText@@QBEMXZ @ 1181 NONAME ABSENT ; float QDeclarativeText::paintedWidth(void) const @@ -1297,7 +1297,7 @@ EXPORTS ?value@QDeclarativeOpenMetaObject@@QBE?AVQVariant@@H@Z @ 1296 NONAME ABSENT ; class QVariant QDeclarativeOpenMetaObject::value(int) const ?tr@QDeclarativeDebugRootContextQuery@@SA?AVQString@@PBD0H@Z @ 1297 NONAME ABSENT ; class QString QDeclarativeDebugRootContextQuery::tr(char const *, char const *, int) ?setFromState@QDeclarativeTransition@@QAEXABVQString@@@Z @ 1298 NONAME ; void QDeclarativeTransition::setFromState(class QString const &) - ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ABSENT ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const + ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const ?state@QDeclarativeDebugQuery@@QBE?AW4State@1@XZ @ 1300 NONAME ABSENT ; enum QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state(void) const ?setBottom@QDeclarativeScaleGrid@@QAEXH@Z @ 1301 NONAME ABSENT ; void QDeclarativeScaleGrid::setBottom(int) ?topMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 1302 NONAME ABSENT ; void QDeclarativeAnchors::topMarginChanged(void) @@ -1305,7 +1305,7 @@ EXPORTS ?position@QDeclarativeDomObject@@QBEHXZ @ 1304 NONAME ABSENT ; int QDeclarativeDomObject::position(void) const ?update@QDeclarativeBinding@@UAEXV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 1305 NONAME ABSENT ; void QDeclarativeBinding::update(class QFlags) ?tr@QDeclarativeBehavior@@SA?AVQString@@PBD0@Z @ 1306 NONAME ABSENT ; class QString QDeclarativeBehavior::tr(char const *, char const *) - ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ABSENT ; bool QDeclarativeDebugService::isDebuggingEnabled(void) + ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ; bool QDeclarativeDebugService::isDebuggingEnabled(void) ?tr@QDeclarativeText@@SA?AVQString@@PBD0H@Z @ 1308 NONAME ABSENT ; class QString QDeclarativeText::tr(char const *, char const *, int) ?reset@QDeclarativeProperty@@QBE_NXZ @ 1309 NONAME ; bool QDeclarativeProperty::reset(void) const ?objectDebugId@QDeclarativeDebugWatch@@QBEHXZ @ 1310 NONAME ABSENT ; int QDeclarativeDebugWatch::objectDebugId(void) const @@ -1344,7 +1344,7 @@ EXPORTS ?maximumPacketSize@QPacketProtocol@@QBEHXZ @ 1343 NONAME ; int QPacketProtocol::maximumPacketSize(void) const ??_EQDeclarativeDebuggerStatus@@UAE@I@Z @ 1344 NONAME ABSENT ; QDeclarativeDebuggerStatus::~QDeclarativeDebuggerStatus(unsigned int) ?error@QDeclarativeCustomParser@@IAEXABVQString@@@Z @ 1345 NONAME ; void QDeclarativeCustomParser::error(class QString const &) - ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ABSENT ; void QDeclarativeDebugService::messageReceived(class QByteArray const &) + ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ; void QDeclarativeDebugService::messageReceived(class QByteArray const &) ??0QDeclarativeParserStatus@@QAE@XZ @ 1347 NONAME ; QDeclarativeParserStatus::QDeclarativeParserStatus(void) ?isNumber@Variant@QDeclarativeParser@@QBE_NXZ @ 1348 NONAME ; bool QDeclarativeParser::Variant::isNumber(void) const ?getStaticMetaObject@QDeclarativeEngineDebug@@SAABUQMetaObject@@XZ @ 1349 NONAME ABSENT ; struct QMetaObject const & QDeclarativeEngineDebug::getStaticMetaObject(void) @@ -1475,7 +1475,7 @@ EXPORTS ?packetWritten@QPacketProtocol@@IAEXXZ @ 1474 NONAME ; void QPacketProtocol::packetWritten(void) ?getStaticMetaObject@QDeclarativeDebugObjectQuery@@SAABUQMetaObject@@XZ @ 1475 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugObjectQuery::getStaticMetaObject(void) ?isSignalProperty@QDeclarativeProperty@@QBE_NXZ @ 1476 NONAME ; bool QDeclarativeProperty::isSignalProperty(void) const - ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ABSENT ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void) + ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void) ?qmlTypeNames@QDeclarativeMetaType@@SA?AV?$QList@VQByteArray@@@@XZ @ 1478 NONAME ABSENT ; class QList QDeclarativeMetaType::qmlTypeNames(void) ?componentComplete@QDeclarativeItem@@MAEXXZ @ 1479 NONAME ; void QDeclarativeItem::componentComplete(void) ?creationContext@QDeclarativeComponent@@QBEPAVQDeclarativeContext@@XZ @ 1480 NONAME ; class QDeclarativeContext * QDeclarativeComponent::creationContext(void) const @@ -1575,7 +1575,7 @@ EXPORTS ?keyCount@QMetaEnumBuilder@@QBEHXZ @ 1574 NONAME ABSENT ; int QMetaEnumBuilder::keyCount(void) const ??1QDeclarativeDomProperty@@QAE@XZ @ 1575 NONAME ABSENT ; QDeclarativeDomProperty::~QDeclarativeDomProperty(void) ?url@QDeclarativePixmap@@QBEABVQUrl@@XZ @ 1576 NONAME ; class QUrl const & QDeclarativePixmap::url(void) const - ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ABSENT ; void QDeclarativeDebugService::sendMessage(class QByteArray const &) + ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ; void QDeclarativeDebugService::sendMessage(class QByteArray const &) ?context@QDeclarativeScriptString@@QBEPAVQDeclarativeContext@@XZ @ 1578 NONAME ; class QDeclarativeContext * QDeclarativeScriptString::context(void) const ?queryObject@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugObjectQuery@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1579 NONAME ABSENT ; class QDeclarativeDebugObjectQuery * QDeclarativeEngineDebug::queryObject(class QDeclarativeDebugObjectReference const &, class QObject *) ?tr@QDeclarativePropertyMap@@SA?AVQString@@PBD0H@Z @ 1580 NONAME ; class QString QDeclarativePropertyMap::tr(char const *, char const *, int) @@ -1608,7 +1608,7 @@ EXPORTS ??_EQDeclarativeComponent@@UAE@I@Z @ 1607 NONAME ; QDeclarativeComponent::~QDeclarativeComponent(unsigned int) ?get@QDeclarativeItemPrivate@@SAPAV1@PAVQDeclarativeItem@@@Z @ 1608 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItemPrivate::get(class QDeclarativeItem *) ?staticMetaObject@QDeclarativeView@@2UQMetaObject@@B @ 1609 NONAME ; struct QMetaObject const QDeclarativeView::staticMetaObject - ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ABSENT ; class QString QDeclarativeDebugService::objectToString(class QObject *) + ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ; class QString QDeclarativeDebugService::objectToString(class QObject *) ?defaultValue@QDeclarativeDomDynamicProperty@@QBE?AVQDeclarativeDomProperty@@XZ @ 1611 NONAME ABSENT ; class QDeclarativeDomProperty QDeclarativeDomDynamicProperty::defaultValue(void) const ?relatedMetaObject@QMetaObjectBuilder@@QBEPBUQMetaObject@@H@Z @ 1612 NONAME ABSENT ; struct QMetaObject const * QMetaObjectBuilder::relatedMetaObject(int) const ?addKey@QMetaEnumBuilder@@QAEHABVQByteArray@@H@Z @ 1613 NONAME ABSENT ; int QMetaEnumBuilder::addKey(class QByteArray const &, int) @@ -1633,7 +1633,7 @@ EXPORTS ?tr@QDeclarativeView@@SA?AVQString@@PBD0@Z @ 1632 NONAME ; class QString QDeclarativeView::tr(char const *, char const *) ?qt_metacall@QPacketProtocol@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1633 NONAME ; int QPacketProtocol::qt_metacall(enum QMetaObject::Call, int, void * *) ??0QDeclarativeItem@@QAE@PAV0@@Z @ 1634 NONAME ; QDeclarativeItem::QDeclarativeItem(class QDeclarativeItem *) - ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ABSENT ; bool QDeclarativeDebugService::hasDebuggingClient(void) + ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ; bool QDeclarativeDebugService::hasDebuggingClient(void) ?staticMetaObject@QDeclarativeContext@@2UQMetaObject@@B @ 1636 NONAME ; struct QMetaObject const QDeclarativeContext::staticMetaObject ?setContextForObject@QDeclarativeEngine@@SAXPAVQObject@@PAVQDeclarativeContext@@@Z @ 1637 NONAME ; void QDeclarativeEngine::setContextForObject(class QObject *, class QDeclarativeContext *) ?baselineOffsetChanged@QDeclarativeItem@@IAEXM@Z @ 1638 NONAME ; void QDeclarativeItem::baselineOffsetChanged(float) @@ -1733,7 +1733,7 @@ EXPORTS ?start@QDeclarativeTimer@@QAEXXZ @ 1732 NONAME ABSENT ; void QDeclarativeTimer::start(void) ?transition@QDeclarativeAbstractAnimation@@UAEXAAV?$QList@VQDeclarativeAction@@@@AAV?$QList@VQDeclarativeProperty@@@@W4TransitionDirection@1@@Z @ 1733 NONAME ABSENT ; void QDeclarativeAbstractAnimation::transition(class QList &, class QList &, enum QDeclarativeAbstractAnimation::TransitionDirection) ?componentComplete@QDeclarativeAbstractAnimation@@UAEXXZ @ 1734 NONAME ABSENT ; void QDeclarativeAbstractAnimation::componentComplete(void) - ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ABSENT ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status) + ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status) ?runningChanged@QDeclarativeAbstractAnimation@@IAEX_N@Z @ 1736 NONAME ABSENT ; void QDeclarativeAbstractAnimation::runningChanged(bool) ?trUtf8@QDeclarativeAbstractAnimation@@SA?AVQString@@PBD0H@Z @ 1737 NONAME ABSENT ; class QString QDeclarativeAbstractAnimation::trUtf8(char const *, char const *, int) ??_EQDeclarativeBasePositioner@@UAE@I@Z @ 1738 NONAME ABSENT ; QDeclarativeBasePositioner::~QDeclarativeBasePositioner(unsigned int) @@ -1813,7 +1813,7 @@ EXPORTS ?setTarget@QDeclarativeAbstractAnimation@@EAEXABVQDeclarativeProperty@@@Z @ 1812 NONAME ABSENT ; void QDeclarativeAbstractAnimation::setTarget(class QDeclarativeProperty const &) ?alwaysRunToEnd@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1813 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::alwaysRunToEnd(void) const ?tr@QDeclarativeTimer@@SA?AVQString@@PBD0H@Z @ 1814 NONAME ABSENT ; class QString QDeclarativeTimer::tr(char const *, char const *, int) - ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ABSENT ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const + ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const ?intervalChanged@QDeclarativeTimer@@IAEXXZ @ 1816 NONAME ABSENT ; void QDeclarativeTimer::intervalChanged(void) ?isPaused@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1817 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::isPaused(void) const ?getStaticMetaObject@QDeclarativeAbstractAnimation@@SAABUQMetaObject@@XZ @ 1818 NONAME ABSENT ; struct QMetaObject const & QDeclarativeAbstractAnimation::getStaticMetaObject(void) diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def index 95180d4..130e2d5 100644 --- a/src/s60installs/eabi/QtDeclarativeu.def +++ b/src/s60installs/eabi/QtDeclarativeu.def @@ -761,20 +761,20 @@ EXPORTS _ZN24QDeclarativeCustomParser5errorERK28QDeclarativeCustomParserNodeRK7QString @ 760 NONAME _ZN24QDeclarativeCustomParser5errorERK32QDeclarativeCustomParserPropertyRK7QString @ 761 NONAME _ZN24QDeclarativeCustomParser5errorERK7QString @ 762 NONAME - _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME ABSENT - _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME ABSENT - _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME ABSENT - _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME ABSENT - _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME ABSENT + _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME + _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME + _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME + _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME + _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME _ZN24QDeclarativeDebugService14enabledChangedEb @ 768 NONAME ABSENT - _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME ABSENT - _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME ABSENT - _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16 ABSENT - _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME ABSENT - _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME ABSENT - _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME ABSENT - _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME ABSENT - _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME ABSENT + _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME + _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME + _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16 + _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME + _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME + _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME + _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME + _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME _ZN24QDeclarativeDomComponentC1ERKS_ @ 777 NONAME ABSENT _ZN24QDeclarativeDomComponentC1Ev @ 778 NONAME ABSENT _ZN24QDeclarativeDomComponentC2ERKS_ @ 779 NONAME ABSENT @@ -1425,8 +1425,8 @@ EXPORTS _ZNK23QDeclarativePropertyMapixERK7QString @ 1424 NONAME _ZNK24QDeclarativeCustomParser11resolveTypeERK10QByteArray @ 1425 NONAME _ZNK24QDeclarativeCustomParser12evaluateEnumERK10QByteArray @ 1426 NONAME - _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME ABSENT - _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME ABSENT + _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME + _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME _ZNK24QDeclarativeDebugService9isEnabledEv @ 1429 NONAME ABSENT _ZNK24QDeclarativeDomComponent13componentRootEv @ 1430 NONAME ABSENT _ZNK24QDeclarativeScriptString11scopeObjectEv @ 1431 NONAME @@ -1554,7 +1554,7 @@ EXPORTS _ZTI23QDeclarativeItemPrivate @ 1553 NONAME _ZTI23QDeclarativePropertyMap @ 1554 NONAME _ZTI24QDeclarativeCustomParser @ 1555 NONAME - _ZTI24QDeclarativeDebugService @ 1556 NONAME ABSENT + _ZTI24QDeclarativeDebugService @ 1556 NONAME _ZTI24QDeclarativeParserStatus @ 1557 NONAME _ZTI25QDeclarativeImageProvider @ 1558 NONAME _ZTI26QDeclarativeDebuggerStatus @ 1559 NONAME ABSENT @@ -1604,7 +1604,7 @@ EXPORTS _ZTV23QDeclarativeItemPrivate @ 1603 NONAME _ZTV23QDeclarativePropertyMap @ 1604 NONAME _ZTV24QDeclarativeCustomParser @ 1605 NONAME - _ZTV24QDeclarativeDebugService @ 1606 NONAME ABSENT + _ZTV24QDeclarativeDebugService @ 1606 NONAME _ZTV24QDeclarativeParserStatus @ 1607 NONAME _ZTV25QDeclarativeImageProvider @ 1608 NONAME _ZTV26QDeclarativeDebuggerStatus @ 1609 NONAME ABSENT @@ -1777,10 +1777,10 @@ EXPORTS _ZN23QDeclarativeDebugClientD1Ev @ 1776 NONAME ABSENT _ZN23QDeclarativeDebugClientD2Ev @ 1777 NONAME ABSENT _ZN23QDeclarativeEngineDebug13statusChangedENS_6StatusE @ 1778 NONAME ABSENT - _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME ABSENT - _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME ABSENT - _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME ABSENT - _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME ABSENT + _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME + _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME + _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME + _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME _ZN26QDeclarativeBasePositioner10addChangedEv @ 1783 NONAME ABSENT _ZN26QDeclarativeBasePositioner10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 1784 NONAME ABSENT _ZN26QDeclarativeBasePositioner10setSpacingEi @ 1785 NONAME ABSENT @@ -1851,7 +1851,7 @@ EXPORTS _ZNK17QDeclarativeTimer9isRunningEv @ 1850 NONAME ABSENT _ZNK23QDeclarativeDebugClient6statusEv @ 1851 NONAME ABSENT _ZNK23QDeclarativeEngineDebug6statusEv @ 1852 NONAME ABSENT - _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME ABSENT + _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME _ZNK26QDeclarativeBasePositioner10metaObjectEv @ 1854 NONAME ABSENT _ZNK26QDeclarativeBasePositioner3addEv @ 1855 NONAME ABSENT _ZNK26QDeclarativeBasePositioner4moveEv @ 1856 NONAME ABSENT -- cgit v0.12 From eeea1dd085d4712ce78166bdf8769e4270e2d831 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 25 Feb 2011 13:07:04 +1000 Subject: Ensure layout is updated when section property changes. When the section property changed the sections were recalculated, but the items were not relayouted. Also avoid 'Unable to assign undefined value' warning by setting section item parent before component is completed. Change-Id: I7bd8eb369877a6faf72b32b80b45a68366c95772 Task-number: QTBUG-17759 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativelistview.cpp | 5 ++++- .../data/listview-sections_delegate.qml | 3 ++- .../tst_qdeclarativelistview.cpp | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 338cb58..431e311 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -942,7 +942,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem) } else { QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q)); context->setContextProperty(QLatin1String("section"), listItem->attached->m_section); - QObject *nobj = sectionCriteria->delegate()->create(context); + QObject *nobj = sectionCriteria->delegate()->beginCreate(context); if (nobj) { QDeclarative_setParent_noEvent(context, nobj); listItem->section = qobject_cast(nobj); @@ -956,6 +956,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem) } else { delete context; } + sectionCriteria->delegate()->completeCreate(); } listItem->setPosition(pos); } else { @@ -2797,6 +2798,8 @@ void QDeclarativeListView::updateSections() roles << d->sectionCriteria->property().toUtf8(); d->model->setWatchedRoles(roles); d->updateSections(); + if (d->itemCount) + d->layout(); } } diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml index 9d9cda8..b2d9213 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml @@ -1,6 +1,7 @@ import QtQuick 1.0 Rectangle { + property string sectionProperty: "number" width: 240 height: 320 color: "#ffffff" @@ -56,7 +57,7 @@ Rectangle { height: 320 model: testModel delegate: myDelegate - section.property: "number" + section.property: sectionProperty section.delegate: Rectangle { objectName: "sect_" + section color: "#99bb99" diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index c7f90da..e8b6028 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1091,6 +1091,28 @@ void tst_QDeclarativeListView::sectionsDelegate() QList items = findItems(contentItem, "sect_1"); QCOMPARE(items.count(), 1); + // QTBUG-17759 + model.modifyItem(0, "One", "aaa"); + model.modifyItem(1, "One", "aaa"); + model.modifyItem(2, "One", "aaa"); + model.modifyItem(3, "Four", "aaa"); + model.modifyItem(4, "Four", "aaa"); + model.modifyItem(5, "Four", "aaa"); + model.modifyItem(6, "Five", "aaa"); + model.modifyItem(7, "Five", "aaa"); + model.modifyItem(8, "Five", "aaa"); + model.modifyItem(9, "Two", "aaa"); + model.modifyItem(10, "Two", "aaa"); + model.modifyItem(11, "Two", "aaa"); + QTest::qWait(100); + canvas->rootObject()->setProperty("sectionProperty", "name"); + for (int i = 0; i < 4; ++i) { + QDeclarativeItem *item = findItem(contentItem, + "sect_" + model.name(i*3)); + QVERIFY(item); + QTRY_COMPARE(item->y(), qreal(i*20*4)); + } + delete canvas; } -- cgit v0.12 From d14bc92ccdf263cfd05dc8d1bec21aa95edd20a4 Mon Sep 17 00:00:00 2001 From: David Fries Date: Fri, 25 Feb 2011 14:11:49 +0100 Subject: spelling fixes in extending.qdoc Merge-request: 1103 Reviewed-by: Oswald Buddenhagen --- doc/src/declarative/extending.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 5a95551..4b4e05e 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -51,7 +51,7 @@ to either instantiating an object instance, or assigning a property a value. QML relies heavily on Qt's meta object system and can only instantiate classes that derive from QObject. For visual element types, this will usually mean a subclass of QDeclarativeItem; for models used with the view elements, a subclass of QAbstractItemModel; -and for abitrary objects with properties, a direct subclass of QObject. +and for arbitrary objects with properties, a direct subclass of QObject. The QML engine has no intrinsic knowledge of any class types. Instead the programmer must register the C++ types with their corresponding QML names. @@ -522,7 +522,7 @@ The \c {invite()} method is similarly available if it is declared as a slot. \snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0 \snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1 -The QML snippet shown above applies a property value source to the \c announcment property. +The QML snippet shown above applies a property value source to the \c announcement property. A property value source generates a value for a property that changes over time. Property value sources are most commonly used to do animation. Rather than @@ -562,7 +562,7 @@ assignment fails does the engine call the \l {QDeclarativePropertyValueSource::} the type to also be used in contexts other than just as a value source. \l {Extending QML - Property Value Source Example} shows the complete code used -implement the \c HappyBirthdaySong property value source. +to implement the \c HappyBirthdaySong property value source. \section1 Property Binding -- cgit v0.12 From 31e3cc1256083494d28b20af874f7b2023446df0 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 7 Feb 2011 13:41:46 +0200 Subject: Recreate GL surface when native window is resized on Symbian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symbian doesn't automatically resize EGL surface when native window is resized. Task-number: QTBUG-15249 Reviewed-by: Jørgen Lind --- src/opengl/qwindowsurface_gl.cpp | 54 ++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index aad12d7..0bffbda 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -776,32 +776,60 @@ void QGLWindowSurface::updateGeometry() { return; d_ptr->geometry_updated = false; - QRect rect = geometry(); - hijackWindow(window()); - QGLContext *ctx = reinterpret_cast(window()->d_func()->extraData()->glContext); + bool hijack(true); + QWidgetPrivate *wd = window()->d_func(); + if (wd->extraData() && wd->extraData()->glContext) + hijack = false; // we already have gl context for widget + + if (hijack) + hijackWindow(window()); + + QGLContext *ctx = reinterpret_cast(wd->extraData()->glContext); #ifdef Q_WS_MAC ctx->updatePaintDevice(); #endif - const GLenum target = GL_TEXTURE_2D; + QSize surfSize = geometry().size(); - if (rect.width() <= 0 || rect.height() <= 0) + if (surfSize.width() <= 0 || surfSize.height() <= 0) return; - if (d_ptr->size == rect.size()) + if (d_ptr->size == surfSize) return; - d_ptr->size = rect.size(); + d_ptr->size = surfSize; + +#ifdef Q_OS_SYMBIAN + if (!hijack) { // Symbian needs to recreate EGL surface when native window size changes + if (ctx->d_func()->eglSurface != EGL_NO_SURFACE) { + eglDestroySurface(ctx->d_func()->eglContext->display(), + ctx->d_func()->eglSurface); + } + + ctx->d_func()->eglSurface = QEgl::createSurface(ctx->device(), + ctx->d_func()->eglContext->config()); + +#if !defined(QGL_NO_PRESERVED_SWAP) + eglGetError(); // Clear error state first. + eglSurfaceAttrib(QEgl::display(), ctx->d_func()->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + if (eglGetError() != EGL_SUCCESS) { + qWarning("QGLWindowSurface: could not restore preserved swap behaviour"); + } +#endif + } +#endif if (d_ptr->ctx) { #ifndef QT_OPENGL_ES_2 if (d_ptr->destructive_swap_buffers) - initializeOffscreenTexture(rect.size()); + initializeOffscreenTexture(surfSize); #endif return; } + const GLenum target = GL_TEXTURE_2D; if (d_ptr->destructive_swap_buffers && (QGLExtensions::glExtensions() & QGLExtensions::FramebufferObject) && (d_ptr->fbo || !d_ptr->tried_fbo) @@ -820,10 +848,10 @@ void QGLWindowSurface::updateGeometry() { if (QGLExtensions::glExtensions() & QGLExtensions::FramebufferBlit) format.setSamples(8); - d_ptr->fbo = new QGLFramebufferObject(rect.size(), format); + d_ptr->fbo = new QGLFramebufferObject(surfSize, format); if (d_ptr->fbo->isValid()) { - qDebug() << "Created Window Surface FBO" << rect.size() + qDebug() << "Created Window Surface FBO" << surfSize << "with samples" << d_ptr->fbo->format().samples(); return; } else { @@ -844,7 +872,7 @@ void QGLWindowSurface::updateGeometry() { delete d_ptr->pb; - d_ptr->pb = new QGLPixelBuffer(rect.width(), rect.height(), + d_ptr->pb = new QGLPixelBuffer(surfSize.width(), surfSize.height(), QGLFormat(QGL::SampleBuffers | QGL::StencilBuffer | QGL::DepthBuffer), qt_gl_share_widget()); @@ -854,7 +882,7 @@ void QGLWindowSurface::updateGeometry() { glGenTextures(1, &d_ptr->pb_tex_id); glBindTexture(target, d_ptr->pb_tex_id); - glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + glTexImage2D(target, 0, GL_RGBA, surfSize.width(), surfSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -878,7 +906,7 @@ void QGLWindowSurface::updateGeometry() { #ifndef QT_OPENGL_ES_2 if (d_ptr->destructive_swap_buffers) - initializeOffscreenTexture(rect.size()); + initializeOffscreenTexture(surfSize); #endif qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;; -- cgit v0.12 From 01dcf4ca11c38df20c0948357383ff22ecd29035 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 7 Feb 2011 13:38:51 +0200 Subject: Use the 'convertInPlace' versions of QImage in QGLPixmapData load. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change QGLPixmapData load functions to use 'convertInPlace' versions of QImage to save memory. Task-number: QTBUG-17256 Reviewed-by: Samuel Rødal --- src/opengl/qpixmapdata_gl.cpp | 113 +++++++++++++++++++++++++++++------------- src/opengl/qpixmapdata_gl_p.h | 4 ++ 2 files changed, 83 insertions(+), 34 deletions(-) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 9980f2d..011d5b6 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -55,6 +55,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -369,40 +370,18 @@ void QGLPixmapData::ensureCreated() const void QGLPixmapData::fromImage(const QImage &image, Qt::ImageConversionFlags flags) { - if (image.size() == QSize(w, h)) - setSerialNumber(++qt_gl_pixmap_serial); - resize(image.width(), image.height()); - - if (pixelType() == BitmapType) { - m_source = image.convertToFormat(QImage::Format_MonoLSB); - - } else { - QImage::Format format = QImage::Format_RGB32; - if (qApp->desktop()->depth() == 16) - format = QImage::Format_RGB16; - - if (image.hasAlphaChannel() - && ((flags & Qt::NoOpaqueDetection) - || const_cast(image).data_ptr()->checkForAlphaPixels())) - format = QImage::Format_ARGB32_Premultiplied;; - - m_source = image.convertToFormat(format); - } - - m_dirty = true; - m_hasFillColor = false; + QImage img = image; + createPixmapForImage(img, flags, false); +} - m_hasAlpha = m_source.hasAlphaChannel(); - w = image.width(); - h = image.height(); - is_null = (w <= 0 || h <= 0); - d = m_source.depth(); +void QGLPixmapData::fromImageReader(QImageReader *imageReader, + Qt::ImageConversionFlags flags) +{ + QImage image = imageReader->read(); + if (image.isNull()) + return; - if (m_texture.id) { - QGLShareContextScope ctx(qt_gl_share_widget()->context()); - glDeleteTextures(1, &m_texture.id); - m_texture.id = 0; - } + createPixmapForImage(image, flags, true); } bool QGLPixmapData::fromFile(const QString &filename, const char *format, @@ -435,7 +414,13 @@ bool QGLPixmapData::fromFile(const QString &filename, const char *format, } return false; } - fromImage(QImageReader(&file, format).read(), flags); + + QImage image = QImageReader(filename, format).read(); + if (image.isNull()) + return false; + + createPixmapForImage(image, flags, true); + return !isNull(); } @@ -459,7 +444,67 @@ bool QGLPixmapData::fromData(const uchar *buffer, uint len, const char *format, return true; } } - return QPixmapData::fromData(buffer, len, format, flags); + + QByteArray a = QByteArray::fromRawData(reinterpret_cast(buffer), len); + QBuffer b(&a); + b.open(QIODevice::ReadOnly); + QImage image = QImageReader(&b, format).read(); + if (image.isNull()) + return false; + + createPixmapForImage(image, flags, true); + + return !isNull(); +} + +/*! + out-of-place conversion (inPlace == false) will always detach() + */ +void QGLPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace) +{ + if (image.size() == QSize(w, h)) + setSerialNumber(++qt_gl_pixmap_serial); + + resize(image.width(), image.height()); + + if (pixelType() == BitmapType) { + m_source = image.convertToFormat(QImage::Format_MonoLSB); + + } else { + QImage::Format format = QImage::Format_RGB32; + if (qApp->desktop()->depth() == 16) + format = QImage::Format_RGB16; + + if (image.hasAlphaChannel() + && ((flags & Qt::NoOpaqueDetection) + || const_cast(image).data_ptr()->checkForAlphaPixels())) + format = QImage::Format_ARGB32_Premultiplied;; + + if (inPlace && image.data_ptr()->convertInPlace(format, flags)) { + m_source = image; + } else { + m_source = image.convertToFormat(format); + + // convertToFormat won't detach the image if format stays the same. + if (image.format() == format) + m_source.detach(); + } + } + + m_dirty = true; + m_hasFillColor = false; + + m_hasAlpha = m_source.hasAlphaChannel(); + w = image.width(); + h = image.height(); + is_null = (w <= 0 || h <= 0); + d = m_source.depth(); + + if (m_texture.id) { + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + glDeleteTextures(1, &m_texture.id); + m_texture.id = 0; + } } bool QGLPixmapData::scroll(int dx, int dy, const QRect &rect) diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 5545d3c..96631e6 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -107,6 +107,8 @@ public: // Re-implemented from QPixmapData: void resize(int width, int height); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); + void fromImageReader(QImageReader *imageReader, + Qt::ImageConversionFlags flags); bool fromFile(const QString &filename, const char *format, Qt::ImageConversionFlags flags); bool fromData(const uchar *buffer, uint len, const char *format, @@ -149,6 +151,8 @@ private: QImage fillImage(const QColor &color) const; + void createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace); + mutable QGLFramebufferObject *m_renderFbo; mutable QPaintEngine *m_engine; mutable QGLContext *m_ctx; -- cgit v0.12 From 1b71e4082fcb1f3b112cc786ef577e0bf8cffa4c Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 9 Feb 2011 10:11:45 +0200 Subject: QPixmap::to/fromSymbianCFbsBitmap() in OpenGL graphics system. Implementation of Symbian specific conversion functions for converting Symbian native bitmap to QPixmap and QPixmap to Symbian native bitmap. Task-number: QTBUG-16977 Reviewed-by: Jason Barron --- mkspecs/common/symbian/symbian.conf | 11 ++-- src/opengl/qgl_symbian.cpp | 114 ++++++++++++++++++++++++++++++++++++ src/opengl/qpixmapdata_gl_p.h | 5 ++ 3 files changed, 125 insertions(+), 5 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 0bb3a29..65e6aa0e8 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -70,16 +70,17 @@ QMAKE_LINK_OBJECT_SCRIPT= QMAKE_LIBS = -llibc -llibm -leuser -llibdl QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv -lhal -lbafl -lapparc -QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -lcentralrepository +QMAKE_LIBS_CFBSBITMAP = -lfbscli -lbitgdi -lgdi +QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_CFBSBITMAP -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -lcentralrepository QMAKE_LIBS_NETWORK = QMAKE_LIBS_EGL = -llibEGL QMAKE_LIBS_OPENGL = -llibGLESv2 QMAKE_LIBS_OPENGL_ES1 = -llibGLESv1_CM QMAKE_LIBS_OPENGL_ES2 = -llibGLESv2 -QMAKE_LIBS_OPENGL_QT = -llibGLESv2 -lcone -lws32 -QMAKE_LIBS_OPENGL_ES1_QT = -llibGLESv1_CM -lcone -lws32 -QMAKE_LIBS_OPENGL_ES2_QT = -llibGLESv2 -lcone -lws32 -QMAKE_LIBS_OPENVG = -llibOpenVG -lfbscli -lbitgdi -lgdi +QMAKE_LIBS_OPENGL_QT = $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_CFBSBITMAP -lcone -lws32 +QMAKE_LIBS_OPENGL_ES1_QT = $$QMAKE_LIBS_OPENGL_ES1 $$QMAKE_LIBS_CFBSBITMAP -lcone -lws32 +QMAKE_LIBS_OPENGL_ES2_QT = $$QMAKE_LIBS_OPENGL_ES2 $$QMAKE_LIBS_CFBSBITMAP -lcone -lws32 +QMAKE_LIBS_OPENVG = $$QMAKE_LIBS_CFBSBITMAP -llibOpenVG QMAKE_LIBS_THREAD = -llibpthread QMAKE_LIBS_COMPAT = QMAKE_LIBS_S60 = -lavkon -leikcoctl diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 82b66f5..3426a4c 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -44,12 +44,14 @@ #include #include #include +#include #include #include #include #include #include // to access QWExtra #include "qgl_egl_p.h" +#include "qpixmapdata_gl_p.h" #include "qcolormap.h" #include @@ -358,5 +360,117 @@ void QGLWidgetPrivate::recreateEglSurface() eglSurfaceWindowId = currentId; } +/* + * Symbian specific QGLPixmapData functions + */ + +static CFbsBitmap* createBlitCopy(CFbsBitmap* bitmap) +{ + CFbsBitmap *copy = q_check_ptr(new CFbsBitmap); + if(!copy) + return 0; + + if (copy->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()) != KErrNone) { + delete copy; + copy = 0; + + return 0; + } + + CFbsBitmapDevice* bitmapDevice = 0; + CFbsBitGc *bitmapGc = 0; + QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(copy)); + QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL()); + bitmapGc->Activate(bitmapDevice); + + bitmapGc->BitBlt(TPoint(), bitmap); + + delete bitmapGc; + delete bitmapDevice; + + return copy; +} + +void QGLPixmapData::fromNativeType(void* pixmap, NativeType type) +{ + if (type == QPixmapData::FbsBitmap) { + CFbsBitmap *bitmap = reinterpret_cast(pixmap); + + bool deleteSourceBitmap = false; +#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE + + // Rasterize extended bitmaps + + TUid extendedBitmapType = bitmap->ExtendedBitmapType(); + if (extendedBitmapType != KNullUid) { + bitmap = createBlitCopy(bitmap); + deleteSourceBitmap = true; + } +#endif + + if (bitmap->IsCompressedInRAM()) { + bitmap = createBlitCopy(bitmap); + deleteSourceBitmap = true; + } + + TDisplayMode displayMode = bitmap->DisplayMode(); + QImage::Format format = qt_TDisplayMode2Format(displayMode); + + TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode); + + bitmap->BeginDataAccess(); + uchar *bytes = (uchar*)bitmap->DataAddress(); + QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format); + img = img.copy(); + bitmap->EndDataAccess(); + + if(displayMode == EGray2) { + //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid + //So invert mono bitmaps so that masks work correctly. + img.invertPixels(); + } else if(displayMode == EColor16M) { + img = img.rgbSwapped(); // EColor16M is BGR + } + + fromImage(img, Qt::AutoColor); + + if(deleteSourceBitmap) + delete bitmap; + } +} + +void* QGLPixmapData::toNativeType(NativeType type) +{ + if (type == QPixmapData::FbsBitmap) { + CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); + + if (bitmap) { + QImage image = toImage(); + + TDisplayMode displayMode(EColor16MU); + if (image.format()==QImage::Format_ARGB32_Premultiplied) + displayMode = EColor16MAP; + + if (bitmap->Create(TSize(image.width(), image.height()), + displayMode) == KErrNone) { + const uchar *sptr = const_cast(image).bits(); + bitmap->BeginDataAccess(); + + uchar *dptr = (uchar*)bitmap->DataAddress(); + Mem::Copy(dptr, sptr, image.byteCount()); + + bitmap->EndDataAccess(); + } else { + delete bitmap; + bitmap = 0; + } + } + + return reinterpret_cast(bitmap); + } + return 0; +} + QT_END_NAMESPACE diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 96631e6..a4066fd 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -129,6 +129,11 @@ public: GLuint bind(bool copyBack = true) const; QGLTexture *texture() const; +#if defined(Q_OS_SYMBIAN) + void* toNativeType(NativeType type); + void fromNativeType(void* pixmap, NativeType type); +#endif + private: bool isValid() const; -- cgit v0.12 From efe5a9415f69e5a9ab7a46efa91d465616364371 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 9 Feb 2011 12:06:04 +0200 Subject: Fix code style in qgl_symbian.cpp Reviewed-by: TRUSTME --- src/opengl/qgl_symbian.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 3426a4c..a9e2248 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -367,7 +367,7 @@ void QGLWidgetPrivate::recreateEglSurface() static CFbsBitmap* createBlitCopy(CFbsBitmap* bitmap) { CFbsBitmap *copy = q_check_ptr(new CFbsBitmap); - if(!copy) + if (!copy) return 0; if (copy->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()) != KErrNone) { @@ -425,17 +425,17 @@ void QGLPixmapData::fromNativeType(void* pixmap, NativeType type) img = img.copy(); bitmap->EndDataAccess(); - if(displayMode == EGray2) { + if (displayMode == EGray2) { //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid //So invert mono bitmaps so that masks work correctly. img.invertPixels(); - } else if(displayMode == EColor16M) { + } else if (displayMode == EColor16M) { img = img.rgbSwapped(); // EColor16M is BGR } fromImage(img, Qt::AutoColor); - if(deleteSourceBitmap) + if (deleteSourceBitmap) delete bitmap; } } -- cgit v0.12 From db5d15c9698f797f1cd56a3ab3778ecd4fbad9fc Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 9 Feb 2011 12:49:13 +0200 Subject: Fix for loading QPixmaps from file in GL graphics system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPixmap::load fails if extension (.png) is left out from given filename when loading a pixmap. QPixmap should try loading with all supported formats. Task-number: QTBUG-17328 Reviewed-by: Samuel Rødal --- src/opengl/qpixmapdata_gl.cpp | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 011d5b6..4f8d647 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -390,29 +390,29 @@ bool QGLPixmapData::fromFile(const QString &filename, const char *format, if (pixelType() == QPixmapData::BitmapType) return QPixmapData::fromFile(filename, format, flags); QFile file(filename); - if (!file.open(QIODevice::ReadOnly)) - return false; - QByteArray data = file.peek(64); - bool alpha; - if (m_texture.canBindCompressedTexture - (data.constData(), data.size(), format, &alpha)) { - resize(0, 0); - data = file.readAll(); - file.close(); - QGLShareContextScope ctx(qt_gl_share_widget()->context()); - QSize size = m_texture.bindCompressedTexture - (data.constData(), data.size(), format); - if (!size.isEmpty()) { - w = size.width(); - h = size.height(); - is_null = false; - d = 32; - m_hasAlpha = alpha; - m_source = QImage(); - m_dirty = isValid(); - return true; + if (file.open(QIODevice::ReadOnly)) { + QByteArray data = file.peek(64); + bool alpha; + if (m_texture.canBindCompressedTexture + (data.constData(), data.size(), format, &alpha)) { + resize(0, 0); + data = file.readAll(); + file.close(); + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QSize size = m_texture.bindCompressedTexture + (data.constData(), data.size(), format); + if (!size.isEmpty()) { + w = size.width(); + h = size.height(); + is_null = false; + d = 32; + m_hasAlpha = alpha; + m_source = QImage(); + m_dirty = isValid(); + return true; + } + return false; } - return false; } QImage image = QImageReader(filename, format).read(); -- cgit v0.12 From 91c340aef789bfc06b0403524c09076e05a8d40c Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Fri, 25 Feb 2011 15:23:31 +0200 Subject: Fix extern usage in qpixmapdata_gl.cpp 'extern' is insufficient for linking on DLL-based platforms that use ELF binaries. Reviewed-by: TRUSTME --- src/opengl/qpixmapdata_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 4f8d647..cd403f8 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -extern QGLWidget* qt_gl_share_widget(); +Q_OPENGL_EXPORT extern QGLWidget* qt_gl_share_widget(); /*! \class QGLFramebufferObjectPool -- cgit v0.12 From 6f8300eec79240373ad8fe41f6b963189cd84dfe Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Fri, 25 Feb 2011 15:35:31 +0200 Subject: Update QtOpenGL def files Reviewed-by: TRUSTME --- src/s60installs/bwins/QtOpenGLu.def | 8 ++++++++ src/s60installs/eabi/QtOpenGLu.def | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def index 620fcb9..3eb1512 100644 --- a/src/s60installs/bwins/QtOpenGLu.def +++ b/src/s60installs/bwins/QtOpenGLu.def @@ -703,4 +703,12 @@ EXPORTS ?maxTextureWidth@QGLTextureGlyphCache@@UBEHXZ @ 702 NONAME ; int QGLTextureGlyphCache::maxTextureWidth(void) const ?filterMode@QGLTextureGlyphCache@@QBE?AW4FilterMode@1@XZ @ 703 NONAME ; enum QGLTextureGlyphCache::FilterMode QGLTextureGlyphCache::filterMode(void) const ?setFilterMode@QGLTextureGlyphCache@@QAEXW4FilterMode@1@@Z @ 704 NONAME ; void QGLTextureGlyphCache::setFilterMode(enum QGLTextureGlyphCache::FilterMode) + ?toNativeType@QGLPixmapData@@UAEPAXW4NativeType@QPixmapData@@@Z @ 705 NONAME ; void * QGLPixmapData::toNativeType(enum QPixmapData::NativeType) + ?fromNativeType@QGLPixmapData@@UAEXPAXW4NativeType@QPixmapData@@@Z @ 706 NONAME ; void QGLPixmapData::fromNativeType(void *, enum QPixmapData::NativeType) + ?clear@QGLTextureGlyphCache@@QAEXXZ @ 707 NONAME ; void QGLTextureGlyphCache::clear(void) + ?context@QGLTextureGlyphCache@@QBEPAVQGLContext@@XZ @ 708 NONAME ; class QGLContext * QGLTextureGlyphCache::context(void) const + ?swapBehavior@QGLWindowSurface@@2W4SwapMode@1@A @ 709 NONAME ; enum QGLWindowSurface::SwapMode QGLWindowSurface::swapBehavior + ?createPixmapForImage@QGLPixmapData@@AAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 710 NONAME ; void QGLPixmapData::createPixmapForImage(class QImage &, class QFlags, bool) + ?fromImageReader@QGLPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 711 NONAME ; void QGLPixmapData::fromImageReader(class QImageReader *, class QFlags) + ?setContext@QGLTextureGlyphCache@@QAEXPAVQGLContext@@@Z @ 712 NONAME ; void QGLTextureGlyphCache::setContext(class QGLContext *) diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def index c92d99e..33d40fd 100644 --- a/src/s60installs/eabi/QtOpenGLu.def +++ b/src/s60installs/eabi/QtOpenGLu.def @@ -707,4 +707,11 @@ EXPORTS _ZNK20QGLTextureGlyphCache16maxTextureHeightEv @ 706 NONAME _ZThn8_NK20QGLTextureGlyphCache15maxTextureWidthEv @ 707 NONAME _ZThn8_NK20QGLTextureGlyphCache16maxTextureHeightEv @ 708 NONAME + _ZN13QGLPixmapData12toNativeTypeEN11QPixmapData10NativeTypeE @ 709 NONAME + _ZN13QGLPixmapData14fromNativeTypeEPvN11QPixmapData10NativeTypeE @ 710 NONAME + _ZN13QGLPixmapData15fromImageReaderEP12QImageReader6QFlagsIN2Qt19ImageConversionFlagEE @ 711 NONAME + _ZN13QGLPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 712 NONAME + _ZN16QGLWindowSurface12swapBehaviorE @ 713 NONAME DATA 4 + _ZN20QGLTextureGlyphCache10setContextEP10QGLContext @ 714 NONAME + _ZN20QGLTextureGlyphCache5clearEv @ 715 NONAME -- cgit v0.12 From d4166fa6ce24b55b483f29e8ef447c0f63f0a30f Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 25 Feb 2011 13:23:07 +0100 Subject: Don't crash when marking arguments object of native context JSC assumes that the callee is always valid, since JSC::Arguments is used for JS frames, which must have a callee. But we use JSC::Arguments for arguments object of pushContext()-created contexts, and then there is no callee. But the callee member can't be null, so now we put a fake callee there and make sure it doesn't bleed up to the public API. Alternative solution: Add "if (d->callee)" to JSC::Arguments::markChildren(), then no other changes would be needed. But we don't want to patch JSC any more. Non-solution: Subclass JSC::Arguments and reimplement markChildren() to temporarily set a dummy callee during marking. Can't be done, as JSC::Arguments::d is private (again, we don't want to patch JSC). Task-number: QTBUG-17788 Reviewed-by: Olivier Goffart --- src/script/api/qscriptcontext.cpp | 10 ++++++++-- src/script/api/qscriptengine.cpp | 8 ++++++++ tests/auto/qscriptengine/tst_qscriptengine.cpp | 11 +++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index 2468a46..5454df5 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -268,8 +268,14 @@ QScriptValue QScriptContext::argument(int index) const QScriptValue QScriptContext::callee() const { const JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this); - QScript::APIShim shim(QScript::scriptEngineFromExec(frame)); - return QScript::scriptEngineFromExec(frame)->scriptValueFromJSCValue(frame->callee()); + QScriptEnginePrivate *eng = QScript::scriptEngineFromExec(frame); + QScript::APIShim shim(eng); + if (frame->callee() == eng->originalGlobalObject()) { + // This is a pushContext()-created context; the callee is a lie. + Q_ASSERT(QScriptEnginePrivate::contextFlags(const_cast(frame)) & QScriptEnginePrivate::NativeContext); + return QScriptValue(); + } + return eng->scriptValueFromJSCValue(frame->callee()); } /*! diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index d3e5f2f..9e880b6 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2727,6 +2727,14 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV bool clearScopeChain) { JSC::JSValue thisObject = _thisObject; + if (!callee) { + // callee can't be zero, as this can cause JSC to crash during GC + // marking phase if the context's Arguments object has been created. + // Fake it by using the global object. Note that this is also handled + // in QScriptContext::callee(), as that function should still return + // an invalid value. + callee = originalGlobalObject(); + } if (calledAsConstructor) { //JSC doesn't create default created object for native functions. so we do it JSC::JSValue prototype = callee->get(exec, exec->propertyNames().prototype); diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 8de6fbc..6c89bcb 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -169,6 +169,7 @@ private slots: void nativeFunctionScopes(); void evaluateProgram(); void collectGarbageAfterConnect(); + void collectGarbageAfterNativeArguments(); void promoteThisObjectToQObjectInConstructor(); void qRegExpInport_data(); @@ -5040,6 +5041,16 @@ void tst_QScriptEngine::collectGarbageAfterConnect() QVERIFY(widget == 0); } +void tst_QScriptEngine::collectGarbageAfterNativeArguments() +{ + // QTBUG-17788 + QScriptEngine eng; + QScriptContext *ctx = eng.pushContext(); + QScriptValue arguments = ctx->argumentsObject(); + // Shouldn't crash when marking the arguments object. + collectGarbage_helper(eng); +} + static QScriptValue constructQObjectFromThisObject(QScriptContext *ctx, QScriptEngine *eng) { Q_ASSERT(ctx->isCalledAsConstructor()); -- cgit v0.12 From 2af7bc6259e41415817cadb456909f33249225ed Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 25 Feb 2011 15:33:47 +0100 Subject: Add missing API shims to QScriptValue constructors This is needed to ensure that the calls into JSC are safe, e.g. with regards to reentrancy. I was not able to construct a testcase, but several of our autotests crash without this change if COLLECT_ON_EVERY_ALLOCATION is set to 1 in Collector.cpp (this forces a garbage collection every time an object is allocated). Task-number: QTBUG-17815 Reviewed-by: Olivier Goffart --- src/script/api/qscriptvalue.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index ac57918..e289636 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -254,6 +254,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val) : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine))) { if (engine) { + QScript::APIShim shim(d_ptr->engine); JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); } else @@ -271,6 +272,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val) : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine))) { if (engine) { + QScript::APIShim shim(d_ptr->engine); JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); } else @@ -288,6 +290,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val) : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine))) { if (engine) { + QScript::APIShim shim(d_ptr->engine); JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); } else @@ -305,6 +308,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val) : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine))) { if (engine) { + QScript::APIShim shim(d_ptr->engine); JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsString(exec, val)); } else { @@ -325,6 +329,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const char *val) : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine))) { if (engine) { + QScript::APIShim shim(d_ptr->engine); JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsString(exec, val)); } else { -- cgit v0.12 From e77e820191919aaf54c85f599cf71cfbecd1ee14 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 25 Feb 2011 14:06:57 +0100 Subject: QSortFilterProxyModel::reset() should invalidate. This was broken by: d149a3faca9b97ce806249bc7ef73fe2f59589d5 The connection was removed in that commit because we did not want the layoutChanged signal to be emitted. So instead of calling invalidate(), we call clearMapping() directly. In order to do that, clear_mapping has been turned into a private slot Task-number: QTBUG-17812 Reviewed-by: Gabriel --- src/gui/itemviews/qsortfilterproxymodel.cpp | 15 +++--- src/gui/itemviews/qsortfilterproxymodel.h | 1 + .../tst_qsortfilterproxymodel.cpp | 57 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index e54cbd2..9f89bf5 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -227,7 +227,7 @@ public: void _q_sourceColumnsRemoved(const QModelIndex &source_parent, int start, int end); - void clear_mapping(); + void _q_clearMapping(); void sort(); bool update_source_sort_column(); @@ -281,7 +281,7 @@ typedef QHash IndexMap; void QSortFilterProxyModelPrivate::_q_sourceModelDestroyed() { QAbstractProxyModelPrivate::_q_sourceModelDestroyed(); - clear_mapping(); + _q_clearMapping(); } void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source_parent) @@ -293,7 +293,7 @@ void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source } } -void QSortFilterProxyModelPrivate::clear_mapping() +void QSortFilterProxyModelPrivate::_q_clearMapping() { // store the persistent indexes QModelIndexPairList source_indexes = store_persistent_indexes(); @@ -1223,7 +1223,7 @@ void QSortFilterProxyModelPrivate::_q_sourceReset() { Q_Q(QSortFilterProxyModel); invalidatePersistentIndexes(); - clear_mapping(); + _q_clearMapping(); // All internal structures are deleted in clear() q->endResetModel(); update_source_sort_column(); @@ -1519,6 +1519,7 @@ QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent) d->filter_column = 0; d->filter_role = Qt::DisplayRole; d->dynamic_sortfilter = false; + connect(this, SIGNAL(modelReset()), this, SLOT(_q_clearMapping())); } /*! @@ -1620,7 +1621,7 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel) connect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset())); connect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset())); - d->clear_mapping(); + d->_q_clearMapping(); endResetModel(); if (d->update_source_sort_column() && d->dynamic_sortfilter) d->sort(); @@ -2311,7 +2312,7 @@ void QSortFilterProxyModel::clear() { Q_D(QSortFilterProxyModel); emit layoutAboutToBeChanged(); - d->clear_mapping(); + d->_q_clearMapping(); emit layoutChanged(); } @@ -2326,7 +2327,7 @@ void QSortFilterProxyModel::invalidate() { Q_D(QSortFilterProxyModel); emit layoutAboutToBeChanged(); - d->clear_mapping(); + d->_q_clearMapping(); emit layoutChanged(); } diff --git a/src/gui/itemviews/qsortfilterproxymodel.h b/src/gui/itemviews/qsortfilterproxymodel.h index 09fd20f..afeaa69 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.h +++ b/src/gui/itemviews/qsortfilterproxymodel.h @@ -189,6 +189,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsInserted(const QModelIndex &source_parent, int start, int end)) Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end)) Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsRemoved(const QModelIndex &source_parent, int start, int end)) + Q_PRIVATE_SLOT(d_func(), void _q_clearMapping()) }; QT_END_NAMESPACE diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index bce7281..dfe47cb 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -144,6 +144,8 @@ private slots: void taskQTBUG_7537_appearsAndSort(); void taskQTBUG_7716_unnecessaryDynamicSorting(); void taskQTBUG_10287_unnecessaryMapCreation(); + void taskQTBUG_17812_resetInvalidate_data(); + void taskQTBUG_17812_resetInvalidate(); void testMultipleProxiesWithSelection(); void mapSelectionFromSource(); @@ -3213,5 +3215,60 @@ void tst_QSortFilterProxyModel::filteredColumns() } +void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate_data() +{ + QTest::addColumn("test"); + QTest::addColumn("works"); + + QTest::newRow("nothing") << 0 << false; + QTest::newRow("reset") << 1 << true; + QTest::newRow("invalidate") << 2 << true; + QTest::newRow("invalidate_filter") << 3 << true; +} + +void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate() +{ + QFETCH(int, test); + QFETCH(bool, works); + + struct Proxy : QSortFilterProxyModel { + QString pattern; + virtual bool filterAcceptsRow(int source_row, const QModelIndex&) const { + return sourceModel()->data(sourceModel()->index(source_row, 0)).toString().contains(pattern); + } + void notifyChange(int test) { + switch (test) { + case 0: break; + case 1: reset(); break; + case 2: invalidate(); break; + case 3: invalidateFilter(); break; + } + } + }; + + QStringListModel sourceModel(QStringList() << "Poisson" << "Vache" << "Brebis" + << "Elephant" << "Cochon" << "Serpent" + << "Mouton" << "Ecureuil" << "Mouche"); + Proxy proxy; + proxy.pattern = QString::fromLatin1("n"); + proxy.setSourceModel(&sourceModel); + + QCOMPARE(proxy.rowCount(), 5); + for (int i = 0; i < proxy.rowCount(); i++) { + QVERIFY(proxy.data(proxy.index(i,0)).toString().contains('n')); + } + + proxy.pattern = QString::fromLatin1("o"); + proxy.notifyChange(test); + + QCOMPARE(proxy.rowCount(), works ? 4 : 5); + bool ok = true; + for (int i = 0; i < proxy.rowCount(); i++) { + if (!proxy.data(proxy.index(i,0)).toString().contains('o')) + ok = false; + } + QCOMPARE(ok, works); +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" -- cgit v0.12 From aa1e47a5a1a0978979e98f503cb44c85fc88dece Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 25 Feb 2011 16:45:34 +0100 Subject: Make QtScript support COLLECT_ON_EVERY_ALLOCATION define JSC has a define in runtime/Collector.cpp that can be enabled to force garbage collection on every allocation. This can be useful when investigating GC-related issues. When the define is enabled, GC callbacks will happen before the QScriptEngine(Private) is completely initialized, so we need to initialize some things earlier (nice cleanup, actually), and add some guards in the marking callback. All tests pass with define off and on. Task-number: QTBUG-17781 Reviewed-by: Olivier Goffart --- src/script/api/qscriptengine.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 9e880b6..160058e 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -955,8 +955,11 @@ static QScriptValue __setupPackage__(QScriptContext *ctx, QScriptEngine *eng) } // namespace QScript QScriptEnginePrivate::QScriptEnginePrivate() - : registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0), - registeredScriptStrings(0), inEval(false) + : originalGlobalObjectProxy(0), currentFrame(0), + qobjectPrototype(0), qmetaobjectPrototype(0), variantPrototype(0), + activeAgent(0), agentLineNumber(-1), + registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0), + registeredScriptStrings(0), processEventsInterval(-1), inEval(false) { qMetaTypeId(); qMetaTypeId >(); @@ -1002,10 +1005,6 @@ QScriptEnginePrivate::QScriptEnginePrivate() currentFrame = exec; - originalGlobalObjectProxy = 0; - activeAgent = 0; - agentLineNumber = -1; - processEventsInterval = -1; cachedTranslationUrl = JSC::UString(); cachedTranslationContext = JSC::UString(); JSC::setCurrentIdentifierTable(oldTable); @@ -1253,10 +1252,12 @@ void QScriptEnginePrivate::mark(JSC::MarkStack& markStack) { Q_Q(QScriptEngine); - markStack.append(originalGlobalObject()); - markStack.append(globalObject()); - if (originalGlobalObjectProxy) - markStack.append(originalGlobalObjectProxy); + if (originalGlobalObject()) { + markStack.append(originalGlobalObject()); + markStack.append(globalObject()); + if (originalGlobalObjectProxy) + markStack.append(originalGlobalObjectProxy); + } if (qobjectPrototype) markStack.append(qobjectPrototype); @@ -1281,7 +1282,7 @@ void QScriptEnginePrivate::mark(JSC::MarkStack& markStack) } } - { + if (q) { QScriptContext *context = q->currentContext(); while (context) { -- cgit v0.12 From f3ed538a99adf5dc60305c257feb181d46de3748 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 28 Feb 2011 08:36:09 +1000 Subject: Document BorderImage::asynchronous It's been there forever, but someone forgot the documentation. Task-number: QTBUG-16612 --- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index c03c624..91896f2 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -149,6 +149,20 @@ QT_BEGIN_NAMESPACE \sa Image, AnimatedImage */ +/*! + \qmlproperty bool BorderImage::asynchronous + + Specifies that images on the local filesystem should be loaded + asynchronously in a separate thread. The default value is + false, causing the user interface thread to block while the + image is loaded. Setting \a asynchronous to true is useful where + maintaining a responsive user interface is more desirable + than having images immediately visible. + + Note that this property is only valid for images read from the + local filesystem. Images loaded via a network resource (e.g. HTTP) + are always loaded asynchonously. +*/ QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent) : QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent) { -- cgit v0.12 From b2a0db11c81a47c45d2617b64fef650a830b53f7 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 28 Feb 2011 10:12:47 +1000 Subject: Fix test instability. Allow the asynchronous view changes to complete before testing section positions. Change-Id: I09c7592205b6e3c55807ec1c5aa4b09f9cd8b92c --- .../auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index e8b6028..cceeb63 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1106,6 +1106,8 @@ void tst_QDeclarativeListView::sectionsDelegate() model.modifyItem(11, "Two", "aaa"); QTest::qWait(100); canvas->rootObject()->setProperty("sectionProperty", "name"); + // ensure view has settled. + QTRY_COMPARE(findItems(contentItem, "sect_Four").count(), 1); for (int i = 0; i < 4; ++i) { QDeclarativeItem *item = findItem(contentItem, "sect_" + model.name(i*3)); -- cgit v0.12 From 39013a4a8238d522ed1d13adb25e702da9e25fc9 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 28 Feb 2011 12:31:50 +1000 Subject: fix/improve docs for new QtQuick 1.1 attributes Ensure attributes added in QtQuick 1.1 are marked with the '\since QtQuick 1.1' tag. Also add links to items listed in the QtQuick 1.1 section in whatsnew.qdoc. Task-number: QTBUG-17771 Change-Id: Ic8fb3c8d3c99a1469c1767779efaafd27ef460e1 --- doc/src/declarative/dynamicobjects.qdoc | 8 +-- doc/src/declarative/whatsnew.qdoc | 61 ++++++++++++---------- doc/src/snippets/declarative/componentCreation.js | 7 +-- .../graphicsitems/qdeclarativeborderimage.cpp | 9 ++++ .../graphicsitems/qdeclarativeflickable.cpp | 6 +-- .../graphicsitems/qdeclarativegridview.cpp | 1 + .../graphicsitems/qdeclarativelistview.cpp | 1 + .../graphicsitems/qdeclarativepositioners.cpp | 6 +++ src/declarative/graphicsitems/qdeclarativetext.cpp | 4 ++ .../graphicsitems/qdeclarativetextedit.cpp | 6 +-- .../graphicsitems/qdeclarativetextinput.cpp | 8 +++ src/declarative/qml/qdeclarativecomponent.cpp | 26 ++++++--- 12 files changed, 91 insertions(+), 52 deletions(-) diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index 316fe6b..f2ca0fd 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -68,9 +68,11 @@ the component. This function can take one or two arguments: \o The first is the parent for the new item. Since graphical items will not appear on the scene without a parent, it is recommended that you set the parent this way. However, if you wish to set the parent later you can safely pass \c null to this function. -\o The second is optional and is a script which assigns values to the item's properties during creation. This avoids warnings - when certain properties have been bound to before they have been set by the code. Additionally, there are small performance - benefits when instantiating objects in this way. +\o The second is optional and is a map of property-value items that define initial any property values for the item. + Property values specified by this argument are applied to the object before its creation is finalized, avoiding + binding errors that may occur if particular properties must be initialized to enable other property bindings. + when certain properties have been bound to before they have been set by the code. Additionally, there are small + performance benefits when compared to defining property values and bindings after the object is created. \endlist Here is an example. First there is \c Sprite.qml, which defines a simple QML component: diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc index f4359f9..e8c2124 100644 --- a/doc/src/declarative/whatsnew.qdoc +++ b/doc/src/declarative/whatsnew.qdoc @@ -41,10 +41,10 @@ PinchArea provides support for the common two finger pinch gesture. Added the following properties: \list -\o lineSpacing -\o lineCount -\o maximumLineCount -\o truncated +\o \l {Text::}{lineHeight} +\o \l {Text::}{lineCount} +\o \l {Text::}{maximumLineCount} +\o \l {Text::}{truncated} \endlist horizontalAlignment now accepts Text.AlignJustify alignment mode. @@ -53,85 +53,88 @@ horizontalAlignment now accepts Text.AlignJustify alignment mode. Added the following properties, methods and signal handlers: \list -\o canPaste -\o lineCount -\o deselect() -\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word -\o onLinkActivated(string link) +\o \l {TextEdit::}{canPaste} +\o \l {TextEdit::}{lineCount} +\o \l {TextEdit::}{deselect()} +\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word +\o \l {TextEdit::}{onLinkActivated} \endlist \section2 TextInput Added the following properties and methods: \list -\o canPaste -\o deselect() -\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word +\o \l{TextInput::}{canPaste} +\o \l{TextInput::}{deselect()} +\o \l{TextInput::}{moveCursorSelection()} to enable selection by word \endlist \section2 Image, BorderImage and AnimatedImage Added the following properties: \list -\o cache -\o mirror +\o \l{Image::}{cache} +\o \l{Image::}{mirror} \endlist \section2 Item Added the following properties: \list -\o implicitWidth and implicitHeight +\o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight} \endlist \section2 Flickable Added the following methods: \list -\o resizeContent(qreal w, qreal h, QPointF center) -\o returnToBounds() +\o \l{Flickable::}{resizeContent()} +\o \l{Flickable::}{returnToBounds()} \endlist \section2 ListView and GridView Added the following methods: \list -\o positionViewAtBeginning() -\o positionViewAtEnd() +\o \l{ListView::}{positionViewAtBeginning()} +\o \l{ListView::}{positionViewAtEnd()} \endlist -\section2 Flow, Grid, Row +\section2 Flow, Grid and Row Added the following properties: \list -\o layoutDirection +\o \l{Flow::}{layoutDirection} \endlist \section2 Repeater Added the following methods and signal handlers: \list -\o onItemAdded() -\o onItemRemoved() -\o itemAt(int index) +\o \l{Repeater::}{onItemAdded} +\o \l{Repeater::}{onItemRemoved} +\o \l{Repeater::}{itemAt()} \endlist \section2 Component -The createObject() method now accepts a map of initial property values for the created object. +\list +\o The \l{Component::}{createObject()} method now accepts a map of initial property values for +the created object. +\endlist \section2 Qt -Added the following properties and methods: \list -\o application.layoutDirection -\o application.active +\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application +properties. \endlist \section2 Other changes \list -\o Functions can be assigned to properties from JavaScript to create property bindings +\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript} +to create property bindings. \endlist diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js index cf59777..7364139 100644 --- a/doc/src/snippets/declarative/componentCreation.js +++ b/doc/src/snippets/declarative/componentCreation.js @@ -32,13 +32,10 @@ function createSpriteObjects() { //![finishCreation] function finishCreation() { if (component.status == Component.Ready) { - sprite = component.createObject(appWindow); + sprite = component.createObject(appWindow, {"x": 100, "y": 100}); if (sprite == null) { // Error Handling - } else { - sprite.x = 100; - sprite.y = 100; - // ... + console.log("Error creating object"); } } else if (component.status == Component.Error) { // Error Handling diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 91896f2..8f37e90 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -214,6 +214,15 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() */ /*! + \qmlproperty bool BorderImage::cache + \since Quick 1.1 + + Specifies whether the image should be cached. The default value is + true. Setting \a cache to false is useful when dealing with large images, + to make sure that they aren't cached at the expense of small 'ui element' images. +*/ + +/*! \qmlproperty bool BorderImage::mirror \since Quick 1.1 diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 91230c0..364d76f 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1297,11 +1297,10 @@ void QDeclarativeFlickable::setContentHeight(qreal h) /*! \qmlmethod Flickable::resizeContent(real width, real height, QPointF center) \preliminary + \since Quick 1.1 Resizes the content to \a width x \a height about \a center. - \bold {This method was added in QtQuick 1.1.} - This does not scale the contents of the Flickable - it only resizes the \l contentWidth and \l contentHeight. @@ -1333,11 +1332,10 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center) /*! \qmlmethod Flickable::returnToBounds() \preliminary + \since Quick 1.1 Ensures the content is within legal bounds. - \bold {This method was added in QtQuick 1.1.} - This may be called to ensure that the content is within legal bounds after manually positioning the content. */ diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 6d2285d..00e5b3f 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2250,6 +2250,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode) /*! \qmlmethod GridView::positionViewAtBeginning() \qmlmethod GridView::positionViewAtEnd() + \since Quick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 431e311..e8bc1bf 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2709,6 +2709,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) /*! \qmlmethod ListView::positionViewAtBeginning() \qmlmethod ListView::positionViewAtEnd() + \since Quick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 27a1301..c0be2a2 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -584,6 +584,8 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) /*! \qmlproperty enumeration Row::layoutDirection + \since Quick 1.1 + This property holds the layoutDirection of the row. Possible values: @@ -859,6 +861,8 @@ void QDeclarativeGrid::setFlow(Flow flow) /*! \qmlproperty enumeration Grid::layoutDirection + \since Quick 1.1 + This property holds the layout direction of the layout. Possible values are: @@ -1201,6 +1205,8 @@ void QDeclarativeFlow::setFlow(Flow flow) /*! \qmlproperty enumeration Flow::layoutDirection + \since Quick 1.1 + This property holds the layout direction of the layout. Possible values are: diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 049169e..044425d 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -1168,6 +1168,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode) /*! \qmlproperty int Text::lineCount + \since Quick 1.1 Returns the number of lines visible in the text item. @@ -1183,6 +1184,7 @@ int QDeclarativeText::lineCount() const /*! \qmlproperty bool Text::truncated + \since Quick 1.1 Returns true if the text has been truncated due to \l maximumLineCount or \l elide. @@ -1199,6 +1201,7 @@ bool QDeclarativeText::truncated() const /*! \qmlproperty int Text::maximumLineCount + \since Quick 1.1 Set this property to limit the number of lines that the text item will show. If elide is set to Text.ElideRight, the text will be elided appropriately. @@ -1451,6 +1454,7 @@ qreal QDeclarativeText::paintedHeight() const /*! \qmlproperty real Text::lineHeight + \since Quick 1.1 Sets the line height for the text. The value can be in pixels or a multiplier depending on lineHeightMode. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 7f383a6..59921d5 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -544,6 +544,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode) /*! \qmlproperty int TextEdit::lineCount + \since Quick 1.1 Returns the total number of lines in the textEdit item. */ @@ -1134,6 +1135,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) /*! \qmlmethod void TextEdit::deselect() + \since Quick 1.1 Removes active text selection. */ @@ -1381,13 +1383,11 @@ void QDeclarativeTextEdit::updateImgCache(const QRectF &rf) /*! \qmlproperty bool TextEdit::canPaste + \since QtQuick 1.1 Returns true if the TextEdit is writable and the content of the clipboard is suitable for pasting into the TextEdit. - - \since QtQuick 1.1 */ - bool QDeclarativeTextEdit::canPaste() const { Q_D(const QDeclarativeTextEdit); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index f3c6b93..65ed5c6 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1299,6 +1299,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property) /*! \qmlmethod void TextInput::deselect() + \since Quick 1.1 Removes active text selection. */ @@ -1480,6 +1481,13 @@ void QDeclarativeTextInput::setMouseSelectionMode(SelectionMode mode) } } +/*! + \qmlproperty bool TextInput::canPaste + \since QtQuick 1.1 + + Returns true if the TextInput is writable and the content of the clipboard is + suitable for pasting into the TextEdit. +*/ bool QDeclarativeTextInput::canPaste() const { Q_D(const QDeclarativeTextInput); diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index cf40182..fc393d1 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -615,10 +615,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q } /*! - \qmlmethod object Component::createObject(Item parent, Script valuemap = null) + \qmlmethod object Component::createObject(Item parent, object properties) - Creates and returns an object instance of this component that will have the given - \a parent. Returns null if object creation fails. + Creates and returns an object instance of this component that will have + the given \a parent and \a properties. The \a properties argument is optional. + Returns null if object creation fails. The object will be created in the same context as the one in which the component was created. This function will always return null when called on components @@ -630,14 +631,23 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q property, or else the object will not be visible. If a \a parent is not provided to createObject(), a reference to the returned object must be held so that - it is not destroyed by the garbage collector. This is regardless of Item.parent being set afterwards, + it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards, since setting the Item parent does not change object ownership; only the graphical parent is changed. - Since QtQuick 1.1, a map of property values can be optionally passed to the method that applies values to the object's properties - before its creation is finalised. This will avoid binding issues that can occur when the object is - instantiated before property bindings have been set. For example: + As of QtQuick 1.1, this method accepts an optional \a properties argument that specifies a + map of initial property values for the created object. These values are applied before object + creation is finalized. (This is more efficient than setting property values after object creation, + particularly where large sets of property values are defined, and also allows property bindings + to be set up before the object is created.) - \code component.createObject(parent, {"x": 100, "y": 100, "specialProperty": someObject}); \endcode + The \a properties argument is specified as a map of property-value items. For example, the code + below creates an object with initial \c x and \c y values of 100 and 200, respectively: + + \qml + var component = Qt.createComponent("Button.qml"); + if (component.status == Component.Ready) + component.createObject(parent, {"x": 100, "y": 100}); + \endqml Dynamically created instances can be deleted with the \c destroy() method. See \l {Dynamic Object Management in QML} for more information. -- cgit v0.12 From 6d7c12ae3f3d0eae6946524ce023ac452cf188c4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 28 Feb 2011 13:15:19 +1000 Subject: FolderListModel emitted incorrect rowsRemoved range causing crash. beginRemoveRows() takes the first and last index as parameters, but it was passing count rather than count-1 as the last index. Change-Id: I81a6fbf085acacf5f8c1ca847b0bdc826bcf405b Task-number: QTBUG-17775 Reviewed-by: Bea Lam --- .../qdeclarativefolderlistmodel.cpp | 2 +- .../tst_qdeclarativefolderlistmodel.cpp | 31 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp index d5726c1..9fe01bf 100644 --- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp @@ -365,7 +365,7 @@ void QDeclarativeFolderListModel::refresh() { d->folderIndex = QModelIndex(); if (d->count) { - emit beginRemoveRows(QModelIndex(), 0, d->count); + emit beginRemoveRows(QModelIndex(), 0, d->count-1); d->count = 0; emit endRemoveRows(); } diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp index a62ea31..6028333 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp @@ -62,14 +62,24 @@ class tst_qdeclarativefolderlistmodel : public QObject { Q_OBJECT public: - tst_qdeclarativefolderlistmodel() {} + tst_qdeclarativefolderlistmodel() : removeStart(0), removeEnd(0) {} + +public slots: + void removed(const QModelIndex &, int start, int end) { + removeStart = start; + removeEnd = end; + } private slots: void basicProperties(); + void refresh(); private: void checkNoErrors(const QDeclarativeComponent& component); QDeclarativeEngine engine; + + int removeStart; + int removeEnd; }; void tst_qdeclarativefolderlistmodel::checkNoErrors(const QDeclarativeComponent& component) @@ -115,6 +125,25 @@ void tst_qdeclarativefolderlistmodel::basicProperties() QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile("")); } +void tst_qdeclarativefolderlistmodel::refresh() +{ + QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); + checkNoErrors(component); + + QAbstractListModel *flm = qobject_cast(component.create()); + QVERIFY(flm != 0); + + int count = flm->rowCount(); + + connect(flm, SIGNAL(rowsRemoved(const QModelIndex&,int,int)), + this, SLOT(removed(const QModelIndex&,int,int))); + + flm->setProperty("sortReversed", true); + + QCOMPARE(removeStart, 0); + QCOMPARE(removeEnd, count-1); +} + QTEST_MAIN(tst_qdeclarativefolderlistmodel) #include "tst_qdeclarativefolderlistmodel.moc" -- cgit v0.12 From cb0a6844705802564c81b581f24a76c5d5adf6d1 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 28 Feb 2011 13:49:37 +1000 Subject: Drag over bounds errors when ListView has variable height content There are two related problems: - when dragging variable height content up beyond bounds items are destroyed, causing the maximum extent to change, which in turn causes skipping. This is fixed by storing the extents on press so that later changes do not affect drag behavior. - when variable height content is dragged beyond the bounds and and released, items are created as the view returns to bounds. This changes the extents, however the bound target was not updated. If the viewport height changes during fixup the bounds animation is now updated. Change-Id: Ib37ec9e51f8ceb71af1e2e58f25fd8da18dcd632 Task-number: QTBUG-17769 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativeflickable.cpp | 82 +++++++++++++++------- .../graphicsitems/qdeclarativeflickable_p_p.h | 7 ++ .../graphicsitems/qdeclarativegridview.cpp | 19 ++--- .../graphicsitems/qdeclarativelistview.cpp | 19 ++--- .../tst_qdeclarativelistview.cpp | 26 ++++++- 5 files changed, 108 insertions(+), 45 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 364d76f..d64c347 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -143,7 +143,7 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate() , stealMouse(false), pressed(false), interactive(true), calcVelocity(false) , deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100) , delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600) - , vTime(0), visibleArea(0) + , fixupMode(Normal), vTime(0), visibleArea(0) , flickableDirection(QDeclarativeFlickable::AutoFlickDirection) , boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds) { @@ -219,6 +219,7 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal { Q_Q(QDeclarativeFlickable); qreal maxDistance = -1; + data.fixingUp = false; bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds; // -ve velocity means list is moving up if (velocity > 0) { @@ -288,24 +289,45 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal if (data.move.value() > minExtent || maxExtent > minExtent) { timeline.reset(data.move); if (data.move.value() != minExtent) { - if (fixupDuration) { - qreal dist = minExtent - data.move; - timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); - timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); - } else { + switch (fixupMode) { + case Immediate: timeline.set(data.move, minExtent); + break; + case ExtentChanged: + // The target has changed. Don't start from the beginning; just complete the + // second half of the animation using the new extent. + timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); + data.fixingUp = true; + break; + default: { + qreal dist = minExtent - data.move; + timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); + timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); + data.fixingUp = true; + } } } } else if (data.move.value() < maxExtent) { timeline.reset(data.move); - if (fixupDuration) { - qreal dist = maxExtent - data.move; - timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); - timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); - } else { + switch (fixupMode) { + case Immediate: timeline.set(data.move, maxExtent); + break; + case ExtentChanged: + // The target has changed. Don't start from the beginning; just complete the + // second half of the animation using the new extent. + timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); + data.fixingUp = true; + break; + default: { + qreal dist = maxExtent - data.move; + timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); + timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); + data.fixingUp = true; + } } } + fixupMode = Normal; vTime = timeline.time(); } @@ -688,6 +710,12 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven vData.velocity = 0; hData.dragStartOffset = 0; vData.dragStartOffset = 0; + hData.dragMinBound = q->minXExtent(); + vData.dragMinBound = q->minYExtent(); + hData.dragMaxBound = q->maxXExtent(); + vData.dragMaxBound = q->maxYExtent(); + hData.fixingUp = false; + vData.fixingUp = false; lastPos = QPoint(); QDeclarativeItemPrivate::start(lastPosTime); pressPos = event->pos(); @@ -716,8 +744,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (!vMoved) vData.dragStartOffset = dy; qreal newY = dy + vData.pressPos - vData.dragStartOffset; - const qreal minY = q->minYExtent(); - const qreal maxY = q->maxYExtent(); + const qreal minY = vData.dragMinBound; + const qreal maxY = vData.dragMaxBound; if (newY > minY) newY = minY + (newY - minY) / 2; if (newY < maxY && maxY - minY <= 0) @@ -748,8 +776,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (!hMoved) hData.dragStartOffset = dx; qreal newX = dx + hData.pressPos - hData.dragStartOffset; - const qreal minX = q->minXExtent(); - const qreal maxX = q->maxXExtent(); + const qreal minX = hData.dragMinBound; + const qreal maxX = hData.dragMaxBound; if (newX > minX) newX = minX + (newX - minX) / 2; if (newX < maxX && maxX - minX <= 0) @@ -1065,10 +1093,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, } // Make sure that we're entirely in view. if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { - int oldDuration = d->fixupDuration; - d->fixupDuration = 0; + d->fixupMode = QDeclarativeFlickablePrivate::Immediate; d->fixupX(); - d->fixupDuration = oldDuration; } } if (newGeometry.height() != oldGeometry.height()) { @@ -1080,10 +1106,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, } // Make sure that we're entirely in view. if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { - int oldDuration = d->fixupDuration; - d->fixupDuration = 0; + d->fixupMode = QDeclarativeFlickablePrivate::Immediate; d->fixupY(); - d->fixupDuration = oldDuration; } } @@ -1258,10 +1282,11 @@ void QDeclarativeFlickable::setContentWidth(qreal w) d->contentItem->setWidth(w); // Make sure that we're entirely in view. if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { - int oldDuration = d->fixupDuration; - d->fixupDuration = 0; + d->fixupMode = QDeclarativeFlickablePrivate::Immediate; + d->fixupX(); + } else if (!d->pressed && d->hData.fixingUp) { + d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged; d->fixupX(); - d->fixupDuration = oldDuration; } emit contentWidthChanged(); d->updateBeginningEnd(); @@ -1285,10 +1310,11 @@ void QDeclarativeFlickable::setContentHeight(qreal h) d->contentItem->setHeight(h); // Make sure that we're entirely in view. if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { - int oldDuration = d->fixupDuration; - d->fixupDuration = 0; + d->fixupMode = QDeclarativeFlickablePrivate::Immediate; + d->fixupY(); + } else if (!d->pressed && d->vData.fixingUp) { + d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged; d->fixupY(); - d->fixupDuration = oldDuration; } emit contentHeightChanged(); d->updateBeginningEnd(); @@ -1660,6 +1686,7 @@ void QDeclarativeFlickable::movementXEnding() emit movementEnded(); } } + d->hData.fixingUp = false; } void QDeclarativeFlickable::movementYEnding() @@ -1682,6 +1709,7 @@ void QDeclarativeFlickable::movementYEnding() emit movementEnded(); } } + d->vData.fixingUp = false; } void QDeclarativeFlickablePrivate::updateVelocity() diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h index 1b6081c..38a5eb3 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h @@ -94,17 +94,21 @@ public: struct AxisData { AxisData(QDeclarativeFlickablePrivate *fp, void (QDeclarativeFlickablePrivate::*func)(qreal)) : move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true) + , fixingUp(false) {} QDeclarativeTimeLineValueProxy move; qreal viewSize; qreal pressPos; qreal dragStartOffset; + qreal dragMinBound; + qreal dragMaxBound; qreal velocity; qreal flickTarget; QDeclarativeFlickablePrivate::Velocity smoothVelocity; bool atEnd : 1; bool atBeginning : 1; + bool fixingUp : 1; }; void flickX(qreal velocity); @@ -161,6 +165,9 @@ public: int pressDelay; int fixupDuration; + enum FixupMode { Normal, Immediate, ExtentChanged }; + FixupMode fixupMode; + static void fixupY_callback(void *); static void fixupX_callback(void *); diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 00e5b3f..1d2ad1c 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -912,8 +912,7 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m || (flow == QDeclarativeGridView::LeftToRight && &data == &hData)) return; - int oldDuration = fixupDuration; - fixupDuration = moveReason == Mouse ? fixupDuration : 0; + fixupMode = moveReason == Mouse ? fixupMode : Immediate; if (snapMode != QDeclarativeGridView::NoSnap) { FxGridItem *topItem = snapItemAt(position()+highlightRangeStart); @@ -932,7 +931,6 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m pos = qMax(qMin(bottomItem->rowPos() - highlightRangeStart, -maxExtent), -minExtent); } else { QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent); - fixupDuration = oldDuration; return; } if (currentItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) { @@ -947,10 +945,12 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m qreal dist = qAbs(data.move + pos); if (dist > 0) { timeline.reset(data.move); - if (fixupDuration) + if (fixupMode != Immediate) { timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - else + data.fixingUp = true; + } else { timeline.set(data.move, -pos); + } vTime = timeline.time(); } } else if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) { @@ -965,23 +965,26 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m timeline.reset(data.move); if (viewPos != position()) { - if (fixupDuration) + if (fixupMode != Immediate) { timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - else + data.fixingUp = true; + } else { timeline.set(data.move, -viewPos); + } } vTime = timeline.time(); } } else { QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent); } - fixupDuration = oldDuration; + fixupMode = Normal; } void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity) { Q_Q(QDeclarativeGridView); + data.fixingUp = false; moveReason = Mouse; if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange) && snapMode == QDeclarativeGridView::NoSnap) { diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index e8bc1bf..e369ba6 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1198,8 +1198,7 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m return; correctFlick = false; - int oldDuration = fixupDuration; - fixupDuration = moveReason == Mouse ? fixupDuration : 0; + fixupMode = moveReason == Mouse ? fixupMode : Immediate; if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) { updateHighlight(); @@ -1212,10 +1211,12 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m timeline.reset(data.move); if (viewPos != position()) { - if (fixupDuration) + if (fixupMode != Immediate) { timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - else + data.fixingUp = true; + } else { timeline.set(data.move, -viewPos); + } } vTime = timeline.time(); } else if (snapMode != QDeclarativeListView::NoSnap) { @@ -1231,23 +1232,24 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent); } else { QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent); - fixupDuration = oldDuration; return; } qreal dist = qAbs(data.move + pos); if (dist > 0) { timeline.reset(data.move); - if (fixupDuration) + if (fixupMode != Immediate) { timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - else + data.fixingUp = true; + } else { timeline.set(data.move, -pos); + } vTime = timeline.time(); } } else { QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent); } - fixupDuration = oldDuration; + fixupMode = Normal; } void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, @@ -1255,6 +1257,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m { Q_Q(QDeclarativeListView); + data.fixingUp = false; moveReason = Mouse; if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) { correctFlick = true; diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index cceeb63..e326136 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1104,7 +1104,7 @@ void tst_QDeclarativeListView::sectionsDelegate() model.modifyItem(9, "Two", "aaa"); model.modifyItem(10, "Two", "aaa"); model.modifyItem(11, "Two", "aaa"); - QTest::qWait(100); + QTRY_COMPARE(findItems(contentItem, "sect_aaa").count(), 1); canvas->rootObject()->setProperty("sectionProperty", "name"); // ensure view has settled. QTRY_COMPARE(findItems(contentItem, "sect_Four").count(), 1); @@ -1115,6 +1115,28 @@ void tst_QDeclarativeListView::sectionsDelegate() QTRY_COMPARE(item->y(), qreal(i*20*4)); } + // QTBUG-17769 + model.removeItems(10, 20); + // ensure view has settled. + QTRY_COMPARE(findItems(contentItem, "wrapper").count(), 10); + // Drag view up beyond bounds + QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,20))); + { + QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,0)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); + QApplication::sendEvent(canvas->viewport(), &mv); + } + { + QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-50)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); + QApplication::sendEvent(canvas->viewport(), &mv); + } + { + QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-200)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); + QApplication::sendEvent(canvas->viewport(), &mv); + } + QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,-200))); + // view should settle back at 0 + QTRY_COMPARE(listview->contentY(), 0.0); + delete canvas; } @@ -2445,7 +2467,7 @@ QList tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QSt //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QDeclarativeItem *item = qobject_cast(parent->childItems().at(i)); - if(!item) + if(!item || !item->isVisible()) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) -- cgit v0.12 From 0db888489e613ca5c5c57c46e1043e1823fcd0d8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 28 Feb 2011 12:01:26 +0200 Subject: Fix openvg compilation on win32. Changed a system include to local one. Reviewed-by: Jason Barron --- src/openvg/qvgfontglyphcache_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h index 9a105ec..ce12301 100644 --- a/src/openvg/qvgfontglyphcache_p.h +++ b/src/openvg/qvgfontglyphcache_p.h @@ -56,7 +56,7 @@ #include #include -#include +#include "qvg_p.h" QT_BEGIN_NAMESPACE -- cgit v0.12 From 2e80c16854c97aafff229828a5dbf4b0e31d245f Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 28 Feb 2011 13:11:27 +0100 Subject: Fix Mac synthesized italic fonts clipping issue for QGLWidget Backport 43d5a0757d857c2a6694ae81d6b70c04ef876aff from 4.8. Task-number: QTBUG-16954 Reviewed-by: Eskil --- src/gui/text/qfontengine_mac.mm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 1c21f91..42b9402 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -59,6 +59,8 @@ QT_BEGIN_NAMESPACE +static float SYNTHETIC_ITALIC_SKEW = tanf(14 * acosf(0) / 90); + /***************************************************************************** QFontEngine debug facilities *****************************************************************************/ @@ -467,6 +469,9 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) glyph_metrics_t ret; CGGlyph g = glyph; CGRect rect = CTFontGetBoundingRectsForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, 0, 1); + if (synthesisFlags & QFontEngine::SynthesizedItalic) { + rect.size.width += rect.size.height * SYNTHETIC_ITALIC_SKEW; + } ret.width = QFixed::fromReal(rect.size.width); ret.height = QFixed::fromReal(rect.size.height); ret.x = QFixed::fromReal(rect.origin.x); @@ -558,7 +563,7 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt CGAffineTransformConcat(cgMatrix, oldTextMatrix); if (synthesisFlags & QFontEngine::SynthesizedItalic) - cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0)); + cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0)); cgMatrix = CGAffineTransformConcat(cgMatrix, transform); @@ -646,7 +651,7 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position cgMatrix = CGAffineTransformScale(cgMatrix, 1, -1); if (synthesisFlags & QFontEngine::SynthesizedItalic) - cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0)); + cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0)); for (int i = 0; i < nGlyphs; ++i) { @@ -681,7 +686,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, int margin, bool aa) CGAffineTransformConcat(cgMatrix, oldTextMatrix); if (synthesisFlags & QFontEngine::SynthesizedItalic) - cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0)); + cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, SYNTHETIC_ITALIC_SKEW, 1, 0, 0)); cgMatrix = CGAffineTransformConcat(cgMatrix, transform); @@ -1625,7 +1630,7 @@ QImage QFontEngineMac::imageForGlyph(glyph_t glyph, int margin, bool colorful) CGAffineTransformConcat(cgMatrix, oldTextMatrix); if (synthesisFlags & QFontEngine::SynthesizedItalic) - cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0)); + cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, SYNTHETIC_ITALIC_SKEW, 1, 0, 0)); cgMatrix = CGAffineTransformConcat(cgMatrix, transform); @@ -1718,7 +1723,7 @@ void QFontEngineMac::draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt CGAffineTransformConcat(cgMatrix, oldTextMatrix); if (synthesisFlags & QFontEngine::SynthesizedItalic) - cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0)); + cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0)); cgMatrix = CGAffineTransformConcat(cgMatrix, transform); -- cgit v0.12 From c9832df940516d14ce98031b284a3c87d80aaa80 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 1 Mar 2011 08:27:17 +1000 Subject: Fix FolderListModel test - set folder to one containing files. Change-Id: I95aabd35c3a33b603aa3b11130ddea5f5c101ce9 Task-number: QTBUG-17775 --- .../qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp index 6028333..ffd5d38 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp @@ -133,6 +133,9 @@ void tst_qdeclarativefolderlistmodel::refresh() QAbstractListModel *flm = qobject_cast(component.create()); QVERIFY(flm != 0); + flm->setProperty("folder",QUrl::fromLocalFile(SRCDIR "/data")); + QTRY_COMPARE(flm->property("count").toInt(),2); // wait for refresh + int count = flm->rowCount(); connect(flm, SIGNAL(rowsRemoved(const QModelIndex&,int,int)), -- cgit v0.12