summaryrefslogtreecommitdiffstats
path: root/doc/namespace.n
Commit message (Expand)AuthorAgeFilesLines
* merge 8.4dgp2011-03-141-1/+1
|\
| * whitespace tidydgp2011-03-141-1/+1
* | Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-3/+1
|\ \ | |/
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| * Corrected example that confused [namespace which] and [namespace origin]dgp2005-05-121-2/+2
| * Yet more doc update backportingdkf2004-10-271-92/+137
* | [Bug 2921538]: Updated example to not be quite so ancient.dkf2009-12-271-3/+7
* | * doc/namespace.n: fix [Bug 2098441]Miguel Sofer2008-09-071-2/+2
* | Minor tidying up. [Bug 1909019]dkf2008-03-061-22/+24
* | merge stable branch onto HEADdgp2007-12-131-1/+1
* | * doc/namespace.n: Documentation for zero-argument form ofdgp2007-12-061-3/+19
* | Eliminate misuse of .brdkf2007-10-301-4/+11
* | Typo [Bug 1811621]dkf2007-10-301-3/+2
* | Next stage of doing GOOBE improvements to documentation now that the html gen...dkf2007-10-291-13/+13
* | * doc/apply.n: fixed example [Bug 1811791]Miguel Sofer2007-10-271-2/+2
* | * changes: Updated for 8.5b2 release.core_8_5_b2dgp2007-10-261-11/+10
* | Lots of improvements to look and feel of manual pagesdkf2007-10-241-10/+11
* | bugfix, docs clarification and new tests for 'namespace upvar' [Bug 1546833]Miguel Sofer2006-08-261-3/+6
* | TIP#181 IMPLEMENTATIONdgp2006-02-011-1/+12
* | TIP#250 IMPLEMENTATIONdgp2006-02-011-2/+9
* | TIP#229 implementationdkf2005-05-301-5/+31
* | Corrected example that confused [namespace which] and [namespace origin]dgp2005-05-121-2/+2
* | More minor doc fixesdkf2004-10-271-88/+88
* | Grammar and spelling fixes. [Patch 1018486]dkf2004-08-311-15/+15
* | Added some more examples; there are actually examples scattered through the f...dkf2004-05-211-12/+39
* | fixed typos in documentation and commentsvincentdarley2004-03-091-2/+2
* | removed 'the the' typosvincentdarley2004-02-281-2/+2
* | TIP#112 ([namespace ensemble] command) implementation.dkf2003-09-291-5/+171
* | Added example section "SCOPED SCRIPTS", supplied by Kevin Kenny.jenglish2003-04-151-2/+26
|/
* Clarified documentation of [namespace inscope] [SF Patch #670110]jenglish2003-01-211-13/+12
* added description of [namepace forget] behaviour for unqualified patterns [Bu...Miguel Sofer2002-06-031-6/+11
* Corrected behaviour of [namespace code] (bug #219385, patch #403530)Miguel Sofer2001-04-071-2/+2
* * doc/namespace.n:hobbs2000-05-111-1/+6
* syntax cleanupcore_8_3_0hobbs2000-02-101-3/+3
* * generic/tclNamesp.c: Undid fix for #956, which broke backwardsericm2000-01-261-2/+5
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-27/+27
* Replaced SCCS strings, fixed binary filescore_8_0_3stanton1998-09-141-1/+1
* Initial revisionrjohnson1998-03-261-0/+563
hedFollow@@UBEPBUQMetaObject@@XZ @ 3850 NONAME ; struct QMetaObject const * QDeclarativeSmoothedFollow::metaObject(void) const + ?mouseMoveEvent@QDeclarativeTextInput@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 3851 NONAME ; void QDeclarativeTextInput::mouseMoveEvent(class QGraphicsSceneMouseEvent *) + ?moveCursorSelection@QDeclarativeTextInput@@QAEXH@Z @ 3852 NONAME ; void QDeclarativeTextInput::moveCursorSelection(int) + ?passwordCharacter@QDeclarativeTextInput@@QBE?AVQString@@XZ @ 3853 NONAME ; class QString QDeclarativeTextInput::passwordCharacter(void) const + ?passwordCharacterChanged@QDeclarativeTextInput@@IAEXXZ @ 3854 NONAME ; void QDeclarativeTextInput::passwordCharacterChanged(void) + ?pluginPathList@QDeclarativeEngine@@QBE?AVQStringList@@XZ @ 3855 NONAME ; class QStringList QDeclarativeEngine::pluginPathList(void) const + ?qt_metacall@QDeclarativeSmoothedFollow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3856 NONAME ; int QDeclarativeSmoothedFollow::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacast@QDeclarativeSmoothedFollow@@UAEPAXPBD@Z @ 3857 NONAME ; void * QDeclarativeSmoothedFollow::qt_metacast(char const *) + ?resetTarget@QDeclarativeDrag@@QAEXXZ @ 3858 NONAME ; void QDeclarativeDrag::resetTarget(void) + ?reversingMode@QDeclarativeSmoothedFollow@@QBE?AW4ReversingMode@1@XZ @ 3859 NONAME ; enum QDeclarativeSmoothedFollow::ReversingMode QDeclarativeSmoothedFollow::reversingMode(void) const + ?reversingModeChanged@QDeclarativeSmoothedFollow@@IAEXXZ @ 3860 NONAME ; void QDeclarativeSmoothedFollow::reversingModeChanged(void) + ?setAutoScroll@QDeclarativeTextInput@@QAEX_N@Z @ 3861 NONAME ; void QDeclarativeTextInput::setAutoScroll(bool) + ?setDuration@QDeclarativeSmoothedFollow@@QAEXH@Z @ 3862 NONAME ; void QDeclarativeSmoothedFollow::setDuration(int) + ?setEnabled@QDeclarativeSmoothedFollow@@QAEX_N@Z @ 3863 NONAME ; void QDeclarativeSmoothedFollow::setEnabled(bool) + ?setHighlightMoveDuration@QDeclarativeGridView@@QAEXH@Z @ 3864 NONAME ; void QDeclarativeGridView::setHighlightMoveDuration(int) + ?setHighlightMoveDuration@QDeclarativeListView@@QAEXH@Z @ 3865 NONAME ; void QDeclarativeListView::setHighlightMoveDuration(int) + ?setHighlightMoveDuration@QDeclarativePathView@@QAEXH@Z @ 3866 NONAME ; void QDeclarativePathView::setHighlightMoveDuration(int) + ?setHighlightResizeDuration@QDeclarativeListView@@QAEXH@Z @ 3867 NONAME ; void QDeclarativeListView::setHighlightResizeDuration(int) + ?setMaximumEasingTime@QDeclarativeSmoothedFollow@@QAEXH@Z @ 3868 NONAME ; void QDeclarativeSmoothedFollow::setMaximumEasingTime(int) + ?setPasswordCharacter@QDeclarativeTextInput@@QAEXABVQString@@@Z @ 3869 NONAME ; void QDeclarativeTextInput::setPasswordCharacter(class QString const &) + ?setPluginPathList@QDeclarativeEngine@@QAEXABVQStringList@@@Z @ 3870 NONAME ; void QDeclarativeEngine::setPluginPathList(class QStringList const &) + ?setReversingMode@QDeclarativeSmoothedFollow@@QAEXW4ReversingMode@1@@Z @ 3871 NONAME ; void QDeclarativeSmoothedFollow::setReversingMode(enum QDeclarativeSmoothedFollow::ReversingMode) + ?setSourceSize@QDeclarativeImageBase@@UAEXABVQSize@@@Z @ 3872 NONAME ; void QDeclarativeImageBase::setSourceSize(class QSize const &) + ?setTarget@QDeclarativeSmoothedFollow@@UAEXABVQDeclarativeProperty@@@Z @ 3873 NONAME ; void QDeclarativeSmoothedFollow::setTarget(class QDeclarativeProperty const &) + ?setTo@QDeclarativeSmoothedFollow@@QAEXM@Z @ 3874 NONAME ; void QDeclarativeSmoothedFollow::setTo(float) + ?setTo@QDeclarativeSpringFollow@@QAEXM@Z @ 3875 NONAME ; void QDeclarativeSpringFollow::setTo(float) + ?setVelocity@QDeclarativeSmoothedFollow@@QAEXM@Z @ 3876 NONAME ; void QDeclarativeSmoothedFollow::setVelocity(float) + ?setWrapMode@QDeclarativeText@@QAEXW4WrapMode@1@@Z @ 3877 NONAME ; void QDeclarativeText::setWrapMode(enum QDeclarativeText::WrapMode) + ?setWrapMode@QDeclarativeTextEdit@@QAEXW4WrapMode@1@@Z @ 3878 NONAME ; void QDeclarativeTextEdit::setWrapMode(enum QDeclarativeTextEdit::WrapMode) + ?sourceSizeChanged@QDeclarativeAnimatedImage@@IAEXXZ @ 3879 NONAME ; void QDeclarativeAnimatedImage::sourceSizeChanged(void) + ?to@QDeclarativeSmoothedFollow@@QBEMXZ @ 3880 NONAME ; float QDeclarativeSmoothedFollow::to(void) const + ?to@QDeclarativeSpringFollow@@QBEMXZ @ 3881 NONAME ; float QDeclarativeSpringFollow::to(void) const + ?tr@QDeclarativeCompiler@@AAE?AVQString@@PBD@Z @ 3882 NONAME ; class QString QDeclarativeCompiler::tr(char const *) + ?tr@QDeclarativeSmoothedFollow@@SA?AVQString@@PBD0@Z @ 3883 NONAME ; class QString QDeclarativeSmoothedFollow::tr(char const *, char const *) + ?tr@QDeclarativeSmoothedFollow@@SA?AVQString@@PBD0H@Z @ 3884 NONAME ; class QString QDeclarativeSmoothedFollow::tr(char const *, char const *, int) + ?trUtf8@QDeclarativeSmoothedFollow@@SA?AVQString@@PBD0@Z @ 3885 NONAME ; class QString QDeclarativeSmoothedFollow::trUtf8(char const *, char const *) + ?trUtf8@QDeclarativeSmoothedFollow@@SA?AVQString@@PBD0H@Z @ 3886 NONAME ; class QString QDeclarativeSmoothedFollow::trUtf8(char const *, char const *, int) + ?velocity@QDeclarativeSmoothedFollow@@QBEMXZ @ 3887 NONAME ; float QDeclarativeSmoothedFollow::velocity(void) const + ?velocityChanged@QDeclarativeSmoothedFollow@@IAEXXZ @ 3888 NONAME ; void QDeclarativeSmoothedFollow::velocityChanged(void) + ?wrapMode@QDeclarativeText@@QBE?AW4WrapMode@1@XZ @ 3889 NONAME ; enum QDeclarativeText::WrapMode QDeclarativeText::wrapMode(void) const + ?wrapMode@QDeclarativeTextEdit@@QBE?AW4WrapMode@1@XZ @ 3890 NONAME ; enum QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode(void) const + ?wrapModeChanged@QDeclarativeText@@IAEXXZ @ 3891 NONAME ; void QDeclarativeText::wrapModeChanged(void) + ?wrapModeChanged@QDeclarativeTextEdit@@IAEXXZ @ 3892 NONAME ; void QDeclarativeTextEdit::wrapModeChanged(void) + ?xToPosition@QDeclarativeTextInput@@QAEHH@Z @ 3893 NONAME ; int QDeclarativeTextInput::xToPosition(int) + ?staticMetaObject@QDeclarativeSmoothedFollow@@2UQMetaObject@@B @ 3894 NONAME ; struct QMetaObject const QDeclarativeSmoothedFollow::staticMetaObject diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 1c33477..c34690e 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12724,7 +12724,7 @@ EXPORTS ?visibilityChanged@QToolBar@@IAEX_N@Z @ 12723 NONAME ; void QToolBar::visibilityChanged(bool) ??0FileInfo@QZipReader@@QAE@ABU01@@Z @ 12724 NONAME ; QZipReader::FileInfo::FileInfo(struct QZipReader::FileInfo const &) ??0QStaticText@@QAE@ABVQString@@@Z @ 12725 NONAME ; QStaticText::QStaticText(class QString const &) - ?append@QGraphicsItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@PAVQGraphicsObject@@@Z @ 12726 NONAME ; void QGraphicsItemPrivate::append(class QDeclarativeListProperty *, class QGraphicsObject *) + ?append@QGraphicsItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@PAVQGraphicsObject@@@Z @ 12726 NONAME ABSENT ; void QGraphicsItemPrivate::append(class QDeclarativeListProperty *, class QGraphicsObject *) ?bitPlaneCount@QImage@@QBEHXZ @ 12727 NONAME ; int QImage::bitPlaneCount(void) const ?childrenChanged@QGraphicsObject@@IAEXXZ @ 12728 NONAME ; void QGraphicsObject::childrenChanged(void) ?childrenList@QGraphicsItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQGraphicsObject@@@@XZ @ 12729 NONAME ; class QDeclarativeListProperty QGraphicsItemPrivate::childrenList(void) @@ -12767,4 +12767,7 @@ EXPORTS ?updateMicroFocus@QGraphicsObject@@IAEXXZ @ 12766 NONAME ; void QGraphicsObject::updateMicroFocus(void) ?width@QGraphicsItemPrivate@@UBEMXZ @ 12767 NONAME ; float QGraphicsItemPrivate::width(void) const ?widthChanged@QGraphicsObject@@IAEXXZ @ 12768 NONAME ; void QGraphicsObject::widthChanged(void) + ?children_append@QGraphicsItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@PAVQGraphicsObject@@@Z @ 12769 NONAME ; void QGraphicsItemPrivate::children_append(class QDeclarativeListProperty *, class QGraphicsObject *) + ?children_at@QGraphicsItemPrivate@@SAPAVQGraphicsObject@@PAV?$QDeclarativeListProperty@VQGraphicsObject@@@@H@Z @ 12770 NONAME ; class QGraphicsObject * QGraphicsItemPrivate::children_at(class QDeclarativeListProperty *, int) + ?children_count@QGraphicsItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@@Z @ 12771 NONAME ; int QGraphicsItemPrivate::children_count(class QDeclarativeListProperty *) diff --git a/src/s60installs/bwins/QtMultimediau.def b/src/s60installs/bwins/QtMultimediau.def index 6c98fdf..ad33993 100644 --- a/src/s60installs/bwins/QtMultimediau.def +++ b/src/s60installs/bwins/QtMultimediau.def @@ -946,4 +946,6 @@ EXPORTS ?volume@QSoundEffect@@QBEHXZ @ 945 NONAME ; int QSoundEffect::volume(void) const ?volumeChanged@QSoundEffect@@IAEXXZ @ 946 NONAME ; void QSoundEffect::volumeChanged(void) ?staticMetaObject@QSoundEffect@@2UQMetaObject@@B @ 947 NONAME ; struct QMetaObject const QSoundEffect::staticMetaObject + ?event@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 948 NONAME ; bool QGraphicsVideoItem::event(class QEvent *) + ?sceneEvent@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 949 NONAME ; bool QGraphicsVideoItem::sceneEvent(class QEvent *) diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index 79fd0ce..e54e03f 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -803,9 +803,9 @@ EXPORTS _ZN16QCoreApplicationD0Ev @ 802 NONAME _ZN16QCoreApplicationD1Ev @ 803 NONAME _ZN16QCoreApplicationD2Ev @ 804 NONAME - _ZN16QDeclarativeDataD0Ev @ 805 NONAME - _ZN16QDeclarativeDataD1Ev @ 806 NONAME - _ZN16QDeclarativeDataD2Ev @ 807 NONAME + _ZN16QDeclarativeDataD0Ev @ 805 NONAME ABSENT + _ZN16QDeclarativeDataD1Ev @ 806 NONAME ABSENT + _ZN16QDeclarativeDataD2Ev @ 807 NONAME ABSENT _ZN16QEventTransition11qt_metacallEN11QMetaObject4CallEiPPv @ 808 NONAME _ZN16QEventTransition11qt_metacastEPKc @ 809 NONAME _ZN16QEventTransition12onTransitionEP6QEvent @ 810 NONAME @@ -3332,7 +3332,7 @@ EXPORTS _ZTI15QPauseAnimation @ 3331 NONAME _ZTI15QSocketNotifier @ 3332 NONAME _ZTI16QCoreApplication @ 3333 NONAME - _ZTI16QDeclarativeData @ 3334 NONAME + _ZTI16QDeclarativeData @ 3334 NONAME ABSENT _ZTI16QEventTransition @ 3335 NONAME _ZTI16QIODevicePrivate @ 3336 NONAME _ZTI16QTextCodecPlugin @ 3337 NONAME @@ -3407,7 +3407,7 @@ EXPORTS _ZTV15QPauseAnimation @ 3406 NONAME _ZTV15QSocketNotifier @ 3407 NONAME _ZTV16QCoreApplication @ 3408 NONAME - _ZTV16QDeclarativeData @ 3409 NONAME + _ZTV16QDeclarativeData @ 3409 NONAME ABSENT _ZTV16QEventTransition @ 3410 NONAME _ZTV16QIODevicePrivate @ 3411 NONAME _ZTV16QTextCodecPlugin @ 3412 NONAME @@ -3692,4 +3692,7 @@ EXPORTS _ZN9QDateTime18setMSecsSinceEpochEx @ 3691 NONAME _ZN9QDateTime19fromMSecsSinceEpochEx @ 3692 NONAME _ZNK9QDateTime17toMSecsSinceEpochEv @ 3693 NONAME + _ZN10QTextCodec11validCodecsEv @ 3694 NONAME + _ZN16QDeclarativeData13parentChangedE @ 3695 NONAME DATA 4 + _ZN16QDeclarativeData9destroyedE @ 3696 NONAME DATA 4 diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def index 17a57d0..0f0e886 100644 --- a/src/s60installs/eabi/QtDeclarativeu.def +++ b/src/s60installs/eabi/QtDeclarativeu.def @@ -179,7 +179,7 @@ EXPORTS _ZN16QDeclarativeText11qt_metacallEN11QMetaObject4CallEiPPv @ 178 NONAME _ZN16QDeclarativeText11qt_metacastEPKc @ 179 NONAME _ZN16QDeclarativeText11textChangedERK7QString @ 180 NONAME - _ZN16QDeclarativeText11wrapChangedEb @ 181 NONAME + _ZN16QDeclarativeText11wrapChangedEb @ 181 NONAME ABSENT _ZN16QDeclarativeText12colorChangedERK6QColor @ 182 NONAME _ZN16QDeclarativeText12setElideModeENS_13TextElideModeE @ 183 NONAME _ZN16QDeclarativeText12styleChangedENS_9TextStyleE @ 184 NONAME @@ -337,7 +337,7 @@ EXPORTS _ZN18QDeclarativeEngine11qt_metacastEPKc @ 336 NONAME _ZN18QDeclarativeEngine11rootContextEv @ 337 NONAME _ZN18QDeclarativeEngine13addImportPathERK7QString @ 338 NONAME - _ZN18QDeclarativeEngine15importExtensionERK7QStringS2_ @ 339 NONAME + _ZN18QDeclarativeEngine15importExtensionERK7QStringS2_ @ 339 NONAME ABSENT _ZN18QDeclarativeEngine15objectOwnershipEP7QObject @ 340 NONAME _ZN18QDeclarativeEngine16addImageProviderERK7QStringP25QDeclarativeImageProvider @ 341 NONAME _ZN18QDeclarativeEngine16contextForObjectEPK7QObject @ 342 NONAME @@ -897,7 +897,7 @@ EXPORTS _ZN20QDeclarativeTextEdit11qt_metacastEPKc @ 896 NONAME _ZN20QDeclarativeTextEdit11setReadOnlyEb @ 897 NONAME _ZN20QDeclarativeTextEdit11textChangedERK7QString @ 898 NONAME - _ZN20QDeclarativeTextEdit11wrapChangedEb @ 899 NONAME + _ZN20QDeclarativeTextEdit11wrapChangedEb @ 899 NONAME ABSENT _ZN20QDeclarativeTextEdit12colorChangedERK6QColor @ 900 NONAME _ZN20QDeclarativeTextEdit12drawContentsEP8QPainterRK5QRect @ 901 NONAME _ZN20QDeclarativeTextEdit13keyPressEventEP9QKeyEvent @ 902 NONAME @@ -1234,7 +1234,7 @@ EXPORTS _ZN21QDeclarativeTextInput24selectedTextColorChangedERK6QColor @ 1233 NONAME _ZN21QDeclarativeTextInput26horizontalAlignmentChangedENS_10HAlignmentE @ 1234 NONAME _ZN21QDeclarativeTextInput5eventEP6QEvent @ 1235 NONAME - _ZN21QDeclarativeTextInput6xToPosEi @ 1236 NONAME + _ZN21QDeclarativeTextInput6xToPosEi @ 1236 NONAME ABSENT _ZN21QDeclarativeTextInput7setFontERK5QFont @ 1237 NONAME _ZN21QDeclarativeTextInput7setTextERK7QString @ 1238 NONAME _ZN21QDeclarativeTextInput8acceptedEv @ 1239 NONAME @@ -1652,7 +1652,7 @@ EXPORTS _ZN24QDeclarativeSpringFollow11syncChangedEv @ 1651 NONAME _ZN24QDeclarativeSpringFollow12valueChangedEf @ 1652 NONAME _ZN24QDeclarativeSpringFollow14modulusChangedEv @ 1653 NONAME - _ZN24QDeclarativeSpringFollow14setSourceValueEf @ 1654 NONAME + _ZN24QDeclarativeSpringFollow14setSourceValueEf @ 1654 NONAME ABSENT _ZN24QDeclarativeSpringFollow16staticMetaObjectE @ 1655 NONAME DATA 16 _ZN24QDeclarativeSpringFollow19getStaticMetaObjectEv @ 1656 NONAME _ZN24QDeclarativeSpringFollow7setMassEf @ 1657 NONAME @@ -2130,19 +2130,19 @@ EXPORTS _ZN34QDeclarativeDebugPropertyReferenceC2ERKS_ @ 2129 NONAME _ZN34QDeclarativeDebugPropertyReferenceC2Ev @ 2130 NONAME _ZN34QDeclarativeDebugPropertyReferenceaSERKS_ @ 2131 NONAME - _ZN35QDeclarativeGraphicsObjectContainer10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 2132 NONAME - _ZN35QDeclarativeGraphicsObjectContainer11eventFilterEP7QObjectP6QEvent @ 2133 NONAME - _ZN35QDeclarativeGraphicsObjectContainer11qt_metacallEN11QMetaObject4CallEiPPv @ 2134 NONAME - _ZN35QDeclarativeGraphicsObjectContainer11qt_metacastEPKc @ 2135 NONAME - _ZN35QDeclarativeGraphicsObjectContainer16staticMetaObjectE @ 2136 NONAME DATA 16 - _ZN35QDeclarativeGraphicsObjectContainer17setGraphicsObjectEP15QGraphicsObject @ 2137 NONAME - _ZN35QDeclarativeGraphicsObjectContainer19getStaticMetaObjectEv @ 2138 NONAME - _ZN35QDeclarativeGraphicsObjectContainer23setSynchronizedResizingEb @ 2139 NONAME - _ZN35QDeclarativeGraphicsObjectContainerC1EP16QDeclarativeItem @ 2140 NONAME - _ZN35QDeclarativeGraphicsObjectContainerC2EP16QDeclarativeItem @ 2141 NONAME - _ZN35QDeclarativeGraphicsObjectContainerD0Ev @ 2142 NONAME - _ZN35QDeclarativeGraphicsObjectContainerD1Ev @ 2143 NONAME - _ZN35QDeclarativeGraphicsObjectContainerD2Ev @ 2144 NONAME + _ZN35QDeclarativeGraphicsObjectContainer10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 2132 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer11eventFilterEP7QObjectP6QEvent @ 2133 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer11qt_metacallEN11QMetaObject4CallEiPPv @ 2134 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer11qt_metacastEPKc @ 2135 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer16staticMetaObjectE @ 2136 NONAME DATA 16 ABSENT + _ZN35QDeclarativeGraphicsObjectContainer17setGraphicsObjectEP15QGraphicsObject @ 2137 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer19getStaticMetaObjectEv @ 2138 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainer23setSynchronizedResizingEb @ 2139 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainerC1EP16QDeclarativeItem @ 2140 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainerC2EP16QDeclarativeItem @ 2141 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainerD0Ev @ 2142 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainerD1Ev @ 2143 NONAME ABSENT + _ZN35QDeclarativeGraphicsObjectContainerD2Ev @ 2144 NONAME ABSENT _ZN36QDeclarativeDomValueValueInterceptorC1ERKS_ @ 2145 NONAME _ZN36QDeclarativeDomValueValueInterceptorC1Ev @ 2146 NONAME _ZN36QDeclarativeDomValueValueInterceptorC2ERKS_ @ 2147 NONAME @@ -2765,7 +2765,7 @@ EXPORTS _ZNK24QDeclarativeScriptString6scriptEv @ 2764 NONAME _ZNK24QDeclarativeScriptString7contextEv @ 2765 NONAME _ZNK24QDeclarativeSpringFollow10metaObjectEv @ 2766 NONAME - _ZNK24QDeclarativeSpringFollow11sourceValueEv @ 2767 NONAME + _ZNK24QDeclarativeSpringFollow11sourceValueEv @ 2767 NONAME ABSENT _ZNK24QDeclarativeSpringFollow4massEv @ 2768 NONAME _ZNK24QDeclarativeSpringFollow5valueEv @ 2769 NONAME _ZNK24QDeclarativeSpringFollow6inSyncEv @ 2770 NONAME @@ -2933,9 +2933,9 @@ EXPORTS _ZNK34QDeclarativeDebugPropertyReference4nameEv @ 2932 NONAME _ZNK34QDeclarativeDebugPropertyReference5valueEv @ 2933 NONAME _ZNK34QDeclarativeDebugPropertyReference7bindingEv @ 2934 NONAME - _ZNK35QDeclarativeGraphicsObjectContainer10metaObjectEv @ 2935 NONAME - _ZNK35QDeclarativeGraphicsObjectContainer14graphicsObjectEv @ 2936 NONAME - _ZNK35QDeclarativeGraphicsObjectContainer20synchronizedResizingEv @ 2937 NONAME + _ZNK35QDeclarativeGraphicsObjectContainer10metaObjectEv @ 2935 NONAME ABSENT + _ZNK35QDeclarativeGraphicsObjectContainer14graphicsObjectEv @ 2936 NONAME ABSENT + _ZNK35QDeclarativeGraphicsObjectContainer20synchronizedResizingEv @ 2937 NONAME ABSENT _ZNK36QDeclarativeDomValueValueInterceptor6objectEv @ 2938 NONAME _ZNK38QDeclarativeDebugObjectExpressionWatch10expressionEv @ 2939 NONAME _ZNK38QDeclarativeDebugObjectExpressionWatch10metaObjectEv @ 2940 NONAME @@ -3039,7 +3039,7 @@ EXPORTS _ZTI31QDeclarativePropertyValueSource @ 3038 NONAME _ZTI32QDeclarativeDebugExpressionQuery @ 3039 NONAME _ZTI33QDeclarativeDebugRootContextQuery @ 3040 NONAME - _ZTI35QDeclarativeGraphicsObjectContainer @ 3041 NONAME + _ZTI35QDeclarativeGraphicsObjectContainer @ 3041 NONAME ABSENT _ZTI36QDeclarativePropertyValueInterceptor @ 3042 NONAME _ZTI38QDeclarativeDebugObjectExpressionWatch @ 3043 NONAME _ZTI39QDeclarativeNetworkAccessManagerFactory @ 3044 NONAME @@ -3142,7 +3142,7 @@ EXPORTS _ZTV31QDeclarativePropertyValueSource @ 3141 NONAME _ZTV32QDeclarativeDebugExpressionQuery @ 3142 NONAME _ZTV33QDeclarativeDebugRootContextQuery @ 3143 NONAME - _ZTV35QDeclarativeGraphicsObjectContainer @ 3144 NONAME + _ZTV35QDeclarativeGraphicsObjectContainer @ 3144 NONAME ABSENT _ZTV36QDeclarativePropertyValueInterceptor @ 3145 NONAME _ZTV38QDeclarativeDebugObjectExpressionWatch @ 3146 NONAME _ZTV39QDeclarativeNetworkAccessManagerFactory @ 3147 NONAME @@ -3198,8 +3198,8 @@ EXPORTS _ZThn16_N26QDeclarativeBasePositioner17componentCompleteEv @ 3197 NONAME _ZThn16_N26QDeclarativeBasePositionerD0Ev @ 3198 NONAME _ZThn16_N26QDeclarativeBasePositionerD1Ev @ 3199 NONAME - _ZThn16_N35QDeclarativeGraphicsObjectContainerD0Ev @ 3200 NONAME - _ZThn16_N35QDeclarativeGraphicsObjectContainerD1Ev @ 3201 NONAME + _ZThn16_N35QDeclarativeGraphicsObjectContainerD0Ev @ 3200 NONAME ABSENT + _ZThn16_N35QDeclarativeGraphicsObjectContainerD1Ev @ 3201 NONAME ABSENT _ZThn8_N16QDeclarativeBind17componentCompleteEv @ 3202 NONAME _ZThn8_N16QDeclarativeBindD0Ev @ 3203 NONAME _ZThn8_N16QDeclarativeBindD1Ev @ 3204 NONAME @@ -3351,9 +3351,9 @@ EXPORTS _ZThn8_N29QDeclarativeStateChangeScript7executeEv @ 3350 NONAME _ZThn8_N29QDeclarativeStateChangeScriptD0Ev @ 3351 NONAME _ZThn8_N29QDeclarativeStateChangeScriptD1Ev @ 3352 NONAME - _ZThn8_N35QDeclarativeGraphicsObjectContainer10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3353 NONAME - _ZThn8_N35QDeclarativeGraphicsObjectContainerD0Ev @ 3354 NONAME - _ZThn8_N35QDeclarativeGraphicsObjectContainerD1Ev @ 3355 NONAME + _ZThn8_N35QDeclarativeGraphicsObjectContainer10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3353 NONAME ABSENT + _ZThn8_N35QDeclarativeGraphicsObjectContainerD0Ev @ 3354 NONAME ABSENT + _ZThn8_N35QDeclarativeGraphicsObjectContainerD1Ev @ 3355 NONAME ABSENT _ZThn8_NK16QDeclarativeItem12boundingRectEv @ 3356 NONAME _ZThn8_NK16QDeclarativeItem16inputMethodQueryEN2Qt16InputMethodQueryE @ 3357 NONAME _ZThn8_NK19QDeclarativeBinding10expressionEv @ 3358 NONAME @@ -3394,4 +3394,81 @@ EXPORTS _ZNK18QDeclarativeParser7Variant8asScriptEv @ 3393 NONAME _ZNK18QDeclarativeParser7Variant8asStringEv @ 3394 NONAME _ZNK18QDeclarativeParser7Variant9asBooleanEv @ 3395 NONAME + _ZN16QDeclarativeDrag11resetTargetEv @ 3396 NONAME + _ZN16QDeclarativeText11setWrapModeENS_8WrapModeE @ 3397 NONAME + _ZN16QDeclarativeText15wrapModeChangedEv @ 3398 NONAME + _ZN18QDeclarativeActionC1EP7QObjectRK7QStringP19QDeclarativeContextRK8QVariant @ 3399 NONAME + _ZN18QDeclarativeActionC2EP7QObjectRK7QStringP19QDeclarativeContextRK8QVariant @ 3400 NONAME + _ZN18QDeclarativeEngine12importPluginERK7QStringS2_ @ 3401 NONAME + _ZN18QDeclarativeEngine13addPluginPathERK7QString @ 3402 NONAME + _ZN18QDeclarativeEngine17setPluginPathListERK11QStringList @ 3403 NONAME + _ZN20QDeclarativeCompiler2trEPKc @ 3404 NONAME + _ZN20QDeclarativeGridView24setHighlightMoveDurationEi @ 3405 NONAME + _ZN20QDeclarativeGridView28highlightMoveDurationChangedEv @ 3406 NONAME + _ZN20QDeclarativeListView24setHighlightMoveDurationEi @ 3407 NONAME + _ZN20QDeclarativeListView26setHighlightResizeDurationEi @ 3408 NONAME + _ZN20QDeclarativeListView28highlightMoveDurationChangedEv @ 3409 NONAME + _ZN20QDeclarativeListView30highlightResizeDurationChangedEv @ 3410 NONAME + _ZN20QDeclarativePathView24setHighlightMoveDurationEi @ 3411 NONAME + _ZN20QDeclarativePathView28highlightMoveDurationChangedEv @ 3412 NONAME + _ZN20QDeclarativeTextEdit11setWrapModeENS_8WrapModeE @ 3413 NONAME + _ZN20QDeclarativeTextEdit15wrapModeChangedEv @ 3414 NONAME + _ZN21QDeclarativeTextInput11xToPositionEi @ 3415 NONAME + _ZN21QDeclarativeTextInput13setAutoScrollEb @ 3416 NONAME + _ZN21QDeclarativeTextInput14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 3417 NONAME + _ZN21QDeclarativeTextInput17autoScrollChangedEb @ 3418 NONAME + _ZN21QDeclarativeTextInput18displayTextChangedERK7QString @ 3419 NONAME + _ZN21QDeclarativeTextInput19moveCursorSelectionEi @ 3420 NONAME + _ZN21QDeclarativeTextInput20setPasswordCharacterERK7QString @ 3421 NONAME + _ZN21QDeclarativeTextInput24passwordCharacterChangedEv @ 3422 NONAME + _ZN24QDeclarativeSpringFollow5setToEf @ 3423 NONAME + _ZN25QDeclarativeAnimatedImage17sourceSizeChangedEv @ 3424 NONAME + _ZN26QDeclarativeSmoothedFollow10setEnabledEb @ 3425 NONAME + _ZN26QDeclarativeSmoothedFollow11qt_metacallEN11QMetaObject4CallEiPPv @ 3426 NONAME + _ZN26QDeclarativeSmoothedFollow11qt_metacastEPKc @ 3427 NONAME + _ZN26QDeclarativeSmoothedFollow11setDurationEi @ 3428 NONAME + _ZN26QDeclarativeSmoothedFollow11setVelocityEf @ 3429 NONAME + _ZN26QDeclarativeSmoothedFollow14enabledChangedEv @ 3430 NONAME + _ZN26QDeclarativeSmoothedFollow15durationChangedEv @ 3431 NONAME + _ZN26QDeclarativeSmoothedFollow15velocityChangedEv @ 3432 NONAME + _ZN26QDeclarativeSmoothedFollow16setReversingModeENS_13ReversingModeE @ 3433 NONAME + _ZN26QDeclarativeSmoothedFollow16staticMetaObjectE @ 3434 NONAME DATA 16 + _ZN26QDeclarativeSmoothedFollow19getStaticMetaObjectEv @ 3435 NONAME + _ZN26QDeclarativeSmoothedFollow20reversingModeChangedEv @ 3436 NONAME + _ZN26QDeclarativeSmoothedFollow20setMaximumEasingTimeEi @ 3437 NONAME + _ZN26QDeclarativeSmoothedFollow24maximumEasingTimeChangedEv @ 3438 NONAME + _ZN26QDeclarativeSmoothedFollow5setToEf @ 3439 NONAME + _ZN26QDeclarativeSmoothedFollow9setTargetERK20QDeclarativeProperty @ 3440 NONAME + _ZN26QDeclarativeSmoothedFollowC1EP7QObject @ 3441 NONAME + _ZN26QDeclarativeSmoothedFollowC2EP7QObject @ 3442 NONAME + _ZN26QDeclarativeSmoothedFollowD0Ev @ 3443 NONAME + _ZN26QDeclarativeSmoothedFollowD1Ev @ 3444 NONAME + _ZN26QDeclarativeSmoothedFollowD2Ev @ 3445 NONAME + _ZNK16QDeclarativeText8wrapModeEv @ 3446 NONAME + _ZNK16QDeclarativeType10createSizeEv @ 3447 NONAME + _ZNK16QDeclarativeType14createFunctionEv @ 3448 NONAME + _ZNK16QDeclarativeType14isExtendedTypeEv @ 3449 NONAME + _ZNK18QDeclarativeEngine14pluginPathListEv @ 3450 NONAME + _ZNK20QDeclarativeGridView21highlightMoveDurationEv @ 3451 NONAME + _ZNK20QDeclarativeListView21highlightMoveDurationEv @ 3452 NONAME + _ZNK20QDeclarativeListView23highlightResizeDurationEv @ 3453 NONAME + _ZNK20QDeclarativePathView21highlightMoveDurationEv @ 3454 NONAME + _ZNK20QDeclarativeTextEdit8wrapModeEv @ 3455 NONAME + _ZNK21QDeclarativeTextInput10autoScrollEv @ 3456 NONAME + _ZNK21QDeclarativeTextInput11displayTextEv @ 3457 NONAME + _ZNK21QDeclarativeTextInput17passwordCharacterEv @ 3458 NONAME + _ZNK24QDeclarativeSpringFollow2toEv @ 3459 NONAME + _ZNK26QDeclarativeSmoothedFollow10metaObjectEv @ 3460 NONAME + _ZNK26QDeclarativeSmoothedFollow13reversingModeEv @ 3461 NONAME + _ZNK26QDeclarativeSmoothedFollow17maximumEasingTimeEv @ 3462 NONAME + _ZNK26QDeclarativeSmoothedFollow2toEv @ 3463 NONAME + _ZNK26QDeclarativeSmoothedFollow7enabledEv @ 3464 NONAME + _ZNK26QDeclarativeSmoothedFollow8durationEv @ 3465 NONAME + _ZNK26QDeclarativeSmoothedFollow8velocityEv @ 3466 NONAME + _ZTI26QDeclarativeSmoothedFollow @ 3467 NONAME + _ZTV26QDeclarativeSmoothedFollow @ 3468 NONAME + _ZThn8_N21QDeclarativeTextInput14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 3469 NONAME + _ZThn8_N26QDeclarativeSmoothedFollow9setTargetERK20QDeclarativeProperty @ 3470 NONAME + _ZThn8_N26QDeclarativeSmoothedFollowD0Ev @ 3471 NONAME + _ZThn8_N26QDeclarativeSmoothedFollowD1Ev @ 3472 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 59e63ea..353603e 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -11943,7 +11943,7 @@ EXPORTS _ZN20QGraphicsItemPrivate14setFocusHelperEN2Qt11FocusReasonEbb @ 11942 NONAME _ZN20QGraphicsItemPrivate16clearFocusHelperEb @ 11943 NONAME _ZN20QGraphicsItemPrivate24prependGraphicsTransformEP18QGraphicsTransform @ 11944 NONAME - _ZN20QGraphicsItemPrivate6appendEP24QDeclarativeListPropertyI15QGraphicsObjectEPS1_ @ 11945 NONAME + _ZN20QGraphicsItemPrivate6appendEP24QDeclarativeListPropertyI15QGraphicsObjectEPS1_ @ 11945 NONAME ABSENT _ZN20QGraphicsItemPrivate8setWidthEf @ 11946 NONAME _ZN20QGraphicsItemPrivate9setHeightEf @ 11947 NONAME _ZN7QWizard11pageRemovedEi @ 11948 NONAME @@ -11970,4 +11970,7 @@ EXPORTS _ZNK12QPaintBuffer15frameStartIndexEi @ 11969 NONAME _ZNK12QPaintBuffer15processCommandsEP8QPainterii @ 11970 NONAME _ZNK12QPaintBuffer18commandDescriptionEi @ 11971 NONAME + _ZN20QGraphicsItemPrivate11children_atEP24QDeclarativeListPropertyI15QGraphicsObjectEi @ 11972 NONAME + _ZN20QGraphicsItemPrivate14children_countEP24QDeclarativeListPropertyI15QGraphicsObjectE @ 11973 NONAME + _ZN20QGraphicsItemPrivate15children_appendEP24QDeclarativeListPropertyI15QGraphicsObjectEPS1_ @ 11974 NONAME diff --git a/src/s60installs/eabi/QtMultimediau.def b/src/s60installs/eabi/QtMultimediau.def index 384796d..64a6dc6 100644 --- a/src/s60installs/eabi/QtMultimediau.def +++ b/src/s60installs/eabi/QtMultimediau.def @@ -972,4 +972,7 @@ EXPORTS _ZNK12QSoundEffect7isMutedEv @ 971 NONAME _ZTI12QSoundEffect @ 972 NONAME _ZTV12QSoundEffect @ 973 NONAME + _ZN18QGraphicsVideoItem10sceneEventEP6QEvent @ 974 NONAME + _ZN18QGraphicsVideoItem5eventEP6QEvent @ 975 NONAME + _ZThn8_N18QGraphicsVideoItem10sceneEventEP6QEvent @ 976 NONAME -- cgit v0.12 From 1d267f33d179abbac753a72c2235e7fb07c4def7 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 15 Apr 2010 20:31:07 +1000 Subject: Revert "Update Phonon ds9 backend to 4.4.0." This reverts commit 19a3fc3bd817628070e5637caf158b0be79eee82. The phonon backend in 4.4.0 is outdated. Qt has the most recent one. Conflicts: src/3rdparty/phonon/ds9/iodevicereader.cpp (cherry picked from commit 6253ced81bcd60c04803f1a52bc59a239022b9c4) Conflicts: src/3rdparty/phonon/ds9/mediaobject.cpp --- src/3rdparty/phonon/ds9/abstractvideorenderer.cpp | 4 +- src/3rdparty/phonon/ds9/backend.cpp | 14 +- src/3rdparty/phonon/ds9/backend.h | 4 + src/3rdparty/phonon/ds9/backendnode.cpp | 19 ++ src/3rdparty/phonon/ds9/ds9.desktop | 17 +- src/3rdparty/phonon/ds9/effect.cpp | 4 +- src/3rdparty/phonon/ds9/fakesource.cpp | 34 +--- src/3rdparty/phonon/ds9/iodevicereader.cpp | 94 +++------- src/3rdparty/phonon/ds9/iodevicereader.h | 1 - src/3rdparty/phonon/ds9/mediagraph.cpp | 38 ++-- src/3rdparty/phonon/ds9/mediaobject.cpp | 205 +++++++++------------ src/3rdparty/phonon/ds9/mediaobject.h | 8 +- src/3rdparty/phonon/ds9/qasyncreader.cpp | 72 +++----- src/3rdparty/phonon/ds9/qasyncreader.h | 6 +- src/3rdparty/phonon/ds9/qaudiocdreader.cpp | 54 ++---- src/3rdparty/phonon/ds9/qaudiocdreader.h | 2 +- src/3rdparty/phonon/ds9/qbasefilter.cpp | 33 ++-- src/3rdparty/phonon/ds9/qbasefilter.h | 4 +- src/3rdparty/phonon/ds9/qevr9.h | 143 ++++++++++++++ src/3rdparty/phonon/ds9/qmeminputpin.cpp | 113 ++++-------- src/3rdparty/phonon/ds9/qmeminputpin.h | 9 +- src/3rdparty/phonon/ds9/qpin.cpp | 73 +++----- src/3rdparty/phonon/ds9/qpin.h | 7 +- src/3rdparty/phonon/ds9/videorenderer_default.cpp | 153 +++++++++++++++ src/3rdparty/phonon/ds9/videorenderer_default.h | 55 ++++++ src/3rdparty/phonon/ds9/videorenderer_evr.cpp | 215 ++++++++++++++++++++++ src/3rdparty/phonon/ds9/videorenderer_evr.h | 56 ++++++ src/3rdparty/phonon/ds9/videorenderer_soft.cpp | 15 +- src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp | 113 +----------- src/3rdparty/phonon/ds9/videorenderer_vmr9.h | 1 - src/3rdparty/phonon/ds9/videowidget.cpp | 50 ++++- src/3rdparty/phonon/ds9/volumeeffect.cpp | 5 +- src/3rdparty/phonon/ds9/volumeeffect.h | 2 +- src/plugins/phonon/ds9/ds9.pro | 2 + 34 files changed, 1001 insertions(+), 624 deletions(-) create mode 100644 src/3rdparty/phonon/ds9/qevr9.h create mode 100644 src/3rdparty/phonon/ds9/videorenderer_default.cpp create mode 100644 src/3rdparty/phonon/ds9/videorenderer_default.h create mode 100644 src/3rdparty/phonon/ds9/videorenderer_evr.cpp create mode 100644 src/3rdparty/phonon/ds9/videorenderer_evr.h diff --git a/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp b/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp index e932e70..a9d0694 100644 --- a/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp +++ b/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp @@ -99,8 +99,8 @@ namespace Phonon m_dstX = m_dstY = 0; if (ratio > 0) { - if (realWidth / realHeight > ratio && scaleMode == Phonon::VideoWidget::FitInView - || realWidth / realHeight < ratio && scaleMode == Phonon::VideoWidget::ScaleAndCrop) { + if ((realWidth / realHeight > ratio && scaleMode == Phonon::VideoWidget::FitInView) + || (realWidth / realHeight < ratio && scaleMode == Phonon::VideoWidget::ScaleAndCrop)) { //the height is correct, let's change the width m_dstWidth = qRound(realHeight * ratio); m_dstX = qRound((realWidth - realHeight * ratio) / 2.); diff --git a/src/3rdparty/phonon/ds9/backend.cpp b/src/3rdparty/phonon/ds9/backend.cpp index 2c56af7..fbc4bdc 100644 --- a/src/3rdparty/phonon/ds9/backend.cpp +++ b/src/3rdparty/phonon/ds9/backend.cpp @@ -41,6 +41,8 @@ namespace Phonon { namespace DS9 { + QMutex *Backend::directShowMutex = 0; + bool Backend::AudioMoniker::operator==(const AudioMoniker &other) { return other->IsEqual(*this) == S_OK; @@ -50,6 +52,8 @@ namespace Phonon Backend::Backend(QObject *parent, const QVariantList &) : QObject(parent) { + directShowMutex = &m_directShowMutex; + ::CoInitialize(0); //registering meta types @@ -62,6 +66,8 @@ namespace Phonon m_audioOutputs.clear(); m_audioEffects.clear(); ::CoUninitialize(); + + directShowMutex = 0; } QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList &args) @@ -131,6 +137,7 @@ namespace Phonon QList Backend::objectDescriptionIndexes(Phonon::ObjectDescriptionType type) const { + QMutexLocker locker(&m_directShowMutex); QList ret; switch(type) @@ -157,7 +164,7 @@ namespace Phonon while (S_OK == enumMon->Next(1, mon.pparam(), 0)) { LPOLESTR str = 0; mon->GetDisplayName(0,0,&str); - const QString name = QString::fromUtf16((unsigned short*)str); + const QString name = QString::fromWCharArray(str); ComPointer alloc; ::CoGetMalloc(1, alloc.pparam()); alloc->Free(str); @@ -204,6 +211,7 @@ namespace Phonon QHash Backend::objectDescriptionProperties(Phonon::ObjectDescriptionType type, int index) const { + QMutexLocker locker(&m_directShowMutex); QHash ret; switch (type) { @@ -216,7 +224,7 @@ namespace Phonon LPOLESTR str = 0; HRESULT hr = mon->GetDisplayName(0,0, &str); if (SUCCEEDED(hr)) { - QString name = QString::fromUtf16((unsigned short*)str); + QString name = QString::fromWCharArray(str); ComPointer alloc; ::CoGetMalloc(1, alloc.pparam()); alloc->Free(str); @@ -231,7 +239,7 @@ namespace Phonon WCHAR name[80]; // 80 is clearly stated in the MSDN doc HRESULT hr = ::DMOGetName(m_audioEffects[index], name); if (SUCCEEDED(hr)) { - ret["name"] = QString::fromUtf16((unsigned short*)name); + ret["name"] = QString::fromWCharArray(name); } } break; diff --git a/src/3rdparty/phonon/ds9/backend.h b/src/3rdparty/phonon/ds9/backend.h index ad638f2..7c3c109 100644 --- a/src/3rdparty/phonon/ds9/backend.h +++ b/src/3rdparty/phonon/ds9/backend.h @@ -23,6 +23,7 @@ along with this library. If not, see . #include #include +#include #include "compointer.h" #include "backendnode.h" @@ -63,6 +64,8 @@ namespace Phonon Filter getAudioOutputFilter(int index) const; + static QMutex *directShowMutex; + Q_SIGNALS: void objectDescriptionChanged(ObjectDescriptionType); @@ -74,6 +77,7 @@ namespace Phonon }; mutable QVector m_audioOutputs; mutable QVector m_audioEffects; + mutable QMutex m_directShowMutex; }; } } diff --git a/src/3rdparty/phonon/ds9/backendnode.cpp b/src/3rdparty/phonon/ds9/backendnode.cpp index 7e0b3cd..737ab7b 100644 --- a/src/3rdparty/phonon/ds9/backendnode.cpp +++ b/src/3rdparty/phonon/ds9/backendnode.cpp @@ -57,6 +57,25 @@ namespace Phonon BackendNode::~BackendNode() { + //this will remove the filter from the graph + FILTER_INFO info; + for(int i = 0; i < FILTER_COUNT; ++i) { + const Filter &filter = m_filters[i]; + if (!filter) + continue; + filter->QueryFilterInfo(&info); + if (info.pGraph) { + HRESULT hr = info.pGraph->RemoveFilter(filter); + + if (FAILED(hr) && m_mediaObject) { + m_mediaObject->ensureStopped(); + + hr = info.pGraph->RemoveFilter(filter); + } + Q_ASSERT(SUCCEEDED(hr)); + info.pGraph->Release(); + } + } } void BackendNode::setMediaObject(MediaObject *mo) diff --git a/src/3rdparty/phonon/ds9/ds9.desktop b/src/3rdparty/phonon/ds9/ds9.desktop index 1bc3451..764390e 100644 --- a/src/3rdparty/phonon/ds9/ds9.desktop +++ b/src/3rdparty/phonon/ds9/ds9.desktop @@ -5,13 +5,12 @@ MimeType=application/x-annodex;video/quicktime;video/x-quicktime;audio/x-m4a;app X-KDE-Library=phonon_ds9 X-KDE-PhononBackendInfo-InterfaceVersion=1 X-KDE-PhononBackendInfo-Version=0.1 -X-KDE-PhononBackendInfo-Website=http://www.trolltech.com/ +X-KDE-PhononBackendInfo-Website=http://qt.nokia.com/ InitialPreference=15 Name=DirectShow9 Name[bg]=DirectShow9 Name[ca]=DirectShow9 -Name[ca@valencia]=DirectShow9 Name[cs]=DirectShow9 Name[da]=DirectShow9 Name[de]=DirectShow9 @@ -20,14 +19,11 @@ Name[en_GB]=DirectShow9 Name[es]=DirectShow9 Name[et]=DirectShow9 Name[eu]=DirectShow9 -Name[fi]=DirectShow9 Name[fr]=DirectShow9 Name[ga]=DirectShow9 Name[gl]=DirectShow9 -Name[hr]=DirectShow9 Name[hsb]=DirectShow9 Name[hu]=DirectShow9 -Name[id]=DirectShow9 Name[is]=DirectShow9 Name[it]=DirectShow9 Name[ja]=DirectShow9 @@ -35,7 +31,6 @@ Name[ko]=DirectShow9 Name[ku]=DirectShow9 Name[lt]=DirectShow9 Name[lv]=DirectShow9 -Name[nb]=DirectShow9 Name[nds]=DirectShow9 Name[nl]=DirectShow9 Name[nn]=DirectShow9 @@ -43,13 +38,10 @@ Name[pa]=ਡਾਇਰੈਕਸ਼ੋ9 Name[pl]=DirectShow9 Name[pt]=DirectShow9 Name[pt_BR]=DirectShow9 -Name[ru]=DirectShow9 Name[se]=DirectShow9 Name[sk]=DirectShow 9 Name[sl]=DirectShow 9 Name[sr]=Директшоу‑9 -Name[sr@ijekavian]=Директшоу‑9 -Name[sr@ijekavianlatin]=DirectShow‑9 Name[sr@latin]=DirectShow‑9 Name[sv]=Directshow 9 Name[tr]=DirectShow9 @@ -61,7 +53,6 @@ Name[zh_TW]=DirectShow9 Comment=Phonon DirectShow9 backend Comment[bg]=Phonon DirectShow9 Comment[ca]=Dorsal DirectShow9 del Phonon -Comment[ca@valencia]=Dorsal DirectShow9 del Phonon Comment[cs]=Phonon DirectShow9 backend Comment[da]=DirectShow9-backend til Phonon Comment[de]=Phonon-Treiber für DirectShow9 @@ -70,13 +61,11 @@ Comment[en_GB]=Phonon DirectShow9 backend Comment[es]=Motor DirectShow9 para Phonon Comment[et]=Phononi DirectShow9 taustaprogramm Comment[eu]=Phonon DirectShow9 backend -Comment[fi]=Phonon DirectShow9-taustaohjelma Comment[fr]=Système de gestion DirectShow9 pour Phonon Comment[ga]=Inneall DirectShow9 le haghaidh Phonon Comment[gl]=Infraestrutura de DirectShow9 para Phonon Comment[hsb]=Phonon DirectShow9 backend Comment[hu]=Phonon DirectShow9 modul -Comment[id]=Phonon DirectShow9 backend Comment[is]=Phonon DirectShow9 bakendi Comment[it]=Motore DirectShow9 di Phonon Comment[ja]=Phonon DirectShow9 ãƒãƒƒã‚¯ã‚¨ãƒ³ãƒ‰ @@ -84,7 +73,6 @@ Comment[ko]=Phonon DirectShow9 백엔드 Comment[ku]=Binesaza Phonon DirectShow9 Comment[lt]=Phonon DirectShow9 galinÄ— sÄ…saja Comment[lv]=Phonon DirectShow9 aizmugure -Comment[nb]=Phonon-motor for DirectShow9 Comment[nds]=Phonon-Hülpprogrmm DirectShow9 Comment[nl]=DirectShow9-backend (Phonon) Comment[nn]=Phonon-motor for DirectShow9 @@ -92,13 +80,10 @@ Comment[pa]=ਫੋਨੋਨ ਡਾਇਰੈਕਟਸ਼ੋ9 ਬੈਕà¨à¨‚ਡ Comment[pl]=ObsÅ‚uga DirectShow9 przez Phonon Comment[pt]=Infra-estrutura do DirectShow9 para o Phonon Comment[pt_BR]=Infraestrutura Phonon DirectShow9 -Comment[ru]=Механизм DirectShow9 Ð´Ð»Ñ Phonon Comment[se]=Phonon DirectShow9 duogášmohtor Comment[sk]=Phonon DirectShow 9 podsystém Comment[sl]=Phononova Hrbtenica DirectShow 9 Comment[sr]=Директшоу‑9 као позадина Фонона -Comment[sr@ijekavian]=Директшоу‑9 као позадина Фонона -Comment[sr@ijekavianlatin]=DirectShow‑9 kao pozadina Phonona Comment[sr@latin]=DirectShow‑9 kao pozadina Phonona Comment[sv]=Phonon Directshow 9-gränssnitt Comment[tr]=Phonon DirectShow9 arka ucu diff --git a/src/3rdparty/phonon/ds9/effect.cpp b/src/3rdparty/phonon/ds9/effect.cpp index 104a3c1..ebe976b 100644 --- a/src/3rdparty/phonon/ds9/effect.cpp +++ b/src/3rdparty/phonon/ds9/effect.cpp @@ -82,7 +82,7 @@ namespace Phonon current += wcslen(current) + 1; //skip the name current += wcslen(current) + 1; //skip the unit for(; *current; current += wcslen(current) + 1) { - values.append( QString::fromUtf16((unsigned short*)current) ); + values.append( QString::fromWCharArray(current) ); } } //FALLTHROUGH @@ -107,7 +107,7 @@ namespace Phonon Phonon::EffectParameter::Hints hint = info.mopCaps == MP_CAPS_CURVE_INVSQUARE ? Phonon::EffectParameter::LogarithmicHint : Phonon::EffectParameter::Hints(0); - const QString n = QString::fromUtf16((unsigned short*)name); + const QString n = QString::fromWCharArray(name); ret.append(Phonon::EffectParameter(i, n, hint, def, min, max, values)); ::CoTaskMemFree(name); //let's free the memory } diff --git a/src/3rdparty/phonon/ds9/fakesource.cpp b/src/3rdparty/phonon/ds9/fakesource.cpp index 9a61a2e..4dce138 100644 --- a/src/3rdparty/phonon/ds9/fakesource.cpp +++ b/src/3rdparty/phonon/ds9/fakesource.cpp @@ -29,8 +29,10 @@ namespace Phonon namespace DS9 { static WAVEFORMATEX g_defaultWaveFormat = {WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0}; - static BITMAPINFOHEADER g_defautBitmapHeader = { sizeof(BITMAPINFOHEADER), 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}; - static VIDEOINFOHEADER2 g_defaultVideoInfo = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + static VIDEOINFOHEADER2 g_defaultVideoInfo = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, {0}, 0, {sizeof(BITMAPINFOHEADER), 1, 1, 1, 0, 0, 0, 0, 0, 0, 0} }; + + static const AM_MEDIA_TYPE g_fakeAudioType = {MEDIATYPE_Audio, MEDIASUBTYPE_PCM, 0, 0, 2, FORMAT_WaveFormatEx, 0, sizeof(WAVEFORMATEX), reinterpret_cast(&g_defaultWaveFormat)}; + static const AM_MEDIA_TYPE g_fakeVideoType = {MEDIATYPE_Video, MEDIASUBTYPE_RGB32, TRUE, FALSE, 0, FORMAT_VideoInfo2, 0, sizeof(VIDEOINFOHEADER2), reinterpret_cast(&g_defaultVideoInfo)}; class FakePin : public QPin { @@ -128,36 +130,12 @@ namespace Phonon void FakeSource::createFakeAudioPin() { - AM_MEDIA_TYPE mt; - qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Audio; - mt.subtype = MEDIASUBTYPE_PCM; - mt.formattype = FORMAT_WaveFormatEx; - mt.lSampleSize = 2; - - //fake the format (stereo 44.1 khz stereo 16 bits) - mt.cbFormat = sizeof(WAVEFORMATEX); - mt.pbFormat = reinterpret_cast(&g_defaultWaveFormat); - - new FakePin(this, mt); + new FakePin(this, g_fakeAudioType); } void FakeSource::createFakeVideoPin() { - AM_MEDIA_TYPE mt; - qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Video; - mt.subtype = MEDIASUBTYPE_RGB32; - mt.formattype = FORMAT_VideoInfo2; - mt.bFixedSizeSamples = 1; - - g_defaultVideoInfo.bmiHeader = g_defautBitmapHeader; - - //fake the format - mt.cbFormat = sizeof(VIDEOINFOHEADER2); - mt.pbFormat = reinterpret_cast(&g_defaultVideoInfo); - - new FakePin(this, mt); + new FakePin(this, g_fakeVideoType); } } diff --git a/src/3rdparty/phonon/ds9/iodevicereader.cpp b/src/3rdparty/phonon/ds9/iodevicereader.cpp index 9152712..ba4ae5c 100644 --- a/src/3rdparty/phonon/ds9/iodevicereader.cpp +++ b/src/3rdparty/phonon/ds9/iodevicereader.cpp @@ -36,18 +36,20 @@ namespace Phonon //these mediatypes define a stream, its type will be autodetected by DirectShow static QVector getMediaTypes() { - AM_MEDIA_TYPE mt = { MEDIATYPE_Stream, MEDIASUBTYPE_NULL, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; + //the order here is important because otherwise, + //directshow might not be able to detect the stream type correctly + + AM_MEDIA_TYPE mt = { MEDIATYPE_Stream, MEDIASUBTYPE_Avi, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; QVector ret; - //normal auto-detect stream - mt.subtype = MEDIASUBTYPE_NULL; - ret << mt; //AVI stream - mt.subtype = MEDIASUBTYPE_Avi; ret << mt; //WAVE stream mt.subtype = MEDIASUBTYPE_WAVE; ret << mt; + //normal auto-detect stream (must be at the end!) + mt.subtype = MEDIASUBTYPE_NULL; + ret << mt; return ret; } @@ -64,7 +66,6 @@ namespace Phonon //for Phonon::StreamInterface void writeData(const QByteArray &data) { - QWriteLocker locker(&m_lock); m_pos += data.size(); m_buffer += data; } @@ -75,54 +76,22 @@ namespace Phonon void setStreamSize(qint64 newSize) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_size = newSize; } - qint64 streamSize() const - { - QReadLocker locker(&m_lock); - return m_size; - } - void setStreamSeekable(bool s) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_seekable = s; } - bool streamSeekable() const - { - QReadLocker locker(&m_lock); - return m_seekable; - } - - void setCurrentPos(qint64 pos) - { - QWriteLocker locker(&m_lock); - m_pos = pos; - seekStream(pos); - m_buffer.clear(); - } - - qint64 currentPos() const - { - QReadLocker locker(&m_lock); - return m_pos; - } - - int currentBufferSize() const - { - QReadLocker locker(&m_lock); - return m_buffer.size(); - } - //virtual pure members //implementation from IAsyncReader STDMETHODIMP Length(LONGLONG *total, LONGLONG *available) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (total) { *total = m_size; } @@ -137,37 +106,39 @@ namespace Phonon HRESULT read(LONGLONG pos, LONG length, BYTE *buffer, LONG *actual) { - QMutexLocker locker(&m_mutexRead); + Q_ASSERT(!m_mutex.tryLock()); + if (m_mediaGraph->isStopping()) { + return VFW_E_WRONG_STATE; + } - if(streamSize() != 1 && pos + length > streamSize()) { + if(m_size != 1 && pos + length > m_size) { //it tries to read outside of the boundaries return E_FAIL; } - if (currentPos() - currentBufferSize() != pos) { - if (!streamSeekable()) { + if (m_pos - m_buffer.size() != pos) { + if (!m_seekable) { return S_FALSE; } - setCurrentPos(pos); + m_pos = pos; + seekStream(pos); + m_buffer.clear(); } - int oldSize = currentBufferSize(); - while (currentBufferSize() < int(length)) { + int oldSize = m_buffer.size(); + while (m_buffer.size() < int(length)) { needData(); - if (oldSize == currentBufferSize()) { + if (oldSize == m_buffer.size()) { break; //we didn't get any data } - oldSize = currentBufferSize(); + oldSize = m_buffer.size(); } - DWORD bytesRead = qMin(currentBufferSize(), int(length)); - { - QWriteLocker locker(&m_lock); - qMemCopy(buffer, m_buffer.data(), bytesRead); - //truncate the buffer - m_buffer = m_buffer.mid(bytesRead); - } + int bytesRead = qMin(m_buffer.size(), int(length)); + qMemCopy(buffer, m_buffer.data(), bytesRead); + //truncate the buffer + m_buffer = m_buffer.mid(bytesRead); if (actual) { *actual = bytesRead; //initialization @@ -183,7 +154,6 @@ namespace Phonon qint64 m_pos; qint64 m_size; - QMutex m_mutexRead; const MediaGraph *m_mediaGraph; }; @@ -197,14 +167,6 @@ namespace Phonon IODeviceReader::~IODeviceReader() { } - - STDMETHODIMP IODeviceReader::Stop() - { - HRESULT hr = QBaseFilter::Stop(); - m_streamReader->enoughData(); //this asks to cancel any blocked call to needData - return hr; - } - } } diff --git a/src/3rdparty/phonon/ds9/iodevicereader.h b/src/3rdparty/phonon/ds9/iodevicereader.h index af4b271..c8b91c3 100644 --- a/src/3rdparty/phonon/ds9/iodevicereader.h +++ b/src/3rdparty/phonon/ds9/iodevicereader.h @@ -41,7 +41,6 @@ namespace Phonon public: IODeviceReader(const MediaSource &source, const MediaGraph *); ~IODeviceReader(); - STDMETHODIMP Stop(); private: StreamReader *m_streamReader; diff --git a/src/3rdparty/phonon/ds9/mediagraph.cpp b/src/3rdparty/phonon/ds9/mediagraph.cpp index db0ec84..3e7a68b 100644 --- a/src/3rdparty/phonon/ds9/mediagraph.cpp +++ b/src/3rdparty/phonon/ds9/mediagraph.cpp @@ -68,6 +68,8 @@ namespace Phonon return ret; } + +/* static HRESULT saveToFile(Graph graph, const QString &filepath) { const WCHAR wszStreamName[] = L"ActiveMovieGraph"; @@ -103,7 +105,7 @@ namespace Phonon return hr; } - +*/ MediaGraph::MediaGraph(MediaObject *mo, short index) : m_graph(CLSID_FilterGraph, IID_IGraphBuilder), @@ -377,11 +379,12 @@ namespace Phonon FILTER_INFO info; filter->QueryFilterInfo(&info); #ifdef GRAPH_DEBUG - qDebug() << "removeFilter" << QString::fromUtf16(info.achName); + qDebug() << "removeFilter" << QString((const QChar *)info.achName); #endif if (info.pGraph) { info.pGraph->Release(); - return m_graph->RemoveFilter(filter); + if (info.pGraph == m_graph) + return m_graph->RemoveFilter(filter); } //already removed @@ -537,11 +540,11 @@ namespace Phonon const QList outputs = BackendNode::pins(filter, PINDIR_OUTPUT); for(int i = 0; i < outputs.count(); ++i) { const OutputPin &pin = outputs.at(i); - if (VFW_E_NOT_CONNECTED == pin->ConnectedTo(inPin.pparam())) { + if (HRESULT(VFW_E_NOT_CONNECTED) == pin->ConnectedTo(inPin.pparam())) { return SUCCEEDED(pin->Connect(newIn, 0)); } } - //we should never go here + //we shoud never go here return false; } else { QAMMediaType type; @@ -679,7 +682,6 @@ namespace Phonon #ifndef QT_NO_PHONON_MEDIACONTROLLER } else if (source.discType() == Phonon::Cd) { m_realSource = Filter(new QAudioCDPlayer); - m_result = m_graph->AddFilter(m_realSource, 0); #endif //QT_NO_PHONON_MEDIACONTROLLER } else { @@ -809,7 +811,7 @@ namespace Phonon for (int i = 0; i < outputs.count(); ++i) { const OutputPin &out = outputs.at(i); InputPin pin; - if (out->ConnectedTo(pin.pparam()) == VFW_E_NOT_CONNECTED) { + if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) { m_decoderPins += out; //unconnected outputs can be decoded outputs } } @@ -820,7 +822,7 @@ namespace Phonon //let's reestablish the connections for (int i = 0; i < connections.count(); ++i) { const GraphConnection &connection = connections.at(i); - //check if we should transfer the sink node + //check if we shoud transfer the sink node grabFilter(connection.input); grabFilter(connection.output); @@ -873,7 +875,7 @@ namespace Phonon { FILTER_INFO info; filter->QueryFilterInfo(&info); - qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName); + qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName); if (info.pGraph) { info.pGraph->Release(); } @@ -919,7 +921,7 @@ namespace Phonon { FILTER_INFO info; filter->QueryFilterInfo(&info); - qDebug() << "found a decoder filter" << QString::fromUtf16(info.achName); + qDebug() << "found a decoder filter" << QString((const QChar *)info.achName); if (info.pGraph) { info.pGraph->Release(); } @@ -935,7 +937,7 @@ namespace Phonon { FILTER_INFO info; filter->QueryFilterInfo(&info); - qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName); + qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName); if (info.pGraph) { info.pGraph->Release(); } @@ -954,7 +956,7 @@ namespace Phonon { FILTER_INFO info; filter->QueryFilterInfo(&info); - qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName); + qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName); if (info.pGraph) { info.pGraph->Release(); } @@ -988,7 +990,7 @@ namespace Phonon { FILTER_INFO info; filter->QueryFilterInfo(&info); - qDebug() << "found a demuxer filter" << QString::fromUtf16(info.achName); + qDebug() << "found a demuxer filter" << QString((const QChar *)info.achName); if (info.pGraph) { info.pGraph->Release(); } @@ -1006,27 +1008,27 @@ namespace Phonon BSTR str; HRESULT hr = mediaContent->get_AuthorName(&str); if (SUCCEEDED(hr)) { - ret.insert(QLatin1String("ARTIST"), QString::fromUtf16((const unsigned short*)str)); + ret.insert(QLatin1String("ARTIST"), QString::fromWCharArray(str)); SysFreeString(str); } hr = mediaContent->get_Title(&str); if (SUCCEEDED(hr)) { - ret.insert(QLatin1String("TITLE"), QString::fromUtf16((const unsigned short*)str)); + ret.insert(QLatin1String("TITLE"), QString::fromWCharArray(str)); SysFreeString(str); } hr = mediaContent->get_Description(&str); if (SUCCEEDED(hr)) { - ret.insert(QLatin1String("DESCRIPTION"), QString::fromUtf16((const unsigned short*)str)); + ret.insert(QLatin1String("DESCRIPTION"), QString::fromWCharArray(str)); SysFreeString(str); } hr = mediaContent->get_Copyright(&str); if (SUCCEEDED(hr)) { - ret.insert(QLatin1String("COPYRIGHT"), QString::fromUtf16((const unsigned short*)str)); + ret.insert(QLatin1String("COPYRIGHT"), QString::fromWCharArray(str)); SysFreeString(str); } hr = mediaContent->get_MoreInfoText(&str); if (SUCCEEDED(hr)) { - ret.insert(QLatin1String("MOREINFO"), QString::fromUtf16((const unsigned short*)str)); + ret.insert(QLatin1String("MOREINFO"), QString::fromWCharArray(str)); SysFreeString(str); } } diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index b9a8713..34f92c2 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -23,13 +23,10 @@ along with this library. If not, see . #ifndef Q_CC_MSVC #include -#endif //Q_CC_MSVC +#endif #include #include #include -#ifdef Q_CC_MSVC -# include -#endif #include #include "mediaobject.h" @@ -52,7 +49,7 @@ namespace Phonon //first the definition of the WorkerThread class WorkerThread::WorkerThread() - : QThread(), m_currentRenderId(0), m_finished(false), m_currentWorkId(1) + : QThread(), m_finished(false), m_currentWorkId(1) { } @@ -60,24 +57,6 @@ namespace Phonon { } - WorkerThread::Work WorkerThread::dequeueWork() - { - QMutexLocker locker(&m_mutex); - if (m_finished) { - return Work(); - } - Work ret = m_queue.dequeue(); - - //we ensure to have the wait condition in the right state - if (m_queue.isEmpty()) { - m_waitCondition.reset(); - } else { - m_waitCondition.set(); - } - - return ret; - } - void WorkerThread::run() { while (m_finished == false) { @@ -91,11 +70,6 @@ namespace Phonon } DWORD result = ::WaitForMultipleObjects(count, handles, FALSE, INFINITE); if (result == WAIT_OBJECT_0) { - if (m_finished) { - //that's the end of the thread execution - return; - } - handleTask(); } else { //this is the event management @@ -183,6 +157,7 @@ namespace Phonon //we create a new graph w.graph = Graph(CLSID_FilterGraph, IID_IGraphBuilder); w.filter = filter; + w.graph->AddFilter(filter, 0); w.id = m_currentWorkId++; m_queue.enqueue(w); m_waitCondition.set(); @@ -202,23 +177,29 @@ namespace Phonon void WorkerThread::handleTask() { - const Work w = dequeueWork(); + QMutexLocker locker(Backend::directShowMutex); + { + QMutexLocker locker(&m_mutex); + if (m_finished || m_queue.isEmpty()) { + return; + } - if (m_finished) { - return; + m_currentWork = m_queue.dequeue(); + + //we ensure to have the wait condition in the right state + if (m_queue.isEmpty()) { + m_waitCondition.reset(); + } else { + m_waitCondition.set(); + } } HRESULT hr = S_OK; - m_currentRender = w.graph; - m_currentRenderId = w.id; - if (w.task == ReplaceGraph) { - QMutexLocker locker(&m_mutex); - HANDLE h; - + if (m_currentWork.task == ReplaceGraph) { int index = -1; for(int i = 0; i < FILTER_COUNT; ++i) { - if (m_graphHandle[i].graph == w.oldGraph) { + if (m_graphHandle[i].graph == m_currentWork.oldGraph) { m_graphHandle[i].graph = Graph(); index = i; break; @@ -231,51 +212,40 @@ namespace Phonon Q_ASSERT(index != -1); //add the new graph - if (SUCCEEDED(ComPointer(w.graph, IID_IMediaEvent) + HANDLE h; + if (SUCCEEDED(ComPointer(m_currentWork.graph, IID_IMediaEvent) ->GetEventHandle(reinterpret_cast(&h)))) { - m_graphHandle[index].graph = w.graph; + m_graphHandle[index].graph = m_currentWork.graph; m_graphHandle[index].handle = h; } - } else if (w.task == Render) { - if (w.filter) { + } else if (m_currentWork.task == Render) { + if (m_currentWork.filter) { //let's render pins - w.graph->AddFilter(w.filter, 0); - const QList outputs = BackendNode::pins(w.filter, PINDIR_OUTPUT); - for (int i = 0; i < outputs.count(); ++i) { - //blocking call - hr = w.graph->Render(outputs.at(i)); - if (FAILED(hr)) { - break; - } + const QList outputs = BackendNode::pins(m_currentWork.filter, PINDIR_OUTPUT); + for (int i = 0; SUCCEEDED(hr) && i < outputs.count(); ++i) { + hr = m_currentWork.graph->Render(outputs.at(i)); } - } else if (!w.url.isEmpty()) { + } else if (!m_currentWork.url.isEmpty()) { //let's render a url (blocking call) - hr = w.graph->RenderFile(reinterpret_cast(w.url.utf16()), 0); + hr = m_currentWork.graph->RenderFile(reinterpret_cast(m_currentWork.url.utf16()), 0); } if (hr != E_ABORT) { - emit asyncRenderFinished(w.id, hr, w.graph); + emit asyncRenderFinished(m_currentWork.id, hr, m_currentWork.graph); } - } else if (w.task == Seek) { + } else if (m_currentWork.task == Seek) { //that's a seekrequest - ComPointer mediaSeeking(w.graph, IID_IMediaSeeking); - qint64 newtime = w.time * 10000; + ComPointer mediaSeeking(m_currentWork.graph, IID_IMediaSeeking); + qint64 newtime = m_currentWork.time * 10000; hr = mediaSeeking->SetPositions(&newtime, AM_SEEKING_AbsolutePositioning, 0, AM_SEEKING_NoPositioning); - qint64 currentTime = -1; - if (SUCCEEDED(hr)) { - hr = mediaSeeking->GetCurrentPosition(¤tTime); - if (SUCCEEDED(hr)) { - currentTime /= 10000; //convert to ms - } - } - emit asyncSeekingFinished(w.id, currentTime); + emit asyncSeekingFinished(m_currentWork.id, newtime / 10000); hr = E_ABORT; //to avoid emitting asyncRenderFinished - } else if (w.task == ChangeState) { + } else if (m_currentWork.task == ChangeState) { //remove useless decoders QList unused; - for (int i = 0; i < w.decoders.count(); ++i) { - const Filter &filter = w.decoders.at(i); + for (int i = 0; i < m_currentWork.decoders.count(); ++i) { + const Filter &filter = m_currentWork.decoders.at(i); bool used = false; const QList pins = BackendNode::pins(filter, PINDIR_OUTPUT); for( int i = 0; i < pins.count(); ++i) { @@ -292,15 +262,15 @@ namespace Phonon //we can get the state for (int i = 0; i < unused.count(); ++i) { //we should remove this filter from the graph - w.graph->RemoveFilter(unused.at(i)); + m_currentWork.graph->RemoveFilter(unused.at(i)); } //we can get the state - ComPointer mc(w.graph, IID_IMediaControl); + ComPointer mc(m_currentWork.graph, IID_IMediaControl); //we change the state here - switch(w.state) + switch(m_currentWork.state) { case State_Stopped: mc->Stop(); @@ -318,36 +288,38 @@ namespace Phonon if (SUCCEEDED(hr)) { if (s == State_Stopped) { - emit stateReady(w.graph, Phonon::StoppedState); + emit stateReady(m_currentWork.graph, Phonon::StoppedState); } else if (s == State_Paused) { - emit stateReady(w.graph, Phonon::PausedState); + emit stateReady(m_currentWork.graph, Phonon::PausedState); } else /*if (s == State_Running)*/ { - emit stateReady(w.graph, Phonon::PlayingState); + emit stateReady(m_currentWork.graph, Phonon::PlayingState); } } } - m_currentRender = Graph(); - m_currentRenderId = 0; - + { + QMutexLocker locker(&m_mutex); + m_currentWork = Work(); //reinitialize + } } - void WorkerThread::abortCurrentRender(qint16 renderId) - { + void WorkerThread::abortCurrentRender(qint16 renderId) + { QMutexLocker locker(&m_mutex); + if (m_currentWork.id == renderId) { + m_currentWork.graph->Abort(); + } bool found = false; - //we try to see if there is already an attempt to seek and we remove it for(int i = 0; !found && i < m_queue.size(); ++i) { const Work &w = m_queue.at(i); if (w.id == renderId) { found = true; m_queue.removeAt(i); + if (m_queue.isEmpty()) { + m_waitCondition.reset(); + } } } - - if (m_currentRender && m_currentRenderId == renderId) { - m_currentRender->Abort(); - } } //tells the thread to stop processing @@ -355,9 +327,9 @@ namespace Phonon { QMutexLocker locker(&m_mutex); m_queue.clear(); - if (m_currentRender) { + if (m_currentWork.graph) { //in case we're currently rendering something - m_currentRender->Abort(); + m_currentWork.graph->Abort(); } @@ -389,17 +361,17 @@ namespace Phonon m_graphs[i] = new MediaGraph(this, i); } - connect(&m_thread, SIGNAL(stateReady(Graph, Phonon::State)), - SLOT(slotStateReady(Graph, Phonon::State))); + connect(&m_thread, SIGNAL(stateReady(Graph,Phonon::State)), + SLOT(slotStateReady(Graph,Phonon::State))); - connect(&m_thread, SIGNAL(eventReady(Graph, long, long)), - SLOT(handleEvents(Graph, long, long))); + connect(&m_thread, SIGNAL(eventReady(Graph,long,long)), + SLOT(handleEvents(Graph,long,long))); - connect(&m_thread, SIGNAL(asyncRenderFinished(quint16, HRESULT, Graph)), - SLOT(finishLoading(quint16, HRESULT, Graph))); + connect(&m_thread, SIGNAL(asyncRenderFinished(quint16,HRESULT,Graph)), + SLOT(finishLoading(quint16,HRESULT,Graph))); - connect(&m_thread, SIGNAL(asyncSeekingFinished(quint16, qint64)), - SLOT(finishSeeking(quint16, qint64))); + connect(&m_thread, SIGNAL(asyncSeekingFinished(quint16,qint64)), + SLOT(finishSeeking(quint16,qint64))); //really special case m_mediaObject = this; m_thread.start(); @@ -522,6 +494,18 @@ namespace Phonon qSwap(m_graphs[0], m_graphs[1]); //swap the graphs + if (m_transitionTime >= 0) + m_graphs[1]->stop(); //make sure we stop the previous graph + + if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid && + catchComError(currentGraph()->renderResult())) { + setState(Phonon::ErrorState); + return; + } + + //we need to play the next media + play(); + //we tell the video widgets to switch now to the new source #ifndef QT_NO_PHONON_VIDEO for (int i = 0; i < m_videoWidgets.count(); ++i) { @@ -530,15 +514,6 @@ namespace Phonon #endif //QT_NO_PHONON_VIDEO emit currentSourceChanged(currentGraph()->mediaSource()); - - if (currentGraph()->isLoading()) { - //will simply tell that when loading is finished - //it should start the playback - play(); - } - - - emit metaDataChanged(currentGraph()->metadata()); if (nextGraph()->hasVideo() != currentGraph()->hasVideo()) { @@ -551,15 +526,6 @@ namespace Phonon #ifndef QT_NO_PHONON_MEDIACONTROLLER setTitles(currentGraph()->titles()); #endif //QT_NO_PHONON_MEDIACONTROLLER - - //this manages only gapless transitions - if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid) { - if (catchComError(currentGraph()->renderResult())) { - setState(Phonon::ErrorState); - } else { - play(); - } - } } Phonon::State MediaObject::state() const @@ -794,15 +760,16 @@ namespace Phonon case Phonon::PausedState: pause(); break; - case Phonon::StoppedState: - stop(); - break; case Phonon::PlayingState: play(); break; case Phonon::ErrorState: setState(Phonon::ErrorState); break; + case Phonon::StoppedState: + default: + stop(); + break; } } } @@ -850,13 +817,11 @@ namespace Phonon #endif LPAMGETERRORTEXT getErrorText = (LPAMGETERRORTEXT)QLibrary::resolve(QLatin1String("quartz"), "AMGetErrorTextW"); - ushort buffer[MAX_ERROR_TEXT_LEN]; - if (getErrorText && getErrorText(hr, (WCHAR*)buffer, MAX_ERROR_TEXT_LEN)) { - m_errorString = QString::fromUtf16(buffer); -#ifdef Q_CC_MSVC + WCHAR buffer[MAX_ERROR_TEXT_LEN]; + if (getErrorText && getErrorText(hr, buffer, MAX_ERROR_TEXT_LEN)) { + m_errorString = QString::fromWCharArray(buffer); } else { - m_errorString = QString::fromUtf16((ushort*)_com_error(hr).ErrorMessage()); -#endif + m_errorString = QString::fromLatin1("Unknown error"); } const QString comError = QString::number(uint(hr), 16); if (!m_errorString.toLower().contains(comError.toLower())) { diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h index 2c34ffc..34aa666 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.h +++ b/src/3rdparty/phonon/ds9/mediaobject.h @@ -114,6 +114,7 @@ namespace Phonon enum Task { + None, Render, Seek, ChangeState, @@ -122,6 +123,7 @@ namespace Phonon struct Work { + Work() : task(None), id(0), time(0) { } Task task; quint16 id; Graph graph; @@ -135,16 +137,14 @@ namespace Phonon }; QList decoders; //for the state change requests }; - Work dequeueWork(); void handleTask(); - Graph m_currentRender; - qint16 m_currentRenderId; + Work m_currentWork; QQueue m_queue; bool m_finished; quint16 m_currentWorkId; QWinWaitCondition m_waitCondition; - QMutex m_mutex; + QMutex m_mutex; // mutex for the m_queue, m_finished and m_currentWorkId //this is for WaitForMultipleObjects struct diff --git a/src/3rdparty/phonon/ds9/qasyncreader.cpp b/src/3rdparty/phonon/ds9/qasyncreader.cpp index 68ec1f8..a3f9cda 100644 --- a/src/3rdparty/phonon/ds9/qasyncreader.cpp +++ b/src/3rdparty/phonon/ds9/qasyncreader.cpp @@ -15,8 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ -#include - #include "qasyncreader.h" #include "qbasefilter.h" @@ -80,8 +78,7 @@ namespace Phonon STDMETHODIMP QAsyncReader::Request(IMediaSample *sample,DWORD_PTR user) { - QMutexLocker mutexLocker(&m_mutexWait); - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (m_flushing) { return VFW_E_WRONG_STATE; } @@ -93,33 +90,28 @@ namespace Phonon STDMETHODIMP QAsyncReader::WaitForNext(DWORD timeout, IMediaSample **sample, DWORD_PTR *user) { - QMutexLocker locker(&m_mutexWait); + QMutexLocker locker(&m_mutex); if (!sample ||!user) { return E_POINTER; } + //msdn says to return immediately if we're flushing but that doesn't seem to be true + //since it triggers a dead-lock somewhere inside directshow (see task 258830) + *sample = 0; *user = 0; - AsyncRequest r = getNextRequest(); - - if (r.sample == 0) { - //there is no request in the queue - if (isFlushing()) { + if (m_requestQueue.isEmpty()) { + if (m_requestWait.wait(&m_mutex, timeout) == false) { + return VFW_E_TIMEOUT; + } + if (m_requestQueue.isEmpty()) { return VFW_E_WRONG_STATE; - } else { - //First we need to lock the mutex - if (m_requestWait.wait(&m_mutexWait, timeout) == false) { - return VFW_E_TIMEOUT; - } - if (isFlushing()) { - return VFW_E_WRONG_STATE; - } - - r = getNextRequest(); } } + AsyncRequest r = m_requestQueue.dequeue(); + //at this point we're sure to have a request to proceed if (r.sample == 0) { return E_FAIL; @@ -127,14 +119,12 @@ namespace Phonon *sample = r.sample; *user = r.user; - - return SyncReadAligned(r.sample); + return syncReadAlignedUnlocked(r.sample); } STDMETHODIMP QAsyncReader::BeginFlush() { - QMutexLocker mutexLocker(&m_mutexWait); - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_flushing = true; m_requestWait.wakeOne(); return S_OK; @@ -142,13 +132,28 @@ namespace Phonon STDMETHODIMP QAsyncReader::EndFlush() { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_flushing = false; return S_OK; } STDMETHODIMP QAsyncReader::SyncReadAligned(IMediaSample *sample) { + QMutexLocker locker(&m_mutex); + return syncReadAlignedUnlocked(sample); + } + + STDMETHODIMP QAsyncReader::SyncRead(LONGLONG pos, LONG length, BYTE *buffer) + { + QMutexLocker locker(&m_mutex); + return read(pos, length, buffer, 0); + } + + + STDMETHODIMP QAsyncReader::syncReadAlignedUnlocked(IMediaSample *sample) + { + Q_ASSERT(!m_mutex.tryLock()); + if (!sample) { return E_POINTER; } @@ -175,23 +180,6 @@ namespace Phonon return sample->SetActualDataLength(actual); } - STDMETHODIMP QAsyncReader::SyncRead(LONGLONG pos, LONG length, BYTE *buffer) - { - return read(pos, length, buffer, 0); - } - - - //addition - QAsyncReader::AsyncRequest QAsyncReader::getNextRequest() - { - QWriteLocker locker(&m_lock); - AsyncRequest ret; - if (!m_requestQueue.isEmpty()) { - ret = m_requestQueue.dequeue(); - } - - return ret; - } } } diff --git a/src/3rdparty/phonon/ds9/qasyncreader.h b/src/3rdparty/phonon/ds9/qasyncreader.h index cb789ee..95872f9 100644 --- a/src/3rdparty/phonon/ds9/qasyncreader.h +++ b/src/3rdparty/phonon/ds9/qasyncreader.h @@ -48,11 +48,12 @@ namespace Phonon STDMETHODIMP WaitForNext(DWORD,IMediaSample **,DWORD_PTR *); STDMETHODIMP SyncReadAligned(IMediaSample *); STDMETHODIMP SyncRead(LONGLONG,LONG,BYTE *); - virtual STDMETHODIMP Length(LONGLONG *,LONGLONG *) = 0; + STDMETHODIMP Length(LONGLONG *,LONGLONG *) = 0; STDMETHODIMP BeginFlush(); STDMETHODIMP EndFlush(); protected: + STDMETHODIMP syncReadAlignedUnlocked(IMediaSample *); virtual HRESULT read(LONGLONG pos, LONG length, BYTE *buffer, LONG *actual) = 0; private: @@ -62,9 +63,6 @@ namespace Phonon IMediaSample *sample; DWORD_PTR user; }; - AsyncRequest getNextRequest(); - - QMutex m_mutexWait; QQueue m_requestQueue; QWaitCondition m_requestWait; diff --git a/src/3rdparty/phonon/ds9/qaudiocdreader.cpp b/src/3rdparty/phonon/ds9/qaudiocdreader.cpp index b9f9fd6..6d0f335 100644 --- a/src/3rdparty/phonon/ds9/qaudiocdreader.cpp +++ b/src/3rdparty/phonon/ds9/qaudiocdreader.cpp @@ -103,8 +103,8 @@ namespace Phonon private: HANDLE m_cddrive; - CDROM_TOC *m_toc; - WaveStructure *m_waveHeader; + CDROM_TOC m_toc; + WaveStructure m_waveHeader; qint64 m_trackAddress; }; @@ -112,19 +112,8 @@ namespace Phonon #define SECTOR_SIZE 2352 #define NB_SECTORS_READ 20 - static AM_MEDIA_TYPE getAudioCDMediaType() - { - AM_MEDIA_TYPE mt; - qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Stream; - mt.subtype = MEDIASUBTYPE_WAVE; - mt.bFixedSizeSamples = TRUE; - mt.bTemporalCompression = FALSE; - mt.lSampleSize = 1; - mt.formattype = GUID_NULL; - return mt; - } - + static const AM_MEDIA_TYPE audioCDMediaType = { MEDIATYPE_Stream, MEDIASUBTYPE_WAVE, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; + int addressToSectors(UCHAR address[4]) { return ((address[0] * 60 + address[1]) * 60 + address[2]) * 75 + address[3] - 150; @@ -141,11 +130,8 @@ namespace Phonon } - QAudioCDReader::QAudioCDReader(QBaseFilter *parent, QChar drive) : QAsyncReader(parent, QVector() << getAudioCDMediaType()) + QAudioCDReader::QAudioCDReader(QBaseFilter *parent, QChar drive) : QAsyncReader(parent, QVector() << audioCDMediaType) { - m_toc = new CDROM_TOC; - m_waveHeader = new WaveStructure; - //now open the cd-drive QString path; if (drive.isNull()) { @@ -154,36 +140,30 @@ namespace Phonon path = QString::fromLatin1("\\\\.\\%1:").arg(drive); } - m_cddrive = QT_WA_INLINE ( - ::CreateFile( (TCHAR*)path.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ), - ::CreateFileA( path.toLocal8Bit().constData(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ) - ); + m_cddrive = ::CreateFile((const wchar_t *)path.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - qMemSet(m_toc, 0, sizeof(CDROM_TOC)); + qMemSet(&m_toc, 0, sizeof(CDROM_TOC)); //read the TOC DWORD bytesRead = 0; - bool tocRead = ::DeviceIoControl(m_cddrive, IOCTL_CDROM_READ_TOC, 0, 0, m_toc, sizeof(CDROM_TOC), &bytesRead, 0); + bool tocRead = ::DeviceIoControl(m_cddrive, IOCTL_CDROM_READ_TOC, 0, 0, &m_toc, sizeof(CDROM_TOC), &bytesRead, 0); if (!tocRead) { qWarning("unable to load the TOC from the CD"); return; } - m_trackAddress = addressToSectors(m_toc->TrackData[0].Address); - const qint32 nbSectorsToRead = (addressToSectors(m_toc->TrackData[m_toc->LastTrack + 1 - m_toc->FirstTrack].Address) + m_trackAddress = addressToSectors(m_toc.TrackData[0].Address); + const qint32 nbSectorsToRead = (addressToSectors(m_toc.TrackData[m_toc.LastTrack + 1 - m_toc.FirstTrack].Address) - m_trackAddress); const qint32 dataLength = nbSectorsToRead * SECTOR_SIZE; - m_waveHeader->chunksize = 4 + (8 + m_waveHeader->chunksize2) + (8 + dataLength); - m_waveHeader->dataLength = dataLength; + m_waveHeader.chunksize = 4 + (8 + m_waveHeader.chunksize2) + (8 + dataLength); + m_waveHeader.dataLength = dataLength; } QAudioCDReader::~QAudioCDReader() { ::CloseHandle(m_cddrive); - delete m_toc; - delete m_waveHeader; - } STDMETHODIMP_(ULONG) QAudioCDReader::AddRef() @@ -199,7 +179,7 @@ namespace Phonon STDMETHODIMP QAudioCDReader::Length(LONGLONG *total,LONGLONG *available) { - const LONGLONG length = sizeof(WaveStructure) + m_waveHeader->dataLength; + const LONGLONG length = sizeof(WaveStructure) + m_waveHeader.dataLength; if (total) { *total = length; } @@ -238,11 +218,11 @@ namespace Phonon if (pos < sizeof(WaveStructure)) { //we first copy the content of the structure nbRead = qMin(LONG(sizeof(WaveStructure) - pos), length); - qMemCopy(buffer, reinterpret_cast(m_waveHeader) + pos, nbRead); + qMemCopy(buffer, reinterpret_cast(&m_waveHeader) + pos, nbRead); } const LONGLONG posInTrack = pos - sizeof(WaveStructure) + nbRead; - const int bytesLeft = qMin(m_waveHeader->dataLength - posInTrack, LONGLONG(length - nbRead)); + const int bytesLeft = qMin(m_waveHeader.dataLength - posInTrack, LONGLONG(length - nbRead)); if (bytesLeft > 0) { @@ -297,8 +277,8 @@ namespace Phonon { QList ret; ret << 0; - for(int i = m_toc->FirstTrack; i <= m_toc->LastTrack ; ++i) { - const uchar *address = m_toc->TrackData[i].Address; + for(int i = m_toc.FirstTrack; i <= m_toc.LastTrack ; ++i) { + const uchar *address = m_toc.TrackData[i].Address; ret << ((address[0] * 60 + address[1]) * 60 + address[2]) * 1000 + address[3]*1000/75 - 2000; } diff --git a/src/3rdparty/phonon/ds9/qaudiocdreader.h b/src/3rdparty/phonon/ds9/qaudiocdreader.h index 9049b66..eff845d 100644 --- a/src/3rdparty/phonon/ds9/qaudiocdreader.h +++ b/src/3rdparty/phonon/ds9/qaudiocdreader.h @@ -31,7 +31,7 @@ namespace Phonon { struct CDROM_TOC; struct WaveStructure; - extern const IID IID_ITitleInterface; + EXTERN_C const IID IID_ITitleInterface; //interface for the Titles struct ITitleInterface : public IUnknown diff --git a/src/3rdparty/phonon/ds9/qbasefilter.cpp b/src/3rdparty/phonon/ds9/qbasefilter.cpp index 95cab92..78b8b8f 100644 --- a/src/3rdparty/phonon/ds9/qbasefilter.cpp +++ b/src/3rdparty/phonon/ds9/qbasefilter.cpp @@ -92,8 +92,8 @@ namespace Phonon return E_POINTER; } - int nbfetched = 0; - while (nbfetched < int(count) && m_index < m_pins.count()) { + uint nbfetched = 0; + while (nbfetched < count && m_index < m_pins.count()) { IPin *current = m_pins[m_index]; current->AddRef(); ret[nbfetched] = current; @@ -166,19 +166,19 @@ namespace Phonon const QList QBaseFilter::pins() const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); return m_pins; } void QBaseFilter::addPin(QPin *pin) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_pins.append(pin); } void QBaseFilter::removePin(QPin *pin) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_pins.removeAll(pin); } @@ -211,7 +211,8 @@ namespace Phonon } else if (iid == IID_IMediaPosition || iid == IID_IMediaSeeking) { if (inputPins().isEmpty()) { - if (*out = getUpStreamInterface(iid)) { + *out = getUpStreamInterface(iid); + if (*out) { return S_OK; //we return here to avoid adding a reference } else { hr = E_NOINTERFACE; @@ -250,35 +251,35 @@ namespace Phonon STDMETHODIMP QBaseFilter::GetClassID(CLSID *clsid) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); *clsid = m_clsid; return S_OK; } STDMETHODIMP QBaseFilter::Stop() { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_state = State_Stopped; return S_OK; } STDMETHODIMP QBaseFilter::Pause() { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_state = State_Paused; return S_OK; } STDMETHODIMP QBaseFilter::Run(REFERENCE_TIME) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_state = State_Running; return S_OK; } STDMETHODIMP QBaseFilter::GetState(DWORD, FILTER_STATE *state) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (!state) { return E_POINTER; } @@ -289,7 +290,7 @@ namespace Phonon STDMETHODIMP QBaseFilter::SetSyncSource(IReferenceClock *clock) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (clock) { clock->AddRef(); } @@ -302,7 +303,7 @@ namespace Phonon STDMETHODIMP QBaseFilter::GetSyncSource(IReferenceClock **clock) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (!clock) { return E_POINTER; } @@ -341,7 +342,7 @@ namespace Phonon STDMETHODIMP QBaseFilter::QueryFilterInfo(FILTER_INFO *info ) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (!info) { return E_POINTER; } @@ -355,9 +356,9 @@ namespace Phonon STDMETHODIMP QBaseFilter::JoinFilterGraph(IFilterGraph *graph, LPCWSTR name) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_graph = graph; - m_name = QString::fromUtf16((const unsigned short*)name); + m_name = QString::fromWCharArray(name); return S_OK; } diff --git a/src/3rdparty/phonon/ds9/qbasefilter.h b/src/3rdparty/phonon/ds9/qbasefilter.h index 85f1431..a72d6fe 100644 --- a/src/3rdparty/phonon/ds9/qbasefilter.h +++ b/src/3rdparty/phonon/ds9/qbasefilter.h @@ -22,7 +22,7 @@ along with this library. If not, see . #include #include -#include +#include #include @@ -127,7 +127,7 @@ namespace Phonon IFilterGraph *m_graph; FILTER_STATE m_state; QList m_pins; - mutable QReadWriteLock m_lock; + mutable QMutex m_mutex; }; } } diff --git a/src/3rdparty/phonon/ds9/qevr9.h b/src/3rdparty/phonon/ds9/qevr9.h new file mode 100644 index 0000000..8599fce --- /dev/null +++ b/src/3rdparty/phonon/ds9/qevr9.h @@ -0,0 +1,143 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#include + +#define DXVA2_ProcAmp_Brightness 1 +#define DXVA2_ProcAmp_Contrast 2 +#define DXVA2_ProcAmp_Hue 4 +#define DXVA2_ProcAmp_Saturation 8 + +typedef enum { + MFVideoARMode_None = 0x00000000, + MFVideoARMode_PreservePicture = 0x00000001, + MFVideoARMode_PreservePixel = 0x00000002, + MFVideoARMode_NonLinearStretch = 0x00000004, + MFVideoARMode_Mask = 0x00000007 +} MFVideoAspectRatioMode; + +typedef struct { + float left; + float top; + float right; + float bottom; +} MFVideoNormalizedRect; + +typedef struct { + UINT DeviceCaps; + D3DPOOL InputPool; + UINT NumForwardRefSamples; + UINT NumBackwardRefSamples; + UINT Reserved; + UINT DeinterlaceTechnology; + UINT ProcAmpControlCaps; + UINT VideoProcessorOperations; + UINT NoiseFilterTechnology; + UINT DetailFilterTechnology; +} DXVA2_VideoProcessorCaps; + +typedef struct { + union { + struct { + USHORT Fraction; + SHORT Value; + }; + LONG ll; + }; +} DXVA2_Fixed32; + +typedef struct { + DXVA2_Fixed32 MinValue; + DXVA2_Fixed32 MaxValue; + DXVA2_Fixed32 DefaultValue; + DXVA2_Fixed32 StepSize; +} DXVA2_ValueRange; + +typedef struct { + DXVA2_Fixed32 Brightness; + DXVA2_Fixed32 Contrast; + DXVA2_Fixed32 Hue; + DXVA2_Fixed32 Saturation; +} DXVA2_ProcAmpValues; + +DXVA2_Fixed32 DXVA2FloatToFixed(const float _float_) +{ + DXVA2_Fixed32 _fixed_; + _fixed_.Fraction = LOWORD(_float_ * 0x10000); + _fixed_.Value = HIWORD(_float_ * 0x10000); + return _fixed_; +} + +float DXVA2FixedToFloat(const DXVA2_Fixed32 _fixed_) +{ + return (FLOAT)_fixed_.Value + (FLOAT)_fixed_.Fraction / 0x10000; +} + +#undef INTERFACE +#define INTERFACE IMFVideoDisplayControl +DECLARE_INTERFACE_(IMFVideoDisplayControl, IUnknown) +{ + STDMETHOD(GetNativeVideoSize)(THIS_ SIZE* pszVideo, SIZE* pszARVideo) PURE; + STDMETHOD(GetIdealVideoSize)(THIS_ SIZE* pszMin, SIZE* pszMax) PURE; + STDMETHOD(SetVideoPosition)(THIS_ const MFVideoNormalizedRect* pnrcSource, const LPRECT prcDest) PURE; + STDMETHOD(GetVideoPosition)(THIS_ MFVideoNormalizedRect* pnrcSource, LPRECT prcDest) PURE; + STDMETHOD(SetAspectRatioMode)(THIS_ DWORD dwAspectRatioMode) PURE; + STDMETHOD(GetAspectRatioMode)(THIS_ DWORD* pdwAspectRatioMode) PURE; + STDMETHOD(SetVideoWindow)(THIS_ HWND hwndVideo) PURE; + STDMETHOD(GetVideoWindow)(THIS_ HWND* phwndVideo) PURE; + STDMETHOD(RepaintVideo)(THIS_) PURE; + STDMETHOD(GetCurrentImage)(THIS_ BITMAPINFOHEADER* pBih, BYTE** pDib, DWORD* pcbDib, LONGLONG* pTimeStamp) PURE; + STDMETHOD(SetBorderColor)(THIS_ COLORREF Clr) PURE; + STDMETHOD(GetBorderColor)(THIS_ COLORREF* pClr) PURE; + STDMETHOD(SetRenderingPrefs)(THIS_ DWORD dwRenderFlags) PURE; + STDMETHOD(GetRenderingPrefs)(THIS_ DWORD* pdwRenderFlags) PURE; + STDMETHOD(SetFullScreen)(THIS_ BOOL fFullscreen) PURE; + STDMETHOD(GetFullScreen)(THIS_ BOOL* pfFullscreen) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoMixerControl +DECLARE_INTERFACE_(IMFVideoMixerControl, IUnknown) +{ + STDMETHOD(SetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD dwZ) PURE; + STDMETHOD(GetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD* pdwZ) PURE; + STDMETHOD(SetStreamOutputRect)(THIS_ DWORD dwStreamID, const MFVideoNormalizedRect* pnrcOutput) PURE; + STDMETHOD(GetStreamOutputRect)(THIS_ DWORD dwStreamID, MFVideoNormalizedRect* pnrcOutput) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoProcessor +DECLARE_INTERFACE_(IMFVideoProcessor, IUnknown) +{ + STDMETHOD(GetAvailableVideoProcessorModes)(THIS_ UINT* lpdwNumProcessingModes, GUID** ppVideoProcessingModes) PURE; + STDMETHOD(GetVideoProcessorCaps)(THIS_ LPGUID lpVideoProcessorMode, DXVA2_VideoProcessorCaps* lpVideoProcessorCaps) PURE; + STDMETHOD(GetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(SetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(GetProcAmpRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* Values) PURE; + STDMETHOD(SetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* pValues) PURE; + STDMETHOD(GetFilteringRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(SetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(GetBackgroundColor)(THIS_ COLORREF* lpClrBkg) PURE; + STDMETHOD(SetBackgroundColor)(THIS_ COLORREF ClrBkg) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFGetService +DECLARE_INTERFACE_(IMFGetService, IUnknown) +{ + STDMETHOD(GetService)(THIS_ REFGUID guidService, REFIID riid, LPVOID* ppvObject) PURE; +}; +#undef INTERFACE diff --git a/src/3rdparty/phonon/ds9/qmeminputpin.cpp b/src/3rdparty/phonon/ds9/qmeminputpin.cpp index dca99db..a21fbe7 100644 --- a/src/3rdparty/phonon/ds9/qmeminputpin.cpp +++ b/src/3rdparty/phonon/ds9/qmeminputpin.cpp @@ -28,8 +28,8 @@ namespace Phonon namespace DS9 { - QMemInputPin::QMemInputPin(QBaseFilter *parent, const QVector &mt, bool transform) : - QPin(parent, PINDIR_INPUT, mt), m_shouldDuplicateSamples(true), m_transform(transform) + QMemInputPin::QMemInputPin(QBaseFilter *parent, const QVector &mt, bool transform, QPin *output) : + QPin(parent, PINDIR_INPUT, mt), m_shouldDuplicateSamples(true), m_transform(transform), m_output(output) { } @@ -66,11 +66,9 @@ namespace Phonon { //this allows to serialize with Receive calls QMutexLocker locker(&m_mutexReceive); - for(int i = 0; i < m_outputs.count(); ++i) { - IPin *conn = m_outputs.at(i)->connected(); - if (conn) { - conn->EndOfStream(); - } + IPin *conn = m_output ? m_output->connected() : 0; + if (conn) { + conn->EndOfStream(); } return S_OK; } @@ -78,13 +76,11 @@ namespace Phonon STDMETHODIMP QMemInputPin::BeginFlush() { //pass downstream - for(int i = 0; i < m_outputs.count(); ++i) { - IPin *conn = m_outputs.at(i)->connected(); - if (conn) { - conn->BeginFlush(); - } + IPin *conn = m_output ? m_output->connected() : 0; + if (conn) { + conn->BeginFlush(); } - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_flushing = true; return S_OK; } @@ -92,22 +88,19 @@ namespace Phonon STDMETHODIMP QMemInputPin::EndFlush() { //pass downstream - for(int i = 0; i < m_outputs.count(); ++i) { - IPin *conn = m_outputs.at(i)->connected(); - if (conn) { - conn->EndFlush(); - } + IPin *conn = m_output ? m_output->connected() : 0; + if (conn) { + conn->EndFlush(); } - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_flushing = false; return S_OK; } STDMETHODIMP QMemInputPin::NewSegment(REFERENCE_TIME start, REFERENCE_TIME stop, double rate) { - for(int i = 0; i < m_outputs.count(); ++i) { - m_outputs.at(i)->NewSegment(start, stop, rate); - } + if (m_output) + m_output->NewSegment(start, stop, rate); return S_OK; } @@ -119,14 +112,9 @@ namespace Phonon if (hr == S_OK && mt->majortype != MEDIATYPE_NULL && mt->subtype != MEDIASUBTYPE_NULL && - mt->formattype != GUID_NULL) { - //we tell the output pins that they should connect with this type - for(int i = 0; i < m_outputs.count(); ++i) { - hr = m_outputs.at(i)->setAcceptedMediaType(connectedType()); - if (FAILED(hr)) { - break; - } - } + mt->formattype != GUID_NULL && m_output) { + //we tell the output pin that it should connect with this type + hr = m_output->setAcceptedMediaType(connectedType()); } return hr; } @@ -137,7 +125,8 @@ namespace Phonon return E_POINTER; } - if (*alloc = memoryAllocator(true)) { + *alloc = memoryAllocator(true); + if (*alloc) { return S_OK; } @@ -151,18 +140,15 @@ namespace Phonon } { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); m_shouldDuplicateSamples = m_transform && readonly; } setMemoryAllocator(alloc); - for(int i = 0; i < m_outputs.count(); ++i) { - IPin *pin = m_outputs.at(i)->connected(); - if (pin) { - ComPointer input(pin, IID_IMemInputPin); - input->NotifyAllocator(alloc, m_shouldDuplicateSamples); - } + if (m_output) { + ComPointer input(m_output, IID_IMemInputPin); + input->NotifyAllocator(alloc, m_shouldDuplicateSamples); } return S_OK; @@ -201,22 +187,18 @@ namespace Phonon } } - for (int i = 0; i < m_outputs.count(); ++i) { - QPin *current = m_outputs.at(i); + if (m_output) { IMediaSample *outSample = m_shouldDuplicateSamples ? - duplicateSampleForOutput(sample, current->memoryAllocator()) + duplicateSampleForOutput(sample, m_output->memoryAllocator()) : sample; if (m_shouldDuplicateSamples) { m_parent->processSample(outSample); } - IPin *pin = current->connected(); - if (pin) { - ComPointer input(pin, IID_IMemInputPin); - if (input) { - input->Receive(outSample); - } + ComPointer input(m_output->connected(), IID_IMemInputPin); + if (input) { + input->Receive(outSample); } if (m_shouldDuplicateSamples) { @@ -247,39 +229,16 @@ namespace Phonon STDMETHODIMP QMemInputPin::ReceiveCanBlock() { - //we test the output to see if they can block - for(int i = 0; i < m_outputs.count(); ++i) { - IPin *input = m_outputs.at(i)->connected(); - if (input) { - ComPointer meminput(input, IID_IMemInputPin); - if (meminput && meminput->ReceiveCanBlock() != S_FALSE) { - return S_OK; - } + //we test the output to see if it can block + if (m_output) { + ComPointer meminput(m_output->connected(), IID_IMemInputPin); + if (meminput && meminput->ReceiveCanBlock() != S_FALSE) { + return S_OK; } } return S_FALSE; } - //addition - //this should be used by the filter to tell its input pins to which output they should route the samples - - void QMemInputPin::addOutput(QPin *output) - { - QWriteLocker locker(&m_lock); - m_outputs += output; - } - - void QMemInputPin::removeOutput(QPin *output) - { - QWriteLocker locker(&m_lock); - m_outputs.removeOne(output); - } - - QList QMemInputPin::outputs() const - { - QReadLocker locker(&m_lock); - return m_outputs; - } ALLOCATOR_PROPERTIES QMemInputPin::getDefaultAllocatorProperties() const { @@ -294,7 +253,7 @@ namespace Phonon LONG length = sample->GetActualDataLength(); HRESULT hr = alloc->Commit(); - if (hr == VFW_E_SIZENOTSET) { + if (hr == HRESULT(VFW_E_SIZENOTSET)) { ALLOCATOR_PROPERTIES prop = getDefaultAllocatorProperties(); prop.cbBuffer = qMax(prop.cbBuffer, length); ALLOCATOR_PROPERTIES actual; @@ -324,7 +283,7 @@ namespace Phonon { LONGLONG start, end; hr = sample->GetMediaTime(&start, &end); - if (hr != VFW_E_MEDIA_TIME_NOT_SET) { + if (hr != HRESULT(VFW_E_MEDIA_TIME_NOT_SET)) { hr = out->SetMediaTime(&start, &end); Q_ASSERT(SUCCEEDED(hr)); } diff --git a/src/3rdparty/phonon/ds9/qmeminputpin.h b/src/3rdparty/phonon/ds9/qmeminputpin.h index c449721..d74c451 100644 --- a/src/3rdparty/phonon/ds9/qmeminputpin.h +++ b/src/3rdparty/phonon/ds9/qmeminputpin.h @@ -37,7 +37,7 @@ namespace Phonon class QMemInputPin : public QPin, public IMemInputPin { public: - QMemInputPin(QBaseFilter *, const QVector &, bool transform); + QMemInputPin(QBaseFilter *, const QVector &, bool transform, QPin *output); ~QMemInputPin(); //reimplementation from IUnknown @@ -60,18 +60,13 @@ namespace Phonon STDMETHODIMP ReceiveMultiple(IMediaSample **,long,long *); STDMETHODIMP ReceiveCanBlock(); - //addition - void addOutput(QPin *output); - void removeOutput(QPin *output); - QList outputs() const; - private: IMediaSample *duplicateSampleForOutput(IMediaSample *, IMemAllocator *); ALLOCATOR_PROPERTIES getDefaultAllocatorProperties() const; bool m_shouldDuplicateSamples; const bool m_transform; //defines if the pin is transforming the samples - QList m_outputs; + QPin* const m_output; QMutex m_mutexReceive; }; } diff --git a/src/3rdparty/phonon/ds9/qpin.cpp b/src/3rdparty/phonon/ds9/qpin.cpp index 37fe48d..b4afd10 100644 --- a/src/3rdparty/phonon/ds9/qpin.cpp +++ b/src/3rdparty/phonon/ds9/qpin.cpp @@ -28,20 +28,7 @@ namespace Phonon namespace DS9 { - static const AM_MEDIA_TYPE defaultMediaType() - { - AM_MEDIA_TYPE ret; - ret.majortype = MEDIATYPE_NULL; - ret.subtype = MEDIASUBTYPE_NULL; - ret.bFixedSizeSamples = TRUE; - ret.bTemporalCompression = FALSE; - ret.lSampleSize = 1; - ret.formattype = GUID_NULL; - ret.pUnk = 0; - ret.cbFormat = 0; - ret.pbFormat = 0; - return ret; - } + static const AM_MEDIA_TYPE defaultMediaType = { MEDIATYPE_NULL, MEDIASUBTYPE_NULL, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; class QEnumMediaTypes : public IEnumMediaTypes { @@ -104,8 +91,8 @@ namespace Phonon return E_INVALIDARG; } - int nbFetched = 0; - while (nbFetched < int(count) && m_index < m_pin->mediaTypes().count()) { + uint nbFetched = 0; + while (nbFetched < count && m_index < m_pin->mediaTypes().count()) { //the caller will deallocate the memory *out = static_cast(::CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))); const AM_MEDIA_TYPE original = m_pin->mediaTypes().at(m_index); @@ -158,9 +145,9 @@ namespace Phonon QPin::QPin(QBaseFilter *parent, PIN_DIRECTION dir, const QVector &mt) : - m_memAlloc(0), m_parent(parent), m_refCount(1), m_connected(0), - m_direction(dir), m_mediaTypes(mt), m_connectedType(defaultMediaType()), - m_flushing(false) + m_parent(parent), m_flushing(false), m_refCount(1), m_connected(0), + m_direction(dir), m_mediaTypes(mt), m_connectedType(defaultMediaType), + m_memAlloc(0) { Q_ASSERT(m_parent); m_parent->addPin(this); @@ -273,7 +260,7 @@ namespace Phonon if (FAILED(hr)) { setConnected(0); - setConnectedType(defaultMediaType()); + setConnectedType(defaultMediaType); } else { ComPointer input(pin, IID_IMemInputPin); if (input) { @@ -315,10 +302,8 @@ namespace Phonon } setConnected(0); - setConnectedType(defaultMediaType()); - if (m_direction == PINDIR_INPUT) { - setMemoryAllocator(0); - } + setConnectedType(defaultMediaType); + setMemoryAllocator(0); return S_OK; } @@ -338,7 +323,7 @@ namespace Phonon STDMETHODIMP QPin::ConnectionMediaType(AM_MEDIA_TYPE *type) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (!type) { return E_POINTER; } @@ -353,7 +338,6 @@ namespace Phonon STDMETHODIMP QPin::QueryPinInfo(PIN_INFO *info) { - QReadLocker locker(&m_lock); if (!info) { return E_POINTER; } @@ -361,14 +345,12 @@ namespace Phonon info->dir = m_direction; info->pFilter = m_parent; m_parent->AddRef(); - qMemCopy(info->achName, m_name.utf16(), qMin(MAX_FILTER_NAME, m_name.length()+1) *2); - + info->achName[0] = 0; return S_OK; } STDMETHODIMP QPin::QueryDirection(PIN_DIRECTION *dir) { - QReadLocker locker(&m_lock); if (!dir) { return E_POINTER; } @@ -379,20 +361,18 @@ namespace Phonon STDMETHODIMP QPin::QueryId(LPWSTR *id) { - QReadLocker locker(&m_lock); if (!id) { return E_POINTER; } - int nbBytes = (m_name.length()+1)*2; - *id = static_cast(::CoTaskMemAlloc(nbBytes)); - qMemCopy(*id, m_name.utf16(), nbBytes); + *id = static_cast(::CoTaskMemAlloc(2)); + *id[0] = 0; return S_OK; } STDMETHODIMP QPin::QueryAccept(const AM_MEDIA_TYPE *type) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (!type) { return E_POINTER; } @@ -439,7 +419,7 @@ namespace Phonon STDMETHODIMP QPin::NewSegment(REFERENCE_TIME start, REFERENCE_TIME stop, double rate) { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (m_direction == PINDIR_OUTPUT && m_connected) { //we deliver this downstream m_connected->NewSegment(start, stop, rate); @@ -456,8 +436,8 @@ namespace Phonon HRESULT QPin::checkOutputMediaTypesConnection(IPin *pin) { - IEnumMediaTypes *emt = 0; - HRESULT hr = pin->EnumMediaTypes(&emt); + ComPointer emt; + HRESULT hr = pin->EnumMediaTypes(emt.pparam()); if (hr != S_OK) { return hr; } @@ -470,7 +450,7 @@ namespace Phonon freeMediaType(type); return S_OK; } else { - setConnectedType(defaultMediaType()); + setConnectedType(defaultMediaType); freeMediaType(type); } } @@ -520,7 +500,7 @@ namespace Phonon void QPin::setConnectedType(const AM_MEDIA_TYPE &type) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); //1st we free memory freeMediaType(m_connectedType); @@ -530,13 +510,13 @@ namespace Phonon const AM_MEDIA_TYPE &QPin::connectedType() const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); return m_connectedType; } void QPin::setConnected(IPin *pin) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (pin) { pin->AddRef(); } @@ -548,7 +528,7 @@ namespace Phonon IPin *QPin::connected(bool addref) const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (addref && m_connected) { m_connected->AddRef(); } @@ -557,13 +537,12 @@ namespace Phonon bool QPin::isFlushing() const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); return m_flushing; } FILTER_STATE QPin::filterState() const { - QReadLocker locker(&m_lock); FILTER_STATE fstate = State_Stopped; m_parent->GetState(0, &fstate); return fstate; @@ -571,7 +550,7 @@ namespace Phonon QVector QPin::mediaTypes() const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); return m_mediaTypes; } @@ -607,7 +586,7 @@ namespace Phonon void QPin::setMemoryAllocator(IMemAllocator *alloc) { - QWriteLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (alloc) { alloc->AddRef(); } @@ -619,7 +598,7 @@ namespace Phonon IMemAllocator *QPin::memoryAllocator(bool addref) const { - QReadLocker locker(&m_lock); + QMutexLocker locker(&m_mutex); if (addref && m_memAlloc) { m_memAlloc->AddRef(); } diff --git a/src/3rdparty/phonon/ds9/qpin.h b/src/3rdparty/phonon/ds9/qpin.h index a3287c4..280ad61 100644 --- a/src/3rdparty/phonon/ds9/qpin.h +++ b/src/3rdparty/phonon/ds9/qpin.h @@ -22,7 +22,7 @@ along with this library. If not, see . #include #include -#include +#include #include @@ -85,8 +85,8 @@ namespace Phonon protected: //this can be used by sub-classes - mutable QReadWriteLock m_lock; - QBaseFilter *m_parent; + mutable QMutex m_mutex; + QBaseFilter * const m_parent; bool m_flushing; private: @@ -98,7 +98,6 @@ namespace Phonon const PIN_DIRECTION m_direction; QVector m_mediaTypes; //accepted media types AM_MEDIA_TYPE m_connectedType; - QString m_name; IMemAllocator *m_memAlloc; }; diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp new file mode 100644 index 0000000..0045a49 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp @@ -0,0 +1,153 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + + +#include "videorenderer_default.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + + +namespace Phonon +{ + namespace DS9 + { + VideoRendererDefault::~VideoRendererDefault() + { + } + + bool VideoRendererDefault::isNative() const + { + return true; + } + + + VideoRendererDefault::VideoRendererDefault(QWidget *target) : m_target(target) + { + m_target->setAttribute(Qt::WA_PaintOnScreen, true); + m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); + } + + QSize VideoRendererDefault::videoSize() const + { + LONG w = 0, + h = 0; + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->GetVideoSize( &w, &h); + } + return QSize(w, h); + } + + void VideoRendererDefault::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) + { + //nothing to do here: the renderer paints everything + } + + void VideoRendererDefault::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(0, 0, 0, 0); + } + return; + } + + ComPointer video(m_filter, IID_IVideoWindow); + + OAHWND owner; + HRESULT hr = video->get_Owner(&owner); + if (FAILED(hr)) { + return; + } + + const OAHWND newOwner = reinterpret_cast(m_target->winId()); + if (owner != newOwner) { + video->put_Owner(newOwner); + video->put_MessageDrain(newOwner); + video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); + } + + //make sure the widget takes the whole size of the parent + video->SetWindowPosition(0, 0, size.width(), size.height()); + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); + } + } + + void VideoRendererDefault::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) + { + //this can't be supported for the default renderer + } + + QImage VideoRendererDefault::snapshot() const + { + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + LONG bufferSize = 0; + //1st we get the buffer size + basic->GetCurrentImage(&bufferSize, 0); + + QByteArray buffer; + buffer.resize(bufferSize); + HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast(buffer.data())); + + if (SUCCEEDED(hr)) { + + const BITMAPINFOHEADER *bmi = reinterpret_cast(buffer.constData()); + + const int w = qAbs(bmi->biWidth), + h = qAbs(bmi->biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + const char *data = buffer.constData() + bmi->biSize; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + return ret; + } + } + return QImage(); + } + + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.h b/src/3rdparty/phonon/ds9/videorenderer_default.h new file mode 100644 index 0000000..43768d9 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.h @@ -0,0 +1,55 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#ifndef PHONON_VIDEORENDERER_DEFAULT_H +#define PHONON_VIDEORENDERER_DEFAULT_H + +#include "abstractvideorenderer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererDefault : public AbstractVideoRenderer + { + public: + VideoRendererDefault(QWidget *target); + ~VideoRendererDefault(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp new file mode 100644 index 0000000..d23d9ce --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp @@ -0,0 +1,215 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + + +#include "videorenderer_evr.h" +#include "qevr9.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ + namespace DS9 + { + //we have to define them here because not all compilers/sdk have them + static const GUID MR_VIDEO_RENDER_SERVICE = {0x1092a86c, 0xab1a, 0x459a, {0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff} }; + static const GUID MR_VIDEO_MIXER_SERVICE = { 0x73cd2fc, 0x6cf4, 0x40b7, {0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8} }; + static const IID IID_IMFVideoDisplayControl = {0xa490b1e4, 0xab84, 0x4d31, {0xa1, 0xb2, 0x18, 0x1e, 0x03, 0xb1, 0x07, 0x7a} }; + static const IID IID_IMFVideoMixerControl = {0xA5C6C53F, 0xC202, 0x4aa5, {0x96, 0x95, 0x17, 0x5B, 0xA8, 0xC5, 0x08, 0xA5} }; + static const IID IID_IMFVideoProcessor = {0x6AB0000C, 0xFECE, 0x4d1f, {0xA2, 0xAC, 0xA9, 0x57, 0x35, 0x30, 0x65, 0x6E} }; + static const IID IID_IMFGetService = {0xFA993888, 0x4383, 0x415A, {0xA9, 0x30, 0xDD, 0x47, 0x2A, 0x8C, 0xF6, 0xF7} }; + static const GUID CLSID_EnhancedVideoRenderer = {0xfa10746c, 0x9b63, 0x4b6c, {0xbc, 0x49, 0xfc, 0x30, 0xe, 0xa5, 0xf2, 0x56} }; + + template ComPointer getService(const Filter &filter, REFGUID guidService, REFIID riid) + { + //normally we should use IID_IMFGetService but this introduces another dependency + //so here we simply define our own IId with the same value + ComPointer getService(filter, IID_IMFGetService); + Q_ASSERT(getService); + T *ptr = 0; + HRESULT hr = getService->GetService(guidService, riid, reinterpret_cast(&ptr)); + if (!SUCCEEDED(hr) || ptr == 0) + Q_ASSERT(!SUCCEEDED(hr) && ptr != 0); + ComPointer service(ptr); + return service; + } + + VideoRendererEVR::~VideoRendererEVR() + { + } + + bool VideoRendererEVR::isNative() const + { + return true; + } + + VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) + { + m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); + if (!m_filter) { + return; + } + + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->SetVideoWindow(reinterpret_cast(target->winId())); + filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size + } + + QImage VideoRendererEVR::snapshot() const + { + // This will always capture black areas where no video is drawn, if any are present. + // Due to the hack in notifyResize() + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + if (filterControl) { + BITMAPINFOHEADER bmi; + BYTE *buffer = 0; + DWORD bufferSize; + LONGLONG timeStamp; + + bmi.biSize = sizeof(BITMAPINFOHEADER); + + HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp); + if (SUCCEEDED(hr)) { + + const int w = qAbs(bmi.biWidth), + h = qAbs(bmi.biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + uchar *data = buffer; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + ::CoTaskMemFree(buffer); + return ret; + } + } + return QImage(); + } + + QSize VideoRendererEVR::videoSize() const + { + SIZE nativeSize; + SIZE aspectRatioSize; + + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize); + + return QSize(nativeSize.cx, nativeSize.cy); + } + + void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect) + { + // repaint the video + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + // All failed results can be safely ignored + filterControl->RepaintVideo(); + } + + void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + RECT dummyRect = { 0, 0, 0, 0}; + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + filterControl->SetVideoPosition(0, &dummyRect); + return; + } + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + RECT dstRectWin = { 0, 0, size.width(), size.height()}; + + // Resize the Stream output rect instead of the destination rect. + // Hacky workaround for flicker in the areas outside of the destination rect + // This way these areas don't exist + MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()), + float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())}; + + ComPointer filterMixer = getService(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl); + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterMixer->SetStreamOutputRect(0, &streamOutputRect); + filterControl->SetVideoPosition(0, &dstRectWin); + } + + void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation) + { + InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first(); + OutputPin source; + if (FAILED(sink->ConnectedTo(source.pparam()))) { + return; //it must be connected to work + } + + // Get the "Video Processor" (used for brightness/contrast/saturation/hue) + ComPointer processor = getService(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor); + Q_ASSERT(processor); + + DXVA2_ValueRange contrastRange; + DXVA2_ValueRange brightnessRange; + DXVA2_ValueRange saturationRange; + DXVA2_ValueRange hueRange; + + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange))) + return; + + DXVA2_ProcAmpValues values; + + values.Contrast = DXVA2FloatToFixed(((contrast < 0 + ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue)) + - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue)); + values.Brightness = DXVA2FloatToFixed(((brightness < 0 + ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue)) + - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue)); + values.Saturation = DXVA2FloatToFixed(((saturation < 0 + ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue)) + - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue)); + values.Hue = DXVA2FloatToFixed(((hue < 0 + ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue)) + - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue)); + + //finally set the settings + processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values); + + } + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.h b/src/3rdparty/phonon/ds9/videorenderer_evr.h new file mode 100644 index 0000000..229c36d --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.h @@ -0,0 +1,56 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#ifndef PHONON_VIDEORENDERER_EVR_H +#define PHONON_VIDEORENDERER_EVR_H + +#include "abstractvideorenderer.h" +#include "compointer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererEVR : public AbstractVideoRenderer + { + public: + VideoRendererEVR(QWidget *target); + ~VideoRendererEVR(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp index 491d1bd..9c7993c 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp @@ -194,8 +194,8 @@ namespace Phonon m_sampleBuffer = ComPointer(); #ifndef QT_NO_OPENGL freeGLResources(); -#endif // QT_NO_OPENGL m_textureUploaded = false; +#endif // QT_NO_OPENGL } void endOfStream() @@ -314,7 +314,6 @@ namespace Phonon REFERENCE_TIME m_start; HANDLE m_renderEvent, m_receiveCanWait; // Signals sample to render QSize m_size; - bool m_textureUploaded; //mixer settings qreal m_brightness, @@ -356,6 +355,7 @@ namespace Phonon bool m_checkedPrograms; bool m_usingOpenGL; + bool m_textureUploaded; GLuint m_program[2]; GLuint m_texture[3]; #endif @@ -365,7 +365,7 @@ namespace Phonon { public: VideoRendererSoftPin(VideoRendererSoftFilter *parent) : - QMemInputPin(parent, videoMediaTypes(), false /*no transformation of the samples*/), + QMemInputPin(parent, videoMediaTypes(), false /*no transformation of the samples*/, 0), m_renderer(parent) { } @@ -436,7 +436,7 @@ namespace Phonon QBaseFilter(CLSID_NULL), m_inputPin(new VideoRendererSoftPin(this)), m_renderer(renderer), m_start(0) #ifndef QT_NO_OPENGL - ,m_usingOpenGL(false), m_checkedPrograms(false), m_textureUploaded(false) + , m_checkedPrograms(false), m_usingOpenGL(false), m_textureUploaded(false) #endif { m_renderEvent = ::CreateEvent(0, 0, 0, 0); @@ -661,7 +661,10 @@ namespace Phonon #ifndef QT_NO_OPENGL - if (painter.paintEngine() && painter.paintEngine()->type() == QPaintEngine::OpenGL && checkGLPrograms()) { + if (painter.paintEngine() && + (painter.paintEngine()->type() == QPaintEngine::OpenGL || painter.paintEngine()->type() == QPaintEngine::OpenGL2) + && checkGLPrograms()) { + //for now we only support YUV (both YV12 and YUY2) updateTexture(); @@ -673,6 +676,7 @@ namespace Phonon } //let's draw the texture + painter.beginNativePainting(); //Let's pass the other arguments const Program prog = (m_inputPin->connectedType().subtype == MEDIASUBTYPE_YV12) ? YV12toRGB : YUY2toRGB; @@ -722,6 +726,7 @@ namespace Phonon glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_FRAGMENT_PROGRAM_ARB); + painter.endNativePainting(); return; } else #endif diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp index 298e9fa..545b31e 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp @@ -22,14 +22,9 @@ along with this library. If not, see . #include #include -#include -#ifndef Q_OS_WINCE #include #include -#else -#include -#endif QT_BEGIN_NAMESPACE @@ -48,116 +43,10 @@ namespace Phonon } -#ifdef Q_OS_WINCE - VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) - { - m_target->setAttribute(Qt::WA_PaintOnScreen, true); - m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); - } - - QSize VideoRendererVMR9::videoSize() const - { - LONG w = 0, - h = 0; - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->GetVideoSize( &w, &h); - } - return QSize(w, h); - } - - void VideoRendererVMR9::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) - { - //nothing to do here: the renderer paints everything - } - - void VideoRendererVMR9::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, - Phonon::VideoWidget::ScaleMode scaleMode) - { - if (!isActive()) { - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(0, 0, 0, 0); - } - return; - } - - ComPointer video(m_filter, IID_IVideoWindow); - - OAHWND owner; - HRESULT hr = video->get_Owner(&owner); - if (FAILED(hr)) { - return; - } - - const OAHWND newOwner = reinterpret_cast(m_target->winId()); - if (owner != newOwner) { - video->put_Owner(newOwner); - video->put_MessageDrain(newOwner); - video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - } - - //make sure the widget takes the whole size of the parent - video->SetWindowPosition(0, 0, size.width(), size.height()); - - const QSize vsize = videoSize(); - internalNotifyResize(size, vsize, aspectRatio, scaleMode); - - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); - } - } - - void VideoRendererVMR9::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) - { - //this can't be supported for WinCE - } - - QImage VideoRendererVMR9::snapshot() const - { - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - LONG bufferSize = 0; - //1st we get the buffer size - basic->GetCurrentImage(&bufferSize, 0); - - QByteArray buffer; - buffer.resize(bufferSize); - HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast(buffer.data())); - - if (SUCCEEDED(hr)) { - - const BITMAPINFOHEADER *bmi = reinterpret_cast(buffer.constData()); - - const int w = qAbs(bmi->biWidth), - h = qAbs(bmi->biHeight); - - // Create image and copy data into image. - QImage ret(w, h, QImage::Format_RGB32); - - if (!ret.isNull()) { - const char *data = buffer.constData() + bmi->biSize; - const int bytes_per_line = w * sizeof(QRgb); - for (int y = h - 1; y >= 0; --y) { - qMemCopy(ret.scanLine(y), //destination - data, //source - bytes_per_line); - data += bytes_per_line; - } - } - return ret; - } - } - return QImage(); - } - -#else VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) { m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter); if (!m_filter) { - qWarning("the video widget could not be initialized correctly"); return; } @@ -169,6 +58,7 @@ namespace Phonon Q_ASSERT(SUCCEEDED(hr)); ComPointer windowlessControl(m_filter, IID_IVMRWindowlessControl9); windowlessControl->SetVideoClippingWindow(reinterpret_cast(target->winId())); + windowlessControl->SetAspectRatioMode(VMR9ARMode_None); //we're in control of the size } QImage VideoRendererVMR9::snapshot() const @@ -324,7 +214,6 @@ namespace Phonon //finally set the settings mixer->SetProcAmpControl(0, &ctrl); } -#endif } } diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h index 4eb237e..516d79d 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h @@ -19,7 +19,6 @@ along with this library. If not, see . #define PHONON_VIDEORENDERER_VMR9_H #include "abstractvideorenderer.h" -#include "compointer.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index de7ce5f..09d42a4 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,7 +24,12 @@ along with this library. If not, see . #include "mediaobject.h" +#ifndef Q_OS_WINCE +#include "videorenderer_evr.h" #include "videorenderer_vmr9.h" +#else +#include "videorenderer_default.h" +#endif #include "videorenderer_soft.h" QT_BEGIN_NAMESPACE @@ -84,7 +89,19 @@ namespace Phonon void setCurrentRenderer(AbstractVideoRenderer *renderer) { m_currentRenderer = renderer; - update(); + //we disallow repaint on that widget for just a fraction of second + //this allows better transition between videos + setUpdatesEnabled(false); + m_flickerFreeTimer.start(20, this); + } + + void timerEvent(QTimerEvent *e) + { + if (e->timerId() == m_flickerFreeTimer.timerId()) { + m_flickerFreeTimer.stop(); + setUpdatesEnabled(true); + } + QWidget::timerEvent(e); } QSize sizeHint() const @@ -106,6 +123,8 @@ namespace Phonon void paintEvent(QPaintEvent *e) { + if (!updatesEnabled()) + return; //this avoids repaint from native events checkCurrentRenderingMode(); m_currentRenderer->repaintCurrentFrame(this, e->rect()); } @@ -153,13 +172,14 @@ namespace Phonon } } else if (!isEmbedded()) { m_currentRenderer = m_node->switchRendering(m_currentRenderer); - setAttribute(Qt::WA_PaintOnScreen, true); + setAttribute(Qt::WA_PaintOnScreen, false); } } VideoWidget *m_node; AbstractVideoRenderer *m_currentRenderer; QVariant m_restoreScreenSaverActive; + QBasicTimer m_flickerFreeTimer; }; VideoWidget::VideoWidget(QWidget *parent) @@ -203,6 +223,9 @@ namespace Phonon if (toNative && m_noNativeRendererSupported) return current; //no switch here + if (!mediaObject()) + return current; + //firt we delete the renderer //initialization of the widgets for(int i = 0; i < FILTER_COUNT; ++i) { @@ -261,6 +284,7 @@ namespace Phonon { m_aspectRatio = aspectRatio; updateVideoSize(); + m_widget->update(); } Phonon::VideoWidget::ScaleMode VideoWidget::scaleMode() const @@ -279,6 +303,7 @@ namespace Phonon { m_scaleMode = scaleMode; updateVideoSize(); + m_widget->update(); } void VideoWidget::setBrightness(qreal b) @@ -332,14 +357,29 @@ namespace Phonon int index = graphIndex * 2 + type; if (m_renderers[index] == 0 && autoCreate) { AbstractVideoRenderer *renderer = 0; - if (type == Native) { - renderer = new VideoRendererVMR9(m_widget); + if (type == Native) { +#ifndef Q_OS_WINCE + renderer = new VideoRendererEVR(m_widget); + if (renderer->getFilter() == 0) { + delete renderer; + //EVR not present, let's try VMR + renderer = new VideoRendererVMR9(m_widget); + if (renderer->getFilter() == 0) { + //instanciating the renderer might fail + m_noNativeRendererSupported = true; + delete renderer; + renderer = 0; + } + } +#else + renderer = new VideoRendererDefault(m_widget); if (renderer->getFilter() == 0) { - //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273) + //instanciating the renderer might fail m_noNativeRendererSupported = true; delete renderer; renderer = 0; } +#endif } if (renderer == 0) { diff --git a/src/3rdparty/phonon/ds9/volumeeffect.cpp b/src/3rdparty/phonon/ds9/volumeeffect.cpp index b9a5fce..a93b074 100644 --- a/src/3rdparty/phonon/ds9/volumeeffect.cpp +++ b/src/3rdparty/phonon/ds9/volumeeffect.cpp @@ -76,7 +76,7 @@ namespace Phonon class VolumeMemInputPin : public QMemInputPin { public: - VolumeMemInputPin(QBaseFilter *parent, const QVector &mt) : QMemInputPin(parent, mt, true /*transform*/) + VolumeMemInputPin(QBaseFilter *parent, const QVector &mt, QPin *output) : QMemInputPin(parent, mt, true /*transform*/, output) { } @@ -139,8 +139,7 @@ namespace Phonon //then creating the input mt << audioMediaType(); - m_input = new VolumeMemInputPin(this, mt); - m_input->addOutput(m_output); //make the connection here + m_input = new VolumeMemInputPin(this, mt, m_output); } void VolumeEffectFilter::treatOneSamplePerChannel(BYTE **buffer, int sampleSize, int channelCount, int frequency) diff --git a/src/3rdparty/phonon/ds9/volumeeffect.h b/src/3rdparty/phonon/ds9/volumeeffect.h index 39b20d0..d1b0186 100644 --- a/src/3rdparty/phonon/ds9/volumeeffect.h +++ b/src/3rdparty/phonon/ds9/volumeeffect.h @@ -47,7 +47,7 @@ namespace Phonon private: float m_volume; - //parameters used to fade + //paramaters used to fade Phonon::VolumeFaderEffect::FadeCurve m_fadeCurve; bool m_fading; //determines if we should be fading. diff --git a/src/plugins/phonon/ds9/ds9.pro b/src/plugins/phonon/ds9/ds9.pro index f40c561..dab5116 100644 --- a/src/plugins/phonon/ds9/ds9.pro +++ b/src/plugins/phonon/ds9/ds9.pro @@ -23,6 +23,7 @@ HEADERS += \ $$PHONON_DS9_DIR/videowidget.h \ $$PHONON_DS9_DIR/videorenderer_soft.h \ $$PHONON_DS9_DIR/videorenderer_vmr9.h \ + $$PHONON_DS9_DIR/videorenderer_evr.h \ $$PHONON_DS9_DIR/volumeeffect.h \ $$PHONON_DS9_DIR/qbasefilter.h \ $$PHONON_DS9_DIR/qpin.h \ @@ -46,6 +47,7 @@ SOURCES += \ $$PHONON_DS9_DIR/videowidget.cpp \ $$PHONON_DS9_DIR/videorenderer_soft.cpp \ $$PHONON_DS9_DIR/videorenderer_vmr9.cpp \ + $$PHONON_DS9_DIR/videorenderer_evr.cpp \ $$PHONON_DS9_DIR/volumeeffect.cpp \ $$PHONON_DS9_DIR/qbasefilter.cpp \ $$PHONON_DS9_DIR/qpin.cpp \ -- cgit v0.12 From ab31654127d7a6e9a06a2c75bc8b2832d68cdfc0 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 15 Apr 2010 20:32:27 +1000 Subject: Fix previous merge commit. --- src/3rdparty/phonon/ds9/mediaobject.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index 34f92c2..d640956 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -27,6 +27,9 @@ along with this library. If not, see . #include #include #include +#ifdef Q_CC_MSVC +# include +#endif #include #include "mediaobject.h" -- cgit v0.12 From f2f5184d4a1c1bb0dd4816a13918a67ae0435d3d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 15 Apr 2010 12:23:19 +0200 Subject: qdoc: Fixed .qdocconf files for assistant. (cherry picked from commit 114cb018c088570ff0640eeb0d57594905ff9fcf) --- tools/qdoc3/test/qt-build-docs.qdocconf | 30 ++++++++++++++++++++++++++- tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 29 +++++++++++++++++++++++++- tools/qdoc3/test/qt.qdocconf | 29 +++++++++++++++++++++++++- tools/qdoc3/test/qt_zh_CN.qdocconf | 29 +++++++++++++++++++++++++- 4 files changed, 113 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index c9392c0..900c7c3 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,13 +22,41 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML -qhp.Qt.extraFiles = classic.css \ +qhp.Qt.extraFiles = style/style.css \ + scripts/functions.js \ + scripts/jquery.js \ + images/api_examples.png \ + images/api_lookup.png \ + images/api_topcs.png \ + images/bg_11.png \ + images/bg_1_blank.png \ + images/bg_1.png \ + images/bg_1r.png \ + images/bg_r.png \ + images/bg_ul_blank.png \ + images/bg_ul.png \ + images/bg_ur_blank.png \ + images/bg_ur.png \ + images/breadcrumb.png \ + images/bullet_dn.png \ + images/bullet_gt.png \ + images/feedbackground.png \ + images/form_bg.png \ + images/horBar.png \ + images/page_bg.png \ + images/print.png \ + images/qt_guide.png \ images/qt-logo.png \ + images/qt_ref_doc.png \ + images/qt_tools.png \ + images/sep.png \ + images/sprites-combined.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png + qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.0 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 19db8a9..93c5e3e 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -29,8 +29,35 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML -qhp.Qt.extraFiles = classic.css \ +qhp.Qt.extraFiles = style/style.css \ + scripts/functions.js \ + scripts/jquery.js \ + images/api_examples.png \ + images/api_lookup.png \ + images/api_topcs.png \ + images/bg_11.png \ + images/bg_1_blank.png \ + images/bg_1.png \ + images/bg_1r.png \ + images/bg_r.png \ + images/bg_ul_blank.png \ + images/bg_ul.png \ + images/bg_ur_blank.png \ + images/bg_ur.png \ + images/breadcrumb.png \ + images/bullet_dn.png \ + images/bullet_gt.png \ + images/feedbackground.png \ + images/form_bg.png \ + images/horBar.png \ + images/page_bg.png \ + images/print.png \ + images/qt_guide.png \ images/qt-logo.png \ + images/qt_ref_doc.png \ + images/qt_tools.png \ + images/sep.png \ + images/sprites-combined.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ images/dynamiclayouts-example.png \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 29b49e2..91f9525 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -24,8 +24,35 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML -qhp.Qt.extraFiles = classic.css \ +qhp.Qt.extraFiles = style/style.css \ + scripts/functions.js \ + scripts/jquery.js \ + images/api_examples.png \ + images/api_lookup.png \ + images/api_topcs.png \ + images/bg_11.png \ + images/bg_1_blank.png \ + images/bg_1.png \ + images/bg_1r.png \ + images/bg_r.png \ + images/bg_ul_blank.png \ + images/bg_ul.png \ + images/bg_ur_blank.png \ + images/bg_ur.png \ + images/breadcrumb.png \ + images/bullet_dn.png \ + images/bullet_gt.png \ + images/feedbackground.png \ + images/form_bg.png \ + images/horBar.png \ + images/page_bg.png \ + images/print.png \ + images/qt_guide.png \ images/qt-logo.png \ + images/qt_ref_doc.png \ + images/qt_tools.png \ + images/sep.png \ + images/sprites-combined.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ images/dynamiclayouts-example.png \ diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index 980c542..925edec 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -31,8 +31,35 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML -qhp.Qt.extraFiles = classic.css \ +qhp.Qt.extraFiles = style/style.css \ + scripts/functions.js \ + scripts/jquery.js \ + images/api_examples.png \ + images/api_lookup.png \ + images/api_topcs.png \ + images/bg_11.png \ + images/bg_1_blank.png \ + images/bg_1.png \ + images/bg_1r.png \ + images/bg_r.png \ + images/bg_ul_blank.png \ + images/bg_ul.png \ + images/bg_ur_blank.png \ + images/bg_ur.png \ + images/breadcrumb.png \ + images/bullet_dn.png \ + images/bullet_gt.png \ + images/feedbackground.png \ + images/form_bg.png \ + images/horBar.png \ + images/page_bg.png \ + images/print.png \ + images/qt_guide.png \ images/qt-logo.png \ + images/qt_ref_doc.png \ + images/qt_tools.png \ + images/sep.png \ + images/sprites-combined.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ images/dynamiclayouts-example.png \ -- cgit v0.12 From 3764acbd211b97cf48908d90697d16e43c116836 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 13 Apr 2010 15:15:33 +0200 Subject: Doc: Fixing design bugs. Updating the index page and script/style files. Adding some image files. Reveiwed-by: trustme (cherry picked from commit c0d02030333c9f96188b5a425f2552472ab53325) --- doc/src/index.qdoc | 2 - doc/src/template/images/bullet_dn.png | Bin 0 -> 230 bytes doc/src/template/images/bullet_up.png | Bin 0 -> 253 bytes doc/src/template/images/header.png | Bin 0 -> 2600 bytes doc/src/template/scripts/functions.js | 11 +- doc/src/template/style/style.css | 817 +++++++++--------------- tools/qdoc3/test/qt-defines.qdocconf | 2 + tools/qdoc3/test/qt-html-templates.qdocconf | 26 +- tools/qdoc3/test/scripts/functions.js | 60 ++ tools/qdoc3/test/scripts/jquery.js | 152 +++++ tools/qdoc3/test/style/style.css | 946 ++++++++++++++++++++++++++++ tools/qdoc3/test/style/style_ie6.css | 54 ++ tools/qdoc3/test/style/style_ie7.css | 19 + tools/qdoc3/test/style/style_ie8.css | 0 14 files changed, 1562 insertions(+), 527 deletions(-) create mode 100644 doc/src/template/images/bullet_dn.png create mode 100644 doc/src/template/images/bullet_up.png create mode 100644 doc/src/template/images/header.png create mode 100644 tools/qdoc3/test/scripts/functions.js create mode 100644 tools/qdoc3/test/scripts/jquery.js create mode 100644 tools/qdoc3/test/style/style.css create mode 100644 tools/qdoc3/test/style/style_ie6.css create mode 100644 tools/qdoc3/test/style/style_ie7.css create mode 100644 tools/qdoc3/test/style/style_ie8.css diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 71060f8..2f23e6e 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -43,8 +43,6 @@ \page index.html \keyword Qt Reference Documentation - \title Qt Reference Documentation - \raw HTML
diff --git a/doc/src/template/images/bullet_dn.png b/doc/src/template/images/bullet_dn.png new file mode 100644 index 0000000..f776247 Binary files /dev/null and b/doc/src/template/images/bullet_dn.png differ diff --git a/doc/src/template/images/bullet_up.png b/doc/src/template/images/bullet_up.png new file mode 100644 index 0000000..285e741 Binary files /dev/null and b/doc/src/template/images/bullet_up.png differ diff --git a/doc/src/template/images/header.png b/doc/src/template/images/header.png new file mode 100644 index 0000000..141488b Binary files /dev/null and b/doc/src/template/images/header.png differ diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index c510410..329b910 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,7 +1,7 @@ /* START non link areas where cursor should change to pointing hand */ $('.t_button').mouseover(function() { - $(this).css('cursor','pointer'); + $('.t_button').css('cursor','pointer'); /*document.getElementById(this.id).style.cursor='pointer';*/ }); @@ -17,17 +17,20 @@ $('#medA').click(function() { $('.content h1').css('font','600 18px/1.2 Arial'); $('.content h2').css('font','600 16px/1.2 Arial'); $('.content h3').css('font','600 14px/1.2 Arial'); - $('.content p').css('font','13px/1.2 Verdana'); - $('.content li').css('font','600 10pt/1 Verdana'); + $('.content p').css('font','13px/20px Verdana'); + $('.content li').css('font','400 13px/1 Verdana'); $('.content li').css('line-height','14px'); + $('.content .toc li').css('font', 'normal 10px/1.2 Verdana'); $('.content table').css('font','13px/1.2 Verdana'); + $('.content .heading').css('font','600 16px/1 Arial'); + $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); $('.t_button').removeClass('active') $(this).addClass('active') }); $('#bigA').click(function() { $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); - $('.content li').css('line-height','14px'); + $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); $('.t_button').removeClass('active') $(this).addClass('active') }); diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 4668c23..c46e875 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -73,6 +73,7 @@ { font-size: 100%; } + /* Page style */ html { background-color: #e5e5e5; @@ -101,7 +102,6 @@ { background: url(../images/bg_r.png) repeat-y 100% 0; } - .wrapper .hd { padding-left: 216px; @@ -109,12 +109,10 @@ background: url(../images/bg_ul.png) no-repeat 0 0; overflow: hidden; } - .offline .wrapper .hd { background: url(../images/bg_ul_blank.png) no-repeat 0 0; } - .wrapper .hd span { height: 15px; @@ -122,23 +120,19 @@ background: url(../images/bg_ur.png) no-repeat 100% 0; overflow: hidden; } - .offline .wrapper .hd span { /* background: url(../images/bg_ur_blank.png) no-repeat 100% 0; */ } - .wrapper .bd { background: url(../images/bg_l.png) repeat-y 0 0; position: relative; } - .offline .wrapper .bd { background: url(../images/bg_l_blank.png) repeat-y 0 0; } - .wrapper .ft { padding-left: 216px; @@ -146,12 +140,10 @@ background: url(../images/bg_ll.png) no-repeat 0 0; overflow: hidden; } - .offline .wrapper .ft { background: url(../images/bg_ll_blank.png) no-repeat 0 0; } - .wrapper .ft span { height: 15px; @@ -159,34 +151,23 @@ background: url(../images/bg_lr.png) no-repeat 100% 0; overflow: hidden; } - .header, .footer { display: block; clear: both; overflow: hidden; } - - /* .header - { - height: 130px; - position: relative; - } - */ - .header { height: 115px; position: relative; } - .header .icon { position: absolute; top: 13px; left: 0; } - .header .qtref { position: absolute; @@ -195,7 +176,6 @@ width: 302px; height: 22px; } - .header .qtref span { display: block; @@ -204,7 +184,184 @@ text-indent: -999em; background: url(../images/qt_ref_doc.png) no-repeat 0 0; } + /* header elements */ + #nav-topright + { + height: 70px; + } + + #nav-topright ul + { + list-style-type: none; + float: right; + width: 370px; + margin-top: 11px; + } + + #nav-topright li + { + display: inline-block; + margin-right: 20px; + float: left; + } + + #nav-topright li.nav-topright-last + { + margin-right: 0; + } + + #nav-topright li a + { + background: transparent url(../images/sprites-combined.png) no-repeat; + height: 18px; + display: block; + overflow: hidden; + text-indent: -9999px; + } + + #nav-topright li.nav-topright-home a + { + width: 65px; + background-position: -2px -91px; + } + + #nav-topright li.nav-topright-home a:hover + { + background-position: -2px -117px; + } + + + #nav-topright li.nav-topright-dev a + { + width: 30px; + background-position: -76px -91px; + } + + #nav-topright li.nav-topright-dev a:hover + { + background-position: -76px -117px; + } + + + #nav-topright li.nav-topright-labs a + { + width: 40px; + background-position: -114px -91px; + } + + #nav-topright li.nav-topright-labs a:hover + { + background-position: -114px -117px; + } + + #nav-topright li.nav-topright-doc a + { + width: 32px; + background-position: -162px -91px; + } + + #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a + { + background-position: -162px -117px; + } + + #nav-topright li.nav-topright-blog a + { + width: 40px; + background-position: -203px -91px; + } + + #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a + { + background-position: -203px -117px; + } + + #nav-topright li.nav-topright-shop a + { + width: 40px; + background-position: -252px -91px; + } + + #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a + { + background-position: -252px -117px; + } + + #nav-logo + { + background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px; + left: -3px; + position: absolute; + width: 75px; + height: 75px; + top: 13px; + } + #nav-logo a + { + width: 75px; + height: 75px; + display: block; + text-indent: -9999px; + overflow: hidden; + } + /* Clearing */ + .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after + { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + /* ^ Clearing */ + + + + .shortCut-topleft-inactive + { + padding-left: 3px; + background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px; + height: 20px; + width: 93px; + } + .shortCut-topleft-inactive span + { + font-variant: normal; + } + #shortCut + { + padding-top: 10px; + font-weight: bolder; + color: #b0adab; + } + #shortCut ul + { + list-style-type: none; + float: left; + width: 347px; + margin-left: 100px; + } + #shortCut li + { + display: inline-block; + margin-right: 25px; + float: left; + white-space: nowrap; + } + #shortCut li a + { + color: #b0adab; + text-decoration: none; + } + #shortCut li a:hover + { + color: #44a51c; + text-decoration: none; + } + /* end of header elements */ + + /* menu element */ .sidebar { float: left; @@ -212,7 +369,6 @@ width: 200px; font-size: 11px; } - .sidebar a { color: #00732f; @@ -222,19 +378,15 @@ { display: none; } - .sidebar .searchlabel { padding: 0 0 2px 17px; font: normal bold 11px/1.2 Verdana; } - .sidebar .search { padding: 0 15px 0 16px; } - - .sidebar .search form { width: 167px; @@ -242,7 +394,6 @@ padding: 2px 0 0 5px; background: url(../images/form_bg.png) no-repeat 0 0; } - .sidebar .search form fieldset input#searchstring { width: 158px; @@ -252,84 +403,66 @@ outline: none; font: 13px/1.2 Verdana; } - .sidebar .box { padding: 17px 15px 5px 16px; } - .sidebar .box .first { background-image: none; } - .sidebar .box h2 { font: normal 18px/1.2 Arial; padding: 15px 0 0 40px; min-height: 32px; } - .sidebar .box#lookup h2 { background: url(../images/api_lookup.png) no-repeat 0 0; } - .sidebar .box#topics h2 { background: url(../images/api_topics.png) no-repeat 0 0; } - .sidebar .box#examples h2 { background: url(../images/api_examples.png) no-repeat 0 0; } - .sidebar .box .list { display: block; } - .sidebar .box .live { display: none; height: 100px; overflow: auto; } - .list li a:hover, .live li a:hover { text-decoration: underline; } - - - .sidebar .box ul - { - } - .sidebar .box ul li { padding-left: 12px; background: url(../images/bullet_gt.png) no-repeat 0 5px; margin-bottom: 15px; } - .sidebar .bottombar { background: url(../images/box_bg.png) repeat-x 0 bottom; } - + /* content elements */ .wrap { - /* margin: 0 5px 0 0px;*/ overflow: hidden; } - .offline .wrap { margin: 0 5px 0 5px; } - + /* tool bar */ .wrap .toolbar { background-color: #fafafa; @@ -339,12 +472,10 @@ margin-right: 5px; position: relative; } - .wrap .toolbar .toolblock { position: absolute; } - .wrap .toolbar .breadcrumb { font-size: 11px; @@ -359,12 +490,10 @@ vertical-align: top; overflow: hidden; } - .wrap .toolbar .toolbuttons .active { color: #00732F; } - .wrap .toolbar .toolbuttons ul { float: right; @@ -378,7 +507,6 @@ font-weight: bold; color: #B0ADAB; } - #smallA { font-size: 10pt; @@ -391,31 +519,20 @@ { font-size: 14pt; } - #smallA:hover, #medA:hover, #bigA:hover { color: #00732F; } - #print { font-size: 14pt; line-height: 20pt; } - #printIcon { margin-left: 5px; } - - .offline .wrap .breadcrumb - { - } - - .wrap .breadcrumb ul - { - } - + /* bread crumbs */ .wrap .breadcrumb ul li { float: left; @@ -424,105 +541,87 @@ margin-left: 15px; font-weight: bold; } - .wrap .breadcrumb ul li.last { font-weight: normal; } - - .wrap .breadcrumb ul li a - { - } - .wrap .breadcrumb ul li.first { background-image: none; padding-left: 0; margin-left: 0; } - .wrap .content { - /* left 30 top 27*/ padding: 30px; position: relative; } - + /* text elements */ .heading { font: normal 600 16px/1.0 Arial; padding-bottom: 15px; } + .subtitle + { + font-size: 13px; + } + + .small-subtitle + { + font-size: 13px; + } + .wrap .content h1 { font: 600 18px/1.2 Arial; padding-bottom: 15px; } - .wrap .content h2 { font: 600 16px/1.2 Arial; } - .wrap .content h3 { font: 600 14px/1.2 Arial; } - - - .wrap .content p { - padding-bottom: 10px; + line-height:20px; + padding:10px 5px 10px 5px; } - .wrap .content ul { - padding-left: 15px; + padding-left: 25px; } .wrap .content li { padding-left: 12px; background: url(../images/bullet_sq.png) no-repeat 0 5px; - font: normal 600 10pt/1 Verdana; + font: normal 400 10pt/1 Verdana; margin-bottom: 10px; line-height: 14px; } - - .content li:hover + a { + color: #00732F; text-decoration: none; } - - .content li + a:hover { - text-decoration: none; + color: #4c0033; + text-decoration: underline; } - - /*.content*/ a - { - color: #00732F; - text-decoration: none; - } - - .content a:hover - { - color: #4c0033; - text-decoration: underline; - } - .content a:visited { color: #4c0033; + text-decoration: none; } - .offline .wrap .content { padding-top: 15px; } - - .footer { min-height: 100px; @@ -531,7 +630,6 @@ text-align: center; padding-top: 40px; } - .feedback { float: right; @@ -539,7 +637,6 @@ font: normal 8px/1 Verdana; color: #B0ADAB; } - .feedback:hover { float: right; @@ -547,196 +644,6 @@ color: #00732F; text-decoration: underline; } - - - - /* Clearing */ - .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after - { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } - /* ^ Clearing */ - - - /* header elements */ - - - #nav-topright - { - height: 70px; - } - - #nav-topright ul - { - list-style-type: none; - float: right; - width: 347px; - margin-top: 11px; - } - - #nav-topright li - { - display: inline-block; - margin-right: 20px; - float: left; - } - - #nav-topright li.nav-topright-last - { - margin-right: 0; - } - - #nav-topright li a - { - background: transparent url(../images/sprites-combined.png) no-repeat; - height: 18px; - display: block; - overflow: hidden; - text-indent: -9999px; - } - - #nav-topright li.nav-topright-home a - { - width: 65px; - background-position: -2px -91px; - } - - #nav-topright li.nav-topright-home a:hover - { - background-position: -2px -117px; - } - - - #nav-topright li.nav-topright-dev a - { - width: 30px; - background-position: -76px -91px; - } - - #nav-topright li.nav-topright-dev a:hover - { - background-position: -76px -117px; - } - - - #nav-topright li.nav-topright-labs a - { - width: 40px; - background-position: -114px -91px; - } - - #nav-topright li.nav-topright-labs a:hover - { - background-position: -114px -117px; - } - - #nav-topright li.nav-topright-doc a - { - width: 32px; - background-position: -162px -91px; - } - - #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a - { - background-position: -162px -117px; - } - - #nav-topright li.nav-topright-blog a - { - width: 40px; - background-position: -203px -91px; - } - - #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a - { - background-position: -203px -117px; - } - - #nav-topright li.nav-topright-shop a - { - width: 40px; - background-position: -252px -91px; - } - - #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a - { - background-position: -252px -117px; - } - - #nav-logo - { - background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px; - left: -3px; - position: absolute; - width: 75px; - height: 75px; - top: 13px; - } - #nav-logo a - { - width: 75px; - height: 75px; - display: block; - text-indent: -9999px; - overflow: hidden; - } - - - .shortCut-topleft-inactive - { - padding-left: 3px; - background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px; - height: 20px; - width: 93px; - } - - .shortCut-topleft-inactive span - { - font-variant: normal; - } - - #shortCut - { - padding-top: 10px; - font-weight: bolder; - color: #b0adab; - } - - #shortCut ul - { - list-style-type: none; - float: left; - width: 347px; - margin-left: 100px; - } - - #shortCut li - { - display: inline-block; - margin-right: 25px; - float: left; - white-space: nowrap; - } - - #shortCut li a - { - color: #b0adab; - text-decoration: none; - } - - #shortCut li a:hover - { - color: #44a51c; - text-decoration: none; - } - - - /* end of header elements */ - hr { background-color: #e0e0e0; @@ -745,228 +652,111 @@ text-align: left; margin: 15px 0px 15px 0px; } + .content .alignedsummary { margin: 15px; } - - table.valuelist - { - border-width: 0px 0px 1px 0px; - border-style: solid; - border-color: #b0adab; - border-collapse: collapse; - background-color: #f0f0f0; /* border-bottom: solid 1px #b0adab;*/ - } - - table.valuelist th - { - border-width: 0px 0px 0px 0px; - padding: 4px; - color: #00732F; - font: 600 10pt/1 Verdana; - } - - table.generic, table.annotated + /* tables */ + table, pre { - border: none; - padding-left: 15px; - padding-right: 15px; - margin-bottom: 15px; - } - - - table td.memItemLeft - { - width: 180px; - padding: 2px 0px 0px 8px; - margin: 4px; - border-width: 1px; - border-color: #b0adab; - border-style: none; - font-size: 100%; - white-space: nowrap; - } - - table td.memItemRight - { - padding: 2px 8px 0px 8px; - margin: 4px; - border-width: 1px; - border-color: #b0adab; - border-style: none; - font-size: 100%; + -moz-border-radius: 7px 7px 7px 7px; + background-color: #F6F6F6; + border: 1px solid #E6E6E6; + border-collapse: separate; + font-size: 11px; + min-width: 395px; + margin-bottom: 25px; } - + thead{margin-top: 5px;} + th{ padding: 3px 15px 3px 15px;} + td{padding: 3px 15px 3px 20px;} table tr.odd { - background: #EBEBEB; + border-left: 1px solid #E6E6E6; + background-color: #F6F6F6; color: #66666E; } - table tr.even { - background: #F4F4F4; + border-left: 1px solid #E6E6E6; + background-color: #ffffff; color: #66666E; } - - table.annotated th + table tr.odd:hover { - padding: 3px; - text-align: left; + background-color: #E6E6E6; } - - table td, table th + table tr.even:hover { - padding: 3px; /* border:solid 1px #FFFFFF;*/ + background-color: #E6E6E6; } - - table tr pre - { - padding-top: 0px; - padding-bottom: 0px; - padding-left: 0px; - padding-right: 0px; - border: none; - background: none; - } - - tr.qt-style /* change me - widgets-sliders.html*/ - { - background: #BCBCBC; - border-bottom: solid 1px #b0adab; - } - - table tr.qt-code pre /* investigate */ - { - padding: 0.2em; - border: #e7e7e7 1px solid; - background: #f1f1f1; - color: black; - } - - span.preprocessor, span.preprocessor a - { - color: darkblue; - } - span.comment { - color: darkred; + color: #8B0000; font-style: italic; } - span.string, span.char { - color: darkgreen; + color: #254117; } - - .subtitle + pre { - font-size: 13px; + -moz-border-radius:7px 7px 7px 7px; + background-color:#F6F6F6; + border:1px solid #DDDDDD; + margin:0 20px 10px 10px; + padding:20px 15px 20px 20px; + overflow-x:auto; } - - .small-subtitle - { - font-size: 13px; - } - - .qmlitem - { - padding: 0; - } - - .qmlname - { - white-space: nowrap; - } - .qmltype { text-align: center; font-size: 160%; } - - .qmlproto - { - background-color: #eee; - border-width: 1px; - border-style: solid; - border-color: #ddd; - font-weight: bold; - padding: 6px 10px 6px 10px; - margin: 42px 0px 0px 0px; - } - .qmlreadonly { float: right; - color: red; - } - - .qmldoc - { + color: #254117; } - - *.qmlitem p - { - } - - - thead - { - margin-top: 5px; - } - - td - { - padding: 5px; - } - th - { - padding: 5px; - } - - #feedbackBox { - display: none; - position: fixed; + display:none; + -moz-border-radius:7px 7px 7px 7px; + border:1px solid #DDDDDD; + position:fixed; + top:100px; left: 33%; - bottom: 200px; height: 190px; width: 400px; padding: 5px; background-color: #e6e7e8; z-index: 4; } - #feedcloseX a { - padding-top: 5px; - padding-right: 5px; - color: #333333; + display:inline; + padding: 5px 5px 0 0; + margin-bottom:3px; + color: #363534; + font-weight:600; float: right; text-decoration: none; } - #feedbox + /* here */ { - float: none; - width: 350px; + display:inline; + width: 370px; height: 120px; - margin-top: 5px; - margin-left: 25px; - margin-right: 25px; + margin:0px 25px 10px 15px; } - #feedsubmit { - float: right; - margin-top: 4px; - margin-right: 22px; + display:inline; + float:right; + margin:4px 32px 0 0; } - #blurpage { display: none; @@ -979,74 +769,83 @@ background: transparent url(../images/feedbackground.png) 0 0; z-index: 3; } - /* page elements */ .toc { - float: right; - border: solid 1px #666600; - background-color: #FFFFCC; - margin: 15px; + float: right; + -moz-border-radius:7px 7px 7px 7px; + background-color:#F6F6F6; + border:1px solid #DDDDDD; + margin:0 20px 10px 10px; + padding:20px 15px 20px 20px; height: auto; width: 200px; } + .toc h3 + { + font:600 12px/1.2 Arial; + } + .toc ul { float: left; padding: 15px; + } + .content .toc li { - font: normal 13px/1.2 Verdana; + font: normal 10px/1.2 Verdana; + background: url(../images/bullet_dn.png) no-repeat 0 5px; } - - .relpage /* edit */ + + .relpage { + -moz-border-radius: 7px 7px 7px 7px; + border: 1px solid #DDDDDD; + padding: 25px 25px; clear:both; - border: solid 1px #666600; - background-color: #FFFFCC; - height: auto; - width: 100%; - } - .relpage ul - { - float:none; + } + .relpage ul + { + float: none; padding: 15px; - - } - .relpage li - { - font: normal 13px/1.2 Verdana; - - } -/* edit */ + } + .content .relpage li + { + font: normal 11px/1.2 Verdana; + } + /* edit */ h3.fn, span.fn { - background-color: #eee; + background-color: #F6F6F6; border-width: 1px; border-style: solid; - border-color: #ddd; - font-weight: bold; - /* padding: 6px 0px 6px 10px;*/ - /* margin: 42px 0px 0px 0px;*/ + border-color: #E6E6E6; + font-weight: bold; + /* padding: 6px 0px 6px 10px;*/ + /* margin: 42px 0px 0px 0px;*/ } /* edit */ .indexbox { - /* max-width:785px;*/ - width: 100%; /* margin-bottom: 30px;*/ + width: 100%; + } + .content .indexboxcont li + { + font: normal 600 13px/1 Verdana; } - .indexbox a + /* .indexbox a { color: #00732f; text-decoration: none; - } - .indexbox a:hover + }*/ + .indexbox a:hover, .indexbox a:visited:hover { - color: #00732f; + color: #4c0033; text-decoration: underline; } .indexbox a:visited @@ -1062,14 +861,14 @@ .indexboxbar { - background: transparent url( "../images/horBar.png" ) repeat-x left bottom; + background: transparent url( "../images/horBar.png" ) repeat-x left bottom; margin-bottom: 25px; } .indexboxcont .section { - display: inline-block; /*Pål padding-right: 20px; padding-left: 10px; */ - width: 49%; + display: inline-block; + width: 49%; *width:42%; _width:42%; padding:0 2% 0 1%; @@ -1078,14 +877,13 @@ .indexboxcont .indexIcon { - /*PÅL width: 115px;*/ - width: 13%; + width: 11%; *width:18%; _width:18%; overflow:hidden; } .indexboxcont .section p - { /*PÅL max-width: 350px;*/ + { padding-top: 20px; padding-bottom: 20px; } @@ -1093,37 +891,40 @@ .indexboxcont .sectionlist { display: inline-block; - width: 34%; - margin-right:-2px; - vertical-align:top; + width: 33%; + margin-right: -2px; + vertical-align: top; padding: 0; } .tricol { - /* margin-left: 10px; *//*PÅL padding-right:76px;*/ + } .indexboxcont .sectionlist ul { + padding-left: 15px; margin-bottom: 20px; } - +/* .indexboxcont .sectionlist ul li { line-height: 12px; } - +*/ .lastcol { display: inline-block; - vertical-align:top; + vertical-align: top; padding: 0; max-width: 25%; } .tricol .lastcol { + margin-left:-6px; } + /*.toc ul*/ /* end page elements */ } diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index e1a008e..faf3906 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -29,6 +29,8 @@ extraimages.HTML = qt-logo \ bg_ll_blank.png \ bg_ur.png \ bullet_sq.png \ + bullet_dn.png \ + bullet_up.png \ page_bg.png \ qt_tools.png \ api_topics.png \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 5bb4382..67a25f3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -103,7 +103,7 @@ HTML.postheader = "
\n" \ "
\n" HTML.footer = "
\n" \ - "
\n" \ + "
\n" \ " [+] Documentation Feedback
\n" \ "
\n" \ "
\n" \ @@ -113,20 +113,20 @@ HTML.footer = "
\n" \ "
\n" \ "
\n" \ "

\n" \ - " © 2008-2010 Nokia Corporation and/or its>\n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation>\n" \ " in Finland and/or other countries worldwide.

\n" \ "

\n" \ - " All other trademarks are property of their respective owners. \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

\n" \ "
\n" \ "
\n" \ "
\n" \ "
\n" \ - " X\n" \ + " X\n" \ "
\n" \ " \n" \ - " \n" \ + " \n" \ "
\n" \ "
\n" \ @@ -134,12 +134,12 @@ HTML.footer = " \n" \ " \n" \ " \n" \ "\n" diff --git a/tools/qdoc3/test/scripts/functions.js b/tools/qdoc3/test/scripts/functions.js new file mode 100644 index 0000000..0135427 --- /dev/null +++ b/tools/qdoc3/test/scripts/functions.js @@ -0,0 +1,60 @@ + +/* START non link areas where cursor should change to pointing hand */ +$('.t_button').mouseover(function() { + $('.t_button').css('cursor','pointer'); + /*document.getElementById(this.id).style.cursor='pointer';*/ +}); + +/* END non link areas */ +$('#smallA').click(function() { + $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); + $('.t_button').removeClass('active') + $(this).addClass('active') +}); + +$('#medA').click(function() { + $('.content .heading').css('font','600 16px/1 Arial'); + $('.content h1').css('font','600 18px/1.2 Arial'); + $('.content h2').css('font','600 16px/1.2 Arial'); + $('.content h3').css('font','600 14px/1.2 Arial'); + $('.content p').css('font','13px/20px Verdana'); + $('.content li').css('font','400 13px/1 Verdana'); + $('.content li').css('line-height','14px'); + $('.content table').css('font','13px/1.2 Verdana'); + $('.content .heading').css('font','600 16px/1 Arial'); + $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); + $('.t_button').removeClass('active') + $(this).addClass('active') +}); + +$('#bigA').click(function() { + $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); + $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); + $('.t_button').removeClass('active') + $(this).addClass('active') +}); + +function doSearch(str){ + +if (str.length>3) + { + alert('start search'); + // document.getElementById("refWrapper").innerHTML=""; + return; + } + else + return; + +// var url="indexSearch.php"; +// url=url+"?q="+str; + // url=url+"&sid="+Math.random(); + // var url="http://localhost:8983/solr/select?"; + // url=url+"&q="+str; + // url=url+"&fq=&start=0&rows=10&fl=&qt=&wt=&explainOther=&hl.fl="; + + // $.get(url, function(data){ + // alert(data); + // document.getElementById("refWrapper").innerHTML=data; + //}); + +} \ No newline at end of file diff --git a/tools/qdoc3/test/scripts/jquery.js b/tools/qdoc3/test/scripts/jquery.js new file mode 100644 index 0000000..0c7294c --- /dev/null +++ b/tools/qdoc3/test/scripts/jquery.js @@ -0,0 +1,152 @@ +/*! + * jQuery JavaScript Library v1.4.1 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Jan 25 19:43:33 2010 -0500 + */ +(function(z,v){function la(){if(!c.isReady){try{r.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function Ma(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var n in b)X(a,n,b[n],f,e,d);return a}if(d!==v){f=!i&&f&&c.isFunction(d);for(n=0;n-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete x[o]}i=c(a.target).closest(f, +a.currentTarget);m=0;for(s=i.length;m)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent, +va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:r;if(a=Ta.exec(a))if(c.isPlainObject(b)){a=[r.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ra([d[1]], +[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=r.getElementById(d[2])){if(b.id!==d[2])return S.find(a);this.length=1;this[0]=b}this.context=r;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=r;a=r.getElementsByTagName(a)}else return!b||b.jquery?(b||S).find(a):c(b).find(a);else if(c.isFunction(a))return S.ready(a);if(a.selector!==v){this.selector=a.selector;this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a, +this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return Q.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;ba.apply(this,a);return this},each:function(a,b){return c.each(this, +a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(r,c);else P&&P.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice}; +c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support= +{leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null}; +b.type="text/javascript";try{b.appendChild(r.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if(z[f]){c.support.scriptEval=true;delete z[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function n(){c.support.noCloneEvent=false;d.detachEvent("onclick",n)});d.cloneNode(true).fireEvent("onclick")}d=r.createElement("div");d.innerHTML="";a=r.createDocumentFragment();a.appendChild(d.firstChild); +c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var n=r.createElement("div");n.style.width=n.style.paddingLeft="1px";r.body.appendChild(n);c.boxModel=c.support.boxModel=n.offsetWidth===2;r.body.removeChild(n).style.display="none"});a=function(n){var o=r.createElement("div");n="on"+n;var m=n in o;if(!m){o.setAttribute(n,"return;");m=typeof o[n]==="function"}return m};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props= +{"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ua=0,xa={},Va={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var f=a[G],e=c.cache;if(!b&&!f)return null;f||(f=++Ua);if(typeof b==="object"){a[G]=f;e=e[f]=c.extend(true, +{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});if(d!==v){a[G]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[G]}catch(i){a.removeAttribute&&a.removeAttribute(G)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this, +a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===v){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===v&&this.length)f=c.data(this[0],a);return f===v&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d); +return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===v)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]|| +a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(o){var m= +c(this);m.addClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value|| +{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i=0;else if(c.nodeName(this,"select")){var x=c.makeArray(s);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),x)>=0});if(!x.length)this.selectedIndex=-1}else this.value=s}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](d); +f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==v;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Xa.test(b);if(b in a&&f&&!i){if(e){b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText= +""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?v:a}return c.style(a,b,d)}});var ab=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==z&&!a.frameElement)a=z;if(!d.guid)d.guid=c.guid++;if(f!==v){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j= +function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var n,o=0;n=b[o++];){var m=n.split(".");n=m.shift();if(o>1){d=c.proxy(d);if(f!==v)d.data=f}d.type=m.slice(0).sort().join(".");var s=e[n],x=this.special[n]||{};if(!s){s=e[n]={};if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)}if(x.add)if((m=x.add.call(a, +d,f,m,s))&&c.isFunction(m)){m.guid=m.guid||d.guid;m.data=m.data||d.data;m.type=m.type||d.type;d=m}s[d.guid]=d;this.global[n]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===v||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);for(var n=0;i=b[n++];){var o=i.split(".");i=o.shift();var m=!o.length,s=c.map(o.slice(0).sort(),ab);s=new RegExp("(^|\\.)"+ +s.join("\\.(?:.*\\.)?")+"(\\.|$)");var x=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);for(e in f[i])break;if(!e){if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(A=c.data(a,"handle"))A.elem=null;c.removeData(a, +"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return v;a.result=v;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d, +b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(i){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){d=a.target;var j;if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){try{if(d[e]){if(j=d["on"+e])d["on"+e]=null;this.triggered=true;d[e]()}}catch(n){}if(j)d["on"+e]=j;this.triggered=false}}},handle:function(a){var b, +d;a=arguments[0]=c.event.fix(a||z.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==v){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||r;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=r.documentElement;d=r.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;b.liveProxy=a;c.event.add(this,b.live,na,b)},remove:function(a){if(a.length){var b= +0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],na)}},special:{}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true}; +c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Aa=function(a){for(var b= +a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ba=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ba:Aa,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ba:Aa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!== +"form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this, +"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var da=/textarea|input|select/i;function Ca(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ea(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Ca(d);if(a.type!=="focusout"|| +d.type!=="radio")c.data(d,"_change_data",e);if(!(f===v||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}}c.event.special.change={filters:{focusout:ea,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)},beforeactivate:function(a){a= +a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))}},setup:function(a,b,d){for(var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)},remove:function(a,b){for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)}};var T=c.event.special.change.filters}r.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this, +f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){e=f;f=v}var j=b==="one"?c.proxy(e,function(n){c(this).unbind(n,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a, +b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d0){y=t;break}}t=t[g]}l[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;[0,0].sort(function(){n=false;return 0});var o=function(g,h,k,l){k=k||[];var q=h=h||r;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g|| +typeof g!=="string")return k;for(var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){I=u[3];p.push(u[1]);if(u[2]){R=u[3];break}}if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){g=p.shift();if(m.relative[g])g+=p.shift();t=fa(g,t)}else{if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){u=o.find(p.shift(),h,M);h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]}if(h){u= +l?{expr:p.pop(),set:A(l)}:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=u.expr?o.filter(u.expr,u.set):u.set;if(p.length>0)y=A(t);else H=false;for(;p.length;){var D=p.pop();u=D;if(m.relative[D])u=p.pop();else D="";if(u==null)u=h;m.relative[D](y,u,M)}}else y=[]}y||(y=t);y||o.error(D||g);if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&& +y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);if(R){o(R,q,k,l);o.uniqueSort(k)}return k};o.uniqueSort=function(g){if(C){j=n;g.sort(C);if(j)for(var h=1;h":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var l=0,q=g.length;l=0))k||l.push(u);else if(k)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&& +"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,l,q,p){h=g[1].replace(/\\/g,"");if(!p&&m.attrMap[h])g[1]=m.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,l,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);else{g=o.filter(g[3],h,k,true^q);k||l.push.apply(l,g);return false}else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true); +return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!o(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"=== +g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,k,l){return h===l.length-1},even:function(g,h){return h%2=== +0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return hk[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,l){var q=h[1],p=m.filters[q];if(p)return p(g,k,h,l);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];k=0;for(l=h.length;k= +0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var l=h[2];h=h[4];return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="? +k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,l){var q=m.setFilters[h[2]];if(q)return q(g,k,h,l)}}},s=m.match.POS;for(var x in m.match){m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var A=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g}; +try{Array.prototype.slice.call(r.documentElement.childNodes,0)}catch(B){A=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,l=g.length;k";var k=r.documentElement;k.insertBefore(g,k.firstChild);if(r.getElementById(h)){m.find.ID=function(l,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]};m.filter.ID=function(l,q){var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id"); +return l.nodeType===1&&p&&p.nodeValue===q}}k.removeChild(g);k=g=null})();(function(){var g=r.createElement("div");g.appendChild(r.createComment(""));if(g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);k=h}return k};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){return h.getAttribute("href", +2)};g=null})();r.querySelectorAll&&function(){var g=o,h=r.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){o=function(l,q,p,u){q=q||r;if(!u&&q.nodeType===9&&!w(q))try{return A(q.querySelectorAll(l),p)}catch(t){}return g(l,q,p,u)};for(var k in g)o[k]=g[k];h=null}}();(function(){var g=r.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== +0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){m.order.splice(1,0,"CLASS");m.find.CLASS=function(h,k,l){if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])};g=null}}})();var E=r.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},w=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},fa=function(g,h){var k=[], +l="",q;for(h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){l+=q[0];g=g.replace(m.match.PSEUDO,"")}g=m.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var i=d;i0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for(var n=a.length;e +-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(m,s){for(;s&&s.ownerDocument&&s!==b;){if(o?o.index(s)>-1:c(s).is(a))return s;s=s.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(), +a);return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")}, +nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);bb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e): +e;if((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();return this.pushStack(e,a,Q.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!== +b&&d.push(a);return d}});var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"], +col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));return c.getText(this)}, +wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length? +d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments, +false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&& +!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){qa(this,b);qa(this.find("*"),b.find("*"))}return b},html:function(a){if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;else if(typeof a==="string"&&!/\n"; out() << " \n"; out() << "\n"; - -#if 0 - out() << "\n"; - out() << QString("\n").arg(naturalLanguage); - - QString shortVersion; - if ((project != "Qtopia") && (project != "Qt Extended")) { - shortVersion = project + " " + shortVersion + ": "; - if (node && !node->doc().location().isEmpty()) - out() << "\n"; - - shortVersion = myTree->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); - if (!shortVersion.isEmpty()) { - if (project == "QSA") - shortVersion = "QSA " + shortVersion + ": "; - else - shortVersion = "Qt " + shortVersion + ": "; - } - } - - out() << "\n" - " " << shortVersion << protectEnc(title) << "\n"; - out() << QString("").arg(outputEncoding); - - if (!style.isEmpty()) - out() << " \n"; - - const QMap &metaMap = node->doc().metaTagMap(); - if (!metaMap.isEmpty()) { - QMapIterator i(metaMap); - while (i.hasNext()) { - i.next(); - out() << " \n"; - } - } - - navigationLinks.clear(); - - if (node && !node->links().empty()) { - QPair linkPair; - QPair anchorPair; - const Node *linkNode; - - if (node->links().contains(Node::PreviousLink)) { - linkPair = node->links()[Node::PreviousLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "[Previous: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::ContentsLink)) { - linkPair = node->links()[Node::ContentsLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "["; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::NextLink)) { - linkPair = node->links()[Node::NextLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "[Next: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::IndexLink)) { - linkPair = node->links()[Node::IndexLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " \n"; - } - if (node->links().contains(Node::StartLink)) { - linkPair = node->links()[Node::StartLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " \n"; - } - } - - foreach (const QString &stylesheet, stylesheets) { - out() << " \n"; - } - foreach (const QString &customHeadElement, customHeadElements) { - out() << " " << customHeadElement << "\n"; - } - - out() << "\n" - #endif + if (offlineDocs) + out() << "\n"; + else out() << "\n"; + if (mainPage) generateMacRef(node, marker); out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); -#if 0 +#if 0 // Removed for new docf format. MWS if (node && !node->links().empty()) out() << "

\n" << navigationLinks << "

\n"; #endif @@ -4375,8 +4254,6 @@ void HtmlGenerator::endLink() inObsoleteLink = false; } -QT_END_NAMESPACE - #ifdef QDOC_QML /*! @@ -4728,3 +4605,139 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke } #endif + +#if 0 // fossil removed for new doc format MWS 19/04/2010 + out() << "\n"; + out() << QString("\n").arg(naturalLanguage); + + QString shortVersion; + if ((project != "Qtopia") && (project != "Qt Extended")) { + shortVersion = project + " " + shortVersion + ": "; + if (node && !node->doc().location().isEmpty()) + out() << "\n"; + + shortVersion = myTree->version(); + if (shortVersion.count(QChar('.')) == 2) + shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); + if (!shortVersion.isEmpty()) { + if (project == "QSA") + shortVersion = "QSA " + shortVersion + ": "; + else + shortVersion = "Qt " + shortVersion + ": "; + } + } + + out() << "\n" + " " << shortVersion << protectEnc(title) << "\n"; + out() << QString("").arg(outputEncoding); + + if (!style.isEmpty()) + out() << " \n"; + + const QMap &metaMap = node->doc().metaTagMap(); + if (!metaMap.isEmpty()) { + QMapIterator i(metaMap); + while (i.hasNext()) { + i.next(); + out() << " \n"; + } + } + + navigationLinks.clear(); + + if (node && !node->links().empty()) { + QPair linkPair; + QPair anchorPair; + const Node *linkNode; + + if (node->links().contains(Node::PreviousLink)) { + linkPair = node->links()[Node::PreviousLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "[Previous: "; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::ContentsLink)) { + linkPair = node->links()[Node::ContentsLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "["; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::NextLink)) { + linkPair = node->links()[Node::NextLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "[Next: "; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::IndexLink)) { + linkPair = node->links()[Node::IndexLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " \n"; + } + if (node->links().contains(Node::StartLink)) { + linkPair = node->links()[Node::StartLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " \n"; + } + } + + foreach (const QString &stylesheet, stylesheets) { + out() << " \n"; + } + + foreach (const QString &customHeadElement, customHeadElements) { + out() << " " << customHeadElement << "\n"; + } + + out() << "\n" + #endif + + QT_END_NAMESPACE diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 559c968..2a365e9 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -297,6 +297,7 @@ class HtmlGenerator : public PageGenerator bool inTableHeader; int numTableRows; bool threeColumnEnumValueTable; + bool offlineDocs; QString link; QStringList sectionNumber; QRegExp funcLeftParen; diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index cc3e436..ef6fe97 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -9,6 +9,7 @@ versionsym = version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 +online = true sourceencoding = UTF-8 outputencoding = UTF-8 -- cgit v0.12 From d66a6da84af01f1a6d4fd52d9b1cbec72a4fae3c Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 20 Apr 2010 13:02:51 +1000 Subject: Make offline docs the default for package generation. Acked-by: Martin Smith --- tools/qdoc3/test/qt.qdocconf | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index ef6fe97..cc3e436 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -9,7 +9,6 @@ versionsym = version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 -online = true sourceencoding = UTF-8 outputencoding = UTF-8 -- cgit v0.12 From bb0aa3c61e8c443ec4207381ca10c85f6c4b6665 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 10:34:03 +0200 Subject: Fix crash on startup on Symbian OS The changes to QThread introduced by commit 9aa4538b219ed759a47e8d1f93c2797bf07b5e2f mean that the QThread constructor calls into the event dispatcher. The Symbian event dispatcher owns a QThread, so it crashed when the code re-entered the partially constructed event dispatcher and used an uninitialised pointer. This change delays construction of the QThread until the point of use, so that the event dispatcher is fully constructed. Task-number: QTBUG-10029 Reviewed-by: Jason Barron (cherry picked from commit 2b55d52669beb72396f94e449fdf172735349b3b) --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 20 +++++++++++++++----- src/corelib/kernel/qeventdispatcher_symbian_p.h | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index ca44264..f811361 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -632,6 +632,7 @@ void QSocketActiveObject::deleteLater() QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent) : QAbstractEventDispatcher(parent), + m_selectThread(0), m_activeScheduler(0), m_wakeUpAO(0), m_completeDeferredAOs(0), @@ -659,11 +660,19 @@ void QEventDispatcherSymbian::startingUp() wakeUp(); } +QSelectThread& QEventDispatcherSymbian::selectThread() { + if (!m_selectThread) + m_selectThread = new QSelectThread; + return *m_selectThread; +} + void QEventDispatcherSymbian::closingDown() { - if (m_selectThread.isRunning()) { - m_selectThread.stop(); + if (m_selectThread && m_selectThread->isRunning()) { + m_selectThread->stop(); } + delete m_selectThread; + m_selectThread = 0; delete m_completeDeferredAOs; delete m_wakeUpAO; @@ -935,12 +944,13 @@ void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifie { QSocketActiveObject *socketAO = q_check_ptr(new QSocketActiveObject(this, notifier)); m_notifiers.insert(notifier, socketAO); - m_selectThread.requestSocketEvents(notifier, &socketAO->iStatus); + selectThread().requestSocketEvents(notifier, &socketAO->iStatus); } void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notifier ) { - m_selectThread.cancelSocketEvents(notifier); + if (m_selectThread) + m_selectThread->cancelSocketEvents(notifier); if (m_notifiers.contains(notifier)) { QSocketActiveObject *sockObj = *m_notifiers.find(notifier); m_deferredSocketEvents.removeAll(sockObj); @@ -951,7 +961,7 @@ void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notif void QEventDispatcherSymbian::reactivateSocketNotifier(QSocketNotifier *notifier) { - m_selectThread.requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus); + selectThread().requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus); } void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject * object ) diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 1ab31cc..5281199 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -259,8 +259,9 @@ private: bool sendPostedEvents(); bool sendDeferredSocketEvents(); + QSelectThread& selectThread(); private: - QSelectThread m_selectThread; + QSelectThread *m_selectThread; CQtActiveScheduler *m_activeScheduler; -- cgit v0.12 From c6cb0de12b9bbb71690a0b6d5c53b2329767f2a4 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 19 Apr 2010 18:59:32 +0200 Subject: Quick fix to make the documentation work, needs a proper solution though. Reviewed-by: kh (cherry picked from commit 0fd81e81a357edb9f9e615cff28a1876bd363b2e) --- tools/assistant/tools/assistant/helpviewer.cpp | 4 ++++ tools/assistant/tools/assistant/helpviewer.h | 1 + tools/assistant/tools/assistant/helpviewer_qwv.cpp | 22 ++++++++++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 0c51a02..85e4e71 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,6 +52,10 @@ QT_BEGIN_NAMESPACE +QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." + "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) + .replace(QLatin1String("."), QLatin1String(""))); + QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 6f1f48d..9c3971f 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -67,6 +67,7 @@ public: virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0; + static QString DocPath; static QString AboutBlank; static QString LocalHelpFile; static QString PageNotFoundMessage; diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index db1cd58..a19b29a 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -129,13 +129,27 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { TRACE_OBJ - const QUrl &url = request.url(); - const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url.toString()); - + QString url = request.url().toString(); HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + + // TODO: For some reason the url to load is already wrong (passed from webkit) + // though the css file and the references inside should work that way. One + // possible problem might be that the css is loaded at the same level as the + // html, thus a path inside the css like (../images/foo.png) might cd out of + // the virtual folder + if (!helpEngine.findFile(url).isValid()) { + if (url.startsWith(AbstractHelpViewer::DocPath)) { + if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { + url = url.replace(AbstractHelpViewer::DocPath, + AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + } + } + } + + const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url); const QByteArray &data = helpEngine.findFile(url).isValid() ? helpEngine.fileData(url) - : AbstractHelpViewer::PageNotFoundMessage.arg(url.toString()).toUtf8(); + : AbstractHelpViewer::PageNotFoundMessage.arg(url).toUtf8(); return new HelpNetworkReply(request, data, mimeType.isEmpty() ? QLatin1String("application/octet-stream") : mimeType); } -- cgit v0.12 From 0c3411c051e1f59e050fcf40fd55fa2feb585d6b Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 20 Apr 2010 11:51:35 +0200 Subject: Doc: Correcting qdocconf files for assistant Linking correct files to the qdocconf files Reviewed-by: Daniel Molkentin (cherry picked from commit 84eadc0bc232d8196e08f5aa5614ce9a17ea93bd) --- tools/qdoc3/test/qt-build-docs.qdocconf | 21 ++++++++++++++------- tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 20 +++++++++++++------- tools/qdoc3/test/qt.qdocconf | 20 +++++++++++++------- tools/qdoc3/test/qt_zh_CN.qdocconf | 20 +++++++++++++------- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index dbff4e2..0694748 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,14 +22,12 @@ qhp.Qt.indexTitle = Qt Reference Documentation # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -37,24 +35,33 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css + qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 461c069..5a3d726 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -30,14 +30,12 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -45,24 +43,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index cc3e436..92ce9a3 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -25,14 +25,12 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -40,24 +38,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.0 diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index c5d2c88..a5a65d8 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -32,14 +32,12 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -47,24 +45,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp -- cgit v0.12 From 034e13e765874b25b56d16c9487efd2e98fe4518 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 20 Apr 2010 15:51:04 +0200 Subject: Doc: Cleaning HTML generator and updating index.qdoc Adding links to the index page and removing HTML attributes like align and valing form the HTML generator Reviewed-by: Martin Smith (cherry picked from commit 019af5ecb5dbc9c173109ba670180177713a51ad) --- tools/qdoc3/htmlgenerator.cpp | 123 ++++++++++++++-------------- tools/qdoc3/test/qt-html-templates.qdocconf | 18 ++-- 2 files changed, 68 insertions(+), 73 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 1192daf..68c27db 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -514,14 +514,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "
"
+	out() << "
"
               << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                  marker,relative))
               << "
\n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "
"
+	out() << "
"
               << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                  marker,relative))
               << "
\n"; @@ -529,7 +529,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, #endif case Atom::CodeNew: out() << "

you can rewrite it as

\n" - << "
"
+              << "
"
               << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                  marker,relative))
               << "
\n"; @@ -538,9 +538,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "

For example, if you have code like

\n"; // fallthrough case Atom::CodeBad: - out() << "
"
+        out() << "
"
               << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
-              << "
\n"; + << "
\n"; break; case Atom::FootnoteLeft: // ### For now @@ -849,7 +849,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (atom->type() == Atom::Image) - out() << "

"; + out() << "

"; if (fileName.isEmpty()) { out() << "[Missing image " << protectEnc(atom->string()) << "]"; @@ -868,7 +868,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, case Atom::ImageText: break; case Atom::LegaleseLeft: - out() << "

"; + out() << "
"; break; case Atom::LegaleseRight: out() << "
"; @@ -910,13 +910,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == ATOM_LIST_VALUE) { threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { - out() << "

" + out() << "
" << "" << "" << "\n"; } else { - out() << "

ConstantValueDescription
" + out() << "
" << "\n"; } } @@ -951,10 +951,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, else { // (atom->string() == ATOM_LIST_VALUE) // ### Trenton - out() << "
ConstantValue
" + out() << "
" << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative))) - << ""; + << ""; QString itemValue; if (relative->type() == Node::Enum) { @@ -980,7 +980,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, } else if (atom->string() == ATOM_LIST_VALUE) { if (threeColumnEnumValueTable) { - out() << ""; + out() << ""; if (matchAhead(atom, Atom::ListItemRight)) out() << " "; } @@ -1010,7 +1010,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "\n"; } else if (atom->string() == ATOM_LIST_VALUE) { - out() << "

\n"; + out() << "\n"; } else { out() << "\n"; @@ -1091,29 +1091,28 @@ int HtmlGenerator::generateAtom(const Atom *atom, } if (!atom->string().isEmpty()) { if (atom->string().contains("%")) - out() << "

string() << "\" " - << "align=\"center\">\n"; + out() << "
string() << "\">\n "; else { - out() << "

\n"; + out() << "
\n"; } } else { - out() << "

\n"; + out() << "
\n"; } numTableRows = 0; break; case Atom::TableRight: - out() << "

\n"; + out() << "\n"; break; case Atom::TableHeaderLeft: - out() << ""; + out() << ""; inTableHeader = true; break; case Atom::TableHeaderRight: out() << ""; if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; - out() << "\n"; + out() << "\n"; } else { out() << "\n"; @@ -1122,9 +1121,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::TableRowLeft: if (++numTableRows % 2 == 1) - out() << ""; + out() << ""; else - out() << ""; + out() << ""; break; case Atom::TableRowRight: out() << "\n"; @@ -1189,11 +1188,11 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "string()) << "\">"; break; case Atom::UnhandledFormat: - out() << "<Missing HTML>"; + out() << "<Missing HTML>"; break; case Atom::UnknownCommand: - out() << "\\" << protectEnc(atom->string()) - << ""; + out() << "\\" << protectEnc(atom->string()) + << ""; break; #ifdef QDOC_QML case Atom::QmlText: @@ -1811,7 +1810,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
"
+        out() << "
"
               << trimmedTrailing(highlightedCode(indent(codeIndent,
                                                         marker->markedUpIncludes(inner->includes())),
                                                  marker,inner))
@@ -1845,8 +1844,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
 
     QString tdTag;
     if (numColumns > 1) {
-        tdTag = "";
-        out() << "

\n" + tdTag = "
"; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/ + out() << "\n" << tdTag << "\n"; } @@ -1898,7 +1897,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } if (numColumns > 1) - out() << "

\n"; + out() << "
\n"; inContents = false; inLink = false; @@ -2011,7 +2010,7 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, { if (bar.prev.begin() != 0 || bar.current.begin() != 0 || bar.next.begin() != 0) { - out() << "

"; + out() << "

"; if (bar.prev.begin() != 0) { #if 0 out() << "[

\n"; + out() << "
\n"; int row = 0; foreach (const QString &name, nodeMap.keys()) { @@ -2197,9 +2196,9 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, continue; if (++row % 2 == 1) - out() << ""; + out() << ""; else - out() << ""; + out() << ""; out() << ""; @@ -2219,7 +2218,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, } out() << "\n"; } - out() << "
"; generateFullName(node, relative, marker); out() << "

\n"; + out() << "\n"; } /*! @@ -2372,7 +2371,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } firstOffset[NumColumns] = classMap.count(); - out() << "

\n"; + out() << "
\n"; for (k = 0; k < numRows; k++) { out() << "\n"; for (i = 0; i < NumColumns; i++) { @@ -2393,7 +2392,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, currentParagraphNo[i] = NumParagraphs - 1; } #endif - out() << "\n"; } - out() << "
"; + out() << ""; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph out() << "" @@ -2436,18 +2435,18 @@ void HtmlGenerator::generateCompactList(const Node *relative, } out() << "

\n"; + out() << "\n"; } void HtmlGenerator::generateFunctionIndex(const Node *relative, CodeMarker *marker) { - out() << "

"; + out() << "

"; for (int i = 0; i < 26; i++) { QChar ch('a' + i); out() << QString("%2 ").arg(ch).arg(ch.toUpper()); } - out() << "

\n"; + out() << "

\n"; char nextLetter = 'a'; char currentLetter; @@ -2715,8 +2714,8 @@ void HtmlGenerator::generateSection(const NodeList& nl, } else { if (twoColumn) - out() << "

\n" - << "\n
"; + out() << "\n" + << "\n
"; out() << "
    \n"; } @@ -2729,12 +2728,11 @@ void HtmlGenerator::generateSection(const NodeList& nl, } if (name_alignment) { - out() << "
"; + out() << "
"; } else { if (twoColumn && i == (int) (nl.count() + 1) / 2) - out() << "
    \n"; + out() << "
    \n"; out() << "
  • "; } @@ -2751,7 +2749,7 @@ void HtmlGenerator::generateSection(const NodeList& nl, else { out() << "
\n"; if (twoColumn) - out() << "

\n"; + out() << "
\n"; } } } @@ -2777,8 +2775,8 @@ void HtmlGenerator::generateSectionList(const Section& section, } else { if (twoColumn) - out() << "

\n" - << "\n
"; + out() << "\n" + << "\n
"; out() << "
    \n"; } @@ -2791,12 +2789,11 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (name_alignment) { - out() << "
"; + out() << "
"; } else { if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
    \n"; + out() << "
    \n"; out() << "
  • "; } @@ -2813,7 +2810,7 @@ void HtmlGenerator::generateSectionList(const Section& section, else { out() << "
\n"; if (twoColumn) - out() << "

\n"; + out() << "
\n"; } } @@ -2910,7 +2907,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment && !done) {// && (i != 0)) Why was this here? - html += ""; + html += ""; done = true; } i += 2; @@ -3075,8 +3072,8 @@ void HtmlGenerator::generateSectionList(const Section& section, twoColumn = (section.members.count() >= 5); } if (twoColumn) - out() << "

\n" - << "\n
"; + out() << "\n" + << "\n
"; out() << "
    \n"; int i = 0; @@ -3088,7 +3085,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
    \n"; + out() << "
    \n"; out() << "
  • "; if (style == CodeMarker::Accessors) @@ -3102,7 +3099,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } out() << "
\n"; if (twoColumn) - out() << "

\n"; + out() << "
\n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -4274,15 +4271,15 @@ void HtmlGenerator::generateQmlSummary(const Section& section, twoColumn = (count >= 5); } if (twoColumn) - out() << "

\n" - << "\n
"; + out() << "\n" + << "\n
"; out() << "
    \n"; int row = 0; m = section.members.begin(); while (m != section.members.end()) { if (twoColumn && row == (int) (count + 1) / 2) - out() << "
    \n"; + out() << "
    \n"; out() << "
  • "; generateQmlItem(*m,relative,marker,true); out() << "
  • \n"; @@ -4291,7 +4288,7 @@ void HtmlGenerator::generateQmlSummary(const Section& section, } out() << "
\n"; if (twoColumn) - out() << "

\n"; + out() << "
\n"; } } @@ -4383,7 +4380,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast(n); - out() << "

"; + out() << "

"; Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4430,7 +4427,7 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, { const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { - out() << "

"; + out() << "

"; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4461,7 +4458,7 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { - out() << "

"; + out() << "

"; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 67a25f3..158aef3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -2,7 +2,7 @@ HTML.stylesheets = style/style.css HTML.postheader = "

\n" \ "
\n" \ " Home
\n" \ - " Qt Reference Documentation\n" \ + " Qt Reference Documentation\n" \ "
\n" \ " \n" \ "
\n" \ "
\n" \ @@ -110,7 +110,6 @@ HTML.footer = "
\n" \ "
\n" \ " \n" \ "
\n" \ - " \n" \ "
\n" \ "

\n" \ " © 2008-2010 Nokia Corporation and/or its\n" \ @@ -121,10 +120,10 @@ HTML.footer = "

\n" \ " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy

\n" \ " \n" \ "
\n" \ - "
\n" \ "
\n" \ " X\n" \ "
\n" \ + " \n" \ " \n" \ " \n" \ @@ -132,7 +131,6 @@ HTML.footer = "
\n" \ " \n" \ "
\n" \ "
\n" \ - " \n" \ "\n"; - out() << " \n"; + out() << " \n"; out() << "\n"; if (offlineDocs) - out() << "\n"; + out() << "\n"; else - out() << "\n"; + out() << "\n"; #ifdef GENERATE_MAC_REFS if (mainPage) @@ -1833,18 +1845,16 @@ void HtmlGenerator::generateTitle(const QString& title, CodeMarker *marker) { if (!title.isEmpty()) - out() << "

" << protectEnc(title); + out() << "

" << protectEnc(title) << "

\n"; if (!subTitle.isEmpty()) { - out() << "
"; - if (subTitleSize == SmallSubTitle) - out() << ""; + out() << ""; else - out() << ""; + out() << " class=\"subtitle\">"; generateText(subTitle, relative, marker); out() << "\n"; } - if (!title.isEmpty()) - out() << "\n"; } void HtmlGenerator::generateFooter(const Node *node) @@ -1853,9 +1863,10 @@ void HtmlGenerator::generateFooter(const Node *node) out() << "

\n" << navigationLinks << "

\n"; out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) - << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()) - << "\n" - "\n"; + << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); + out() << " \n"; + out() << "\n"; + out() << "\n"; } void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, @@ -1876,7 +1887,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
"
+        out() << "
"
               << trimmedTrailing(highlightedCode(indent(codeIndent,
                                                         marker->markedUpIncludes(inner->includes())),
                                                  marker,inner))
@@ -3766,7 +3777,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
         out() << "

"; out() << ""; generateSynopsis(enume, relative, marker, CodeMarker::Detailed); - out() << "
"; + out() << "
"; generateSynopsis(enume->flagsType(), relative, marker, diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 1deefce..112b1b2 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -16,45 +16,28 @@ qhp.Assistant.file = assistant.qhp qhp.Assistant.namespace = com.trolltech.assistant.470 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual -qhp.Assistant.extraFiles = images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ +qhp.Assistant.extraFiles = images/bg_l.png \ images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ + images/bullet_sq.png \ images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ images/feedbackground.png \ - images/form_bg.png \ images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ style/style.css + qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 513801a..d4da292 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -16,45 +16,28 @@ qhp.Designer.file = designer.qhp qhp.Designer.namespace = com.trolltech.designer.470 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual -qhp.Designer.extraFiles = images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ +qhp.Designer.extraFiles = images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ - images/content_bg.png \ images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + scripts/functions.js \ + scripts/jquery.js \ + style/style.css + qhp.Designer.filterAttributes = qt 4.7.0 tools designer qhp.Designer.customFilters.Designer.name = Qt Designer Manual qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index a3f4f00..7420b4f 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -16,45 +16,28 @@ qhp.Linguist.file = linguist.qhp qhp.Linguist.namespace = com.trolltech.linguist.470 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual -qhp.Linguist.extraFiles = images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ +qhp.Linguist.extraFiles = images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ - images/content_bg.png \ images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + scripts/functions.js \ + scripts/jquery.js \ + style/style.css + qhp.Linguist.filterAttributes = qt 4.7.0 tools linguist qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 80050e3..8015f57 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -27,45 +27,27 @@ qhp.Qml.indexTitle = Qml Reference # Files not referenced in any qdoc file # See also extraimages.HTML -qhp.Qml.extraFiles = images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css +qhp.Qml.extraFiles = images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qml.filterAttributes = qt 4.6.0 qtrefdoc qhp.Qml.customFilters.Qt.name = Qt 4.6.0 diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index f38a2a4..49d088e 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -16,45 +16,28 @@ qhp.qmake.file = qmake.qhp qhp.qmake.namespace = com.trolltech.qmake.470 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual -qhp.qmake.extraFiles = images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css +qhp.qmake.extraFiles = images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css + qhp.qmake.filterAttributes = qt 4.7.0 tools qmake qhp.qmake.customFilters.qmake.name = qmake Manual qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 0694748..f0c2535 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,45 +22,27 @@ qhp.Qt.indexTitle = Qt Reference Documentation # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 5a3d726..a00d5a1 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -30,45 +30,27 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index 0426f4d..dc81757 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -20,37 +20,20 @@ codeindent = 1 # See also qhp.Qt.extraFiles extraimages.HTML = qt-logo \ trolltech-logo \ - api_examples.png \ - bg_ll.png \ - bg_ul_blank.png \ - bullet_gt.png \ - horBar.png \ - qt_ref_doc.png \ - api_lookup.png \ - bg_ll_blank.png \ - bg_ur.png \ - bullet_sq.png \ - bullet_dn.png \ - bullet_up.png \ - page_bg.png \ - qt_tools.png \ - api_topics.png \ - bg_lr.png \ - bg_ur_blank.png \ - content_bg.png \ - print.png \ - sep.png \ - bg_l.png \ - bg_r.png \ - box_bg.png \ - feedbackground.png \ - qt_guide.png \ - sprites-combined.png \ - bg_l_blank.png \ - bg_ul.png \ - breadcrumb.png \ - form_bg.png \ - qt_icon.png \ + bg_l.png \ + bg_l_blank.png \ + bg_r.png \ + box_bg.png \ + breadcrumb.png \ + bullet_gt.png \ + bullet_dn.png \ + bullet_sq.png \ + bullet_up.png \ + feedbackground.png \ + horBar.png \ + page.png \ + page_bg.png \ + sprites-combined.png \ taskmenuextension-example.png \ coloreditorfactoryimage.png \ dynamiclayouts-example.png \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 0651176..00af376 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -33,30 +33,38 @@ HTML.postheader = "
\n" \ "
\n" \ " \n" \ "
\n" \ - " \n" \ + " \n" \ "
\n" \ " \n" \ "
\n" \ "
\n" \ - "

\n" \ + "

\n" \ " API Lookup

\n" \ - "
\n" \ - " \n" \ "
\n" \ - "
\n" \ + "
\n" \ "
\n" \ "
\n" \ "
\n" \ - "

\n" \ + "

\n" \ " API Topics

\n" \ - "
\n" \ - " \n" \ "
\n" \ - "
\n" \ + "
\n" \ "
\n" \ "
\n" \ "
\n" \ - "

\n" \ + "

\n" \ " API Examples

\n" \ - "
\n" \ - " \n" \ "
\n" \ - "
\n" \ + "
\n" \ "
\n" \ "
\n" \ "
\n" \ @@ -103,13 +116,13 @@ HTML.postpostheader = " \n" \ "
  • A
  • \n" \ "
  • A
  • \n" \ "
  • \n" \ - " \"\"\"Print
  • \n" \ + " Print\n" \ " \n" \ "
    \n" \ "
    \n" \ "
    \n" -HTML.footer = "
    \n" \ +HTML.footer = " \n" \ "
    \n" \ " [+] Documentation Feedback
    \n" \ "
    \n" \ @@ -117,6 +130,7 @@ HTML.footer = " \n" \ "
    \n" \ " \n" \ "
    \n" \ + " \n" \ "
    \n" \ "

    \n" \ " © 2008-2010 Nokia Corporation and/or its\n" \ @@ -131,14 +145,14 @@ HTML.footer = "

    \n" \ " X\n" \ " \n" \ "
    \n" \ - " \n" \ - " \n" \ + "

    \n" \ + "

    \n" \ "
    \n" \ " \n" \ "
    \n" \ "
    \n" \ - " -->\n" diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 69ab4e1..59dd855 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -26,45 +26,27 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.0 diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index a5a65d8..9275b5c 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -32,45 +32,27 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/api_examples.png \ - images/api_lookup.png \ - images/api_topics.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ll.png \ - images/bg_l.png \ - images/bg_lr.png \ - images/bg_r.png \ - images/bg_ul_blank.png \ - images/bg_ul.png \ - images/bg_ur_blank.png \ - images/bg_ur.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_dn.png \ - images/bullet_gt.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/coloreditorfactoryimage.png \ - images/content_bg.png \ - images/dynamiclayouts-example.png \ - images/feedbackground.png \ - images/form_bg.png \ - images/horBar.png \ - images/page_bg.png \ - images/print.png \ - images/qt_guide.png \ - images/qt_icon.png \ - images/qt-logo.png \ - images/qt_ref_doc.png \ - images/qt_tools.png \ - images/sep.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp diff --git a/tools/qdoc3/test/style/style.css b/tools/qdoc3/test/style/style.css index 1ed49fa..9c290f5 100644 --- a/tools/qdoc3/test/style/style.css +++ b/tools/qdoc3/test/style/style.css @@ -58,6 +58,19 @@ { vertical-align: baseline; } + .heading + { + font: normal 600 16px/1.0 Arial; + padding-bottom: 15px; + } + .subtitle + { + font-size: 13px; + } + .small-subtitle + { + font-size: 13px; + } legend { color: #000000; @@ -73,7 +86,6 @@ { font-size: 100%; } - /* Page style */ html { background-color: #e5e5e5; @@ -92,6 +104,11 @@ { font-style: italic; } + a + { + color: #00732f; + text-decoration: none; + } .header, .footer, .wrapper { min-width: 600px; @@ -106,23 +123,19 @@ { padding-left: 216px; height: 15px; - background: url(../images/bg_ul.png) no-repeat 0 0; + background: url(../images/page.png) no-repeat 0 0; overflow: hidden; } .offline .wrapper .hd { - background: url(../images/bg_ul_blank.png) no-repeat 0 0; + background: url(../images/page.png) no-repeat 0 -15px; } .wrapper .hd span { height: 15px; display: block; - background: url(../images/bg_ur.png) no-repeat 100% 0; overflow: hidden; - } - .offline .wrapper .hd span - { - /* background: url(../images/bg_ur_blank.png) no-repeat 100% 0; */ + background: url(../images/page.png) no-repeat 100% -30px; } .wrapper .bd { @@ -137,18 +150,18 @@ { padding-left: 216px; height: 15px; - background: url(../images/bg_ll.png) no-repeat 0 0; + background: url(../images/page.png) no-repeat 0 -75px; overflow: hidden; } .offline .wrapper .ft { - background: url(../images/bg_ll_blank.png) no-repeat 0 0; + background: url(../images/page.png) no-repeat 0 -90px; } .wrapper .ft span { height: 15px; display: block; - background: url(../images/bg_lr.png) no-repeat 100% 0; + background: url(../images/page.png) no-repeat 100% -60px; overflow: hidden; } .header, .footer @@ -182,186 +195,9 @@ width: 302px; height: 22px; text-indent: -999em; - background: url(../images/header.png) no-repeat 0 0; - } - /* header elements */ - #nav-topright - { - height: 70px; - } - - #nav-topright ul - { - list-style-type: none; - float: right; - width: 370px; - margin-top: 11px; - } - - #nav-topright li - { - display: inline-block; - margin-right: 20px; - float: left; - } - - #nav-topright li.nav-topright-last - { - margin-right: 0; - } - - #nav-topright li a - { - background: transparent url(../images/sprites-combined.png) no-repeat; - height: 18px; - display: block; - overflow: hidden; - text-indent: -9999px; - } - - #nav-topright li.nav-topright-home a - { - width: 65px; - background-position: -2px -91px; - } - - #nav-topright li.nav-topright-home a:hover - { - background-position: -2px -117px; - } - - - #nav-topright li.nav-topright-dev a - { - width: 30px; - background-position: -76px -91px; - } - - #nav-topright li.nav-topright-dev a:hover - { - background-position: -76px -117px; - } - - - #nav-topright li.nav-topright-labs a - { - width: 40px; - background-position: -114px -91px; - } - - #nav-topright li.nav-topright-labs a:hover - { - background-position: -114px -117px; - } - - #nav-topright li.nav-topright-doc a - { - width: 32px; - background-position: -162px -91px; - } - - #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a - { - background-position: -162px -117px; - } - - #nav-topright li.nav-topright-blog a - { - width: 40px; - background-position: -203px -91px; - } - - #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a - { - background-position: -203px -117px; - } - - #nav-topright li.nav-topright-shop a - { - width: 40px; - background-position: -252px -91px; - } - - #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a - { - background-position: -252px -117px; - } - - #nav-logo - { - background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px; - left: -3px; - position: absolute; - width: 75px; - height: 75px; - top: 13px; - } - #nav-logo a - { - width: 75px; - height: 75px; - display: block; - text-indent: -9999px; - overflow: hidden; - } - /* Clearing */ - .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after - { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } - /* ^ Clearing */ - - - - .shortCut-topleft-inactive - { - padding-left: 3px; - background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px; - height: 20px; - width: 93px; - } - .shortCut-topleft-inactive span - { - font-variant: normal; - } - #shortCut - { - padding-top: 10px; - font-weight: bolder; - color: #b0adab; - } - #shortCut ul - { - list-style-type: none; - float: left; - width: 347px; - margin-left: 100px; - } - #shortCut li - { - display: inline-block; - margin-right: 25px; - float: left; - white-space: nowrap; - } - #shortCut li a - { - color: #b0adab; - text-decoration: none; - } - #shortCut li a:hover - { - color: #44a51c; - text-decoration: none; + background: url(../images/sprites-combined.png) no-repeat -78px -235px; } - /* end of header elements */ - - /* menu element */ .sidebar { float: left; @@ -369,32 +205,32 @@ width: 200px; font-size: 11px; } - .sidebar a - { - color: #00732f; - text-decoration: none; - } - .offline .sidebar, .offline .feedback + + .offline .sidebar, .offline .feedback, .offline .t_button { display: none; } + .sidebar .searchlabel { padding: 0 0 2px 17px; font: normal bold 11px/1.2 Verdana; } + .sidebar .search { padding: 0 15px 0 16px; } + .sidebar .search form { - width: 167px; - height: 21px; - padding: 2px 0 0 5px; - background: url(../images/form_bg.png) no-repeat 0 0; + background: url(../images/sprites-combined.png) no-repeat -6px -348px; + height:21px; + padding:2px 0 0 5px; + width:167px; } - .sidebar .search form fieldset input#searchstring + + .sidebar .search form input#pageType { width: 158px; height: 19px; @@ -403,32 +239,62 @@ outline: none; font: 13px/1.2 Verdana; } + .sidebar .box { padding: 17px 15px 5px 16px; } + .sidebar .box .first { background-image: none; } + .sidebar .box h2 { font: normal 18px/1.2 Arial; - padding: 15px 0 0 40px; + padding: 0; min-height: 32px; } + .sidebar .box h2 span + { + overflow: hidden; + display: inline-block; + } .sidebar .box#lookup h2 { - background: url(../images/api_lookup.png) no-repeat 0 0; + background-image: none; + } + .sidebar #lookup.box h2 span + { + background: url(../images/sprites-combined.png) no-repeat -6px -311px; + width: 27px; + height: 35px; + margin-right: 13px; } .sidebar .box#topics h2 { - background: url(../images/api_topics.png) no-repeat 0 0; + background-image: none; + } + .sidebar #topics.box h2 span + { + background: url(../images/sprites-combined.png) no-repeat -94px -311px; + width: 27px; + height: 32px; + margin-right: 13px; } .sidebar .box#examples h2 { - background: url(../images/api_examples.png) no-repeat 0 0; + background-image: none; + } + .sidebar #examples.box h2 span + { + background: url(../images/sprites-combined.png) no-repeat -48px -311px; + width: 30px; + height: 31px; + margin-right: 9px; } + .sidebar .box .list { display: block; @@ -443,6 +309,9 @@ { text-decoration: underline; } + .sidebar .box ul + { + } .sidebar .box ul li { padding-left: 12px; @@ -453,23 +322,20 @@ { background: url(../images/box_bg.png) repeat-x 0 bottom; } - /* content elements */ .wrap { - overflow: hidden; + margin: 0 5px 0 208px; + overflow: visible; } .offline .wrap { margin: 0 5px 0 5px; } - /* tool bar */ .wrap .toolbar { background-color: #fafafa; border-bottom: 1px solid #d1d1d1; - height: 20px; - margin-left: 3px; - margin-right: 5px; + height: 20px; position: relative; } .wrap .toolbar .toolblock @@ -487,7 +353,7 @@ { padding: 0 0 10px 21px; right: 5px; - vertical-align: top; + vertical-align: middle; overflow: hidden; } .wrap .toolbar .toolbuttons .active @@ -507,32 +373,56 @@ font-weight: bold; color: #B0ADAB; } - #smallA + + .toolbuttons #print + { + border-left: 1px solid #c5c4c4; + margin-top: 0; + padding-left: 7px; + text-indent: 0; + } + .toolbuttons #print a + { + width: 16px; + height: 16px; + } + + .toolbuttons #print a span + { + width: 16px; + height: 16px; + text-indent: -999em; + display: block; + overflow: hidden; + background: url(../images/sprites-combined.png) no-repeat -137px -311px; + } + + .toolbuttons #smallA { font-size: 10pt; } - #medA + .toolbuttons #medA { font-size: 12pt; } - #bigA + .toolbuttons #bigA { font-size: 14pt; + margin-right: 7px; } + #smallA:hover, #medA:hover, #bigA:hover { color: #00732F; } - #print + + .offline .wrap .breadcrumb { - font-size: 14pt; - line-height: 20pt; } - #printIcon + + .wrap .breadcrumb ul { - margin-left: 5px; } - /* bread crumbs */ .wrap .breadcrumb ul li { float: left; @@ -545,6 +435,10 @@ { font-weight: normal; } + .wrap .breadcrumb ul li a + { + color: #363534; + } .wrap .breadcrumb ul li.first { background-image: none; @@ -554,29 +448,29 @@ .wrap .content { padding: 30px; - position: relative; } - /* text elements */ - .heading + + .wrap .content li { - font: normal 600 16px/1.0 Arial; - padding-bottom: 15px; + padding-left: 12px; + background: url(../images/bullet_sq.png) no-repeat 0 5px; + font: normal 400 10pt/1 Verdana; + color: #44a51c; + margin-bottom: 10px; } - - .subtitle + .content li:hover { - font-size: 13px; + text-decoration: underline; } - .small-subtitle + .offline .wrap .content { - font-size: 13px; + padding-top: 15px; } - + .wrap .content h1 { font: 600 18px/1.2 Arial; - padding-bottom: 15px; } .wrap .content h2 { @@ -588,26 +482,13 @@ } .wrap .content p { - line-height:20px; - padding:10px 5px 10px 5px; + line-height: 20px; + padding: 10px 5px 10px 5px; } .wrap .content ul { padding-left: 25px; } - .wrap .content li - { - padding-left: 12px; - background: url(../images/bullet_sq.png) no-repeat 0 5px; - font: normal 400 10pt/1 Verdana; - margin-bottom: 10px; - line-height: 14px; - } - a - { - color: #00732F; - text-decoration: none; - } a:hover { color: #4c0033; @@ -618,10 +499,6 @@ color: #4c0033; text-decoration: none; } - .offline .wrap .content - { - padding-top: 15px; - } .footer { min-height: 100px; @@ -629,11 +506,15 @@ font: normal 9px/1 Verdana; text-align: center; padding-top: 40px; + background-color: #E6E7E8; + margin: 0; } .feedback { - float: right; - padding-right: 10px; + float: none; + position: absolute; + right: 15px; + bottom: 10px; font: normal 8px/1 Verdana; color: #B0ADAB; } @@ -644,37 +525,223 @@ color: #00732F; text-decoration: underline; } + .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after + { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + #nav-topright + { + height: 70px; + } + + #nav-topright ul + { + list-style-type: none; + float: right; + width: 370px; + margin-top: 11px; + } + + #nav-topright li + { + display: inline-block; + margin-right: 20px; + float: left; + } + + #nav-topright li.nav-topright-last + { + margin-right: 0; + } + + #nav-topright li a + { + background: transparent url(../images/sprites-combined.png) no-repeat; + height: 18px; + display: block; + overflow: hidden; + text-indent: -9999px; + } + + #nav-topright li.nav-topright-home a + { + width: 65px; + background-position: -2px -91px; + } + + #nav-topright li.nav-topright-home a:hover + { + background-position: -2px -117px; + } + + + #nav-topright li.nav-topright-dev a + { + width: 30px; + background-position: -76px -91px; + } + + #nav-topright li.nav-topright-dev a:hover + { + background-position: -76px -117px; + } + + + #nav-topright li.nav-topright-labs a + { + width: 40px; + background-position: -114px -91px; + } + + #nav-topright li.nav-topright-labs a:hover + { + background-position: -114px -117px; + } + + #nav-topright li.nav-topright-doc a + { + width: 32px; + background-position: -162px -91px; + } + + #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a + { + background-position: -162px -117px; + } + + #nav-topright li.nav-topright-blog a + { + width: 40px; + background-position: -203px -91px; + } + + #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a + { + background-position: -203px -117px; + } + + #nav-topright li.nav-topright-shop a + { + width: 40px; + background-position: -252px -91px; + } + + #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a + { + background-position: -252px -117px; + } + + #nav-logo + { + background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px; + left: -3px; + position: absolute; + width: 75px; + height: 75px; + top: 13px; + } + #nav-logo a + { + width: 75px; + height: 75px; + display: block; + text-indent: -9999px; + overflow: hidden; + } + + + .shortCut-topleft-inactive + { + padding-left: 3px; + background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px; + height: 20px; + width: 47px; + } + .shortCut-topleft-inactive span + { + font-variant: normal; + } + #shortCut + { + padding-top: 10px; + font-weight: bolder; + color: #b0adab; + } + #shortCut ul + { + list-style-type: none; + float: left; + width: 347px; + margin-left: 100px; + } + #shortCut li + { + display: inline-block; + margin-right: 25px; + float: left; + white-space: nowrap; + } + #shortCut li a + { + color: #b0adab; + } + #shortCut li a:hover + { + color: #44a51c; + } + hr { - background-color: #e0e0e0; + background-color: #E6E6E6; + border: 1px solid #E6E6E6; height: 1px; width: 100%; text-align: left; margin: 15px 0px 15px 0px; } - + .content .alignedsummary { margin: 15px; } - /* tables */ + pre + { + border: 1px solid #DDDDDD; + margin: 0 20px 10px 10px; + padding: 20px 15px 20px 20px; + overflow-x: auto; + } table, pre { -moz-border-radius: 7px 7px 7px 7px; background-color: #F6F6F6; border: 1px solid #E6E6E6; border-collapse: separate; - font-size: 11px; - min-width: 395px; + font-size: 11px; + /*min-width: 395px;*/ margin-bottom: 25px; + display: inline-block; + } + thead + { + margin-top: 5px; + } + th + { + padding: 3px 15px 3px 15px; + } + td + { + padding: 3px 15px 3px 20px; } - thead{margin-top: 5px;} - th{ padding: 3px 15px 3px 15px;} - td{padding: 3px 15px 3px 20px;} table tr.odd { border-left: 1px solid #E6E6E6; - background-color: #F6F6F6; + background-color: #F6F6F6; color: #66666E; } table tr.even @@ -685,12 +752,13 @@ } table tr.odd:hover { - background-color: #E6E6E6; + background-color: #E6E6E6; } table tr.even:hover { background-color: #E6E6E6; } + span.comment { color: #8B0000; @@ -700,15 +768,7 @@ { color: #254117; } - pre - { - -moz-border-radius:7px 7px 7px 7px; - background-color:#F6F6F6; - border:1px solid #DDDDDD; - margin:0 20px 10px 10px; - padding:20px 15px 20px 20px; - overflow-x:auto; - } + .qmltype { text-align: center; @@ -719,13 +779,28 @@ float: right; color: #254117; } + + .qmldefault + { + float: right; + color: red; + } + + .qmldoc + { + } + + *.qmlitem p + { + } + #feedbackBox { - display:none; - -moz-border-radius:7px 7px 7px 7px; - border:1px solid #DDDDDD; - position:fixed; - top:100px; + display: none; + -moz-border-radius: 7px 7px 7px 7px; + border: 1px solid #DDDDDD; + position: fixed; + top: 100px; left: 33%; height: 190px; width: 400px; @@ -735,27 +810,27 @@ } #feedcloseX a { - display:inline; + display: inline; padding: 5px 5px 0 0; - margin-bottom:3px; + margin-bottom: 3px; color: #363534; - font-weight:600; + font-weight: 600; float: right; text-decoration: none; } + #feedbox - /* here */ { - display:inline; + display: inline; width: 370px; height: 120px; - margin:0px 25px 10px 15px; + margin: 0px 25px 10px 15px; } #feedsubmit { - display:inline; - float:right; - margin:4px 32px 0 0; + display: inline; + float: right; + margin: 4px 32px 0 0; } #blurpage { @@ -771,141 +846,172 @@ } .toc { - float: right; - -moz-border-radius:7px 7px 7px 7px; - background-color:#F6F6F6; - border:1px solid #DDDDDD; - margin:0 20px 10px 10px; - padding:20px 15px 20px 20px; + float: right; + -moz-border-radius: 7px 7px 7px 7px; + background-color: #F6F6F6; + border: 1px solid #DDDDDD; + margin: 0 20px 10px 10px; + padding: 20px 15px 20px 20px; height: auto; width: 200px; } - .toc ul + .toc h3 { - float: left; - padding: 15px; - + font: 600 12px/1.2 Arial; + } + + .wrap .content .toc ul + { + padding-left: 0px; + } + + + .wrap .content .toc .level2 + { + margin-left: 15px; } - .content .toc li { - font: normal 12px/1.2 Verdana; + font: normal 10px/1.2 Verdana; background: url(../images/bullet_dn.png) no-repeat 0 5px; } - .relpage + .relpage { -moz-border-radius: 7px 7px 7px 7px; border: 1px solid #DDDDDD; padding: 25px 25px; - clear:both; + clear: both; } .relpage ul { float: none; padding: 15px; } - .content .relpage li + .content .relpage li { font: normal 11px/1.2 Verdana; } - /* edit */ h3.fn, span.fn { background-color: #F6F6F6; border-width: 1px; border-style: solid; border-color: #E6E6E6; - font-weight: bold; - /* padding: 6px 0px 6px 10px;*/ - /* margin: 42px 0px 0px 0px;*/ + font-weight: bold; } - /* edit */ - .indexbox - { - width: 100%; - } - .content .indexboxcont li - { - font: normal 600 13px/1 Verdana; - } - /* .indexbox a - { - color: #00732f; - text-decoration: none; - }*/ - .indexbox a:hover, .indexbox a:visited:hover - { - color: #4c0033; - text-decoration: underline; - } - .indexbox a:visited + /* start index box */ + .indexbox { - color: #00732f; - text-decoration: none; + width: 100%; + display:inline-block; } .indexboxcont { display: block; + /* overflow: hidden;*/ } .indexboxbar { - background: transparent url( "../images/horBar.png" ) repeat-x left bottom; + background: transparent url(../images/horBar.png ) repeat-x left bottom; margin-bottom: 25px; + /* background-image: none; + border-bottom: 1px solid #e2e2e2;*/ } .indexboxcont .section { - display: inline-block; + display: inline-block; width: 49%; *width:42%; _width:42%; padding:0 2% 0 1%; vertical-align:top; + } .indexboxcont .indexIcon - { + { width: 11%; *width:18%; _width:18%; overflow:hidden; + } .indexboxcont .section p - { + { padding-top: 20px; padding-bottom: 20px; } - .indexboxcont .sectionlist { display: inline-block; width: 33%; - margin-right: -2px; - vertical-align: top; padding: 0; } - .tricol - { - - } .indexboxcont .sectionlist ul { - padding-left: 15px; margin-bottom: 20px; } -/* + .indexboxcont .sectionlist ul li { line-height: 12px; } -*/ + + .content .indexboxcont li + { + font: normal 600 13px/1 Verdana; + } + + .indexbox a:hover, .indexbox a:visited:hover + { + color: #4c0033; + text-decoration: underline; + } + + .indexbox a:visited + { + color: #00732f; + text-decoration: none; + } + + .indexboxcont:after + { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + + .indexbox .indexIcon span + { + display: block; + } + + .indexbox.guide .indexIcon span + { + width: 96px; + height: 137px; + background: url(../images/sprites-combined.png) no-repeat -5px -376px; + padding: 0; + } + + .indexbox.tools .indexIcon span + { + width: 115px; + height: 137px; + background: url(../images/sprites-combined.png) no-repeat -111px -376px; + padding: 0; + } + .lastcol { display: inline-block; @@ -916,12 +1022,9 @@ .tricol .lastcol { - margin-left:-6px; + margin-left: -6px; } - - /*.toc ul*/ - - /* end page elements */ + /* end indexbox */ } /* end of screen media */ @@ -929,7 +1032,7 @@ @media print { - .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft + input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft { display: none; background: none; -- cgit v0.12 From 33664eaa591b4325f83643d8c8a21476b1306c34 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 4 May 2010 14:15:24 +0200 Subject: Disable compiling of the plugin when extra package not found The plugin will only compile when the symbian audiorouting API is installed which is not there by default. So check for that. The configure check should be added soon too. --- src/plugins/mediaservices/mediaservices.pro | 4 +++- src/s60installs/s60installs.pro | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/mediaservices/mediaservices.pro b/src/plugins/mediaservices/mediaservices.pro index 27f05bc..0f0b021 100644 --- a/src/plugins/mediaservices/mediaservices.pro +++ b/src/plugins/mediaservices/mediaservices.pro @@ -9,5 +9,7 @@ contains(QT_CONFIG, media-backend) { SUBDIRS += gstreamer } - symbian:SUBDIRS += symbian + symbian:contains(QT_CONFIG, audio-routing-available) { + SUBDIRS += symbian + } } diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index dfd2694..97b2232 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -158,11 +158,12 @@ symbian: { contains(QT_CONFIG, media-backend) { qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMediaServices$${QT_LIBINFIX}.dll - mediaservices_plugins.path = c:$$QT_PLUGINS_BASE_DIR/mediaservices - mediaservices_plugins.sources += $$QT_BUILD_TREE/plugins/mediaservices/qmmfengine$${QT_LIBINFIX}.dll + contains(QT_CONFIG, audio-routing-available) { + mediaservices_plugins.path = c:$$QT_PLUGINS_BASE_DIR/mediaservices + mediaservices_plugins.sources += $$QT_BUILD_TREE/plugins/mediaservices/qmmfengine$${QT_LIBINFIX}.dll + } DEPLOYMENT += mediaservices_plugins - } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" -- cgit v0.12 From e98459fd11180c24ba9e549b96908cb33a68c714 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 4 May 2010 14:38:20 +0200 Subject: doc: Edited the intro. --- doc/src/declarative/declarativeui.qdoc | 60 ++++++++++++++++------------------ 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index d79c4d2..6a1f5c5 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -40,46 +40,42 @@ ****************************************************************************/ /*! -\title Declarative UI Using QML +\title Qt Quick \page declarativeui.html -\brief The Qt Declarative module provides a declarative framework for building -highly dynamic, custom user interfaces. +\brief Qt Quick provides a declarative framework for building highly +dynamic, custom user interfaces. -\section1 \l{QML Elements}{Fast QML Elements Reference Page} +Qt Quick provides a declarative framework for building highly dynamic, +custom user interfaces from a rich set of \l {QML Elements}{QML elements}. +Qt Quick helps programmers and designers collaborate to +build the fluid user interfaces that are becoming common in portable +consumer devices, such as mobile phones, media players, set-top boxes +and netbooks. -\raw HTML -
    -\endraw +QML is an extension to \l +{http://www.ecma-international.org/publications/standards/Ecma-262.htm} +{JavaScript}, that provides a mechanism to declaratively build an +object tree of \l {QML Elements}{QML elements}. QML improves the +integration between JavaScript and Qt's existing QObject based type +system, adds support for automatic \l {Property Binding}{property +bindings} and provides \l {Network Transparency}{network transparency} +at the language level. -\section1 Preamble +The \l {QML Elements}{QML elements} are a sophisticated set of +graphical and behavioral building blocks. These different elements +are combined together in \l {QML Documents}{QML documents} to build +components ranging in complexity from simple buttons and sliders, to +complete internet-enabled applications like a \l +{http://www.flickr.com}{Flickr} photo browser. -Qt Declarative UI provides a declarative framework for building highly dynamic, custom -user interfaces. Declarative UI helps programmers and designers collaborate to build -the animation rich, fluid user interfaces that are becoming common in portable -consumer devices, such as mobile phones, media players, set-top boxes and netbooks. - -The Qt Declarative module provides an engine for interpreting the declarative -QML language, and a rich set of \bold { \l {QML Elements}{QML elements} } -that can be used from QML. - -QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm} -{JavaScript}, that provides a mechanism to declaratively build an object tree -of QML elements. QML improves the integration between JavaScript and Qt's -existing QObject based type system, adds support for automatic -\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language -level. - -The QML elements are a sophisticated set of graphical and behavioral building -blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components -ranging in complexity from simple buttons and sliders, to complete -internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser. - -Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}. -QML can be be used to incrementally extend an existing application or to build -completely new applications. QML is fully \l {Extending QML in C++}{extensible from C++}. +Qt Quick builds on \l {QML for Qt programmers}{Qt's existing +strengths}. QML can be be used to incrementally extend an existing +application or to build completely new applications. QML is fully \l +{Extending QML in C++}{extensible from C++}. \section1 Getting Started: + \list \o \l {Introduction to the QML language} \o \l {QML Tutorial}{Tutorial: 'Hello World'} -- cgit v0.12 From 855bbe53b69fa12a9daec49e6326a6bbe4483342 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 4 May 2010 15:00:10 +0200 Subject: Doc: Fixed up the diagrams, aligning items with a grid. Reviewed-by: Trust Me --- doc/src/diagrams/modelview-move-rows-1.sk | 62 +++++++++++++++---------------- doc/src/diagrams/modelview-move-rows-2.sk | 46 +++++++++++------------ doc/src/diagrams/modelview-move-rows-3.sk | 54 +++++++++++++-------------- doc/src/diagrams/modelview-move-rows-4.sk | 40 ++++++++++---------- 4 files changed, 101 insertions(+), 101 deletions(-) diff --git a/doc/src/diagrams/modelview-move-rows-1.sk b/doc/src/diagrams/modelview-move-rows-1.sk index 3679dc7..dc90cfb 100644 --- a/doc/src/diagrams/modelview-move-rows-1.sk +++ b/doc/src/diagrams/modelview-move-rows-1.sk @@ -14,10 +14,10 @@ lw(1) r(30,0,0,-30,415.038,664.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,337.792) +r(30,0,0,-30,415,337.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,605) @@ -35,19 +35,19 @@ lw(1) r(30,0,0,-30,277.5,575) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,574.044) +r(30,0,0,-30,415,575) fp((1,1,1)) lw(1) r(30,0,0,-30,220,545) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30.262,220,305.262) fp((1,1,1)) lw(1) -r(31.2174,0,0,-30,414.082,306.92) +r(30,0,0,-30,415,307.5) fp((1,1,1)) lw(1) r(30,0,0,-30,415.038,455.177) @@ -62,31 +62,31 @@ lw(1) r(30,0,0,-30,220,695) fp((1,1,1)) lw(1) -r(30,0,0,-30,415.038,694.044) +r(30,0,0,-30.956,415.038,695) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,367.792) +r(30,0,0,-30,415,367.5) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,277.5,605) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,604.044) +r(30,0,0,-30,415,605) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,277.5,635) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,634.044) +r(30,0,0,-30,415,635) le() lw(1) r(165,0,0,-230,210,705) @@ -107,13 +107,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(423.829,345.932)) +txt('0',(424.44,345.64)) fp((0,0,0)) le() lw(1) @@ -131,13 +131,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(423.829,315.932)) +txt('1',(424.44,315.64)) fp((0,0,0)) le() lw(1) @@ -161,13 +161,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(423.829,612.184)) +txt('2',(424.44,613.14)) fp((0,0,0)) le() lw(1) @@ -191,13 +191,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(423.829,582.184)) +txt('3',(424.44,583.14)) fp((0,0,0)) le() lw(1) @@ -221,13 +221,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(423.829,552.184)) +txt('4',(424.44,553.14)) fp((0,0,0)) le() lw(1) @@ -239,13 +239,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(423.522,285.06)) +txt('5',(424.44,285.64)) fp((0.503,0.503,0.503)) le() lw(1) @@ -255,17 +255,17 @@ txt('5',(424.478,433.317)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(275,635,0) -bs(255,635,0) +bs(277.5,635,0) +bs(252.5,635,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(293.986,545.115,0) +bs(292.5,380,0) +bs(292.5,542.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(290,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-2.sk b/doc/src/diagrams/modelview-move-rows-2.sk index c453a78..7ddb95e 100644 --- a/doc/src/diagrams/modelview-move-rows-2.sk +++ b/doc/src/diagrams/modelview-move-rows-2.sk @@ -14,10 +14,10 @@ lw(1) r(30,0,0,-30,415.038,664.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,337.792) +r(30,0,0,-30,415,337.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,605) @@ -35,7 +35,7 @@ lw(1) r(30,0,0,-30,275,455) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,455) @@ -47,10 +47,10 @@ lw(1) r(30,0,0,-30,415,545) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(29.6927,0,0,-30,220,305.262) fp((1,1,1)) lw(1) -r(31.2174,0,0,-30,414.082,306.92) +r(30,0,0,-30,415,307.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,635) @@ -65,16 +65,16 @@ lw(1) r(30,0,0,-30,415.038,694.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,367.792) +r(30,0,0,-30,415,367.5) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,275,485) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,485) @@ -83,7 +83,7 @@ lw(1) r(30,0,0,-30,275,515) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,515) @@ -107,13 +107,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(423.829,345.932)) +txt('0',(424.44,345.64)) fp((0,0,0)) le() lw(1) @@ -131,13 +131,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(423.829,315.932)) +txt('1',(424.44,315.64)) fp((0,0,0)) le() lw(1) @@ -161,7 +161,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) @@ -191,7 +191,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) @@ -221,7 +221,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) @@ -245,27 +245,27 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(423.522,285.06)) +txt('5',(424.44,285.64)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(272.5,515,0) +bs(275,515,0) bs(252.5,515,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,425,0) +bs(292.5,380,0) +bs(292.5,422.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(290,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-3.sk b/doc/src/diagrams/modelview-move-rows-3.sk index d320900..33a9ad1 100644 --- a/doc/src/diagrams/modelview-move-rows-3.sk +++ b/doc/src/diagrams/modelview-move-rows-3.sk @@ -4,30 +4,30 @@ layout('A4',0) layer('Layer 1',1,1,0,0,(0,0,0)) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,345.913,400) +r(30,0,0,-30,344.997,400) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) lw(1) -r(30,0,0,-30,345.916,339.739) +r(30,0,0,-30,345,339.739) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30,220,305.262) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,345,310) +r(30,0,0,-30,345,310) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,345.913,430) +r(30,0,0,-30,344.997,430) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) lw(1) -r(30,0,0,-30,345.916,369.739) +r(30,0,0,-30,345,369.739) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,272.5,455) @@ -36,7 +36,7 @@ lw(1) r(30,0,0,-30,345,460) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) le() lw(1) r(165,0,0,-230,210,705) @@ -45,25 +45,25 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(355.353,408.14)) +txt('0',(354.437,408.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(355.353,378.14)) +txt('1',(354.437,378.14)) fp((0,0,0)) le() lw(1) @@ -81,37 +81,37 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(355.356,347.879)) +txt('3',(354.44,347.879)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(355.356,317.879)) +txt('4',(354.44,317.879)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0,0,0)) le() lw(1) @@ -121,17 +121,17 @@ txt('5',(355.049,288.14)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(270,455,0) -bs(250,455,0) +bs(272.5,455,0) +bs(252.5,455,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,425,0) +bs(287.5,380,0) +bs(287.5,422.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(285,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-4.sk b/doc/src/diagrams/modelview-move-rows-4.sk index a8a1157..0531749 100644 --- a/doc/src/diagrams/modelview-move-rows-4.sk +++ b/doc/src/diagrams/modelview-move-rows-4.sk @@ -4,28 +4,28 @@ layout('A4',0) layer('Layer 1',1,1,0,0,(0,0,0)) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) r(30,0,0,-30,345,430) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335.18) lw(1) r(30,0,0,-30,345,339.739) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30.442,220,305.442) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,344.084,310) +r(30,0,0,-30,345,310) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) r(30,0,0,-30,345,460) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) lw(1) r(30,0,0,-30,345,400) fp((0.753,0.753,1)) @@ -36,7 +36,7 @@ lw(1) r(30,0,0,-30,345,370) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) le() lw(1) r(165,0,0,-230,210,705) @@ -45,7 +45,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) @@ -57,7 +57,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) @@ -81,13 +81,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0.503,0.503,0.503)) le() lw(1) @@ -99,7 +99,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) @@ -111,27 +111,27 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.44,283.582)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(354.133,288.14)) +txt('5',(354.44,288.14)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(270,335,0) -bs(250,335,0) +bs(272.5,335,0) +bs(252.5,335,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,335,0) +bs(287.5,380,0) +bs(287.5,337.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(285,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') -- cgit v0.12 From d52cc1ded5f30a6da0d11b9c3f7de66b2d3e9ee9 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 4 May 2010 15:14:56 +0200 Subject: Fix rtl issues with sliders in GTK style Sliders that draw groove decorations did not invert appearance correctly in vertical or rtl cases. With this fix we will flip the rectangles of the respective decorations and tell gtk if we are using an rtl widget or not. Task-number: QTBUG-8986 Reviewed-yb: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index e3ca8b2..0988fd8 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1937,14 +1937,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); - QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); bool horizontal = slider->orientation == Qt::Horizontal; bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; bool ticksBelow = slider->tickPosition & QSlider::TicksBelow; - QColor activeHighlight = option->palette.color(QPalette::Normal, QPalette::Highlight); - QPixmap cache; QBrush oldBrush = painter->brush(); QPen oldPen = painter->pen(); @@ -1953,6 +1950,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QColor highlightAlpha(Qt::white); highlightAlpha.setAlpha(80); + QGtkStylePrivate::gtk_widget_set_direction(hScaleWidget, slider->upsideDown ? + GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); GtkWidget *scaleWidget = horizontal ? hScaleWidget : vScaleWidget; style = scaleWidget->style; @@ -1986,11 +1985,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QRect lowerGroove = grooveRect; if (horizontal) { - upperGroove.setLeft(handle.center().x()); - lowerGroove.setRight(handle.center().x()); + if (slider->upsideDown) { + lowerGroove.setLeft(handle.center().x()); + upperGroove.setRight(handle.center().x()); + } else { + upperGroove.setLeft(handle.center().x()); + lowerGroove.setRight(handle.center().x()); + } } else { - upperGroove.setBottom(handle.center().y()); - lowerGroove.setTop(handle.center().y()); + if (!slider->upsideDown) { + lowerGroove.setBottom(handle.center().y()); + upperGroove.setTop(handle.center().y()); + } else { + upperGroove.setBottom(handle.center().y()); + lowerGroove.setTop(handle.center().y()); + } } gtkPainter.paintBox( scaleWidget, "trough-upper", upperGroove, state, -- cgit v0.12 From 409ced7dc098438e185b9a6db6b3f53b1472839d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 4 May 2010 15:33:02 +0200 Subject: qdoc: Fixed the alphabet index in the compact list. Now it leaves out any letter that doesn't appear in the list. i.e. If there are no classes that begin with QJ... J does not appear in the alphabet index. --- doc/src/declarative/declarativeui.qdoc | 8 ++++---- tools/qdoc3/htmlgenerator.cpp | 13 ++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 6a1f5c5..5283ba8 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -74,7 +74,7 @@ strengths}. QML can be be used to incrementally extend an existing application or to build completely new applications. QML is fully \l {Extending QML in C++}{extensible from C++}. -\section1 Getting Started: +\section1 Getting Started \list \o \l {Introduction to the QML language} @@ -84,7 +84,7 @@ application or to build completely new applications. QML is fully \l \o \l {QML for Qt programmers} \endlist -\section1 Core QML Features: +\section1 Core QML Features \list \o \l {QML Documents} \o \l {Property Binding} @@ -102,7 +102,7 @@ application or to build completely new applications. QML is fully \l \o \l {qmlruntime.html}{The Qt Declarative Runtime} \endlist -\section1 Using QML with C++: +\section1 Using QML with C++ \list \o \l {Tutorial: Writing QML extensions with C++} \o \l {Extending QML in C++} @@ -110,7 +110,7 @@ application or to build completely new applications. QML is fully \l \o \l {Integrating QML with existing Qt UI code} \endlist -\section1 Reference: +\section1 Reference \list \o \l {QML Elements} \o \l {QML Global Object} diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 569d1cd..d32ae99 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2399,6 +2399,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, */ NodeMap paragraph[NumParagraphs+1]; QString paragraphName[NumParagraphs+1]; + QSet usedParagraphNames; NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { @@ -2422,6 +2423,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } paragraphName[paragraphNo] = key[0].toUpper(); + usedParagraphNames.insert(key[0].toLower().cell()); paragraph[paragraphNo].insert(key, c.value()); ++c; } @@ -2469,12 +2471,12 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "

    "; for (int i = 0; i < 26; i++) { QChar ch('a' + i); - out() << QString("%2 ").arg(ch).arg(ch.toUpper()); + if (usedParagraphNames.contains(char('a' + i))) + out() << QString("%2 ").arg(ch).arg(ch.toUpper()); } out() << "

    \n"; } - QSet used; out() << "\n"; for (k = 0; k < numRows; k++) { out() << "\n"; @@ -2502,7 +2504,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, if (includeAlphabet) { QChar c = paragraphName[currentParagraphNo[i]][0].toLower(); out() << QString("").arg(c); - used.insert(c.cell()); } out() << "" << paragraphName[currentParagraphNo[i]] @@ -2545,12 +2546,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "\n"; } out() << "
    \n"; - char C = 'a'; - while (C <= 'z') { - if (!used.contains(C)) - out() << QString("").arg(C); - ++C; - } } void HtmlGenerator::generateFunctionIndex(const Node *relative, -- cgit v0.12 From 8737df24cd58359dacd3d0cb7f856cb7484f03c8 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 4 May 2010 15:53:33 +0200 Subject: Doc: Updating style and HTML in CSS and qdoc Adding all classnames generated in qdoc to the CSS and removing redundant   from htmlgenerator. Reviewed-by: Trust Me --- doc/src/template/style/style.css | 96 +++++++++++++++++++++++++++++++++++----- tools/qdoc3/htmlgenerator.cpp | 12 ++--- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 9c290f5..2da91f3 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -58,6 +58,10 @@ { vertical-align: baseline; } + tt, .qmlreadonly span, .qmldefault span + { + word-spacing:5px; + } .heading { font: normal 600 16px/1.0 Arial; @@ -483,7 +487,7 @@ .wrap .content p { line-height: 20px; - padding: 10px 5px 10px 5px; + padding: 5px 5px 5px 5px; } .wrap .content ul { @@ -499,7 +503,11 @@ color: #4c0033; text-decoration: none; } - .footer + .content a:visited:hover + { + color: #4c0033; + text-decoration: underline; + } .footer { min-height: 100px; color: #797775; @@ -665,6 +673,10 @@ { font-variant: normal; } + .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover + { + text-decoration:none; + } #shortCut { padding-top: 10px; @@ -732,12 +744,16 @@ } th { - padding: 3px 15px 3px 15px; + padding: 5px 15px 5px 15px; } td { padding: 3px 15px 3px 20px; } + td.rightAlign + { + padding: 3px 15px 3px 10px; + } table tr.odd { border-left: 1px solid #E6E6E6; @@ -758,7 +774,7 @@ { background-color: #E6E6E6; } - + span.comment { color: #8B0000; @@ -856,11 +872,35 @@ width: 200px; } - .toc h3 + .toc h3, .generic a { font: 600 12px/1.2 Arial; } + .generic{} + .alignedsummary{} + .propsummary{} + .memItemLeft{} + .memItemRight{} + .bottomAlign{} + .highlightedCode{} + .LegaleseLeft{} + .valuelist{} + .annotated{} + .obsolete{} + .compat{} + .flags{} + .qmlsummary{} + .qmlitem{} + .qmlproto{} + .qmlname{} + .qmlreadonly{} + .qmldefault{} + .qmldoc{} + .qt-style{} + .redFont{} + code{} + .wrap .content .toc ul { padding-left: 0px; @@ -901,8 +941,42 @@ border-style: solid; border-color: #E6E6E6; font-weight: bold; - } - + word-spacing:3px; + } + + .functionIndex { + font-size:12pt; + word-spacing:10px; + margin-bottom:10px; + background-color: #F6F6F6; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + } + + .centerAlign + { + text-align:center; + } + + .rightAlign + { + text-align:right; + } + + + .leftAlign + { + text-align:left; + } + + .topAlign{ + vertical-align:top + } + + .functionIndex a{ + display:inline-block; + } /* start index box */ .indexbox @@ -929,8 +1003,8 @@ { display: inline-block; width: 49%; - *width:42%; - _width:42%; + /* *width:42%; + _width:42%;*/ padding:0 2% 0 1%; vertical-align:top; @@ -939,8 +1013,8 @@ .indexboxcont .indexIcon { width: 11%; - *width:18%; - _width:18%; + /* *width:18%; + _width:18%;*/ overflow:hidden; } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index d32ae99..801e199 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2507,7 +2507,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } out() << "" << paragraphName[currentParagraphNo[i]] - << " "; + << ""; } out() << "\n"; @@ -2677,7 +2677,7 @@ void HtmlGenerator::generateQmlItem(const Node *node, if (summary) marked.replace("@name>", "b>"); - marked.replace("<@extra>", "  "); + marked.replace("<@extra>", ""); marked.replace("", ""); if (summary) { @@ -2986,7 +2986,7 @@ void HtmlGenerator::generateSynopsis(const Node *node, extraRegExp.setMinimal(true); marked.replace(extraRegExp, ""); } else { - marked.replace("<@extra>", "  "); + marked.replace("<@extra>", ""); marked.replace("", ""); } @@ -3265,7 +3265,7 @@ void HtmlGenerator::generateSynopsis(const Node *node, extraRegExp.setMinimal(true); marked.replace(extraRegExp, ""); } else { - marked.replace("<@extra>", "  "); + marked.replace("<@extra>", ""); marked.replace("", ""); } @@ -4436,9 +4436,9 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << ""; if (!qpn->isWritable()) - out() << "read-only "; + out() << "read-only"; if (qpgn->isDefault()) - out() << "default "; + out() << "default"; generateQmlItem(qpn, relative, marker, false); out() << ""; if (qpgn->isDefault()) { -- cgit v0.12 From 62201af6fd7a704e936692231b35342ce051bb08 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 12 May 2010 10:49:07 +0200 Subject: REG 4.7: Edit widgets icon no longer in toolbar. Task-number: QTBUG-10626 Reviewed-by: Daniel Molkentin --- tools/designer/src/designer/qdesigner_actions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp index a593a76..86b6214 100644 --- a/tools/designer/src/designer/qdesigner_actions.cpp +++ b/tools/designer/src/designer/qdesigner_actions.cpp @@ -347,6 +347,7 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(editWidgetsSlot())); m_editWidgetsAction->setChecked(true); m_editWidgetsAction->setEnabled(false); + m_editWidgetsAction->setProperty(QDesignerActions::defaultToolbarPropertyName, true); m_toolActions->addAction(m_editWidgetsAction); connect(formWindowManager, SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), -- cgit v0.12 From 0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 4 May 2010 16:25:18 +0200 Subject: Use qrand() instead of rand() This only affects X11 code, and are the only 2 places in Qt where rand() is used instead of qrand(). Task-number: QTBUG-9793 Reviewed-by: TrustMe --- src/gui/kernel/qwidget_x11.cpp | 2 +- src/gui/painting/qpaintengine_x11.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 37ac6bf..43f510c 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -3000,7 +3000,7 @@ Picture QX11Data::getSolidFill(int screen, const QColor &c) return X11->solid_fills[i].picture; } // none found, replace one - int i = rand() % 16; + int i = qrand() % 16; if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) { XRenderFreePicture (X11->display, X11->solid_fills[i].picture); diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index da48fcb..aef8b80 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -315,7 +315,7 @@ static Picture getPatternFill(int screen, const QBrush &b) return X11->pattern_fills[i].picture; } // none found, replace one - int i = rand() % 16; + int i = qrand() % 16; if (X11->pattern_fills[i].screen != screen && X11->pattern_fills[i].picture) { XRenderFreePicture (X11->display, X11->pattern_fills[i].picture); -- cgit v0.12 From d59ef5d00b6c07c3a1c332ebdd0fac060538940c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 4 May 2010 18:48:36 +0200 Subject: QtDeclarative: remove spurious semi-colons from the source code --- src/declarative/graphicsitems/qdeclarativegridview_p.h | 2 +- src/declarative/graphicsitems/qdeclarativelistview_p.h | 2 +- src/declarative/qml/qdeclarativebinding_p.h | 2 +- src/declarative/qml/qdeclarativecompiledbindings_p.h | 4 ++-- src/declarative/qml/qdeclarativecomponent_p.h | 2 +- src/declarative/qml/qdeclarativecontext.h | 2 +- src/declarative/qml/qdeclarativeguard_p.h | 2 +- src/declarative/qml/qdeclarativepropertycache.cpp | 2 +- src/declarative/qml/qdeclarativescriptstring.h | 2 +- src/declarative/qml/qdeclarativestringconverters_p.h | 2 +- src/declarative/qml/qdeclarativeworkerscript_p.h | 2 +- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 6 +++--- src/declarative/util/qdeclarativelistmodelworkeragent_p.h | 2 +- src/declarative/util/qdeclarativesmoothedanimation_p.h | 2 +- src/declarative/util/qdeclarativesmoothedfollow_p.h | 2 +- src/declarative/util/qdeclarativetransitionmanager_p_p.h | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h index c06879e..f5d061d 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview_p.h +++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h @@ -142,7 +142,7 @@ public: void setSnapMode(SnapMode mode); enum PositionMode { Beginning, Center, End, Visible, Contain }; - Q_ENUMS(PositionMode); + Q_ENUMS(PositionMode) Q_INVOKABLE void positionViewAtIndex(int index, int mode); Q_INVOKABLE int indexAt(int x, int y) const; diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 9c0b7dd..051455c 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -200,7 +200,7 @@ public: static QDeclarativeListViewAttached *qmlAttachedProperties(QObject *); enum PositionMode { Beginning, Center, End, Visible, Contain }; - Q_ENUMS(PositionMode); + Q_ENUMS(PositionMode) Q_INVOKABLE void positionViewAtIndex(int index, int mode); Q_INVOKABLE int indexAt(int x, int y) const; diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h index 2d3acf5..598f09f 100644 --- a/src/declarative/qml/qdeclarativebinding_p.h +++ b/src/declarative/qml/qdeclarativebinding_p.h @@ -164,6 +164,6 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeBinding*); +Q_DECLARE_METATYPE(QDeclarativeBinding*) #endif // QDECLARATIVEBINDING_P_H diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h index a17bc84..d5c6a02 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings_p.h +++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h @@ -104,8 +104,8 @@ protected: int qt_metacall(QMetaObject::Call, int, void **); private: - Q_DISABLE_COPY(QDeclarativeCompiledBindings); - Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings); + Q_DISABLE_COPY(QDeclarativeCompiledBindings) + Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings) }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h index 24e5386..8b95945 100644 --- a/src/declarative/qml/qdeclarativecomponent_p.h +++ b/src/declarative/qml/qdeclarativecomponent_p.h @@ -149,7 +149,7 @@ Q_SIGNALS: void destruction(); private: - friend class QDeclarativeContextData;; + friend class QDeclarativeContextData; friend class QDeclarativeComponentPrivate; }; diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h index 548869c..d87123a 100644 --- a/src/declarative/qml/qdeclarativecontext.h +++ b/src/declarative/qml/qdeclarativecontext.h @@ -107,7 +107,7 @@ private: }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QList); +Q_DECLARE_METATYPE(QList) QT_END_HEADER diff --git a/src/declarative/qml/qdeclarativeguard_p.h b/src/declarative/qml/qdeclarativeguard_p.h index be60ce4..02fed0b 100644 --- a/src/declarative/qml/qdeclarativeguard_p.h +++ b/src/declarative/qml/qdeclarativeguard_p.h @@ -97,7 +97,7 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeGuard); +Q_DECLARE_METATYPE(QDeclarativeGuard) #include "private/qdeclarativedata_p.h" diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index 888945b..26bddde 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -45,7 +45,7 @@ #include "private/qdeclarativebinding_p.h" #include -Q_DECLARE_METATYPE(QScriptValue); +Q_DECLARE_METATYPE(QScriptValue) QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qdeclarativescriptstring.h b/src/declarative/qml/qdeclarativescriptstring.h index 43bef44..fc92a9b 100644 --- a/src/declarative/qml/qdeclarativescriptstring.h +++ b/src/declarative/qml/qdeclarativescriptstring.h @@ -79,7 +79,7 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeScriptString); +Q_DECLARE_METATYPE(QDeclarativeScriptString) QT_END_HEADER diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h index 7afdfd3..97f72fc 100644 --- a/src/declarative/qml/qdeclarativestringconverters_p.h +++ b/src/declarative/qml/qdeclarativestringconverters_p.h @@ -80,7 +80,7 @@ namespace QDeclarativeStringConverters QSizeF Q_DECLARATIVE_EXPORT sizeFFromString(const QString &, bool *ok = 0); QRectF Q_DECLARATIVE_EXPORT rectFFromString(const QString &, bool *ok = 0); QVector3D Q_DECLARATIVE_EXPORT vector3DFromString(const QString &, bool *ok = 0); -}; +} QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeworkerscript_p.h b/src/declarative/qml/qdeclarativeworkerscript_p.h index 6cce799..4019d13 100644 --- a/src/declarative/qml/qdeclarativeworkerscript_p.h +++ b/src/declarative/qml/qdeclarativeworkerscript_p.h @@ -119,7 +119,7 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeWorkerScript); +QML_DECLARE_TYPE(QDeclarativeWorkerScript) QT_END_HEADER diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index b7e1832..e034165 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -318,9 +318,9 @@ public: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Node); -Q_DECLARE_METATYPE(NodeList); -Q_DECLARE_METATYPE(NamedNodeMap); +Q_DECLARE_METATYPE(Node) +Q_DECLARE_METATYPE(NodeList) +Q_DECLARE_METATYPE(NamedNodeMap) QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h index 53d30c2..1622144 100644 --- a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h +++ b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h @@ -146,7 +146,7 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef); +Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef) QT_END_HEADER diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p.h index 17aafa4..f45d19f 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation_p.h +++ b/src/declarative/util/qdeclarativesmoothedanimation_p.h @@ -96,7 +96,7 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation); +QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation) QT_END_HEADER diff --git a/src/declarative/util/qdeclarativesmoothedfollow_p.h b/src/declarative/util/qdeclarativesmoothedfollow_p.h index d860052..6319192 100644 --- a/src/declarative/util/qdeclarativesmoothedfollow_p.h +++ b/src/declarative/util/qdeclarativesmoothedfollow_p.h @@ -106,7 +106,7 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeSmoothedFollow); +QML_DECLARE_TYPE(QDeclarativeSmoothedFollow) QT_END_HEADER diff --git a/src/declarative/util/qdeclarativetransitionmanager_p_p.h b/src/declarative/util/qdeclarativetransitionmanager_p_p.h index 4131391..2e23898 100644 --- a/src/declarative/util/qdeclarativetransitionmanager_p_p.h +++ b/src/declarative/util/qdeclarativetransitionmanager_p_p.h @@ -70,7 +70,7 @@ public: void cancel(); private: - Q_DISABLE_COPY(QDeclarativeTransitionManager); + Q_DISABLE_COPY(QDeclarativeTransitionManager) QDeclarativeTransitionManagerPrivate *d; void complete(); -- cgit v0.12 From 395e00552802024cb41335bc87675441ff119d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 4 May 2010 18:43:42 +0200 Subject: Skip tst_LargeFile::mapOffsetOverflow on Mac On this platform mmap'ing beyond EOF may succeed, even beyond filesystem capabilities, but generate Bus Errors on access. Skipping this failing test and accepting the underlying undefined behavior is the right thing to do, until QFile offers proper guarantees. Reviewed-by: Thiago Macieira --- tests/auto/qfile/largefile/tst_largefile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/qfile/largefile/tst_largefile.cpp b/tests/auto/qfile/largefile/tst_largefile.cpp index 041e5f2..60c5f89 100644 --- a/tests/auto/qfile/largefile/tst_largefile.cpp +++ b/tests/auto/qfile/largefile/tst_largefile.cpp @@ -523,6 +523,10 @@ void tst_LargeFile::mapFile() void tst_LargeFile::mapOffsetOverflow() { +#if defined(Q_OS_MAC) + QSKIP("mmap'ping beyond EOF may succeed; generate bus error on access", SkipAll); +#endif + // Out-of-range mappings should fail, and not silently clip the offset for (int i = 50; i < 63; ++i) { uchar *address = 0; -- cgit v0.12 From 36e6c652bc087a6adcef1fad9f899b787e67e9af Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 5 May 2010 10:06:52 +1000 Subject: Update changelog. --- dist/changes-4.7.0 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 4fd7fdb..d156bd7 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -27,6 +27,13 @@ General Improvements - Support for the GL_EXT_geometry_shader4, aka Geometry Shaders, was added to QGLShaderProgram. +New features +------------ + + - QNetworkSession, QNetworkConfiguration, QNetworkConfigurationManager + * New bearer management classes added. + + Third party components ---------------------- -- cgit v0.12 From 3b3ec6bc4114db82462eef812a47db420d4505c2 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Wed, 5 May 2010 10:19:40 +1000 Subject: Fix a crash with null objects returned from a Q_INVOKABLE Task-number: QTBUG-10412 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 03366f0..170f440 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -775,7 +775,8 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e) return QScriptDeclarativeClass::Value(engine, *((QString *)&data)); } else if (type == QMetaType::QObjectStar) { QObject *object = *((QObject **)&data); - QDeclarativeData::get(object, true)->setImplicitDestructible(); + if (object) + QDeclarativeData::get(object, true)->setImplicitDestructible(); QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e); return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(object)); } else if (type == qMetaTypeId >()) { -- cgit v0.12 From 4982b883c31874206aaa05268852fbcee81a8a39 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 5 May 2010 11:49:20 +1000 Subject: Enable states to be activated via their 'when' clause even if unnamed. Autogenerate a name for unnamed states: "anonymousState1", etc. Task-number: QTBUG-10352 Reviewed-by: Aaron Kennedy --- src/declarative/util/qdeclarativestategroup.cpp | 10 +++++++++- .../qdeclarativestates/data/unnamedWhen.qml | 14 ++++++++++++++ .../qdeclarativestates/tst_qdeclarativestates.cpp | 20 ++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index 5b51495..9b042d7 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -47,6 +47,7 @@ #include #include +#include #include #include @@ -62,7 +63,7 @@ class QDeclarativeStateGroupPrivate : public QObjectPrivate public: QDeclarativeStateGroupPrivate() : nullState(0), componentComplete(true), - ignoreTrans(false), applyingState(false) {} + ignoreTrans(false), applyingState(false), unnamedCount(0) {} QString currentState; QDeclarativeState *nullState; @@ -78,6 +79,7 @@ public: bool componentComplete; bool ignoreTrans; bool applyingState; + int unnamedCount; QDeclarativeTransition *findTransition(const QString &from, const QString &to); void setCurrentStateInternal(const QString &state, bool = false); @@ -259,6 +261,12 @@ void QDeclarativeStateGroup::componentComplete() Q_D(QDeclarativeStateGroup); d->componentComplete = true; + for (int ii = 0; ii < d->states.count(); ++ii) { + QDeclarativeState *state = d->states.at(ii); + if (state->name().isEmpty()) + state->setName(QLatin1String("anonymousState") % QString::number(++d->unnamedCount)); + } + if (d->updateAutoState()) { return; } else if (!d->currentState.isEmpty()) { diff --git a/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml new file mode 100644 index 0000000..a70840c --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml @@ -0,0 +1,14 @@ +import Qt 4.7 + +Rectangle { + id: theRect + property bool triggerState: false + property string stateString: "" + states: State { + when: triggerState + PropertyChanges { + target: theRect + stateString: "inState" + } + } +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index d384d26..13992ad 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -110,6 +110,7 @@ private slots: void illegalObjectCreation(); void whenOrdering(); void urlResolution(); + void unnamedWhen(); }; void tst_qdeclarativestates::initTestCase() @@ -1049,6 +1050,25 @@ void tst_qdeclarativestates::urlResolution() QCOMPARE(image3->source(), resolved); } +void tst_qdeclarativestates::unnamedWhen() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/unnamedWhen.qml"); + QDeclarativeRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + + QCOMPARE(rectPrivate->state(), QLatin1String("")); + QCOMPARE(rect->property("stateString").toString(), QLatin1String("")); + rect->setProperty("triggerState", true); + QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1")); + QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState")); + rect->setProperty("triggerState", false); + QCOMPARE(rectPrivate->state(), QLatin1String("")); + QCOMPARE(rect->property("stateString").toString(), QLatin1String("")); +} + QTEST_MAIN(tst_qdeclarativestates) #include "tst_qdeclarativestates.moc" -- cgit v0.12 From a5d15c36ae3db3caff4eeb86fd7eb5cdbb928f2d Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 5 May 2010 12:16:28 +1000 Subject: syntax update --- src/imports/gestures/qdeclarativegesturearea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp index 615c674..19afe0c 100644 --- a/src/imports/gestures/qdeclarativegesturearea.cpp +++ b/src/imports/gestures/qdeclarativegesturearea.cpp @@ -259,7 +259,7 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event) bool accept = true; for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) { if ((gesture = event->gesture(it.key()))) { - it.value()->value(); + it.value()->evaluate(); event->setAccepted(true); // XXX only if value returns true? } } -- cgit v0.12 From 326dab74ba8df7707d1054ca5e0280c5f131c148 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 5 May 2010 12:51:02 +1000 Subject: Null objects should appear as JS null --- src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 3 ++- tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml | 4 ++-- .../declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 170f440..8b64e0e 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -104,7 +104,8 @@ QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); if (!object) - return newObject(scriptEngine, this, new ObjectData(object, type)); + return scriptEngine->nullValue(); +// return newObject(scriptEngine, this, new ObjectData(object, type)); if (QObjectPrivate::get(object)->wasDeleted) return scriptEngine->undefinedValue(); diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml index 72b59ae..2337e44 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml @@ -19,7 +19,7 @@ QtObject { myObject.deleteOnSet = 1; - test3 = myObject.value == undefined; - test4 = obj.value == undefined; + test3 = myObject == null + test4 = obj == null } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 6d39be2..8c9290f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -1104,7 +1104,7 @@ void tst_qdeclarativeecmascript::exceptionClearsOnReeval() QDeclarativeComponent component(&engine, TEST_FILE("exceptionClearsOnReeval.qml")); QString url = component.url().toString(); - QString warning = url + ":4: TypeError: Result of expression 'objectProperty.objectProperty' [undefined] is not an object."; + QString warning = url + ":4: TypeError: Result of expression 'objectProperty' [null] is not an object."; QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); MyQmlObject *object = qobject_cast(component.create()); -- cgit v0.12 From dcee637a9f7a024803f0e5cc1bf57d878dca2ac3 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 5 May 2010 09:50:53 +1000 Subject: Doc improvements, simplify example code --- doc/src/declarative/advtutorial.qdoc | 50 +++++++++++++++---- doc/src/declarative/tutorial.qdoc | 15 +++--- .../declarative/tutorials/helloworld/tutorial1.qml | 3 +- .../declarative/tutorials/helloworld/tutorial2.qml | 3 +- .../declarative/tutorials/helloworld/tutorial3.qml | 3 +- .../tutorials/samegame/samegame1/Block.qml | 2 +- .../tutorials/samegame/samegame1/Button.qml | 17 +++++-- .../tutorials/samegame/samegame1/samegame.qml | 7 ++- .../tutorials/samegame/samegame2/Block.qml | 2 +- .../tutorials/samegame/samegame2/Button.qml | 17 +++++-- .../tutorials/samegame/samegame2/samegame.qml | 5 +- .../tutorials/samegame/samegame3/Button.qml | 17 +++++-- .../tutorials/samegame/samegame3/Dialog.qml | 33 ++++++------- .../tutorials/samegame/samegame3/samegame.js | 9 ++-- .../tutorials/samegame/samegame3/samegame.qml | 14 +++--- .../samegame/samegame4/content/Button.qml | 17 +++++-- .../samegame/samegame4/content/Dialog.qml | 57 ++++++++++++++++------ .../samegame/samegame4/content/samegame.js | 17 ++++--- .../tutorials/samegame/samegame4/samegame.qml | 38 +++++---------- 19 files changed, 208 insertions(+), 118 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 42ce246..7d2967e 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -109,12 +109,16 @@ Notice the anchors for the \c Item, \c Button and \c Text elements are set using \section2 Adding \c Button and \c Block components -The \c Button item in the code above is defined in a separate file named \c Button.qml. +The \c Button item in the code above is defined in a separate component file named \c Button.qml. To create a functional button, we use the QML elements \l Text and \l MouseArea inside a \l Rectangle. Here is the \c Button.qml code: \snippet declarative/tutorials/samegame/samegame1/Button.qml 0 +This essentially defines a rectangle that contains text and can be clicked. The \l MouseArea +has an \c onClicked() handler that is implemented to emit the \c clicked() signal of the +\c container when the area is clicked. + In Same Game, the screen is filled with small blocks when the game begins. Each block is just an item that contains an image. The block code is defined in a separate \c Block.qml file: @@ -226,14 +230,14 @@ until it is won or lost. To do this, we have added the following functions to \c samegame.js: \list -\o function \c{handleClick(x,y)} -\o function \c{floodFill(xIdx,yIdx,type)} -\o function \c{shuffleDown()} -\o function \c{victoryCheck()} -\o function \c{floodMoveCheck(xIdx, yIdx, type)} +\o \c{handleClick(x,y)} +\o \c{floodFill(xIdx,yIdx,type)} +\o \c{shuffleDown()} +\o \c{victoryCheck()} +\o \c{floodMoveCheck(xIdx, yIdx, type)} \endlist -As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to JavaScript. +As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to QML. \section3 Enabling mouse click interaction @@ -269,6 +273,8 @@ And this is how it is used in the main \c samegame.qml file: \snippet declarative/tutorials/samegame/samegame3/samegame.qml 2 +We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on top of our other components. The default \c z value for an item is 0. + \section3 A dash of color @@ -383,15 +389,41 @@ The theme change here is produced simply by replacing the block images. This can Another feature we might want to add to the game is a method of storing and retrieving high scores. -In \c samegame.qml we now pop up a dialog when the game is over and requests the player's name so it can be added to a High Scores table. The dialog is created using \c Dialog.qml: +To do this, we will show a dialog when the game is over to request the player's name and add it to a High Scores table. +This requires a few changes to \c Dialog.qml. In addition to a \c Text element, it now has a +\c TextInput child item for receiving keyboard text input: + +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0 +\dots 4 +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 2 +\dots 4 +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3 + +We'll also add a \c showWithInput() function. The text input will only be visible if this function +is called instead of \c show(). When the dialog is closed, it emits a \c closed() signal, and +other elements can retrieve the text entered by the user through an \c inputText property: + +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0 +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 1 +\dots 4 +\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3 + +Now the dialog can be used in \c samegame.qml: \snippet declarative/tutorials/samegame/samegame4/samegame.qml 0 -When the dialog is closed, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible. +When the dialog emits the \c closed signal, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible. +The \c nameInputDialog is activated in the \c victoryCheck() function in \c samegame.js: + +\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 3 +\dots 4 +\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 4 \section3 Storing high scores offline +Now we need to implement the functionality to actually save the High Scores table. + Here is the \c saveHighScore() function in \c samegame.js: \snippet declarative/tutorials/samegame/samegame4/content/samegame.js 2 diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc index 1a93d05..4cfb999 100644 --- a/doc/src/declarative/tutorial.qdoc +++ b/doc/src/declarative/tutorial.qdoc @@ -86,7 +86,7 @@ Here is the QML code for the application: \section2 Import First, we need to import the types that we need for this example. Most QML files will import the built-in QML -types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with: +types (like \l{Rectangle}, \l{Image}, ...) that come with Qt, using: \snippet examples/declarative/tutorials/helloworld/tutorial1.qml 3 @@ -95,7 +95,7 @@ types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with: \snippet examples/declarative/tutorials/helloworld/tutorial1.qml 1 We declare a root element of type \l{Rectangle}. It is one of the basic building blocks you can use to create an application in QML. -We give it an \c{id} to be able to refer to it later. In this case, we call it \e page. +We give it an \c{id} to be able to refer to it later. In this case, we call it "page". We also set the \c width, \c height and \c color properties. The \l{Rectangle} element contains many other properties (such as \c x and \c y), but these are left at their default values. @@ -103,15 +103,16 @@ The \l{Rectangle} element contains many other properties (such as \c x and \c y) \snippet examples/declarative/tutorials/helloworld/tutorial1.qml 2 -We add a \l Text element as a child of our root element that will display the text 'Hello world!'. +We add a \l Text element as a child of the root Rectangle element that displays the text 'Hello world!'. The \c y property is used to position the text vertically at 30 pixels from the top of its parent. -The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}. - The \c anchors.horizontalCenter property refers to the horizontal center of an element. In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-based Layout}). +The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}. + + \section2 Viewing the example To view what you have created, run the \l{Qt Declarative UI Runtime}{qml} tool (located in the \c bin directory) with your filename as the first argument. @@ -134,10 +135,10 @@ This chapter adds a color picker to change the color of the text. \image declarative-tutorial2.png Our color picker is made of six cells with different colors. -To avoid writing the same code multiple times, we first create a new \c Cell component. +To avoid writing the same code multiple times for each cell, we create a new \c Cell component. A component provides a way of defining a new type that we can re-use in other QML files. A QML component is like a black-box and interacts with the outside world through properties, signals and slots and is generally -defined in its own QML file (for more details, see \l {Defining new Components}). +defined in its own QML file. (For more details, see \l {Defining new Components}). The component's filename must always start with a capital letter. Here is the QML code for \c Cell.qml: diff --git a/examples/declarative/tutorials/helloworld/tutorial1.qml b/examples/declarative/tutorials/helloworld/tutorial1.qml index 5e27b45..04cd155 100644 --- a/examples/declarative/tutorials/helloworld/tutorial1.qml +++ b/examples/declarative/tutorials/helloworld/tutorial1.qml @@ -14,8 +14,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter } //![2] } diff --git a/examples/declarative/tutorials/helloworld/tutorial2.qml b/examples/declarative/tutorials/helloworld/tutorial2.qml index 085efa4..66be509 100644 --- a/examples/declarative/tutorials/helloworld/tutorial2.qml +++ b/examples/declarative/tutorials/helloworld/tutorial2.qml @@ -9,8 +9,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter } Grid { diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml index 4bf4970..041d9a9 100644 --- a/examples/declarative/tutorials/helloworld/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/tutorial3.qml @@ -9,8 +9,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter //![1] MouseArea { id: mouseArea; anchors.fill: parent } diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml index a23654b..11fd844 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml @@ -7,7 +7,7 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png"; + source: "../shared/pics/redStone.png" } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml index e84b1ce..96a80eb 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml @@ -8,9 +8,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -27,8 +27,17 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml index b6e01fd..f2974be 100644 --- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml @@ -22,21 +22,20 @@ Rectangle { Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: console.log("This doesn't do anything yet...") } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml index 4e71e60..39da84e 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml @@ -6,6 +6,6 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png"; + source: "../shared/pics/redStone.png" } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index a7d1fba..9b4d4d5 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -30,7 +30,7 @@ Rectangle { //![1] Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } @@ -38,9 +38,8 @@ Rectangle { Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml index 15b3b2f..3efed2f 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml @@ -2,31 +2,30 @@ import Qt 4.7 Rectangle { - id: page + id: container - signal closed - - function forceClose() { - page.closed(); - page.opacity = 0; + function show(text) { + dialogText.text = text; + container.opacity = 1; } - function show(txt) { - dialogText.text = txt; - page.opacity = 1; + function hide() { + container.opacity = 0; } - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 + width: dialogText.width + 20 + height: dialogText.height + 20 opacity: 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } + Text { + id: dialogText + anchors.centerIn: parent + text: "" } - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } - - MouseArea { anchors.fill: parent; onClicked: forceClose(); } + MouseArea { + anchors.fill: parent + onClicked: hide(); + } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js index 4256aee..84439fc 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js @@ -17,7 +17,7 @@ function startNewGame() { maxIndex = maxRow * maxColumn; //Close dialogs - dialog.forceClose(); + dialog.hide(); //Initialize Board board = new Array(maxIndex); @@ -59,10 +59,9 @@ function createBlock(column, row) { return true; } -var fillFound; -//Set after a floodFill call to the number of blocks found -var floodBoard; -//Set to 1 if the floodFill reaches off that node +var fillFound; //Set after a floodFill call to the number of blocks found +var floodBoard; //Set to 1 if the floodFill reaches off that node + //![1] function handleClick(xPos, yPos) { var column = Math.floor(xPos / gameCanvas.blockSize); diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index 50f9d5d..ac93eb1 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -30,7 +30,6 @@ Rectangle { width: parent.width - (parent.width % blockSize) height: parent.height - (parent.height % blockSize) anchors.centerIn: parent - z: 20 MouseArea { anchors.fill: parent @@ -41,26 +40,29 @@ Rectangle { } //![2] - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + Dialog { + id: dialog + anchors.centerIn: parent + z: 100 + } //![2] Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml index 6848534..2f45362 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml @@ -1,30 +1,59 @@ import Qt 4.7 +//![0] Rectangle { - id: page + id: container +//![0] +//![1] + property string inputText: textInput.text signal closed - function forceClose() { - page.closed(); - page.opacity = 0; + function show(text) { + dialogText.text = text; + container.opacity = 1; + textInput.opacity = 0; } - function show(txt) { - dialogText.text = txt; - page.opacity = 1; + function showWithInput(text) { + show(text); + textInput.opacity = 1; + textInput.text = "" } - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 + function hide() { + container.opacity = 0; + container.closed(); + } +//![1] + + width: dialogText.width + textInput.width + 20 + height: dialogText.height + 20 opacity: 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } + Text { + id: dialogText + anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 } + text: "" + } + +//![2] + TextInput { + id: textInput + anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } + width: 80 + focus: true + text: "" + + onAccepted: container.hide() // close dialog when Enter is pressed } +//![2] - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } + MouseArea { + anchors.fill: parent + onClicked: hide(); + } - MouseArea { anchors.fill: parent; onClicked: forceClose(); } +//![3] } +//![3] diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index 961cd66..06d21e6 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -25,8 +25,8 @@ function startNewGame() { maxIndex = maxRow * maxColumn; //Close dialogs - nameInputDialog.forceClose(); - dialog.forceClose(); + nameInputDialog.hide(); + dialog.hide(); //Initialize Board board = new Array(maxIndex); @@ -72,10 +72,9 @@ function createBlock(column, row) { return true; } -var fillFound; -//Set after a floodFill call to the number of blocks found -var floodBoard; -//Set to 1 if the floodFill reaches off that node +var fillFound; //Set after a floodFill call to the number of blocks found +var floodBoard; //Set to 1 if the floodFill reaches off that node + function handleClick(xPos, yPos) { var column = Math.floor(xPos / gameCanvas.blockSize); var row = Math.floor(yPos / gameCanvas.blockSize); @@ -157,7 +156,9 @@ function shuffleDown() { } } +//![3] function victoryCheck() { +//![3] //Award bonus points if no blocks left var deservesBonus = true; for (var column = maxColumn - 1; column >= 0; column--) @@ -166,12 +167,14 @@ function victoryCheck() { if (deservesBonus) gameCanvas.score += 500; +//![4] //Check whether game has finished if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { gameDuration = new Date() - gameDuration; - nameInputDialog.show("You won! Please enter your name: "); + nameInputDialog.showWithInput("You won! Please enter your name: "); } } +//![4] //only floods up and right, to see if it can find adjacent same-typed blocks function floodMoveCheck(column, row, type) { diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index 404af0a..feb61fd 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -25,7 +25,7 @@ Rectangle { property int score: 0 property int blockSize: 40 - z: 20; anchors.centerIn: parent + anchors.centerIn: parent width: parent.width - (parent.width % blockSize); height: parent.height - (parent.height % blockSize); @@ -35,53 +35,41 @@ Rectangle { } } - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + Dialog { + id: dialog + anchors.centerIn: parent + z: 100 + } //![0] Dialog { id: nameInputDialog - anchors.centerIn: parent - z: 22 + z: 100 - Text { - id: dialogText - opacity: 0 - text: " You won! Please enter your name:" - } - - TextInput { - id: nameInput - width: 72 - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: true - - onAccepted: { - if (nameInputDialog.opacity == 1 && nameInput.text != "") - SameGame.saveHighScore(nameInput.text); - nameInputDialog.forceClose(); - } + onClosed: { + if (nameInputDialog.inputText != "") + SameGame.saveHighScore(nameInputDialog.inputText); } } //![0] Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: " + gameCanvas.score - font.bold: true } } } -- cgit v0.12 From c76d98da76fd687d2953f0026b16bca3c7fcf485 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 5 May 2010 13:24:25 +1000 Subject: Allow translations without extra command-line args, and document both. --- doc/src/declarative/qmlruntime.qdoc | 17 +++++++++ tools/qml/qmlruntime.cpp | 72 +++++++++++++++++++++++-------------- tools/qml/qmlruntime.h | 6 ++++ 3 files changed, 68 insertions(+), 27 deletions(-) diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc index a724c7d..23c5c32 100644 --- a/doc/src/declarative/qmlruntime.qdoc +++ b/doc/src/declarative/qmlruntime.qdoc @@ -112,6 +112,23 @@ When run with the \c -help option, qml shows available options. + \section2 Translations + + When the runtime loads an initial QML file, it will install a translation file from + a "i18n" subdirectory relative to that initial QML file. The actual translation file + loaded will be according to the system locale and have the form + "qml_.qm", where is a two-letter ISO 639 language, + such as "qml_fr.qm", optionally followed by an underscore and an uppercase two-letter ISO 3166 country + code, such as "qml_fr_FR.qm" or "qml_fr_CA.qm". + + Such files can be created using \l{Qt Linguist}. + + See \l{scripting.html#internationalization} for information about how to make + the JavaScript in QML files use translatable strings. + + Additionally, the QML runtime will load translation files specified on the + command line via the \c -translation option. + \section2 Dummy Data The secondary use of the qml runtime is to allow QML files to be viewed with diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 008f163..da31284 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -464,6 +465,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) , frame_stream(0), scaleSkin(true), mb(0) , portraitOrientation(0), landscapeOrientation(0) , m_scriptOptions(0), tester(0), useQmlFileBrowser(true) + , translator(0) { QDeclarativeViewer::registerTypes(); setWindowTitle(tr("Qt Qml Runtime")); @@ -937,6 +939,46 @@ void QDeclarativeViewer::launch(const QString& file_or_url) QMetaObject::invokeMethod(this, "open", Qt::QueuedConnection, Q_ARG(QString, file_or_url)); } +void QDeclarativeViewer::loadTranslationFile(const QString& directory) +{ + if (!translator) { + translator = new QTranslator(this); + QApplication::installTranslator(translator); + } + + translator->load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n")); +} + +void QDeclarativeViewer::loadDummyDataFiles(const QString& directory) +{ + QDir dir(directory+"/dummydata", "*.qml"); + QStringList list = dir.entryList(); + for (int i = 0; i < list.size(); ++i) { + QString qml = list.at(i); + QFile f(dir.filePath(qml)); + f.open(QIODevice::ReadOnly); + QByteArray data = f.readAll(); + QDeclarativeComponent comp(canvas->engine()); + comp.setData(data, QUrl()); + QObject *dummyData = comp.create(); + + if(comp.isError()) { + QList errors = comp.errors(); + foreach (const QDeclarativeError &error, errors) { + qWarning() << error; + } + if (tester) tester->executefailure(); + } + + if (dummyData) { + qWarning() << "Loaded dummy data:" << dir.filePath(qml); + qml.truncate(qml.length()-4); + canvas->rootContext()->setContextProperty(qml, dummyData); + dummyData->setParent(this); + } + } +} + bool QDeclarativeViewer::open(const QString& file_or_url) { currentFileOrUrl = file_or_url; @@ -966,39 +1008,15 @@ bool QDeclarativeViewer::open(const QString& file_or_url) QString fileName = url.toLocalFile(); if (!fileName.isEmpty()) { - QFileInfo fi(fileName); if (fi.exists()) { if (fi.suffix().toLower() != QLatin1String("qml")) { qWarning() << "qml cannot open non-QML file" << fileName; return false; } - QDir dir(fi.path()+"/dummydata", "*.qml"); - QStringList list = dir.entryList(); - for (int i = 0; i < list.size(); ++i) { - QString qml = list.at(i); - QFile f(dir.filePath(qml)); - f.open(QIODevice::ReadOnly); - QByteArray data = f.readAll(); - QDeclarativeComponent comp(canvas->engine()); - comp.setData(data, QUrl()); - QObject *dummyData = comp.create(); - - if(comp.isError()) { - QList errors = comp.errors(); - foreach (const QDeclarativeError &error, errors) { - qWarning() << error; - } - if (tester) tester->executefailure(); - } - - if (dummyData) { - qWarning() << "Loaded dummy data:" << dir.filePath(qml); - qml.truncate(qml.length()-4); - ctxt->setContextProperty(qml, dummyData); - dummyData->setParent(this); - } - } + QFileInfo fi(fileName); + loadTranslationFile(fi.path()); + loadDummyDataFiles(fi.path()); } else { qWarning() << "qml cannot find file:" << fileName; return false; diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 2a0a07d..0b23303 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -59,6 +59,7 @@ class QDeclarativeTester; class QNetworkReply; class QNetworkCookieJar; class NetworkAccessManagerFactory; +class QTranslator; class QDeclarativeViewer #if defined(Q_OS_SYMBIAN) @@ -192,6 +193,11 @@ private: NetworkAccessManagerFactory *namFactory; bool useQmlFileBrowser; + + QTranslator *translator; + void loadTranslationFile(const QString& directory); + + void loadDummyDataFiles(const QString& directory); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeViewer::ScriptOptions) -- cgit v0.12 From 9719866c686805d69b0026f555c97594e09c836f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 5 May 2010 13:35:11 +1000 Subject: Example i18n. --- examples/declarative/i18n/i18n.qml | 33 ++++++++++++++++++++++++++++ examples/declarative/i18n/i18n/base.ts | 12 ++++++++++ examples/declarative/i18n/i18n/qml_en_AU.qm | Bin 0 -> 81 bytes examples/declarative/i18n/i18n/qml_en_AU.ts | 12 ++++++++++ examples/declarative/i18n/i18n/qml_fr.qm | Bin 0 -> 85 bytes examples/declarative/i18n/i18n/qml_fr.ts | 12 ++++++++++ 6 files changed, 69 insertions(+) create mode 100644 examples/declarative/i18n/i18n.qml create mode 100644 examples/declarative/i18n/i18n/base.ts create mode 100644 examples/declarative/i18n/i18n/qml_en_AU.qm create mode 100644 examples/declarative/i18n/i18n/qml_en_AU.ts create mode 100644 examples/declarative/i18n/i18n/qml_fr.qm create mode 100644 examples/declarative/i18n/i18n/qml_fr.ts diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml new file mode 100644 index 0000000..3b1279a --- /dev/null +++ b/examples/declarative/i18n/i18n.qml @@ -0,0 +1,33 @@ +import Qt 4.7 + +// +// The QML runtime automatically loads a translation from the i18n subdirectory of the root +// QML file, based on the system language. +// +// The files are created/updated by running: +// +// lupdate i18n.qml -ts i18n/*.ts +// +// The .ts files can then be edited with Linguist: +// +// linguist i18n/qml_fr.ts +// +// The run-time translation files are then generaeted by running: +// +// lrelease i18n/*.ts +// +// Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts +// and editing the result with Linguist. +// + +Column { + Text { + text: "If a translation is available for the system language (eg. Franch) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'." + width: 200 + wrapMode: Text.WordWrap + } + Text { + text: qsTr("Hello") + font.pointSize: 25 + } +} diff --git a/examples/declarative/i18n/i18n/base.ts b/examples/declarative/i18n/i18n/base.ts new file mode 100644 index 0000000..82547a1 --- /dev/null +++ b/examples/declarative/i18n/i18n/base.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + + + + diff --git a/examples/declarative/i18n/i18n/qml_en_AU.qm b/examples/declarative/i18n/i18n/qml_en_AU.qm new file mode 100644 index 0000000..fb8b710 Binary files /dev/null and b/examples/declarative/i18n/i18n/qml_en_AU.qm differ diff --git a/examples/declarative/i18n/i18n/qml_en_AU.ts b/examples/declarative/i18n/i18n/qml_en_AU.ts new file mode 100644 index 0000000..e991aff --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_en_AU.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + G'day + + + diff --git a/examples/declarative/i18n/i18n/qml_fr.qm b/examples/declarative/i18n/i18n/qml_fr.qm new file mode 100644 index 0000000..583562e Binary files /dev/null and b/examples/declarative/i18n/i18n/qml_fr.qm differ diff --git a/examples/declarative/i18n/i18n/qml_fr.ts b/examples/declarative/i18n/i18n/qml_fr.ts new file mode 100644 index 0000000..365abd9 --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_fr.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + Bonjour + + + -- cgit v0.12 From 846210c6381827396868d15cdbb6d42daabda147 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 5 May 2010 14:32:45 +1000 Subject: Don't start valuesource animations until all component objects have been completed. Task-number: QTBUG-9413 --- src/declarative/util/qdeclarativeanimation.cpp | 10 ++++++++++ src/declarative/util/qdeclarativeanimation_p.h | 1 + .../animation/pauseAnimation/pauseAnimation-visual.qml | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4059522..d9abe71 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -178,6 +179,10 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) d->running = r; if (r == false) d->avoidPropertyValueSourceStart = true; + else { + QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); + engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()")); + } return; } @@ -268,6 +273,11 @@ void QDeclarativeAbstractAnimation::componentComplete() { Q_D(QDeclarativeAbstractAnimation); d->componentComplete = true; +} + +void QDeclarativeAbstractAnimation::componentFinalized() +{ + Q_D(QDeclarativeAbstractAnimation); if (d->running) { d->running = false; setRunning(true); diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 40c893c..e7cd8a8 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -133,6 +133,7 @@ public: private Q_SLOTS: void timelineComplete(); + void componentFinalized(); private: virtual void setTarget(const QDeclarativeProperty &); diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml index d82c6df..cc9a639 100644 --- a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml @@ -16,7 +16,7 @@ Rectangle { id: img source: "pics/qtlogo.png" x: 60-width/2 - y: 100 + y: 200-img.height SequentialAnimation on y { loops: Animation.Infinite NumberAnimation { @@ -24,7 +24,7 @@ Rectangle { easing.type: "InOutQuad" } NumberAnimation { - to: 100 + to: 200-img.height easing.type: "OutBounce" duration: 2000 } -- cgit v0.12 From ce9bc843443f2c61361afa75a62a7d39029557e6 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 14:38:55 +1000 Subject: QList models now update their properties when they change. Task-number: QTBUG-10348 --- doc/src/declarative/qdeclarativemodels.qdoc | 11 +++++++++-- examples/declarative/objectlistmodel/dataobject.cpp | 10 ++++++++-- examples/declarative/objectlistmodel/dataobject.h | 8 ++++++-- examples/declarative/objectlistmodel/view.qml | 2 +- src/declarative/QmlChanges.txt | 4 ++++ .../graphicsitems/qdeclarativevisualitemmodel.cpp | 8 ++++++-- .../declarative/qdeclarativerepeater/data/objlist.qml | 2 +- .../qdeclarativerepeater/tst_qdeclarativerepeater.cpp | 19 ++++++++++++++----- 8 files changed, 49 insertions(+), 15 deletions(-) diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index 91acb3c..9b706a1 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -283,7 +283,9 @@ QDeclarativeContext *ctxt = view.rootContext(); ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); \endcode -The properties of the object may then be accessed in the delegate: +The QObject* is available as the \c modelData property. As a convenience, +the properties of the object are also made available directly in the +delegate's context: \code ListView { @@ -295,13 +297,18 @@ ListView { Rectangle { height: 25 width: 100 - color: model.color + color: model.modelData.color Text { text: name } } } } \endcode +Note the use of the fully qualified access to the \c color property. +The properties of the object are not replicated in the \c model +object, since they are easily available via the modelData +object. + Note: There is no way for the view to know that the contents of a QList have changed. If the QList is changed, it will be necessary to reset the model by calling QDeclarativeContext::setContextProperty() again. diff --git a/examples/declarative/objectlistmodel/dataobject.cpp b/examples/declarative/objectlistmodel/dataobject.cpp index 4c44ee4..14be1b9 100644 --- a/examples/declarative/objectlistmodel/dataobject.cpp +++ b/examples/declarative/objectlistmodel/dataobject.cpp @@ -59,7 +59,10 @@ QString DataObject::name() const void DataObject::setName(const QString &name) { - m_name = name; + if (name != m_name) { + m_name = name; + emit nameChanged(); + } } QString DataObject::color() const @@ -69,5 +72,8 @@ QString DataObject::color() const void DataObject::setColor(const QString &color) { - m_color = color; + if (color != m_color) { + m_color = color; + emit colorChanged(); + } } diff --git a/examples/declarative/objectlistmodel/dataobject.h b/examples/declarative/objectlistmodel/dataobject.h index 6804474..852110d 100644 --- a/examples/declarative/objectlistmodel/dataobject.h +++ b/examples/declarative/objectlistmodel/dataobject.h @@ -48,8 +48,8 @@ class DataObject : public QObject { Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QString color READ color WRITE setColor) + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged) public: DataObject(QObject *parent=0); @@ -61,6 +61,10 @@ public: QString color() const; void setColor(const QString &color); +signals: + void nameChanged(); + void colorChanged(); + private: QString m_name; QString m_color; diff --git a/examples/declarative/objectlistmodel/view.qml b/examples/declarative/objectlistmodel/view.qml index 908e388..2b8383f 100644 --- a/examples/declarative/objectlistmodel/view.qml +++ b/examples/declarative/objectlistmodel/view.qml @@ -9,7 +9,7 @@ ListView { Rectangle { height: 25 width: 100 - color: model.color + color: model.modelData.color Text { text: name } } } diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 7218f78..dfc4244 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -4,6 +4,10 @@ The changes below are pre Qt 4.7.0 RC Flickable: overShoot is replaced by boundsBehavior enumeration. Component: isReady, isLoading, isError and isNull properties removed, use status property instead +QList models no longer provide properties in model object. The +properties are now updated when the object changes. An object's property +"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo" + C++ API ------- diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 2addc77..f01d4c2 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -437,8 +437,7 @@ int QDeclarativeVisualDataModelDataMetaObject::createProperty(const char *name, if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) { if (model->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) { model->ensureRoles(); - QObject *object = model->m_listAccessor->at(data->m_index).value(); - if (object && (object->property(name).isValid() || qstrcmp(name,"modelData")==0)) + if (qstrcmp(name,"modelData") == 0) return QDeclarativeOpenMetaObject::createProperty(name, type); } } @@ -1029,6 +1028,11 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray if (!ccontext) ccontext = qmlContext(this); QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext); QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this); + if ((!d->m_listModelInterface || !d->m_abstractItemModel) && d->m_listAccessor + && d->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) { + ctxt->setContextObject(d->m_listAccessor->at(index).value()); + ctxt = new QDeclarativeContext(ctxt, ctxt); + } ctxt->setContextProperty(QLatin1String("model"), data); ctxt->setContextObject(data); d->m_completePending = false; diff --git a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml index 17c5d8d..e1bd2e2 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml @@ -14,7 +14,7 @@ Rectangle { property int instantiated: 0 Component { Item{ - Component.onCompleted: {if(index!=model.idx) repeater.errors += 1; repeater.instantiated++} + Component.onCompleted: {if(index!=modelData.idx) repeater.errors += 1; repeater.instantiated++} } } } diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 8be7d80..e6b2fdd 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -185,15 +185,24 @@ void tst_QDeclarativeRepeater::numberModel() delete canvas; } +class MyObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int idx READ idx CONSTANT) +public: + MyObject(int i) : QObject(), m_idx(i) {} + + int idx() const { return m_idx; } + + int m_idx; +}; + void tst_QDeclarativeRepeater::objectList() { QDeclarativeView *canvas = createView(); - QObjectList data; - for(int i=0; i<100; i++){ - data << new QObject(); - data.back()->setProperty("idx", i); - } + for(int i=0; i<100; i++) + data << new MyObject(i); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testData", QVariant::fromValue(data)); -- cgit v0.12 From de5728c826d44808529a681472b899f30e18e325 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 5 May 2010 14:51:11 +1000 Subject: doc Task-number: QTBUG-10386 --- .../graphicsitems/qdeclarativeborderimage.cpp | 14 +-- .../graphicsitems/qdeclarativeflickable.cpp | 14 +-- .../graphicsitems/qdeclarativeflipable.cpp | 2 +- .../graphicsitems/qdeclarativegridview.cpp | 18 ++-- .../graphicsitems/qdeclarativeimage.cpp | 20 ++-- src/declarative/graphicsitems/qdeclarativeitem.cpp | 2 +- .../graphicsitems/qdeclarativelistview.cpp | 18 ++-- .../graphicsitems/qdeclarativeloader.cpp | 8 +- .../graphicsitems/qdeclarativepathview.cpp | 8 +- .../graphicsitems/qdeclarativepositioners.cpp | 14 +-- src/declarative/graphicsitems/qdeclarativetext.cpp | 73 +++++++------ .../graphicsitems/qdeclarativetextedit.cpp | 46 ++++----- .../graphicsitems/qdeclarativetextinput.cpp | 28 ++--- src/declarative/qml/qdeclarativecomponent.cpp | 8 +- src/declarative/util/qdeclarativeanimation.cpp | 114 ++++++++++----------- src/declarative/util/qdeclarativefontloader.cpp | 8 +- .../util/qdeclarativesmoothedanimation.cpp | 6 +- .../util/qdeclarativesmoothedfollow.cpp | 6 +- src/declarative/util/qdeclarativexmllistmodel.cpp | 8 +- 19 files changed, 210 insertions(+), 205 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 14a2cab..018bd55 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -102,10 +102,10 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() This property holds the status of image loading. It can be one of: \list - \o Null - no image has been set - \o Ready - the image has been loaded - \o Loading - the image is currently being loaded - \o Error - an error occurred while loading the image + \o BorderImage.Null - no image has been set + \o BorderImage.Ready - the image has been loaded + \o BorderImage.Loading - the image is currently being loaded + \o BorderImage.Error - an error occurred while loading the image \endlist \sa progress @@ -300,9 +300,9 @@ QDeclarativeScaleGrid *QDeclarativeBorderImage::border() This property describes how to repeat or stretch the middle parts of the border image. \list - \o Stretch - Scale the image to fit to the available area. - \o Repeat - Tile the image until there is no more space. May crop the last image. - \o Round - Like Repeat, but scales the images down to ensure that the last image is not cropped. + \o BorderImage.Stretch - Scale the image to fit to the available area. + \o BorderImage.Repeat - Tile the image until there is no more space. May crop the last image. + \o BorderImage.Round - Like Repeat, but scales the images down to ensure that the last image is not cropped. \endlist */ QDeclarativeBorderImage::TileMode QDeclarativeBorderImage::horizontalTileMode() const diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 35aa0f8..3128851 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -587,13 +587,13 @@ QDeclarativeFlickableVisibleArea *QDeclarativeFlickable::visibleArea() This property determines which directions the view can be flicked. \list - \o AutoFlickDirection (default) - allows flicking vertically if the + \o Flickable.AutoFlickDirection (default) - allows flicking vertically if the \e contentHeight is not equal to the \e height of the Flickable. Allows flicking horizontally if the \e contentWidth is not equal to the \e width of the Flickable. - \o HorizontalFlick - allows flicking horizontally. - \o VerticalFlick - allows flicking vertically. - \o HorizontalAndVerticalFlick - allows flicking in both directions. + \o Flickable.HorizontalFlick - allows flicking horizontally. + \o Flickable.VerticalFlick - allows flicking vertically. + \o Flickable.HorizontalAndVerticalFlick - allows flicking in both directions. \endlist */ QDeclarativeFlickable::FlickDirection QDeclarativeFlickable::flickDirection() const @@ -1031,11 +1031,11 @@ void QDeclarativeFlickable::setOverShoot(bool o) The \c boundsBehavior can be one of: \list - \o \e StopAtBounds - the contents can not be dragged beyond the boundary + \o \e Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot. - \o \e DragOverBounds - the contents can be dragged beyond the boundary + \o \e Flickable.DragOverBounds - the contents can be dragged beyond the boundary of the Flickable, but flicks will not overshoot. - \o \e DragAndOvershootBounds (default) - the contents can be dragged + \o \e Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked. \endlist diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index 85f40c3..e2fc809 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -167,7 +167,7 @@ void QDeclarativeFlipable::retransformBack() \qmlproperty enumeration Flipable::side The side of the Flippable currently visible. Possible values are \c - Front and \c Back. + Flippable.Front and \c Flippable.Back. */ QDeclarativeFlipable::Side QDeclarativeFlipable::side() const { diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 8fb3632..f55c483 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1280,17 +1280,17 @@ void QDeclarativeGridView::setHighlightMoveDuration(int duration) highlight range. Furthermore, the behaviour of the current item index will occur whether or not a highlight exists. - If highlightRangeMode is set to \e ApplyRange the view will + If highlightRangeMode is set to \e GridView.ApplyRange the view will attempt to maintain the highlight within the range, however the highlight can move outside of the range at the ends of the list or due to a mouse interaction. - If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never + If highlightRangeMode is set to \e GridView.StrictlyEnforceRange the highlight will never move outside of the range. This means that the current item will change if a keyboard or mouse action would cause the highlight to move outside of the range. - The default value is \e NoHighlightRange. + The default value is \e GridView.NoHighlightRange. Note that a valid range requires preferredHighlightEnd to be greater than or equal to preferredHighlightBegin. @@ -1348,10 +1348,10 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode) \qmlproperty enumeration GridView::flow This property holds the flow of the grid. - Possible values are \c LeftToRight (default) and \c TopToBottom. + Possible values are \c GridView.LeftToRight (default) and \c GridView.TopToBottom. - If \a flow is \c LeftToRight, the view will scroll vertically. - If \a flow is \c TopToBottom, the view will scroll horizontally. + If \a flow is \c GridView.LeftToRight, the view will scroll vertically. + If \a flow is \c GridView.TopToBottom, the view will scroll horizontally. */ QDeclarativeGridView::Flow QDeclarativeGridView::flow() const { @@ -1474,10 +1474,10 @@ void QDeclarativeGridView::setCellHeight(int cellHeight) The allowed values are: \list - \o NoSnap (default) - the view will stop anywhere within the visible area. - \o SnapToRow - the view will settle with a row (or column for TopToBottom flow) + \o GridView.NoSnap (default) - the view will stop anywhere within the visible area. + \o GridView.SnapToRow - the view will settle with a row (or column for TopToBottom flow) aligned with the start of the view. - \o SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow) + \o GridView.SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow) away from the first visible row at the time the mouse button is released. This mode is particularly useful for moving one page at a time. \endlist diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 1c32b45..aeddb15 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -199,12 +199,12 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap) than the size of the item. \list - \o Stretch - the image is scaled to fit - \o PreserveAspectFit - the image is scaled uniformly to fit without cropping - \o PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary - \o Tile - the image is duplicated horizontally and vertically - \o TileVertically - the image is stretched horizontally and tiled vertically - \o TileHorizontally - the image is stretched vertically and tiled horizontally + \o Image.Stretch - the image is scaled to fit + \o Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping + \o Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary + \o Image.Tile - the image is duplicated horizontally and vertically + \o Image.TileVertically - the image is stretched horizontally and tiled vertically + \o Image.TileHorizontally - the image is stretched vertically and tiled horizontally \endlist \image declarative-image_fillMode.gif @@ -243,10 +243,10 @@ qreal QDeclarativeImage::paintedHeight() const This property holds the status of image loading. It can be one of: \list - \o Null - no image has been set - \o Ready - the image has been loaded - \o Loading - the image is currently being loaded - \o Error - an error occurred while loading the image + \o Image.Null - no image has been set + \o Image.Ready - the image has been loaded + \o Image.Loading - the image is currently being loaded + \o Image.Error - an error occurred while loading the image \endlist Note that a change in the status property does not cause anything to happen diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 14f6b4a..a0983cc 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1432,7 +1432,7 @@ QDeclarativeItem::~QDeclarativeItem() } \endqml - The default transform origin is \c Center. + The default transform origin is \c Item.Center. */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 0f3ee61..3b77ff8 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1690,17 +1690,17 @@ void QDeclarativeListView::setHighlightFollowsCurrentItem(bool autoHighlight) highlight range. Furthermore, the behaviour of the current item index will occur whether or not a highlight exists. - If highlightRangeMode is set to \e ApplyRange the view will + If highlightRangeMode is set to \e ListView.ApplyRange the view will attempt to maintain the highlight within the range, however the highlight can move outside of the range at the ends of the list or due to a mouse interaction. - If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never + If highlightRangeMode is set to \e ListView.StrictlyEnforceRange the highlight will never move outside of the range. This means that the current item will change if a keyboard or mouse action would cause the highlight to move outside of the range. - The default value is \e NoHighlightRange. + The default value is \e ListView.NoHighlightRange. Note that a valid range requires preferredHighlightEnd to be greater than or equal to preferredHighlightBegin. @@ -1780,9 +1780,9 @@ void QDeclarativeListView::setSpacing(qreal spacing) Possible values are \c Vertical (default) and \c Horizontal. - Vertical Example: + ListView.Vertical Example: \image trivialListView.png - Horizontal Example: + ListView.Horizontal Example: \image ListViewHorizontal.png */ QDeclarativeListView::Orientation QDeclarativeListView::orientation() const @@ -1996,17 +1996,17 @@ void QDeclarativeListView::setHighlightResizeDuration(int duration) The allowed values are: \list - \o NoSnap (default) - the view will stop anywhere within the visible area. - \o SnapToItem - the view will settle with an item aligned with the start of + \o ListView.NoSnap (default) - the view will stop anywhere within the visible area. + \o ListView.SnapToItem - the view will settle with an item aligned with the start of the view. - \o SnapOneItem - the view will settle no more than one item away from the first + \o ListView.SnapOneItem - the view will settle no more than one item away from the first visible item at the time the mouse button is released. This mode is particularly useful for moving one page at a time. \endlist snapMode does not affect the currentIndex. To update the currentIndex as the list is moved set \e highlightRangeMode - to \e StrictlyEnforceRange. + to \e ListView.StrictlyEnforceRange. \sa highlightRangeMode */ diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 62fa4db..7edd53c 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -329,10 +329,10 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() This property holds the status of QML loading. It can be one of: \list - \o Null - no QML source has been set - \o Ready - the QML source has been loaded - \o Loading - the QML source is currently being loaded - \o Error - an error occurred while loading the QML source + \o Loader.Null - no QML source has been set + \o Loader.Ready - the QML source has been loaded + \o Loader.Loading - the QML source is currently being loaded + \o Loader.Error - an error occurred while loading the QML source \endlist Note that a change in the status property does not cause anything to happen diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 7cb723c..9ae6f9d 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -618,12 +618,12 @@ QDeclarativeItem *QDeclarativePathView::highlightItem() These properties set the preferred range of the highlight (current item) within the view. The preferred values must be in the range 0.0-1.0. - If highlightRangeMode is set to \e ApplyRange the view will + If highlightRangeMode is set to \e PathView.ApplyRange the view will attempt to maintain the highlight within the range, however the highlight can move outside of the range at the ends of the path or due to a mouse interaction. - If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never + If highlightRangeMode is set to \e PathView.StrictlyEnforceRange the highlight will never move outside of the range. This means that the current item will change if a keyboard or mouse action would cause the highlight to move outside of the range. @@ -631,14 +631,14 @@ QDeclarativeItem *QDeclarativePathView::highlightItem() Note that this is the correct way to influence where the current item ends up when the view moves. For example, if you want the currently selected item to be in the middle of the path, then set the - highlight range to be 0.5,0.5 and highlightRangeMode to StrictlyEnforceRange. + highlight range to be 0.5,0.5 and highlightRangeMode to PathView.StrictlyEnforceRange. Then, when the path scrolls, the currently selected item will be the item at that position. This also applies to when the currently selected item changes - it will scroll to within the preferred highlight range. Furthermore, the behaviour of the current item index will occur whether or not a highlight exists. - The default value is \e StrictlyEnforceRange. + The default value is \e PathView.StrictlyEnforceRange. Note that a valid range requires preferredHighlightEnd to be greater than or equal to preferredHighlightBegin. diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 7e4549f..206b09d 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -738,14 +738,14 @@ void QDeclarativeGrid::setRows(const int rows) } /*! - \qmlproperty enumeration Flow::flow + \qmlproperty enumeration Grid::flow This property holds the flow of the layout. - Possible values are \c LeftToRight (default) and \c TopToBottom. + Possible values are \c Grid.LeftToRight (default) and \c Grid.TopToBottom. - If \a flow is \c LeftToRight, the items are positioned next to + If \a flow is \c Grid.LeftToRight, the items are positioned next to to each other from left to right, then wrapped to the next line. - If \a flow is \c TopToBottom, the items are positioned next to each + If \a flow is \c Grid.TopToBottom, the items are positioned next to each other from top to bottom, then wrapped to the next column. */ QDeclarativeGrid::Flow QDeclarativeGrid::flow() const @@ -952,12 +952,12 @@ QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent) \qmlproperty enumeration Flow::flow This property holds the flow of the layout. - Possible values are \c LeftToRight (default) and \c TopToBottom. + Possible values are \c Flow.LeftToRight (default) and \c Flow.TopToBottom. - If \a flow is \c LeftToRight, the items are positioned next to + If \a flow is \c Flow.LeftToRight, the items are positioned next to to each other from left to right until the width of the Flow is exceeded, then wrapped to the next line. - If \a flow is \c TopToBottom, the items are positioned next to each + If \a flow is \c Flow.TopToBottom, the items are positioned next to each other from top to bottom until the height of the Flow is exceeded, then wrapped to the next column. */ diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index eeff0c3..4e7e0fd 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -200,11 +200,11 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate() The weight can be one of: \list - \o Light - \o Normal - the default - \o DemiBold - \o Bold - \o Black + \o Font.Light + \o Font.Normal - the default + \o Font.DemiBold + \o Font.Bold + \o Font.Black \endlist \qml @@ -277,11 +277,11 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate() Sets the capitalization for the text. \list - \o MixedCase - This is the normal text rendering option where no capitalization change is applied. - \o AllUppercase - This alters the text to be rendered in all uppercase type. - \o AllLowercase - This alters the text to be rendered in all lowercase type. - \o SmallCaps - This alters the text to be rendered in small-caps type. - \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. + \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied. + \o Font.AllUppercase - This alters the text to be rendered in all uppercase type. + \o Font.AllLowercase - This alters the text to be rendered in all lowercase type. + \o Font.SmallCaps - This alters the text to be rendered in small-caps type. + \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. \endlist \qml @@ -380,10 +380,10 @@ QColor QDeclarativeText::color() const Supported text styles are: \list - \o Normal - the default - \o Outline - \o Raised - \o Sunken + \o Text.Normal - the default + \o Text.Outline + \o Text.Raised + \o Text.Sunken \endlist \qml @@ -451,9 +451,14 @@ QColor QDeclarativeText::styleColor() const Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is top-left aligned. - The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and - \c AlignHCenter. The valid values for \c verticalAlignment are \c AlignTop, \c AlignBottom - and \c AlignVCenter. + The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight and + \c Text.AlignHCenter. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom + and \c Text.AlignVCenter. + + Note that for a single line of text, the size of the text is the area of the text. In this common case, + all alignments are equivalent. If you want the text to be, say, centered in it parent, then you will + need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to + that of the parent. */ QDeclarativeText::HAlignment QDeclarativeText::hAlign() const { @@ -494,16 +499,16 @@ void QDeclarativeText::setVAlign(VAlignment align) wrap if an explicit width has been set. wrapMode can be one of: \list - \o NoWrap - no wrapping will be performed. - \o WordWrap - wrapping is done on word boundaries. If the text cannot be + \o Text.NoWrap - no wrapping will be performed. + \o Text.WordWrap - wrapping is done on word boundaries. If the text cannot be word-wrapped to the specified width it will be partially drawn outside of the item's bounds. If this is undesirable then enable clipping on the item (Item::clip). - \o WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word. - \o WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it + \o Text.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word. + \o Text.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word. \endlist - The default is NoWrap. + The default is Text.NoWrap. */ QDeclarativeText::WrapMode QDeclarativeText::wrapMode() const { @@ -533,17 +538,17 @@ void QDeclarativeText::setWrapMode(WrapMode mode) Supported text formats are: \list - \o AutoText - \o PlainText - \o RichText - \o StyledText + \o Text.AutoText + \o Text.PlainText + \o Text.RichText + \o Text.StyledText \endlist - The default is AutoText. If the text format is AutoText the text element + The default is Text.AutoText. If the text format is Text.AutoText the text element will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText(). - StyledText is an optimized format supporting some basic text + Text.StyledText is an optimized format supporting some basic text styling markup, in the style of html 3.2: \code @@ -554,7 +559,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode) > < & \endcode - \c StyledText parser is strict, requiring tags to be correctly nested. + \c Text.StyledText parser is strict, requiring tags to be correctly nested. \table \row @@ -622,13 +627,13 @@ void QDeclarativeText::setTextFormat(TextFormat format) Eliding can be: \list - \o ElideNone - the default - \o ElideLeft - \o ElideMiddle - \o ElideRight + \o Text.ElideNone - the default + \o Text.ElideLeft + \o Text.ElideMiddle + \o Text.ElideRight \endlist - If the text is a multi-length string, and the mode is not \c ElideNone, + If the text is a multi-length string, and the mode is not \c Text.ElideNone, the first string that fits will be used, otherwise the last will be elided. Multi-length strings are ordered from longest to shortest, separated by the diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 762640c..d0ee2ee 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -138,11 +138,11 @@ QString QDeclarativeTextEdit::text() const The weight can be one of: \list - \o Light - \o Normal - the default - \o DemiBold - \o Bold - \o Black + \o Font.Light + \o Font.Normal - the default + \o Font.DemiBold + \o Font.Bold + \o Font.Black \endlist \qml @@ -215,11 +215,11 @@ QString QDeclarativeTextEdit::text() const Sets the capitalization for the text. \list - \o MixedCase - This is the normal text rendering option where no capitalization change is applied. - \o AllUppercase - This alters the text to be rendered in all uppercase type. - \o AllLowercase - This alters the text to be rendered in all lowercase type. - \o SmallCaps - This alters the text to be rendered in small-caps type. - \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. + \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied. + \o Font.AllUppercase - This alters the text to be rendered in all uppercase type. + \o Font.AllLowercase - This alters the text to be rendered in all lowercase type. + \o Font.SmallCaps - This alters the text to be rendered in small-caps type. + \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. \endlist \qml @@ -255,13 +255,13 @@ void QDeclarativeTextEdit::setText(const QString &text) The way the text property should be displayed. \list - \o AutoText - \o PlainText - \o RichText - \o StyledText + \o TextEdit.AutoText + \o TextEdit.PlainText + \o TextEdit.RichText + \o TextEdit.StyledText \endlist - The default is AutoText. If the text format is AutoText the text edit + The default is TextEdit.AutoText. If the text format is TextEdit.AutoText the text edit will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText(). @@ -428,9 +428,9 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color) Sets the horizontal and vertical alignment of the text within the TextEdit items width and height. By default, the text is top-left aligned. - The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and - \c AlignHCenter. The valid values for \c verticalAlignment are \c AlignTop, \c AlignBottom - and \c AlignVCenter. + The valid values for \c horizontalAlignment are \c TextEdit.AlignLeft, \c TextEdit.AlignRight and + \c TextEdit.AlignHCenter. The valid values for \c verticalAlignment are \c TextEdit.AlignTop, \c TextEdit.AlignBottom + and \c TextEdit.AlignVCenter. */ QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const { @@ -473,14 +473,14 @@ void QDeclarativeTextEdit::setVAlign(QDeclarativeTextEdit::VAlignment alignment) The text will only wrap if an explicit width has been set. \list - \o NoWrap - no wrapping will be performed. - \o WordWrap - wrapping is done on word boundaries. - \o WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word. - \o WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it + \o TextEdit.NoWrap - no wrapping will be performed. + \o TextEdit.WordWrap - wrapping is done on word boundaries. + \o TextEdit.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word. + \o TextEdit.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word. \endlist - The default is NoWrap. + The default is TextEdit.NoWrap. */ QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode() const { diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 775450a..b04e36e 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -118,11 +118,11 @@ void QDeclarativeTextInput::setText(const QString &s) The weight can be one of: \list - \o Light - \o Normal - the default - \o DemiBold - \o Bold - \o Black + \o Font.Light + \o Font.Normal - the default + \o Font.DemiBold + \o Font.Bold + \o Font.Black \endlist \qml @@ -195,11 +195,11 @@ void QDeclarativeTextInput::setText(const QString &s) Sets the capitalization for the text. \list - \o MixedCase - This is the normal text rendering option where no capitalization change is applied. - \o AllUppercase - This alters the text to be rendered in all uppercase type. - \o AllLowercase - This alters the text to be rendered in all lowercase type. - \o SmallCaps - This alters the text to be rendered in small-caps type. - \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. + \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied. + \o Font.AllUppercase - This alters the text to be rendered in all uppercase type. + \o Font.AllLowercase - This alters the text to be rendered in all lowercase type. + \o Font.SmallCaps - This alters the text to be rendered in small-caps type. + \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. \endlist \qml @@ -308,8 +308,8 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color) vertically. You can use anchors to align it however you want within another item. - The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and - \c AlignHCenter. + The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and + \c TextInput.AlignHCenter. */ QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const { @@ -600,9 +600,9 @@ void QDeclarativeTextInput::setAutoScroll(bool b) This property holds the notation of how a string can describe a number. The values for this property are DoubleValidator.StandardNotation or DoubleValidator.ScientificNotation. - If this property is set to ScientificNotation, the written number may have an exponent part(i.e. 1.5E-2). + If this property is set to DoubleValidator.ScientificNotation, the written number may have an exponent part(i.e. 1.5E-2). - By default, this property is set to ScientificNotation. + By default, this property is set to DoubleValidator.ScientificNotation. */ /*! diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 3ca0707..fb799dc 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -241,10 +241,10 @@ QDeclarativeComponent::~QDeclarativeComponent() \qmlproperty enumeration Component::status This property holds the status of component loading. It can be one of: \list - \o Null - no data is available for the component - \o Ready - the component has been loaded, and can be used to create instances. - \o Loading - the component is currently being loaded - \o Error - an error occurred while loading the component. + \o Component.Null - no data is available for the component + \o Component.Ready - the component has been loaded, and can be used to create instances. + \o Component.Loading - the component is currently being loaded + \o Component.Error - an error occurred while loading the component. Calling errorsString() will provide a human-readable description of any errors. \endlist */ diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4059522..067565d 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1320,27 +1320,27 @@ void QDeclarativeRotationAnimation::setTo(qreal t) /*! \qmlproperty enumeration RotationAnimation::direction The direction in which to rotate. - Possible values are Numerical, Clockwise, Counterclockwise, - or Shortest. + + Possible values are: \table \row - \o Numerical + \o RotationAnimation.Numerical \o Rotate by linearly interpolating between the two numbers. A rotation from 10 to 350 will rotate 340 degrees clockwise. \row - \o Clockwise + \o RotationAnimation.Clockwise \o Rotate clockwise between the two values \row - \o Counterclockwise + \o RotationAnimation.Counterclockwise \o Rotate counterclockwise between the two values \row - \o Shortest + \o RotationAnimation.Shortest \o Rotate in the direction that produces the shortest animation path. A rotation from 10 to 350 will rotate 20 degrees counterclockwise. \endtable - The default direction is Numerical. + The default direction is RotationAnimation.Numerical. */ QDeclarativeRotationAnimation::RotationDirection QDeclarativeRotationAnimation::direction() const { @@ -1754,189 +1754,189 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) Linear. \qml - PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 } + PropertyAnimation { properties: "y"; easing.type: Easing.InOutElastic; easing.amplitude: 2.0; easing.period: 1.5 } \endqml Available types are: \table \row - \o \c Linear + \o \c Easing.Linear \o Easing curve for a linear (t) function: velocity is constant. \o \inlineimage qeasingcurve-linear.png \row - \o \c InQuad + \o \c Easing.InQuad \o Easing curve for a quadratic (t^2) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-inquad.png \row - \o \c OutQuad + \o \c Easing.OutQuad \o Easing curve for a quadratic (t^2) function: decelerating to zero velocity. \o \inlineimage qeasingcurve-outquad.png \row - \o \c InOutQuad + \o \c Easing.InOutQuad \o Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutquad.png \row - \o \c OutInQuad + \o \c Easing.OutInQuad \o Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinquad.png \row - \o \c InCubic + \o \c Easing.InCubic \o Easing curve for a cubic (t^3) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-incubic.png \row - \o \c OutCubic + \o \c Easing.OutCubic \o Easing curve for a cubic (t^3) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outcubic.png \row - \o \c InOutCubic + \o \c Easing.InOutCubic \o Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutcubic.png \row - \o \c OutInCubic + \o \c Easing.OutInCubic \o Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outincubic.png \row - \o \c InQuart + \o \c Easing.InQuart \o Easing curve for a quartic (t^4) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-inquart.png \row - \o \c OutQuart + \o \c Easing.OutQuart \o Easing curve for a cubic (t^4) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outquart.png \row - \o \c InOutQuart + \o \c Easing.InOutQuart \o Easing curve for a cubic (t^4) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutquart.png \row - \o \c OutInQuart + \o \c Easing.OutInQuart \o Easing curve for a cubic (t^4) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinquart.png \row - \o \c InQuint + \o \c Easing.InQuint \o Easing curve for a quintic (t^5) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-inquint.png \row - \o \c OutQuint + \o \c Easing.OutQuint \o Easing curve for a cubic (t^5) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outquint.png \row - \o \c InOutQuint + \o \c Easing.InOutQuint \o Easing curve for a cubic (t^5) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutquint.png \row - \o \c OutInQuint + \o \c Easing.OutInQuint \o Easing curve for a cubic (t^5) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinquint.png \row - \o \c InSine + \o \c Easing.InSine \o Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-insine.png \row - \o \c OutSine + \o \c Easing.OutSine \o Easing curve for a sinusoidal (sin(t)) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outsine.png \row - \o \c InOutSine + \o \c Easing.InOutSine \o Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutsine.png \row - \o \c OutInSine + \o \c Easing.OutInSine \o Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinsine.png \row - \o \c InExpo + \o \c Easing.InExpo \o Easing curve for an exponential (2^t) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-inexpo.png \row - \o \c OutExpo + \o \c Easing.OutExpo \o Easing curve for an exponential (2^t) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outexpo.png \row - \o \c InOutExpo + \o \c Easing.InOutExpo \o Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutexpo.png \row - \o \c OutInExpo + \o \c Easing.OutInExpo \o Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinexpo.png \row - \o \c InCirc + \o \c Easing.InCirc \o Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-incirc.png \row - \o \c OutCirc + \o \c Easing.OutCirc \o Easing curve for a circular (sqrt(1-t^2)) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outcirc.png \row - \o \c InOutCirc + \o \c Easing.InOutCirc \o Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutcirc.png \row - \o \c OutInCirc + \o \c Easing.OutInCirc \o Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outincirc.png \row - \o \c InElastic + \o \c Easing.InElastic \o Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity. \br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. \o \inlineimage qeasingcurve-inelastic.png \row - \o \c OutElastic + \o \c Easing.OutElastic \o Easing curve for an elastic (exponentially decaying sine wave) function: decelerating from zero velocity. \br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. \o \inlineimage qeasingcurve-outelastic.png \row - \o \c InOutElastic + \o \c Easing.InOutElastic \o Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutelastic.png \row - \o \c OutInElastic + \o \c Easing.OutInElastic \o Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinelastic.png \row - \o \c InBack + \o \c Easing.InBack \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity. \o \inlineimage qeasingcurve-inback.png \row - \o \c OutBack + \o \c Easing.OutBack \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity. \o \inlineimage qeasingcurve-outback.png \row - \o \c InOutBack + \o \c Easing.InOutBack \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutback.png \row - \o \c OutInBack + \o \c Easing.OutInBack \o Easing curve for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinback.png \row - \o \c InBounce + \o \c Easing.InBounce \o Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity. \o \inlineimage qeasingcurve-inbounce.png \row - \o \c OutBounce + \o \c Easing.OutBounce \o Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outbounce.png \row - \o \c InOutBounce + \o \c Easing.InOutBounce \o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutbounce.png \row - \o \c OutInBounce + \o \c Easing.OutInBounce \o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinbounce.png \endtable - easing.amplitude is not applicable for all curve types. It is only applicable for bounce and elastic curves (curves of type - QEasingCurve::InBounce, QEasingCurve::OutBounce, QEasingCurve::InOutBounce, QEasingCurve::OutInBounce, QEasingCurve::InElastic, - QEasingCurve::OutElastic, QEasingCurve::InOutElastic or QEasingCurve::OutInElastic). + easing.amplitude is only applicable for bounce and elastic curves (curves of type + Easing.InBounce, Easing.OutBounce, Easing.InOutBounce, Easing.OutInBounce, Easing.InElastic, + Easing.OutElastic, Easing.InOutElastic or Easing.OutInElastic). - easing.overshoot is not applicable for all curve types. It is only applicable if type is: QEasingCurve::InBack, QEasingCurve::OutBack, - QEasingCurve::InOutBack or QEasingCurve::OutInBack. + easing.overshoot is only applicable if type is: Easing.InBack, Easing.OutBack, + Easing.InOutBack or Easing.OutInBack. - easing.period is not applicable for all curve types. It is only applicable if type is: QEasingCurve::InElastic, QEasingCurve::OutElastic, - QEasingCurve::InOutElastic or QEasingCurve::OutInElastic. + easing.period is only applicable if type is: Easing.InElastic, Easing.OutElastic, + Easing.InOutElastic or Easing.OutInElastic. */ QEasingCurve QDeclarativePropertyAnimation::easing() const { @@ -2730,7 +2730,7 @@ void QDeclarativeAnchorAnimation::setDuration(int duration) Linear. \qml - AnchorAnimation { easing.type: "InOutQuad" } + AnchorAnimation { easing.type: Easing.InOutQuad } \endqml See the \l{PropertyAnimation::easing.type} documentation for information diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index f98ce8b..adfcd62 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -185,10 +185,10 @@ void QDeclarativeFontLoader::setName(const QString &name) This property holds the status of font loading. It can be one of: \list - \o Null - no font has been set - \o Ready - the font has been loaded - \o Loading - the font is currently being loaded - \o Error - an error occurred while loading the font + \o FontLoader.Null - no font has been set + \o FontLoader.Ready - the font has been loaded + \o FontLoader.Loading - the font is currently being loaded + \o FontLoader.Error - an error occurred while loading the font \endlist Note that a change in the status property does not cause anything to happen diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index 19a00ee..bd48ef0 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -388,10 +388,10 @@ void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions Sets how the SmoothedAnimation behaves if an animation direction is reversed. - If reversing mode is \c Eased, the animation will smoothly decelerate, and - then reverse direction. If the reversing mode is \c Immediate, the + If reversing mode is \c SmoothedAnimation.Eased, the animation will smoothly decelerate, and + then reverse direction. If the reversing mode is \c SmoothedAnimation.Immediate, the animation will immediately begin accelerating in the reverse direction, - begining with a velocity of 0. If the reversing mode is \c Sync, the + begining with a velocity of 0. If the reversing mode is \c SmoothedAnimation.Sync, the property is immediately set to the target value. */ QDeclarativeSmoothedAnimation::ReversingMode QDeclarativeSmoothedAnimation::reversingMode() const diff --git a/src/declarative/util/qdeclarativesmoothedfollow.cpp b/src/declarative/util/qdeclarativesmoothedfollow.cpp index 3ed9257..e919282 100644 --- a/src/declarative/util/qdeclarativesmoothedfollow.cpp +++ b/src/declarative/util/qdeclarativesmoothedfollow.cpp @@ -143,10 +143,10 @@ QDeclarativeSmoothedFollowPrivate::QDeclarativeSmoothedFollowPrivate() Sets how the SmoothedFollow behaves if an animation direction is reversed. - If reversing mode is \c Eased, the animation will smoothly decelerate, and - then reverse direction. If the reversing mode is \c Immediate, the + If reversing mode is \SmoothedFollow.c Eased, the animation will smoothly decelerate, and + then reverse direction. If the reversing mode is \c SmoothedFollow.Immediate, the animation will immediately begin accelerating in the reverse direction, - begining with a velocity of 0. If the reversing mode is \c Sync, the + begining with a velocity of 0. If the reversing mode is \c SmoothedFollow.Sync, the property is immediately set to the target value. */ QDeclarativeSmoothedFollow::ReversingMode QDeclarativeSmoothedFollow::reversingMode() const diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index bdebadf..ae3b5d7 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -675,10 +675,10 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati Specifies the model loading status, which can be one of the following: \list - \o Null - No XML data has been set for this model. - \o Ready - The XML data has been loaded into the model. - \o Loading - The model is in the process of reading and loading XML data. - \o Error - An error occurred while the model was loading. + \o XmlListModel.Null - No XML data has been set for this model. + \o XmlListModel.Ready - The XML data has been loaded into the model. + \o XmlListModel.Loading - The model is in the process of reading and loading XML data. + \o XmlListModel.Error - An error occurred while the model was loading. \endlist \sa progress -- cgit v0.12 From b1bf4b23fb34337ea1b5ebdd5aedaad48f5c9f4a Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 15:13:35 +1000 Subject: Test for QList model with object properties changing. --- .../tst_qdeclarativevisualdatamodel.cpp | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index 7de15a3..c238ef9 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -44,6 +44,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -74,9 +78,50 @@ public: private slots: void rootIndex(); + void objectListModel(); private: QDeclarativeEngine engine; + template + T *findItem(QGraphicsObject *parent, const QString &objectName, int index); +}; + +class DataObject : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged) + +public: + DataObject(QObject *parent=0) : QObject(parent) {} + DataObject(const QString &name, const QString &color, QObject *parent=0) + : QObject(parent), m_name(name), m_color(color) { } + + + QString name() const { return m_name; } + void setName(const QString &name) { + if (name != m_name) { + m_name = name; + emit nameChanged(); + } + } + + QString color() const { return m_color; } + void setColor(const QString &color) { + if (color != m_color) { + m_color = color; + emit colorChanged(); + } + } + +signals: + void nameChanged(); + void colorChanged(); + +private: + QString m_name; + QString m_color; }; tst_qdeclarativevisualdatamodel::tst_qdeclarativevisualdatamodel() @@ -105,6 +150,60 @@ void tst_qdeclarativevisualdatamodel::rootIndex() delete obj; } +void tst_qdeclarativevisualdatamodel::objectListModel() +{ + QDeclarativeView view; + + QList dataList; + dataList.append(new DataObject("Item 1", "red")); + dataList.append(new DataObject("Item 2", "green")); + dataList.append(new DataObject("Item 3", "blue")); + dataList.append(new DataObject("Item 4", "yellow")); + + QDeclarativeContext *ctxt = view.rootContext(); + ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); + + view.setSource(QUrl::fromLocalFile(SRCDIR "/data/objectlist.qml")); + + QDeclarativeListView *listview = qobject_cast(view.rootObject()); + QVERIFY(listview != 0); + + QDeclarativeItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + QDeclarativeText *name = findItem(viewport, "name", 0); + QCOMPARE(name->text(), QString("Item 1")); + + dataList[0]->setProperty("name", QLatin1String("Changed")); + QCOMPARE(name->text(), QString("Changed")); +} + +template +T *tst_qdeclarativevisualdatamodel::findItem(QGraphicsObject *parent, const QString &objectName, int index) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->childItems().count() << "children"; + for (int i = 0; i < parent->childItems().count(); ++i) { + QDeclarativeItem *item = qobject_cast(parent->childItems().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { + if (index != -1) { + QDeclarativeExpression e(qmlContext(item), "index", item); + if (e.evaluate().toInt() == index) + return static_cast(item); + } else { + return static_cast(item); + } + } + item = findItem(item, objectName, index); + if (item) + return static_cast(item); + } + + return 0; +} QTEST_MAIN(tst_qdeclarativevisualdatamodel) -- cgit v0.12 From ba8ff70b5ac7b68be57a4b63e439fd5a37c4aafa Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 15:24:53 +1000 Subject: Turn off smooth rendering for qDrawBorderPixmap() with transforms. On non-gl graphics systems smooth rendering of qDrawBorderPixmap() with a transform applied resulted in ugly artifacts. Better to draw without smooth and get a correct looking result, though with jaggy edges. Task-number: QTBUG-5687 Reviewed-by: Gunnar --- src/gui/painting/qdrawutil.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index a62f06b..ef9b18c 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1137,6 +1137,15 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin xTarget.resize(columns + 1); yTarget.resize(rows + 1); + bool oldAA = painter->testRenderHint(QPainter::Antialiasing); + bool oldSmooth = painter->testRenderHint(QPainter::SmoothPixmapTransform); + if (painter->paintEngine()->type() != QPaintEngine::OpenGL + && painter->paintEngine()->type() != QPaintEngine::OpenGL2 + && (oldSmooth || oldAA) && painter->combinedTransform().type() != QTransform::TxNone) { + painter->setRenderHint(QPainter::Antialiasing, false); + painter->setRenderHint(QPainter::SmoothPixmapTransform, false); + } + xTarget[0] = targetRect.left(); xTarget[1] = targetCenterLeft; xTarget[columns - 1] = targetCenterRight; @@ -1342,6 +1351,11 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin painter->drawPixmapFragments(opaqueData.data(), opaqueData.size(), pixmap, QPainter::OpaqueHint); if (translucentData.size()) painter->drawPixmapFragments(translucentData.data(), translucentData.size(), pixmap); + + if (oldAA) + painter->setRenderHint(QPainter::Antialiasing, true); + if (oldSmooth) + painter->setRenderHint(QPainter::SmoothPixmapTransform, true); } QT_END_NAMESPACE -- cgit v0.12 From 06c8e20cd7c04c5a11eee5b5a255099fa29bb3e4 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 5 May 2010 14:29:16 +1000 Subject: Fix qdoc errors --- doc/src/declarative/advtutorial.qdoc | 2 +- src/declarative/graphicsitems/qdeclarativeitem.cpp | 8 +------- src/declarative/graphicsitems/qdeclarativepainteditem.cpp | 2 +- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 4 ++-- src/declarative/qml/qdeclarativeengine.cpp | 2 +- src/declarative/qml/qdeclarativepropertyvaluesource.cpp | 3 +++ 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 7d2967e..8f95190 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -468,6 +468,6 @@ By following this tutorial you've seen how you can write a fully functional appl \endlist There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the -demos and examples and the \l {Declarative UI (QML)}{documentation} to find out all the things you can do with QML! +demos and examples and the \l {Declarative UI Using QML}{documentation} to find out all the things you can do with QML! */ diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index a0983cc..0395766 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1632,10 +1632,6 @@ void QDeclarativeItemPrivate::parentProperty(QObject *o, void *rv, QDeclarativeN specify it. */ -/*! - \internal -*/ - /*! \internal */ QDeclarativeListProperty QDeclarativeItemPrivate::data() { @@ -1646,7 +1642,7 @@ QDeclarativeListProperty QDeclarativeItemPrivate::data() \property QDeclarativeItem::childrenRect \brief The geometry of an item's children. - childrenRect provides an easy way to access the (collective) position and size of the item's children. + This property holds the (collective) position and size of the item's children. */ QRectF QDeclarativeItem::childrenRect() { @@ -2966,7 +2962,6 @@ void QDeclarativeItem::setFocus(bool focus) } /*! - \reimp \internal */ void QDeclarativeItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) @@ -2974,7 +2969,6 @@ void QDeclarativeItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidg } /*! - \reimp \internal */ bool QDeclarativeItem::event(QEvent *ev) diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp index 5dd7e5d..6430fae 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp +++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp @@ -231,7 +231,7 @@ void QDeclarativePaintedItem::setCacheFrozen(bool frozen) } /*! - \reimp + \internal */ void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index b04e36e..a1fa8c6 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -828,7 +828,7 @@ void QDeclarativeTextInput::moveCursor() } /*! - \qmlmethod int xToPosition(int x) + \qmlmethod int TextInput::xToPosition(int x) This function returns the character position at x pixels from the left of the textInput. Position 0 is before the @@ -1097,7 +1097,7 @@ QString QDeclarativeTextInput::displayText() const } /*! - \qmlmethod void moveCursorSelection(int position) + \qmlmethod void TextInput::moveCursorSelection(int position) Moves the cursor to \a position and updates the selection accordingly. (To only move the cursor, set the \l cursorPosition property.) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index dee5ec6..ac60758 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1550,7 +1550,7 @@ QStringList QDeclarativeEngine::importPathList() const } /*! - Sets the list of directories where the engine searches for + Sets \a paths as the list of directories where the engine searches for installed modules in a URL-based directory structure. By default, the list contains the paths specified in the \c QML_IMPORT_PATH environment diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp index a0ed78f..039998f 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp +++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp @@ -60,6 +60,9 @@ QDeclarativePropertyValueSource::QDeclarativePropertyValueSource() { } +/*! + Destroys the value source. +*/ QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource() { } -- cgit v0.12 From dc4f8e4b23a4b07efe1605c2ae479e219b456df9 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 5 May 2010 15:41:08 +1000 Subject: Docs - point to property types from tutorial and QML Basic Types page --- doc/src/declarative/basictypes.qdoc | 9 ++++++--- doc/src/declarative/tutorial.qdoc | 14 +++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index 6901947..8db1c35 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -43,9 +43,12 @@ \page qdeclarativebasictypes.html \title QML Basic Types - QML uses a set of property types, which are primitive within QML. - These basic types are referenced throughout the documentation of the - QML elements. Almost all of them are exactly what you would expect. + QML has a set of primitive types, as listed below, that are used throughout + the \l {QML Elements}. + + The simpler types in this list can also be used for defining a new + \c property in a component. See \l{Extending types from QML} for the + list of types that can be used for custom properties. \annotatedlist qmlbasictypes */ diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc index 4cfb999..75c0f851 100644 --- a/doc/src/declarative/tutorial.qdoc +++ b/doc/src/declarative/tutorial.qdoc @@ -57,10 +57,10 @@ The tutorial's source code is located in the $QTDIR/examples/declarative/tutoria Tutorial chapters: -\list -\o \l {QML Tutorial 1 - Basic Types} -\o \l {QML Tutorial 2 - QML Component} -\o \l {QML Tutorial 3 - States and Transitions} +\list 1 +\o \l {QML Tutorial 1 - Basic Types}{Basic Types} +\o \l {QML Tutorial 2 - QML Components}{QML Components} +\o \l {QML Tutorial 3 - States and Transitions}{States and Transitions} \endlist */ @@ -125,7 +125,7 @@ bin/qml $QTDIR/examples/declarative/tutorials/helloworld/tutorial1.qml /*! \page qml-tutorial2.html -\title QML Tutorial 2 - QML Component +\title QML Tutorial 2 - QML Components \contentspage QML Tutorial \previouspage QML Tutorial 1 - Basic Types \nextpage QML Tutorial 3 - States and Transitions @@ -137,7 +137,7 @@ This chapter adds a color picker to change the color of the text. Our color picker is made of six cells with different colors. To avoid writing the same code multiple times for each cell, we create a new \c Cell component. A component provides a way of defining a new type that we can re-use in other QML files. -A QML component is like a black-box and interacts with the outside world through properties, signals and slots and is generally +A QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally defined in its own QML file. (For more details, see \l {Defining new Components}). The component's filename must always start with a capital letter. @@ -158,7 +158,7 @@ An \l Item is the most basic visual element in QML and is often used as a contai We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us to instantiate the cells with different colors. -This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{intro-properties}{Properties}). +This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{Adding new properties}). \snippet examples/declarative/tutorials/helloworld/Cell.qml 5 -- cgit v0.12 From f8af54e12bcb6e991315c53eca758c43653610fa Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 15:54:33 +1000 Subject: little doc fix. --- src/declarative/util/qdeclarativesmoothedfollow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativesmoothedfollow.cpp b/src/declarative/util/qdeclarativesmoothedfollow.cpp index e919282..f70df9d 100644 --- a/src/declarative/util/qdeclarativesmoothedfollow.cpp +++ b/src/declarative/util/qdeclarativesmoothedfollow.cpp @@ -143,7 +143,7 @@ QDeclarativeSmoothedFollowPrivate::QDeclarativeSmoothedFollowPrivate() Sets how the SmoothedFollow behaves if an animation direction is reversed. - If reversing mode is \SmoothedFollow.c Eased, the animation will smoothly decelerate, and + If reversing mode is \c SmoothedFollow.Eased, the animation will smoothly decelerate, and then reverse direction. If the reversing mode is \c SmoothedFollow.Immediate, the animation will immediately begin accelerating in the reverse direction, begining with a velocity of 0. If the reversing mode is \c SmoothedFollow.Sync, the -- cgit v0.12 From 80c04413ba2c1a20a5d93d69df92ba908c26d81d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 16:03:16 +1000 Subject: Document delegate life cycle. Task-number: QTBUG-10353 --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 3 +++ src/declarative/graphicsitems/qdeclarativelistview.cpp | 3 +++ src/declarative/graphicsitems/qdeclarativepathview.cpp | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index f55c483..4c72482 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -908,6 +908,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. + Delegates are instantiated as needed and may be destroyed at any time. + State should \e never be stored in a delegate. + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 589b8e2..3877fab 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1314,6 +1314,9 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. + Delegates are instantiated as needed and may be destroyed at any time. + State should \e never be stored in a delegate. + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 9ae6f9d..5c3a3c0 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -308,12 +308,16 @@ void QDeclarativePathViewPrivate::regenerate() The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML. - The items are laid out along a path defined by a \l Path and may be flicked to scroll. + The \l delegate is instantiated for each item on the \l path. + The items may be flicked to move them along the path. \snippet doc/src/snippets/declarative/pathview/pathview.qml 0 \image pathview.gif + Delegates are instantiated as needed and may be destroyed at any time. + State should \e never be stored in a delegate. + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped -- cgit v0.12 From f5e3e21e95275a8cf31cddf2063dfa497e92872e Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 5 May 2010 16:22:51 +1000 Subject: Use enum rather than string for easing type. --- demos/declarative/calculator/calculator.qml | 4 +- demos/declarative/flickr/flickr.qml | 4 +- demos/declarative/flickr/mobile/GridDelegate.qml | 6 +- demos/declarative/flickr/mobile/ImageDetails.qml | 2 +- demos/declarative/flickr/mobile/TitleBar.qml | 2 +- demos/declarative/minehunt/MinehuntCore/Tile.qml | 2 +- .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 8 +- .../twitter/TwitterCore/HomeTitleBar.qml | 2 +- .../twitter/TwitterCore/MultiTitleBar.qml | 2 +- demos/declarative/twitter/TwitterCore/TitleBar.qml | 2 +- demos/declarative/twitter/twitter.qml | 2 +- .../content/RetractingWebBrowserHeader.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 4 +- examples/declarative/animations/easing.qml | 104 +++++++++++---------- .../declarative/animations/property-animation.qml | 4 +- .../declarative/behaviors/behavior-example.qml | 4 +- .../border-image/content/MyBorderImage.qml | 20 +++- .../connections/connections-example.qml | 2 +- examples/declarative/focus/Core/ListViews.qml | 6 +- examples/declarative/focus/focus.qml | 4 +- examples/declarative/fonts/hello.qml | 2 +- examples/declarative/layouts/Button.qml | 42 ++++++--- examples/declarative/layouts/positioners.qml | 16 ++-- examples/declarative/parallax/qml/Smiley.qml | 4 +- examples/declarative/proxywidgets/proxywidgets.qml | 2 +- .../declarative/slideswitch/content/Switch.qml | 2 +- examples/declarative/states/transitions.qml | 4 +- .../declarative/tutorials/helloworld/tutorial3.qml | 2 +- examples/declarative/xmldata/yahoonews.qml | 2 +- .../graphicsitems/qdeclarativegridview.cpp | 2 +- .../graphicsitems/qdeclarativelistview.cpp | 2 +- .../graphicsitems/qdeclarativepositioners.cpp | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 2 +- src/declarative/util/qdeclarativebehavior.cpp | 2 +- src/declarative/util/qdeclarativespringfollow.cpp | 2 +- 35 files changed, 154 insertions(+), 120 deletions(-) diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 286a4d1..75f5735 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -98,8 +98,8 @@ Rectangle { transitions: Transition { SequentialAnimation { PropertyAction { target: rotateButton; property: "operation" } - NumberAnimation { properties: "rotation"; duration: 300; easing.type: "InOutQuint" } - NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: "InOutQuint" } + NumberAnimation { properties: "rotation"; duration: 300; easing.type: Easing.InOutQuint } + NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } } } } diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 8b73beb..29763d4 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -38,7 +38,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } } @@ -76,7 +76,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } } } diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index 5ab7b87..eccdc34 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -21,7 +21,7 @@ Item { anchors.centerIn: parent scale: 0.0 - Behavior on scale { NumberAnimation { easing.type: "InOutQuad"} } + Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} } id: scaleMe Rectangle { height: 79; width: 79; id: blackRect; anchors.centerIn: parent; color: "black"; smooth: true } @@ -53,14 +53,14 @@ Transition { from: "Show"; to: "Details" ParentAnimation { - NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } }, Transition { from: "Details"; to: "Show" SequentialAnimation { ParentAnimation { - NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } PropertyAction { targets: wrapper; properties: "z" } } diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 58b0b83..310c9df 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -114,7 +114,7 @@ Flipable { transitions: Transition { SequentialAnimation { PropertyAction { target: bigImage; property: "smooth"; value: false } - NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 } + NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 } PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving } } } diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index bb57429..025b897 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -81,6 +81,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } } } diff --git a/demos/declarative/minehunt/MinehuntCore/Tile.qml b/demos/declarative/minehunt/MinehuntCore/Tile.qml index f3620f4..98b2017 100644 --- a/demos/declarative/minehunt/MinehuntCore/Tile.qml +++ b/demos/declarative/minehunt/MinehuntCore/Tile.qml @@ -57,7 +57,7 @@ Flipable { PauseAnimation { duration: pauseDur } - RotationAnimation { easing.type: "InOutQuad" } + RotationAnimation { easing.type: Easing.InOutQuad } ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } } } } diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index d39b7bc..142735f 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -78,11 +78,11 @@ Component { ] GridView.onAdd: NumberAnimation { - target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: "OutQuad" + target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad } GridView.onRemove: SequentialAnimation { PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: "OutQuad" } + NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } } @@ -92,12 +92,12 @@ Component { SequentialAnimation { NumberAnimation { properties: 'opacity'; duration: 250 } PauseAnimation { duration: 350 } - NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: "OutQuad" } + NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } } }, Transition { from: 'inGrid'; to: '*' - NumberAnimation { properties: "y,opacity"; easing.type: "OutQuad"; duration: 300 } + NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } } ] } diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index c1ae3e5..11aa74f 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -113,7 +113,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { properties: "x,y,width,height"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y,width,height"; easing.type: Easing.InOutQuad } } ] } diff --git a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml index 8c27e2b..445eda4 100644 --- a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml @@ -18,7 +18,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } ] } diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 87ceec5..5256de4 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -70,6 +70,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } } } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index 0e3ec3e..f86388e 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -88,7 +88,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } ] } } diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml index f5bfadf..b02a5bf 100644 --- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml +++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml @@ -105,7 +105,7 @@ Image { NumberAnimation { targets: header properties: "progressOff" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 300 } } diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index fbbe7b2..f1a6034 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -99,7 +99,7 @@ Item { Transition { NumberAnimation { properties: "opacity" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 300 } } @@ -155,7 +155,7 @@ Item { Transition { NumberAnimation { properties: "opacity" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 320 } } diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml index b0f9669..939d43b 100644 --- a/examples/declarative/animations/easing.qml +++ b/examples/declarative/animations/easing.qml @@ -6,47 +6,47 @@ Rectangle { ListModel { id: easingTypes - ListElement { type: "Linear"; ballColor: "DarkRed" } - ListElement { type: "InQuad"; ballColor: "IndianRed" } - ListElement { type: "OutQuad"; ballColor: "Salmon" } - ListElement { type: "InOutQuad"; ballColor: "Tomato" } - ListElement { type: "OutInQuad"; ballColor: "DarkOrange" } - ListElement { type: "InCubic"; ballColor: "Gold" } - ListElement { type: "OutCubic"; ballColor: "Yellow" } - ListElement { type: "InOutCubic"; ballColor: "PeachPuff" } - ListElement { type: "OutInCubic"; ballColor: "Thistle" } - ListElement { type: "InQuart"; ballColor: "Orchid" } - ListElement { type: "OutQuart"; ballColor: "Purple" } - ListElement { type: "InOutQuart"; ballColor: "SlateBlue" } - ListElement { type: "OutInQuart"; ballColor: "Chartreuse" } - ListElement { type: "InQuint"; ballColor: "LimeGreen" } - ListElement { type: "OutQuint"; ballColor: "SeaGreen" } - ListElement { type: "InOutQuint"; ballColor: "DarkGreen" } - ListElement { type: "OutInQuint"; ballColor: "Olive" } - ListElement { type: "InSine"; ballColor: "DarkSeaGreen" } - ListElement { type: "OutSine"; ballColor: "Teal" } - ListElement { type: "InOutSine"; ballColor: "Turquoise" } - ListElement { type: "OutInSine"; ballColor: "SteelBlue" } - ListElement { type: "InExpo"; ballColor: "SkyBlue" } - ListElement { type: "OutExpo"; ballColor: "RoyalBlue" } - ListElement { type: "InOutExpo"; ballColor: "MediumBlue" } - ListElement { type: "OutInExpo"; ballColor: "MidnightBlue" } - ListElement { type: "InCirc"; ballColor: "CornSilk" } - ListElement { type: "OutCirc"; ballColor: "Bisque" } - ListElement { type: "InOutCirc"; ballColor: "RosyBrown" } - ListElement { type: "OutInCirc"; ballColor: "SandyBrown" } - ListElement { type: "InElastic"; ballColor: "DarkGoldenRod" } - ListElement { type: "OutElastic"; ballColor: "Chocolate" } - ListElement { type: "InOutElastic"; ballColor: "SaddleBrown" } - ListElement { type: "OutInElastic"; ballColor: "Brown" } - ListElement { type: "InBack"; ballColor: "Maroon" } - ListElement { type: "OutBack"; ballColor: "LavenderBlush" } - ListElement { type: "InOutBack"; ballColor: "MistyRose" } - ListElement { type: "OutInBack"; ballColor: "Gainsboro" } - ListElement { type: "OutBounce"; ballColor: "Silver" } - ListElement { type: "InBounce"; ballColor: "DimGray" } - ListElement { type: "InOutBounce"; ballColor: "SlateGray" } - ListElement { type: "OutInBounce"; ballColor: "DarkSlateGray" } + ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" } + ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" } + ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" } + ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" } + ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" } + ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" } + ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" } + ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" } + ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" } + ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" } + ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" } + ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" } + ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" } + ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" } + ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" } + ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" } + ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" } + ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" } + ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" } + ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" } + ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" } + ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" } + ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" } + ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" } + ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" } + ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" } + ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" } + ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" } + ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" } + ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" } + ListElement { name: "Easing.InElastic"; type: Easing.OutElastic; ballColor: "Chocolate" } + ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" } + ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" } + ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" } + ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" } + ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" } + ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" } + ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" } + ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" } + ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" } + ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" } } Component { @@ -54,19 +54,26 @@ Rectangle { Item { height: 42; width: window.width - Text { text: type; anchors.centerIn: parent; color: "White" } + + Text { text: name; anchors.centerIn: parent; color: "White" } + Rectangle { id: slot1; color: "#121212"; x: 30; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter } + Rectangle { id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter } + Rectangle { id: rect; x: 30; color: "#454545" border.color: "White"; border.width: 2 - height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter + height: 32; width: 32; radius: 8 + anchors.verticalCenter: parent.verticalCenter MouseArea { onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' @@ -79,10 +86,8 @@ Rectangle { } transitions: Transition { - // ParallelAnimation { - NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } - ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } - // } + NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } + ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } } } } @@ -90,6 +95,7 @@ Rectangle { Flickable { anchors.fill: parent; contentHeight: layout.height + Column { id: layout anchors.left: parent.left; anchors.right: parent.right diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animations/property-animation.qml index 5afe8ef..6360511 100644 --- a/examples/declarative/animations/property-animation.qml +++ b/examples/declarative/animations/property-animation.qml @@ -48,13 +48,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/behaviors/behavior-example.qml b/examples/declarative/behaviors/behavior-example.qml index b7bae6c..1f17b81 100644 --- a/examples/declarative/behaviors/behavior-example.qml +++ b/examples/declarative/behaviors/behavior-example.qml @@ -49,12 +49,12 @@ Rectangle { // Setting an 'elastic' behavior on the focusRect's x property. Behavior on x { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } // Setting an 'elastic' behavior on the focusRect's y property. Behavior on y { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } Text { diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml index 2573a14..b47df7b 100644 --- a/examples/declarative/border-image/content/MyBorderImage.qml +++ b/examples/declarative/border-image/content/MyBorderImage.qml @@ -20,14 +20,26 @@ Item { SequentialAnimation on width { loops: Animation.Infinite - NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" } + NumberAnimation { + from: container.minWidth; to: container.maxWidth + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxWidth; to: container.minWidth + duration: 2000; easing.type: Easing.InOutQuad + } } SequentialAnimation on height { loops: Animation.Infinite - NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" } + NumberAnimation { + from: container.minHeight; to: container.maxHeight + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxHeight; to: container.minHeight + duration: 2000; easing.type: Easing.InOutQuad + } } border.top: container.margin diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml index fbef968..1dd10ab 100644 --- a/examples/declarative/connections/connections-example.qml +++ b/examples/declarative/connections/connections-example.qml @@ -17,7 +17,7 @@ Rectangle { rotation: window.angle Behavior on rotation { - NumberAnimation { easing.type: "OutCubic"; duration: 300 } + NumberAnimation { easing.type: Easing.OutCubic; duration: 300 } } } diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/focus/Core/ListViews.qml index 089f821..32a5d4c 100644 --- a/examples/declarative/focus/Core/ListViews.qml +++ b/examples/declarative/focus/Core/ListViews.qml @@ -14,7 +14,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -26,7 +26,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -38,7 +38,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/focus/focus.qml b/examples/declarative/focus/focus.qml index 22b0e50..8c992ae 100644 --- a/examples/declarative/focus/focus.qml +++ b/examples/declarative/focus/focus.qml @@ -38,7 +38,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "y"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint } } } @@ -64,6 +64,6 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/fonts/hello.qml b/examples/declarative/fonts/hello.qml index d4d0e4c..0d6f4cd 100644 --- a/examples/declarative/fonts/hello.qml +++ b/examples/declarative/fonts/hello.qml @@ -19,7 +19,7 @@ Rectangle { SequentialAnimation on font.letterSpacing { loops: Animation.Infinite; - NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 } + NumberAnimation { from: 100; to: 300; easing.type: Easing.InQuad; duration: 3000 } ScriptAction { script: { container.y = (screen.height / 4) + (Math.random() * screen.height / 2) diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml index 0f08893..d03eeb5 100644 --- a/examples/declarative/layouts/Button.qml +++ b/examples/declarative/layouts/Button.qml @@ -1,22 +1,38 @@ import Qt 4.7 -Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page +Rectangle { + id: page + property string text property string icon signal clicked - Image { id: pix; x: 5; y:5; source: parent.icon} - Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} - MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} + border.color: "black"; color: "steelblue"; radius: 5 + width: pix.width + textelement.width + 13 + height: pix.height + 10 + + Image { id: pix; x: 5; y:5; source: parent.icon } + + Text { + id: textelement + text: page.text; color: "white" + x: pix.width + pix.x + 3 + anchors.verticalCenter: pix.verticalCenter + } + + MouseArea { + id: mr + anchors.fill: parent + onClicked: { parent.focus = true; page.clicked() } + } - states: - State{ name:"pressed"; when:mr.pressed - PropertyChanges {target:textelement; x: 5} - PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} - } + states: State { + name: "pressed"; when: mr.pressed + PropertyChanges { target: textelement; x: 5 } + PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 } + } - transitions: - Transition{ - NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } - } + transitions: Transition { + NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 } + } } diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml index 3703b59..2cb0b8b 100644 --- a/examples/declarative/layouts/positioners.qml +++ b/examples/declarative/layouts/positioners.qml @@ -8,10 +8,10 @@ Rectangle { id: layout1 y: 0 move: Transition { - NumberAnimation { properties: "y"; easing.type: "OutBounce" } + NumberAnimation { properties: "y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "y"; easing.type: "OutQuad" } + NumberAnimation { properties: "y"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } @@ -43,10 +43,10 @@ Rectangle { id: layout2 y: 300 move: Transition { - NumberAnimation { properties: "x"; easing.type: "OutBounce" } + NumberAnimation { properties: "x"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x"; easing.type: "OutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } @@ -117,11 +117,11 @@ Rectangle { columns: 3 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } @@ -167,11 +167,11 @@ Rectangle { x: 260; y: 250; width: 150 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/parallax/qml/Smiley.qml index b1e1ae8..cfa4fed 100644 --- a/examples/declarative/parallax/qml/Smiley.qml +++ b/examples/declarative/parallax/qml/Smiley.qml @@ -30,13 +30,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/proxywidgets/proxywidgets.qml b/examples/declarative/proxywidgets/proxywidgets.qml index 46dcf99..88de37f 100644 --- a/examples/declarative/proxywidgets/proxywidgets.qml +++ b/examples/declarative/proxywidgets/proxywidgets.qml @@ -63,7 +63,7 @@ Rectangle { transitions: Transition { ParallelAnimation { - NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: "OutQuad" } + NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad } ColorAnimation { target: window; duration: 600 } } } diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/slideswitch/content/Switch.qml index a8fa6ef..1aa7696 100644 --- a/examples/declarative/slideswitch/content/Switch.qml +++ b/examples/declarative/slideswitch/content/Switch.qml @@ -69,7 +69,7 @@ Item { //![7] transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad"; duration: 200 } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 } } //![7] } diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/states/transitions.qml index d1b1dd6..ccc7060 100644 --- a/examples/declarative/states/transitions.qml +++ b/examples/declarative/states/transitions.qml @@ -72,14 +72,14 @@ Rectangle { // with OutBounce easing function. Transition { from: "*"; to: "middleRight" - NumberAnimation { properties: "x,y"; easing.type: "OutBounce"; duration: 1000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 } }, // When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds, // with InOutQuad easing function. Transition { from: "*"; to: "bottomLeft" - NumberAnimation { properties: "x,y"; easing.type: "InOutQuad"; duration: 2000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 } }, // For any other state changes move x,y linearly over duration of 200ms. diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml index 041d9a9..0da762c 100644 --- a/examples/declarative/tutorials/helloworld/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/tutorial3.qml @@ -28,7 +28,7 @@ Rectangle { transitions: Transition { from: ""; to: "down"; reversible: true ParallelAnimation { - NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: Easing.InOutQuad } ColorAnimation { duration: 500 } } } diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml index 668778e..5bab463 100644 --- a/examples/declarative/xmldata/yahoonews.qml +++ b/examples/declarative/xmldata/yahoonews.qml @@ -65,7 +65,7 @@ Rectangle { transitions: Transition { from: "*"; to: "Details"; reversible: true SequentialAnimation { - NumberAnimation { duration: 200; properties: "height"; easing.type: "OutQuad" } + NumberAnimation { duration: 200; properties: "height"; easing.type: Easing.OutQuad } NumberAnimation { duration: 200; properties: "opacity" } } } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 4c72482..9ae7279 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -964,7 +964,7 @@ QDeclarativeGridView::~QDeclarativeGridView() id: wrapper GridView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false } } } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 3877fab..cef7e18 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1395,7 +1395,7 @@ QDeclarativeListView::~QDeclarativeListView() id: wrapper ListView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } } } diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 206b09d..93bff3e 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -377,7 +377,7 @@ Column { move: Transition { NumberAnimation { properties: "y" - easing.type: "OutBounce" + easing.type: Easing.OutBounce } } } diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 9f95348..7f4d2e4 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1615,7 +1615,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int Animate any objects that have changed their x or y properties in the target state using an InOutQuad easing curve: \qml - Transition { PropertyAnimation { properties: "x,y"; easing.type: "InOutQuad" } } + Transition { PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } } \endqml \o In a Behavior diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index 90344ab..ba90007 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -82,7 +82,7 @@ public: y: 200 // initial value Behavior on y { NumberAnimation { - easing.type: "OutBounce" + easing.type: Easing.OutBounce easing.amplitude: 100 duration: 200 } diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp index 70077f3..aae66ac 100644 --- a/src/declarative/util/qdeclarativespringfollow.cpp +++ b/src/declarative/util/qdeclarativespringfollow.cpp @@ -227,7 +227,7 @@ void QDeclarativeSpringFollowPrivate::stop() loops: Animation.Infinite NumberAnimation { to: 200 - easing.type: "OutBounce" + easing.type: Easing.OutBounce easing.amplitude: 100 duration: 2000 } -- cgit v0.12 From ab030e931e05a060b4f6fabf4235f05aeb0c252c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 5 May 2010 16:39:05 +1000 Subject: Fix cacheBuffer documentation. Task-number: QTBUG-10385 --- .../graphicsitems/qdeclarativegridview.cpp | 20 ++++++++++++++------ .../graphicsitems/qdeclarativelistview.cpp | 18 +++++++++++++----- src/declarative/util/qdeclarativeanimation.cpp | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 4c72482..528cb22 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1405,12 +1405,20 @@ void QDeclarativeGridView::setWrapEnabled(bool wrap) } /*! - \qmlproperty int GridView::cacheBuffer - This property holds the number of off-screen pixels to cache. - - This property determines the number of pixels above the top of the view - and below the bottom of the view to cache. Setting this value can make - scrolling the view smoother at the expense of additional memory usage. + \qmlproperty int GridView::cacheBuffer + This property determines whether delegates are retained outside the + visible area of the view. + + If non-zero the view will keep as many delegates + instantiated as will fit within the buffer specified. For example, + if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is + set to 40, then up to 2 delegates above and 2 delegates below the visible + area may be retained. + + Setting this value can make scrolling the list smoother at the expense + of additional memory usage. It is not a substitute for creating efficient + delegates; the fewer elements in a delegate, the faster a view may be + scrolled. */ int QDeclarativeGridView::cacheBuffer() const { diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 3877fab..75cf547 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1839,11 +1839,19 @@ void QDeclarativeListView::setWrapEnabled(bool wrap) /*! \qmlproperty int ListView::cacheBuffer - This property holds the number of off-screen pixels to cache. - - This property determines the number of pixels above the top of the list - and below the bottom of the list to cache. Setting this value can make - scrolling the list smoother at the expense of additional memory usage. + This property determines whether delegates are retained outside the + visible area of the view. + + If non-zero the view will keep as many delegates + instantiated as will fit within the buffer specified. For example, + if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is + set to 40, then up to 2 delegates above and 2 delegates below the visible + area may be retained. + + Setting this value can make scrolling the list smoother at the expense + of additional memory usage. It is not a substitute for creating efficient + delegates; the fewer elements in a delegate, the faster a view may be + scrolled. */ int QDeclarativeListView::cacheBuffer() const { diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 9f95348..5b2954b 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -874,7 +874,7 @@ void QDeclarativePropertyActionPrivate::init() This property holds an explicit target object to animate. The exact effect of the \c target property depends on how the animation - is being used. Refer to the \l animation documentation for details. + is being used. Refer to the \l {QML Animation} documentation for details. */ QObject *QDeclarativePropertyAction::target() const -- cgit v0.12 From 238ed995be8f32e815ffb6883144d0547355a8eb Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 4 May 2010 14:14:46 +0200 Subject: Move Qt.widgets import to be an unsupported example Layout examples for QML are also cleaned up a bit. Layouts test removed, and LayoutItem test added, to clarify what we support. Reviewed-by: Michael Brasser --- examples/declarative/layouts/Button.qml | 22 -- examples/declarative/layouts/add.png | Bin 1577 -> 0 bytes examples/declarative/layouts/del.png | Bin 1661 -> 0 bytes .../layouts/graphicsLayouts/graphicslayouts.cpp | 366 +++++++++++++++++++++ .../layouts/graphicsLayouts/graphicslayouts.pro | 13 + .../layouts/graphicsLayouts/graphicslayouts.qml | 77 +++++ .../layouts/graphicsLayouts/graphicslayouts.qrc | 5 + .../layouts/graphicsLayouts/graphicslayouts_p.h | 303 +++++++++++++++++ .../declarative/layouts/graphicsLayouts/main.cpp | 60 ++++ .../declarative/layouts/layoutItem/layoutItem.pro | 13 + .../declarative/layouts/layoutItem/layoutItem.qml | 16 + .../declarative/layouts/layoutItem/layoutItem.qrc | 5 + examples/declarative/layouts/layoutItem/main.cpp | 73 ++++ examples/declarative/layouts/layouts.qml | 29 -- examples/declarative/layouts/layouts.qmlproject | 16 - examples/declarative/layouts/positioners.qml | 213 ------------ .../declarative/layouts/positioners/Button.qml | 22 ++ examples/declarative/layouts/positioners/add.png | Bin 0 -> 1577 bytes examples/declarative/layouts/positioners/del.png | Bin 0 -> 1661 bytes .../layouts/positioners/positioners.qml | 213 ++++++++++++ .../layouts/positioners/positioners.qmlproject | 18 + .../positioners/positioners.qmlproject.user | 41 +++ src/imports/imports.pro | 2 +- src/imports/widgets/graphicslayouts.cpp | 366 --------------------- src/imports/widgets/graphicslayouts_p.h | 303 ----------------- src/imports/widgets/qmldir | 1 - src/imports/widgets/widgets.cpp | 71 ---- src/imports/widgets/widgets.pro | 30 -- .../qdeclarativelayoutitem/data/layoutItem.qml | 9 + .../qdeclarativelayoutitem.pro | 8 + .../tst_qdeclarativelayoutitem.cpp | 115 +++++++ .../qdeclarativelayouts/data/layouts.qml | 31 -- .../qdeclarativelayouts/qdeclarativelayouts.pro | 10 - .../tst_qdeclarativelayouts.cpp | 147 --------- 34 files changed, 1358 insertions(+), 1240 deletions(-) delete mode 100644 examples/declarative/layouts/Button.qml delete mode 100644 examples/declarative/layouts/add.png delete mode 100644 examples/declarative/layouts/del.png create mode 100644 examples/declarative/layouts/graphicsLayouts/graphicslayouts.cpp create mode 100644 examples/declarative/layouts/graphicsLayouts/graphicslayouts.pro create mode 100644 examples/declarative/layouts/graphicsLayouts/graphicslayouts.qml create mode 100644 examples/declarative/layouts/graphicsLayouts/graphicslayouts.qrc create mode 100644 examples/declarative/layouts/graphicsLayouts/graphicslayouts_p.h create mode 100644 examples/declarative/layouts/graphicsLayouts/main.cpp create mode 100644 examples/declarative/layouts/layoutItem/layoutItem.pro create mode 100644 examples/declarative/layouts/layoutItem/layoutItem.qml create mode 100644 examples/declarative/layouts/layoutItem/layoutItem.qrc create mode 100644 examples/declarative/layouts/layoutItem/main.cpp delete mode 100644 examples/declarative/layouts/layouts.qml delete mode 100644 examples/declarative/layouts/layouts.qmlproject delete mode 100644 examples/declarative/layouts/positioners.qml create mode 100644 examples/declarative/layouts/positioners/Button.qml create mode 100644 examples/declarative/layouts/positioners/add.png create mode 100644 examples/declarative/layouts/positioners/del.png create mode 100644 examples/declarative/layouts/positioners/positioners.qml create mode 100644 examples/declarative/layouts/positioners/positioners.qmlproject create mode 100644 examples/declarative/layouts/positioners/positioners.qmlproject.user delete mode 100644 src/imports/widgets/graphicslayouts.cpp delete mode 100644 src/imports/widgets/graphicslayouts_p.h delete mode 100644 src/imports/widgets/qmldir delete mode 100644 src/imports/widgets/widgets.cpp delete mode 100644 src/imports/widgets/widgets.pro create mode 100644 tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml create mode 100644 tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro create mode 100644 tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp delete mode 100644 tests/auto/declarative/qdeclarativelayouts/data/layouts.qml delete mode 100644 tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro delete mode 100644 tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml deleted file mode 100644 index 0f08893..0000000 --- a/examples/declarative/layouts/Button.qml +++ /dev/null @@ -1,22 +0,0 @@ -import Qt 4.7 - -Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page - property string text - property string icon - signal clicked - - Image { id: pix; x: 5; y:5; source: parent.icon} - Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} - MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} - - states: - State{ name:"pressed"; when:mr.pressed - PropertyChanges {target:textelement; x: 5} - PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} - } - - transitions: - Transition{ - NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } - } -} diff --git a/examples/declarative/layouts/add.png b/examples/declarative/layouts/add.png deleted file mode 100644 index f29d84b..0000000 Binary files a/examples/declarative/layouts/add.png and /dev/null differ diff --git a/examples/declarative/layouts/del.png b/examples/declarative/layouts/del.png deleted file mode 100644 index 1d753a3..0000000 Binary files a/examples/declarative/layouts/del.png and /dev/null differ diff --git a/examples/declarative/layouts/graphicsLayouts/graphicslayouts.cpp b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.cpp new file mode 100644 index 0000000..25cf994 --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.cpp @@ -0,0 +1,366 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "graphicslayouts_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +LinearLayoutAttached::LinearLayoutAttached(QObject *parent) +: QObject(parent), _stretch(1), _alignment(Qt::AlignCenter), _spacing(0) +{ +} + +void LinearLayoutAttached::setStretchFactor(int f) +{ + if (_stretch == f) + return; + + _stretch = f; + emit stretchChanged(reinterpret_cast(parent()), _stretch); +} + +void LinearLayoutAttached::setSpacing(int s) +{ + if (_spacing == s) + return; + + _spacing = s; + emit spacingChanged(reinterpret_cast(parent()), _spacing); +} + +void LinearLayoutAttached::setAlignment(Qt::Alignment a) +{ + if (_alignment == a) + return; + + _alignment = a; + emit alignmentChanged(reinterpret_cast(parent()), _alignment); +} + +QGraphicsLinearLayoutStretchItemObject::QGraphicsLinearLayoutStretchItemObject(QObject *parent) + : QObject(parent) +{ +} + +QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const +{ +Q_UNUSED(which); +Q_UNUSED(constraint); +return QSizeF(); +} + + +QGraphicsLinearLayoutObject::QGraphicsLinearLayoutObject(QObject *parent) +: QObject(parent) +{ +} + +QGraphicsLinearLayoutObject::~QGraphicsLinearLayoutObject() +{ +} + +void QGraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item) +{ +insertItem(index, item); + +//connect attached properties +if (LinearLayoutAttached *obj = attachedProperties.value(item)) { + setStretchFactor(item, obj->stretchFactor()); + setAlignment(item, obj->alignment()); + updateSpacing(item, obj->spacing()); + QObject::connect(obj, SIGNAL(stretchChanged(QGraphicsLayoutItem*,int)), + this, SLOT(updateStretch(QGraphicsLayoutItem*,int))); + QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), + this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + QObject::connect(obj, SIGNAL(spacingChanged(QGraphicsLayoutItem*,int)), + this, SLOT(updateSpacing(QGraphicsLayoutItem*,int))); + //### need to disconnect when widget is removed? +} +} + +//### is there a better way to do this? +void QGraphicsLinearLayoutObject::clearChildren() +{ +for (int i = 0; i < count(); ++i) + removeAt(i); +} + +qreal QGraphicsLinearLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsLinearLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + +void QGraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) +{ +QGraphicsLinearLayout::setStretchFactor(item, stretch); +} + +void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) +{ + for(int i=0; i < count(); i++){ + if(itemAt(i) == item){ //I do not see the reverse function, which is why we must loop over all items + QGraphicsLinearLayout::setItemSpacing(i, spacing); + return; + } + } +} + +void QGraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +{ +QGraphicsLinearLayout::setAlignment(item, alignment); +} + +QHash QGraphicsLinearLayoutObject::attachedProperties; +LinearLayoutAttached *QGraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj) +{ +// ### This is not allowed - you must attach to any object +if (!qobject_cast(obj)) + return 0; +LinearLayoutAttached *rv = new LinearLayoutAttached(obj); +attachedProperties.insert(qobject_cast(obj), rv); +return rv; +} + +////////////////////////////////////////////////////////////////////////////////////////////////////// +// QGraphicsGridLayout-related classes +////////////////////////////////////////////////////////////////////////////////////////////////////// +GridLayoutAttached::GridLayoutAttached(QObject *parent) +: QObject(parent), _row(-1), _column(-1), _rowspan(1), _colspan(1), _alignment(-1), _rowstretch(-1), + _colstretch(-1), _rowspacing(-1), _colspacing(-1), _rowprefheight(-1), _rowmaxheight(-1), _rowminheight(-1), + _rowfixheight(-1), _colprefwidth(-1), _colmaxwidth(-1), _colminwidth(-1), _colfixwidth(-1) +{ +} + +void GridLayoutAttached::setRow(int r) +{ + if (_row == r) + return; + + _row = r; + //emit rowChanged(reinterpret_cast(parent()), _row); +} + +void GridLayoutAttached::setColumn(int c) +{ + if (_column == c) + return; + + _column = c; + //emit columnChanged(reinterpret_cast(parent()), _column); +} + +void GridLayoutAttached::setRowSpan(int rs) +{ + if (_rowspan == rs) + return; + + _rowspan = rs; + //emit rowSpanChanged(reinterpret_cast(parent()), _rowSpan); +} + +void GridLayoutAttached::setColumnSpan(int cs) +{ + if (_colspan == cs) + return; + + _colspan = cs; + //emit columnSpanChanged(reinterpret_cast(parent()), _columnSpan); +} + +void GridLayoutAttached::setAlignment(Qt::Alignment a) +{ + if (_alignment == a) + return; + + _alignment = a; + emit alignmentChanged(reinterpret_cast(parent()), _alignment); +} + +void GridLayoutAttached::setRowStretchFactor(int f) +{ + _rowstretch = f; +} + +void GridLayoutAttached::setColumnStretchFactor(int f) +{ + _colstretch = f; +} + +void GridLayoutAttached::setRowSpacing(int s) +{ + _rowspacing = s; +} + +void GridLayoutAttached::setColumnSpacing(int s) +{ + _colspacing = s; +} + + +QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent) +: QObject(parent) +{ +} + +QGraphicsGridLayoutObject::~QGraphicsGridLayoutObject() +{ +} + +void QGraphicsGridLayoutObject::addWidget(QGraphicsWidget *wid) +{ +//use attached properties +if (QObject *obj = attachedProperties.value(qobject_cast(wid))) { + int row = static_cast(obj)->row(); + int column = static_cast(obj)->column(); + int rowSpan = static_cast(obj)->rowSpan(); + int columnSpan = static_cast(obj)->columnSpan(); + if (row == -1 || column == -1) { + qWarning() << "Must set row and column for an item in a grid layout"; + return; + } + addItem(wid, row, column, rowSpan, columnSpan); +} +} + +void QGraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) +{ +//use attached properties +if (GridLayoutAttached *obj = attachedProperties.value(item)) { + int row = obj->row(); + int column = obj->column(); + int rowSpan = obj->rowSpan(); + int columnSpan = obj->columnSpan(); + Qt::Alignment alignment = obj->alignment(); + if (row == -1 || column == -1) { + qWarning() << "Must set row and column for an item in a grid layout"; + return; + } + if(obj->rowSpacing() != -1) + setRowSpacing(row, obj->rowSpacing()); + if(obj->columnSpacing() != -1) + setColumnSpacing(column, obj->columnSpacing()); + if(obj->rowStretchFactor() != -1) + setRowStretchFactor(row, obj->rowStretchFactor()); + if(obj->columnStretchFactor() != -1) + setColumnStretchFactor(column, obj->columnStretchFactor()); + if(obj->rowPreferredHeight() != -1) + setRowPreferredHeight(row, obj->rowPreferredHeight()); + if(obj->rowMaximumHeight() != -1) + setRowMaximumHeight(row, obj->rowMaximumHeight()); + if(obj->rowMinimumHeight() != -1) + setRowMinimumHeight(row, obj->rowMinimumHeight()); + if(obj->rowFixedHeight() != -1) + setRowFixedHeight(row, obj->rowFixedHeight()); + if(obj->columnPreferredWidth() != -1) + setColumnPreferredWidth(row, obj->columnPreferredWidth()); + if(obj->columnMaximumWidth() != -1) + setColumnMaximumWidth(row, obj->columnMaximumWidth()); + if(obj->columnMinimumWidth() != -1) + setColumnMinimumWidth(row, obj->columnMinimumWidth()); + if(obj->columnFixedWidth() != -1) + setColumnFixedWidth(row, obj->columnFixedWidth()); + addItem(item, row, column, rowSpan, columnSpan); + if (alignment != -1) + setAlignment(item,alignment); + QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), + this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + //### need to disconnect when widget is removed? +} +} + +//### is there a better way to do this? +void QGraphicsGridLayoutObject::clearChildren() +{ +for (int i = 0; i < count(); ++i) + removeAt(i); +} + +qreal QGraphicsGridLayoutObject::spacing() const +{ +if (verticalSpacing() == horizontalSpacing()) + return verticalSpacing(); +return -1; //### +} + +qreal QGraphicsGridLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsGridLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + + +void QGraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +{ +QGraphicsGridLayout::setAlignment(item, alignment); +} + +QHash QGraphicsGridLayoutObject::attachedProperties; +GridLayoutAttached *QGraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) +{ +// ### This is not allowed - you must attach to any object +if (!qobject_cast(obj)) + return 0; +GridLayoutAttached *rv = new GridLayoutAttached(obj); +attachedProperties.insert(qobject_cast(obj), rv); +return rv; +} + +QT_END_NAMESPACE diff --git a/examples/declarative/layouts/graphicsLayouts/graphicslayouts.pro b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.pro new file mode 100644 index 0000000..e5d91b2 --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +TARGET = graphicslayouts +QT += declarative + +SOURCES += \ + graphicslayouts.cpp \ + main.cpp + +HEADERS += \ + graphicslayouts_p.h + +RESOURCES += \ + graphicslayouts.qrc diff --git a/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qml b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qml new file mode 100644 index 0000000..fcd78d5 --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qml @@ -0,0 +1,77 @@ +import Qt 4.7 +import GraphicsLayouts 4.7 + +Item { + id: resizable + + width: 800 + height: 400 + + QGraphicsWidget { + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsLinearLayout { + LayoutItem { + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + } + } + QGraphicsWidget { + x: parent.width/2 + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsGridLayout { + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "red"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "100x100" + Rectangle { color: "orange"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 2 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "200x200" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "blue"; anchors.fill: parent } + } + } + } +} diff --git a/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qrc b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qrc new file mode 100644 index 0000000..a199f8d --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/graphicslayouts.qrc @@ -0,0 +1,5 @@ + + + graphicslayouts.qml + + diff --git a/examples/declarative/layouts/graphicsLayouts/graphicslayouts_p.h b/examples/declarative/layouts/graphicsLayouts/graphicslayouts_p.h new file mode 100644 index 0000000..ea9c614 --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/graphicslayouts_p.h @@ -0,0 +1,303 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GRAPHICSLAYOUTS_H +#define GRAPHICSLAYOUTS_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayoutItem) +public: + QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); + + virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; +}; + +class LinearLayoutAttached; +class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QDeclarativeListProperty children READ children) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsLinearLayoutObject(QObject * = 0); + ~QGraphicsLinearLayoutObject(); + + QDeclarativeListProperty children() { return QDeclarativeListProperty(this, 0, children_append, children_count, children_at, children_clear); } + + static LinearLayoutAttached *qmlAttachedProperties(QObject *); + + qreal contentsMargin() const; + void setContentsMargin(qreal); + +private Q_SLOTS: + void updateStretch(QGraphicsLayoutItem*,int); + void updateSpacing(QGraphicsLayoutItem*,int); + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + +private: + friend class LinearLayoutAttached; + void clearChildren(); + void insertLayoutItem(int, QGraphicsLayoutItem *); + static QHash attachedProperties; + + static void children_append(QDeclarativeListProperty *prop, QGraphicsLayoutItem *item) { + static_cast(prop->object)->insertLayoutItem(-1, item); + } + + static void children_clear(QDeclarativeListProperty *prop) { + static_cast(prop->object)->clearChildren(); + } + + static int children_count(QDeclarativeListProperty *prop) { + return static_cast(prop->object)->count(); + } + + static QGraphicsLayoutItem *children_at(QDeclarativeListProperty *prop, int index) { + return static_cast(prop->object)->itemAt(index); + } +}; + +class GridLayoutAttached; +class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QDeclarativeListProperty children READ children) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) + Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) + Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsGridLayoutObject(QObject * = 0); + ~QGraphicsGridLayoutObject(); + + QDeclarativeListProperty children() { return QDeclarativeListProperty(this, 0, children_append, children_count, children_at, children_clear); } + + qreal spacing() const; + qreal contentsMargin() const; + void setContentsMargin(qreal); + + static GridLayoutAttached *qmlAttachedProperties(QObject *); + +private Q_SLOTS: + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + +private: + friend class GraphicsLayoutAttached; + void addWidget(QGraphicsWidget *); + void clearChildren(); + void addLayoutItem(QGraphicsLayoutItem *); + static QHash attachedProperties; + + static void children_append(QDeclarativeListProperty *prop, QGraphicsLayoutItem *item) { + static_cast(prop->object)->addLayoutItem(item); + } + + static void children_clear(QDeclarativeListProperty *prop) { + static_cast(prop->object)->clearChildren(); + } + + static int children_count(QDeclarativeListProperty *prop) { + return static_cast(prop->object)->count(); + } + + static QGraphicsLayoutItem *children_at(QDeclarativeListProperty *prop, int index) { + return static_cast(prop->object)->itemAt(index); + } +}; + +class LinearLayoutAttached : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int stretchFactor READ stretchFactor WRITE setStretchFactor NOTIFY stretchChanged) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) + Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) +public: + LinearLayoutAttached(QObject *parent); + + int stretchFactor() const { return _stretch; } + void setStretchFactor(int f); + Qt::Alignment alignment() const { return _alignment; } + void setAlignment(Qt::Alignment a); + int spacing() const { return _spacing; } + void setSpacing(int s); + +Q_SIGNALS: + void stretchChanged(QGraphicsLayoutItem*,int); + void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + void spacingChanged(QGraphicsLayoutItem*,int); + +private: + int _stretch; + Qt::Alignment _alignment; + int _spacing; +}; + +class GridLayoutAttached : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int row READ row WRITE setRow) + Q_PROPERTY(int column READ column WRITE setColumn) + Q_PROPERTY(int rowSpan READ rowSpan WRITE setRowSpan) + Q_PROPERTY(int columnSpan READ columnSpan WRITE setColumnSpan) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(int rowStretchFactor READ rowStretchFactor WRITE setRowStretchFactor) + Q_PROPERTY(int columnStretchFactor READ columnStretchFactor WRITE setColumnStretchFactor) + Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing) + Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing) + Q_PROPERTY(int rowPreferredHeight READ rowPreferredHeight WRITE setRowPreferredHeight) + Q_PROPERTY(int rowMinimumHeight READ rowMinimumHeight WRITE setRowMinimumHeight) + Q_PROPERTY(int rowMaximumHeight READ rowMaximumHeight WRITE setRowMaximumHeight) + Q_PROPERTY(int rowFixedHeight READ rowFixedHeight WRITE setRowFixedHeight) + Q_PROPERTY(int columnPreferredWidth READ columnPreferredWidth WRITE setColumnPreferredWidth) + Q_PROPERTY(int columnMaximumWidth READ columnMaximumWidth WRITE setColumnMaximumWidth) + Q_PROPERTY(int columnMinimumWidth READ columnMinimumWidth WRITE setColumnMinimumWidth) + Q_PROPERTY(int columnFixedWidth READ columnFixedWidth WRITE setColumnFixedWidth) + +public: + GridLayoutAttached(QObject *parent); + + int row() const { return _row; } + void setRow(int r); + + int column() const { return _column; } + void setColumn(int c); + + int rowSpan() const { return _rowspan; } + void setRowSpan(int rs); + + int columnSpan() const { return _colspan; } + void setColumnSpan(int cs); + + Qt::Alignment alignment() const { return _alignment; } + void setAlignment(Qt::Alignment a); + + int rowStretchFactor() const { return _rowstretch; } + void setRowStretchFactor(int f); + int columnStretchFactor() const { return _colstretch; } + void setColumnStretchFactor(int f); + + int rowSpacing() const { return _rowspacing; } + void setRowSpacing(int s); + int columnSpacing() const { return _colspacing; } + void setColumnSpacing(int s); + + int rowPreferredHeight() const { return _rowprefheight; } + void setRowPreferredHeight(int s) { _rowprefheight = s; } + + int rowMaximumHeight() const { return _rowmaxheight; } + void setRowMaximumHeight(int s) { _rowmaxheight = s; } + + int rowMinimumHeight() const { return _rowminheight; } + void setRowMinimumHeight(int s) { _rowminheight = s; } + + int rowFixedHeight() const { return _rowfixheight; } + void setRowFixedHeight(int s) { _rowfixheight = s; } + + int columnPreferredWidth() const { return _colprefwidth; } + void setColumnPreferredWidth(int s) { _colprefwidth = s; } + + int columnMaximumWidth() const { return _colmaxwidth; } + void setColumnMaximumWidth(int s) { _colmaxwidth = s; } + + int columnMinimumWidth() const { return _colminwidth; } + void setColumnMinimumWidth(int s) { _colminwidth = s; } + + int columnFixedWidth() const { return _colfixwidth; } + void setColumnFixedWidth(int s) { _colfixwidth = s; } + +Q_SIGNALS: + void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + +private: + int _row; + int _column; + int _rowspan; + int _colspan; + Qt::Alignment _alignment; + int _rowstretch; + int _colstretch; + int _rowspacing; + int _colspacing; + int _rowprefheight; + int _rowmaxheight; + int _rowminheight; + int _rowfixheight; + int _colprefwidth; + int _colmaxwidth; + int _colminwidth; + int _colfixwidth; +}; + +QT_END_NAMESPACE + +QML_DECLARE_INTERFACE(QGraphicsLayoutItem) +QML_DECLARE_INTERFACE(QGraphicsLayout) +QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) +QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QGraphicsGridLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif // GRAPHICSLAYOUTS_H diff --git a/examples/declarative/layouts/graphicsLayouts/main.cpp b/examples/declarative/layouts/graphicsLayouts/main.cpp new file mode 100644 index 0000000..89b69bf --- /dev/null +++ b/examples/declarative/layouts/graphicsLayouts/main.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "graphicslayouts_p.h" +#include + +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + QDeclarativeView view; + qmlRegisterInterface("QGraphicsLayoutItem"); + qmlRegisterInterface("QGraphicsLayout"); + qmlRegisterType("GraphicsLayouts",4,7,"QGraphicsLinearLayoutStretchItem"); + qmlRegisterType("GraphicsLayouts",4,7,"QGraphicsLinearLayout"); + qmlRegisterType("GraphicsLayouts",4,7,"QGraphicsGridLayout"); + view.setSource(QUrl(":graphicslayouts.qml")); + view.show(); + return app.exec(); +}; + diff --git a/examples/declarative/layouts/layoutItem/layoutItem.pro b/examples/declarative/layouts/layoutItem/layoutItem.pro new file mode 100644 index 0000000..4a3fc73 --- /dev/null +++ b/examples/declarative/layouts/layoutItem/layoutItem.pro @@ -0,0 +1,13 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Tue May 4 13:36:26 2010 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +QT += declarative + +# Input +SOURCES += main.cpp +RESOURCES += layoutItem.qrc diff --git a/examples/declarative/layouts/layoutItem/layoutItem.qml b/examples/declarative/layouts/layoutItem/layoutItem.qml new file mode 100644 index 0000000..9b9db22 --- /dev/null +++ b/examples/declarative/layouts/layoutItem/layoutItem.qml @@ -0,0 +1,16 @@ +import Qt 4.7 +import Qt.widgets 4.7 + +LayoutItem {//Sized by the layout + id: resizable + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + Rectangle { + width: 100; height: 100; + anchors.top: parent.top; + anchors.right: parent.right; + color: "green"; + } +} diff --git a/examples/declarative/layouts/layoutItem/layoutItem.qrc b/examples/declarative/layouts/layoutItem/layoutItem.qrc new file mode 100644 index 0000000..deb0fba --- /dev/null +++ b/examples/declarative/layouts/layoutItem/layoutItem.qrc @@ -0,0 +1,5 @@ + + + layoutItem.qml + + diff --git a/examples/declarative/layouts/layoutItem/main.cpp b/examples/declarative/layouts/layoutItem/main.cpp new file mode 100644 index 0000000..a104251 --- /dev/null +++ b/examples/declarative/layouts/layoutItem/main.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +/* This example demonstrates using a LayoutItem to let QML snippets integrate + nicely with existing QGraphicsView applications designed with GraphicsLayouts +*/ +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + //Set up a graphics scene with a QGraphicsWidget and Layout + QGraphicsView view; + QGraphicsScene scene; + QGraphicsWidget *widget = new QGraphicsWidget(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(); + widget->setLayout(layout); + scene.addItem(widget); + view.setScene(&scene); + //Add the QML snippet into the layout + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl(":layoutItem.qml")); + QGraphicsLayoutItem* obj = qobject_cast(c.create()); + layout->addItem(obj); + + widget->setGeometry(QRectF(0,0, 400,400)); + view.show(); + return app.exec(); +} diff --git a/examples/declarative/layouts/layouts.qml b/examples/declarative/layouts/layouts.qml deleted file mode 100644 index 391eab7..0000000 --- a/examples/declarative/layouts/layouts.qml +++ /dev/null @@ -1,29 +0,0 @@ -import Qt 4.7 -import Qt.widgets 4.7 - -Item { - id: resizable - - width: 400 - height: 400 - - QGraphicsWidget { - size.width: parent.width - size.height: parent.height - - layout: QGraphicsLinearLayout { - LayoutItem { - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { color: "yellow"; anchors.fill: parent } - } - LayoutItem { - minimumSize: "100x100" - maximumSize: "400x400" - preferredSize: "200x200" - Rectangle { color: "green"; anchors.fill: parent } - } - } - } -} diff --git a/examples/declarative/layouts/layouts.qmlproject b/examples/declarative/layouts/layouts.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/layouts/layouts.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml deleted file mode 100644 index 3703b59..0000000 --- a/examples/declarative/layouts/positioners.qml +++ /dev/null @@ -1,213 +0,0 @@ -import Qt 4.7 - -Rectangle { - id: page - width: 420; height: 420 - - Column { - id: layout1 - y: 0 - move: Transition { - NumberAnimation { properties: "y"; easing.type: "OutBounce" } - } - add: Transition { - NumberAnimation { properties: "y"; easing.type: "OutQuad" } - } - - Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueV1 - width: 100; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "green"; width: 100; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueV2 - width: 100; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 } - } - - Row { - id: layout2 - y: 300 - move: Transition { - NumberAnimation { properties: "x"; easing.type: "OutBounce" } - } - add: Transition { - NumberAnimation { properties: "x"; easing.type: "OutQuad" } - } - - Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } - - Rectangle { - id: blueH1 - width: 50; height: 100 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 } - - Rectangle { - id: blueH2 - width: 50; height: 100 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 } - } - - Button { - x: 135; y: 90 - text: "Remove" - icon: "del.png" - - onClicked: { - blueH2.opacity = 0 - blueH1.opacity = 0 - blueV1.opacity = 0 - blueV2.opacity = 0 - blueG1.opacity = 0 - blueG2.opacity = 0 - blueG3.opacity = 0 - blueF1.opacity = 0 - blueF2.opacity = 0 - blueF3.opacity = 0 - } - } - - Button { - x: 145; y: 140 - text: "Add" - icon: "add.png" - - onClicked: { - blueH2.opacity = 1 - blueH1.opacity = 1 - blueV1.opacity = 1 - blueV2.opacity = 1 - blueG1.opacity = 1 - blueG2.opacity = 1 - blueG3.opacity = 1 - blueF1.opacity = 1 - blueF2.opacity = 1 - blueF3.opacity = 1 - } - } - - Grid { - x: 260; y: 0 - columns: 3 - - move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } - } - - add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } - } - - Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueG1 - width: 50; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueG2 - width: 50; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueG3 - width: 50; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } - Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 } - Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } - } - - Flow { - id: layout4 - x: 260; y: 250; width: 150 - - move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } - } - - add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } - } - - Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueF1 - width: 60; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "green"; width: 30; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueF2 - width: 60; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } - - Rectangle { - id: blueF3 - width: 40; height: 50 - color: "lightsteelblue" - border.color: "black" - radius: 15 - Behavior on opacity { NumberAnimation {} } - } - - Rectangle { color: "red"; width: 80; height: 50; border.color: "black"; radius: 15 } - } - -} diff --git a/examples/declarative/layouts/positioners/Button.qml b/examples/declarative/layouts/positioners/Button.qml new file mode 100644 index 0000000..0f08893 --- /dev/null +++ b/examples/declarative/layouts/positioners/Button.qml @@ -0,0 +1,22 @@ +import Qt 4.7 + +Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page + property string text + property string icon + signal clicked + + Image { id: pix; x: 5; y:5; source: parent.icon} + Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} + MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} + + states: + State{ name:"pressed"; when:mr.pressed + PropertyChanges {target:textelement; x: 5} + PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} + } + + transitions: + Transition{ + NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } + } +} diff --git a/examples/declarative/layouts/positioners/add.png b/examples/declarative/layouts/positioners/add.png new file mode 100644 index 0000000..f29d84b Binary files /dev/null and b/examples/declarative/layouts/positioners/add.png differ diff --git a/examples/declarative/layouts/positioners/del.png b/examples/declarative/layouts/positioners/del.png new file mode 100644 index 0000000..1d753a3 Binary files /dev/null and b/examples/declarative/layouts/positioners/del.png differ diff --git a/examples/declarative/layouts/positioners/positioners.qml b/examples/declarative/layouts/positioners/positioners.qml new file mode 100644 index 0000000..3703b59 --- /dev/null +++ b/examples/declarative/layouts/positioners/positioners.qml @@ -0,0 +1,213 @@ +import Qt 4.7 + +Rectangle { + id: page + width: 420; height: 420 + + Column { + id: layout1 + y: 0 + move: Transition { + NumberAnimation { properties: "y"; easing.type: "OutBounce" } + } + add: Transition { + NumberAnimation { properties: "y"; easing.type: "OutQuad" } + } + + Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueV1 + width: 100; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "green"; width: 100; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueV2 + width: 100; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 } + } + + Row { + id: layout2 + y: 300 + move: Transition { + NumberAnimation { properties: "x"; easing.type: "OutBounce" } + } + add: Transition { + NumberAnimation { properties: "x"; easing.type: "OutQuad" } + } + + Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } + + Rectangle { + id: blueH1 + width: 50; height: 100 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 } + + Rectangle { + id: blueH2 + width: 50; height: 100 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 } + } + + Button { + x: 135; y: 90 + text: "Remove" + icon: "del.png" + + onClicked: { + blueH2.opacity = 0 + blueH1.opacity = 0 + blueV1.opacity = 0 + blueV2.opacity = 0 + blueG1.opacity = 0 + blueG2.opacity = 0 + blueG3.opacity = 0 + blueF1.opacity = 0 + blueF2.opacity = 0 + blueF3.opacity = 0 + } + } + + Button { + x: 145; y: 140 + text: "Add" + icon: "add.png" + + onClicked: { + blueH2.opacity = 1 + blueH1.opacity = 1 + blueV1.opacity = 1 + blueV2.opacity = 1 + blueG1.opacity = 1 + blueG2.opacity = 1 + blueG3.opacity = 1 + blueF1.opacity = 1 + blueF2.opacity = 1 + blueF3.opacity = 1 + } + } + + Grid { + x: 260; y: 0 + columns: 3 + + move: Transition { + NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + } + + add: Transition { + NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + } + + Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueG1 + width: 50; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueG2 + width: 50; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueG3 + width: 50; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } + Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 } + Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } + } + + Flow { + id: layout4 + x: 260; y: 250; width: 150 + + move: Transition { + NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + } + + add: Transition { + NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + } + + Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueF1 + width: 60; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "green"; width: 30; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueF2 + width: 60; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 } + + Rectangle { + id: blueF3 + width: 40; height: 50 + color: "lightsteelblue" + border.color: "black" + radius: 15 + Behavior on opacity { NumberAnimation {} } + } + + Rectangle { color: "red"; width: 80; height: 50; border.color: "black"; radius: 15 } + } + +} diff --git a/examples/declarative/layouts/positioners/positioners.qmlproject b/examples/declarative/layouts/positioners/positioners.qmlproject new file mode 100644 index 0000000..e526217 --- /dev/null +++ b/examples/declarative/layouts/positioners/positioners.qmlproject @@ -0,0 +1,18 @@ +/* File generated by QtCreator */ + +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/layouts/positioners/positioners.qmlproject.user b/examples/declarative/layouts/positioners/positioners.qmlproject.user new file mode 100644 index 0000000..593479d --- /dev/null +++ b/examples/declarative/layouts/positioners/positioners.qmlproject.user @@ -0,0 +1,41 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + UTF-8 + + + + ProjectExplorer.Project.Target.0 + + QML Runtime + QmlProjectManager.QmlTarget + -1 + 0 + 0 + + QML Runtime + QmlProjectManager.QmlRunConfiguration + 127.0.0.1 + 3768 + positioners.qml + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/src/imports/imports.pro b/src/imports/imports.pro index ecde0cc..1754908 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS += widgets particles +SUBDIRS += particles contains(QT_CONFIG, webkit): SUBDIRS += webkit contains(QT_CONFIG, mediaservices): SUBDIRS += multimedia diff --git a/src/imports/widgets/graphicslayouts.cpp b/src/imports/widgets/graphicslayouts.cpp deleted file mode 100644 index 25cf994..0000000 --- a/src/imports/widgets/graphicslayouts.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "graphicslayouts_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -LinearLayoutAttached::LinearLayoutAttached(QObject *parent) -: QObject(parent), _stretch(1), _alignment(Qt::AlignCenter), _spacing(0) -{ -} - -void LinearLayoutAttached::setStretchFactor(int f) -{ - if (_stretch == f) - return; - - _stretch = f; - emit stretchChanged(reinterpret_cast(parent()), _stretch); -} - -void LinearLayoutAttached::setSpacing(int s) -{ - if (_spacing == s) - return; - - _spacing = s; - emit spacingChanged(reinterpret_cast(parent()), _spacing); -} - -void LinearLayoutAttached::setAlignment(Qt::Alignment a) -{ - if (_alignment == a) - return; - - _alignment = a; - emit alignmentChanged(reinterpret_cast(parent()), _alignment); -} - -QGraphicsLinearLayoutStretchItemObject::QGraphicsLinearLayoutStretchItemObject(QObject *parent) - : QObject(parent) -{ -} - -QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const -{ -Q_UNUSED(which); -Q_UNUSED(constraint); -return QSizeF(); -} - - -QGraphicsLinearLayoutObject::QGraphicsLinearLayoutObject(QObject *parent) -: QObject(parent) -{ -} - -QGraphicsLinearLayoutObject::~QGraphicsLinearLayoutObject() -{ -} - -void QGraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item) -{ -insertItem(index, item); - -//connect attached properties -if (LinearLayoutAttached *obj = attachedProperties.value(item)) { - setStretchFactor(item, obj->stretchFactor()); - setAlignment(item, obj->alignment()); - updateSpacing(item, obj->spacing()); - QObject::connect(obj, SIGNAL(stretchChanged(QGraphicsLayoutItem*,int)), - this, SLOT(updateStretch(QGraphicsLayoutItem*,int))); - QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), - this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); - QObject::connect(obj, SIGNAL(spacingChanged(QGraphicsLayoutItem*,int)), - this, SLOT(updateSpacing(QGraphicsLayoutItem*,int))); - //### need to disconnect when widget is removed? -} -} - -//### is there a better way to do this? -void QGraphicsLinearLayoutObject::clearChildren() -{ -for (int i = 0; i < count(); ++i) - removeAt(i); -} - -qreal QGraphicsLinearLayoutObject::contentsMargin() const -{ - qreal a,b,c,d; - getContentsMargins(&a, &b, &c, &d); - if(a==b && a==c && a==d) - return a; - return -1; -} - -void QGraphicsLinearLayoutObject::setContentsMargin(qreal m) -{ - setContentsMargins(m,m,m,m); -} - -void QGraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) -{ -QGraphicsLinearLayout::setStretchFactor(item, stretch); -} - -void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) -{ - for(int i=0; i < count(); i++){ - if(itemAt(i) == item){ //I do not see the reverse function, which is why we must loop over all items - QGraphicsLinearLayout::setItemSpacing(i, spacing); - return; - } - } -} - -void QGraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) -{ -QGraphicsLinearLayout::setAlignment(item, alignment); -} - -QHash QGraphicsLinearLayoutObject::attachedProperties; -LinearLayoutAttached *QGraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj) -{ -// ### This is not allowed - you must attach to any object -if (!qobject_cast(obj)) - return 0; -LinearLayoutAttached *rv = new LinearLayoutAttached(obj); -attachedProperties.insert(qobject_cast(obj), rv); -return rv; -} - -////////////////////////////////////////////////////////////////////////////////////////////////////// -// QGraphicsGridLayout-related classes -////////////////////////////////////////////////////////////////////////////////////////////////////// -GridLayoutAttached::GridLayoutAttached(QObject *parent) -: QObject(parent), _row(-1), _column(-1), _rowspan(1), _colspan(1), _alignment(-1), _rowstretch(-1), - _colstretch(-1), _rowspacing(-1), _colspacing(-1), _rowprefheight(-1), _rowmaxheight(-1), _rowminheight(-1), - _rowfixheight(-1), _colprefwidth(-1), _colmaxwidth(-1), _colminwidth(-1), _colfixwidth(-1) -{ -} - -void GridLayoutAttached::setRow(int r) -{ - if (_row == r) - return; - - _row = r; - //emit rowChanged(reinterpret_cast(parent()), _row); -} - -void GridLayoutAttached::setColumn(int c) -{ - if (_column == c) - return; - - _column = c; - //emit columnChanged(reinterpret_cast(parent()), _column); -} - -void GridLayoutAttached::setRowSpan(int rs) -{ - if (_rowspan == rs) - return; - - _rowspan = rs; - //emit rowSpanChanged(reinterpret_cast(parent()), _rowSpan); -} - -void GridLayoutAttached::setColumnSpan(int cs) -{ - if (_colspan == cs) - return; - - _colspan = cs; - //emit columnSpanChanged(reinterpret_cast(parent()), _columnSpan); -} - -void GridLayoutAttached::setAlignment(Qt::Alignment a) -{ - if (_alignment == a) - return; - - _alignment = a; - emit alignmentChanged(reinterpret_cast(parent()), _alignment); -} - -void GridLayoutAttached::setRowStretchFactor(int f) -{ - _rowstretch = f; -} - -void GridLayoutAttached::setColumnStretchFactor(int f) -{ - _colstretch = f; -} - -void GridLayoutAttached::setRowSpacing(int s) -{ - _rowspacing = s; -} - -void GridLayoutAttached::setColumnSpacing(int s) -{ - _colspacing = s; -} - - -QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent) -: QObject(parent) -{ -} - -QGraphicsGridLayoutObject::~QGraphicsGridLayoutObject() -{ -} - -void QGraphicsGridLayoutObject::addWidget(QGraphicsWidget *wid) -{ -//use attached properties -if (QObject *obj = attachedProperties.value(qobject_cast(wid))) { - int row = static_cast(obj)->row(); - int column = static_cast(obj)->column(); - int rowSpan = static_cast(obj)->rowSpan(); - int columnSpan = static_cast(obj)->columnSpan(); - if (row == -1 || column == -1) { - qWarning() << "Must set row and column for an item in a grid layout"; - return; - } - addItem(wid, row, column, rowSpan, columnSpan); -} -} - -void QGraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) -{ -//use attached properties -if (GridLayoutAttached *obj = attachedProperties.value(item)) { - int row = obj->row(); - int column = obj->column(); - int rowSpan = obj->rowSpan(); - int columnSpan = obj->columnSpan(); - Qt::Alignment alignment = obj->alignment(); - if (row == -1 || column == -1) { - qWarning() << "Must set row and column for an item in a grid layout"; - return; - } - if(obj->rowSpacing() != -1) - setRowSpacing(row, obj->rowSpacing()); - if(obj->columnSpacing() != -1) - setColumnSpacing(column, obj->columnSpacing()); - if(obj->rowStretchFactor() != -1) - setRowStretchFactor(row, obj->rowStretchFactor()); - if(obj->columnStretchFactor() != -1) - setColumnStretchFactor(column, obj->columnStretchFactor()); - if(obj->rowPreferredHeight() != -1) - setRowPreferredHeight(row, obj->rowPreferredHeight()); - if(obj->rowMaximumHeight() != -1) - setRowMaximumHeight(row, obj->rowMaximumHeight()); - if(obj->rowMinimumHeight() != -1) - setRowMinimumHeight(row, obj->rowMinimumHeight()); - if(obj->rowFixedHeight() != -1) - setRowFixedHeight(row, obj->rowFixedHeight()); - if(obj->columnPreferredWidth() != -1) - setColumnPreferredWidth(row, obj->columnPreferredWidth()); - if(obj->columnMaximumWidth() != -1) - setColumnMaximumWidth(row, obj->columnMaximumWidth()); - if(obj->columnMinimumWidth() != -1) - setColumnMinimumWidth(row, obj->columnMinimumWidth()); - if(obj->columnFixedWidth() != -1) - setColumnFixedWidth(row, obj->columnFixedWidth()); - addItem(item, row, column, rowSpan, columnSpan); - if (alignment != -1) - setAlignment(item,alignment); - QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), - this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); - //### need to disconnect when widget is removed? -} -} - -//### is there a better way to do this? -void QGraphicsGridLayoutObject::clearChildren() -{ -for (int i = 0; i < count(); ++i) - removeAt(i); -} - -qreal QGraphicsGridLayoutObject::spacing() const -{ -if (verticalSpacing() == horizontalSpacing()) - return verticalSpacing(); -return -1; //### -} - -qreal QGraphicsGridLayoutObject::contentsMargin() const -{ - qreal a,b,c,d; - getContentsMargins(&a, &b, &c, &d); - if(a==b && a==c && a==d) - return a; - return -1; -} - -void QGraphicsGridLayoutObject::setContentsMargin(qreal m) -{ - setContentsMargins(m,m,m,m); -} - - -void QGraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) -{ -QGraphicsGridLayout::setAlignment(item, alignment); -} - -QHash QGraphicsGridLayoutObject::attachedProperties; -GridLayoutAttached *QGraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) -{ -// ### This is not allowed - you must attach to any object -if (!qobject_cast(obj)) - return 0; -GridLayoutAttached *rv = new GridLayoutAttached(obj); -attachedProperties.insert(qobject_cast(obj), rv); -return rv; -} - -QT_END_NAMESPACE diff --git a/src/imports/widgets/graphicslayouts_p.h b/src/imports/widgets/graphicslayouts_p.h deleted file mode 100644 index ea9c614..0000000 --- a/src/imports/widgets/graphicslayouts_p.h +++ /dev/null @@ -1,303 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRAPHICSLAYOUTS_H -#define GRAPHICSLAYOUTS_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayoutItem) -public: - QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); - - virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; -}; - -class LinearLayoutAttached; -class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) - - Q_PROPERTY(QDeclarativeListProperty children READ children) - Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) - Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsLinearLayoutObject(QObject * = 0); - ~QGraphicsLinearLayoutObject(); - - QDeclarativeListProperty children() { return QDeclarativeListProperty(this, 0, children_append, children_count, children_at, children_clear); } - - static LinearLayoutAttached *qmlAttachedProperties(QObject *); - - qreal contentsMargin() const; - void setContentsMargin(qreal); - -private Q_SLOTS: - void updateStretch(QGraphicsLayoutItem*,int); - void updateSpacing(QGraphicsLayoutItem*,int); - void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); - -private: - friend class LinearLayoutAttached; - void clearChildren(); - void insertLayoutItem(int, QGraphicsLayoutItem *); - static QHash attachedProperties; - - static void children_append(QDeclarativeListProperty *prop, QGraphicsLayoutItem *item) { - static_cast(prop->object)->insertLayoutItem(-1, item); - } - - static void children_clear(QDeclarativeListProperty *prop) { - static_cast(prop->object)->clearChildren(); - } - - static int children_count(QDeclarativeListProperty *prop) { - return static_cast(prop->object)->count(); - } - - static QGraphicsLayoutItem *children_at(QDeclarativeListProperty *prop, int index) { - return static_cast(prop->object)->itemAt(index); - } -}; - -class GridLayoutAttached; -class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) - - Q_PROPERTY(QDeclarativeListProperty children READ children) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) - Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) - Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) - Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsGridLayoutObject(QObject * = 0); - ~QGraphicsGridLayoutObject(); - - QDeclarativeListProperty children() { return QDeclarativeListProperty(this, 0, children_append, children_count, children_at, children_clear); } - - qreal spacing() const; - qreal contentsMargin() const; - void setContentsMargin(qreal); - - static GridLayoutAttached *qmlAttachedProperties(QObject *); - -private Q_SLOTS: - void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); - -private: - friend class GraphicsLayoutAttached; - void addWidget(QGraphicsWidget *); - void clearChildren(); - void addLayoutItem(QGraphicsLayoutItem *); - static QHash attachedProperties; - - static void children_append(QDeclarativeListProperty *prop, QGraphicsLayoutItem *item) { - static_cast(prop->object)->addLayoutItem(item); - } - - static void children_clear(QDeclarativeListProperty *prop) { - static_cast(prop->object)->clearChildren(); - } - - static int children_count(QDeclarativeListProperty *prop) { - return static_cast(prop->object)->count(); - } - - static QGraphicsLayoutItem *children_at(QDeclarativeListProperty *prop, int index) { - return static_cast(prop->object)->itemAt(index); - } -}; - -class LinearLayoutAttached : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int stretchFactor READ stretchFactor WRITE setStretchFactor NOTIFY stretchChanged) - Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) - Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) -public: - LinearLayoutAttached(QObject *parent); - - int stretchFactor() const { return _stretch; } - void setStretchFactor(int f); - Qt::Alignment alignment() const { return _alignment; } - void setAlignment(Qt::Alignment a); - int spacing() const { return _spacing; } - void setSpacing(int s); - -Q_SIGNALS: - void stretchChanged(QGraphicsLayoutItem*,int); - void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); - void spacingChanged(QGraphicsLayoutItem*,int); - -private: - int _stretch; - Qt::Alignment _alignment; - int _spacing; -}; - -class GridLayoutAttached : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int row READ row WRITE setRow) - Q_PROPERTY(int column READ column WRITE setColumn) - Q_PROPERTY(int rowSpan READ rowSpan WRITE setRowSpan) - Q_PROPERTY(int columnSpan READ columnSpan WRITE setColumnSpan) - Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) - Q_PROPERTY(int rowStretchFactor READ rowStretchFactor WRITE setRowStretchFactor) - Q_PROPERTY(int columnStretchFactor READ columnStretchFactor WRITE setColumnStretchFactor) - Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing) - Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing) - Q_PROPERTY(int rowPreferredHeight READ rowPreferredHeight WRITE setRowPreferredHeight) - Q_PROPERTY(int rowMinimumHeight READ rowMinimumHeight WRITE setRowMinimumHeight) - Q_PROPERTY(int rowMaximumHeight READ rowMaximumHeight WRITE setRowMaximumHeight) - Q_PROPERTY(int rowFixedHeight READ rowFixedHeight WRITE setRowFixedHeight) - Q_PROPERTY(int columnPreferredWidth READ columnPreferredWidth WRITE setColumnPreferredWidth) - Q_PROPERTY(int columnMaximumWidth READ columnMaximumWidth WRITE setColumnMaximumWidth) - Q_PROPERTY(int columnMinimumWidth READ columnMinimumWidth WRITE setColumnMinimumWidth) - Q_PROPERTY(int columnFixedWidth READ columnFixedWidth WRITE setColumnFixedWidth) - -public: - GridLayoutAttached(QObject *parent); - - int row() const { return _row; } - void setRow(int r); - - int column() const { return _column; } - void setColumn(int c); - - int rowSpan() const { return _rowspan; } - void setRowSpan(int rs); - - int columnSpan() const { return _colspan; } - void setColumnSpan(int cs); - - Qt::Alignment alignment() const { return _alignment; } - void setAlignment(Qt::Alignment a); - - int rowStretchFactor() const { return _rowstretch; } - void setRowStretchFactor(int f); - int columnStretchFactor() const { return _colstretch; } - void setColumnStretchFactor(int f); - - int rowSpacing() const { return _rowspacing; } - void setRowSpacing(int s); - int columnSpacing() const { return _colspacing; } - void setColumnSpacing(int s); - - int rowPreferredHeight() const { return _rowprefheight; } - void setRowPreferredHeight(int s) { _rowprefheight = s; } - - int rowMaximumHeight() const { return _rowmaxheight; } - void setRowMaximumHeight(int s) { _rowmaxheight = s; } - - int rowMinimumHeight() const { return _rowminheight; } - void setRowMinimumHeight(int s) { _rowminheight = s; } - - int rowFixedHeight() const { return _rowfixheight; } - void setRowFixedHeight(int s) { _rowfixheight = s; } - - int columnPreferredWidth() const { return _colprefwidth; } - void setColumnPreferredWidth(int s) { _colprefwidth = s; } - - int columnMaximumWidth() const { return _colmaxwidth; } - void setColumnMaximumWidth(int s) { _colmaxwidth = s; } - - int columnMinimumWidth() const { return _colminwidth; } - void setColumnMinimumWidth(int s) { _colminwidth = s; } - - int columnFixedWidth() const { return _colfixwidth; } - void setColumnFixedWidth(int s) { _colfixwidth = s; } - -Q_SIGNALS: - void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); - -private: - int _row; - int _column; - int _rowspan; - int _colspan; - Qt::Alignment _alignment; - int _rowstretch; - int _colstretch; - int _rowspacing; - int _colspacing; - int _rowprefheight; - int _rowmaxheight; - int _rowminheight; - int _rowfixheight; - int _colprefwidth; - int _colmaxwidth; - int _colminwidth; - int _colfixwidth; -}; - -QT_END_NAMESPACE - -QML_DECLARE_INTERFACE(QGraphicsLayoutItem) -QML_DECLARE_INTERFACE(QGraphicsLayout) -QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) -QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(QGraphicsGridLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) - -QT_END_HEADER - -#endif // GRAPHICSLAYOUTS_H diff --git a/src/imports/widgets/qmldir b/src/imports/widgets/qmldir deleted file mode 100644 index 6f19878..0000000 --- a/src/imports/widgets/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin widgets diff --git a/src/imports/widgets/widgets.cpp b/src/imports/widgets/widgets.cpp deleted file mode 100644 index 20de1fe..0000000 --- a/src/imports/widgets/widgets.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include "graphicslayouts_p.h" -#include -QT_BEGIN_NAMESPACE - -class QWidgetsQmlModule : public QDeclarativeExtensionPlugin -{ - Q_OBJECT -public: - virtual void registerTypes(const char *uri) - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.widgets")); - - qmlRegisterInterface("QGraphicsLayoutItem"); - qmlRegisterInterface("QGraphicsLayout"); - qmlRegisterType(uri,4,7,"QGraphicsLinearLayoutStretchItem"); - qmlRegisterType(uri,4,7,"QGraphicsLinearLayout"); - qmlRegisterType(uri,4,7,"QGraphicsGridLayout"); - } -}; - -QT_END_NAMESPACE - -#include "widgets.moc" - -Q_EXPORT_PLUGIN2(qtwidgetsqmlmodule, QT_PREPEND_NAMESPACE(QWidgetsQmlModule)); - diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro deleted file mode 100644 index 234ff1e..0000000 --- a/src/imports/widgets/widgets.pro +++ /dev/null @@ -1,30 +0,0 @@ -TARGET = widgets -TARGETPATH = Qt/widgets -include(../qimportbase.pri) - -QT += declarative - -SOURCES += \ - graphicslayouts.cpp \ - widgets.cpp - -HEADERS += \ - graphicslayouts_p.h - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH -target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH - -qmldir.files += $$PWD/qmldir -qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH - -symbian:{ - load(data_caging_paths) - include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - - importFiles.sources = widgets.dll qmldir - importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH - - DEPLOYMENT = importFiles -} - -INSTALLS += target qmldir diff --git a/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml new file mode 100644 index 0000000..ee881a2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml @@ -0,0 +1,9 @@ +import Qt 4.7 + +LayoutItem {//Sized by the layout + id: resizable + objectName: "resizable" + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "200x200" +} diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro new file mode 100644 index 0000000..eeb784d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativelayoutitem.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp new file mode 100644 index 0000000..2207635 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../../shared/util.h" + +class tst_qdeclarativelayoutitem : public QObject +{ + Q_OBJECT +public: + tst_qdeclarativelayoutitem(); + +private slots: + void test_resizing(); +}; + +tst_qdeclarativelayoutitem::tst_qdeclarativelayoutitem() +{ +} + +void tst_qdeclarativelayoutitem::test_resizing() +{ + //Create Layout (must be done in C++) + QGraphicsView view; + QGraphicsScene scene; + QGraphicsWidget *widget = new QGraphicsWidget(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(); + widget->setLayout(layout); + scene.addItem(widget); + view.setScene(&scene); + //Add the QML snippet into the layout + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl(SRCDIR "/data/layoutItem.qml")); + QDeclarativeLayoutItem* obj = static_cast(c.create()); + layout->addItem(obj); + layout->setContentsMargins(0,0,0,0); + widget->setContentsMargins(0,0,0,0); + view.show(); + + QVERIFY(obj!= 0); + + widget->setGeometry(QRectF(0,0, 400,400)); + QCOMPARE(obj->width(), 300.0); + QCOMPARE(obj->height(), 300.0); + + widget->setGeometry(QRectF(0,0, 300,300)); + QCOMPARE(obj->width(), 300.0); + QCOMPARE(obj->height(), 300.0); + + widget->setGeometry(QRectF(0,0, 200,200)); + QCOMPARE(obj->width(), 200.0); + QCOMPARE(obj->height(), 200.0); + + widget->setGeometry(QRectF(0,0, 100,100)); + QCOMPARE(obj->width(), 100.0); + QCOMPARE(obj->height(), 100.0); + + widget->setGeometry(QRectF(0,0, 40,40)); + QCOMPARE(obj->width(), 100.0); + QCOMPARE(obj->height(), 100.0); + + widget->setGeometry(QRectF(0,0, 412,112)); + QCOMPARE(obj->width(), 300.0); + QCOMPARE(obj->height(), 112.0); +} + + +QTEST_MAIN(tst_qdeclarativelayoutitem) + +#include "tst_qdeclarativelayoutitem.moc" diff --git a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml b/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml deleted file mode 100644 index 0538738..0000000 --- a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml +++ /dev/null @@ -1,31 +0,0 @@ -import Qt 4.7 -import Qt.widgets 4.7 - -Item { - id: resizable - width:300 - height:300 - QGraphicsWidget { - x : resizable.x - y : resizable.y - width : resizable.width - height : resizable.height - layout: QGraphicsLinearLayout { - spacing: 0 - LayoutItem { - objectName: "left" - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent } - } - LayoutItem { - objectName: "right" - minimumSize: "100x100" - maximumSize: "400x400" - preferredSize: "200x200" - Rectangle { objectName: "greenRect"; color: "green"; anchors.fill: parent } - } - } - } -} diff --git a/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro b/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro deleted file mode 100644 index a2065f4..0000000 --- a/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro +++ /dev/null @@ -1,10 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_qdeclarativelayouts.cpp -macx:CONFIG -= app_bundle - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" - -CONFIG += parallel_test - diff --git a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp b/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp deleted file mode 100644 index 412c3b7..0000000 --- a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include - -class tst_QDeclarativeLayouts : public QObject -{ - Q_OBJECT -public: - tst_QDeclarativeLayouts(); - -private slots: - void test_qml();//GraphicsLayout set up in Qml - void test_cpp();//GraphicsLayout set up in C++ - -private: - QDeclarativeView *createView(const QString &filename); -}; - -tst_QDeclarativeLayouts::tst_QDeclarativeLayouts() -{ -} - -void tst_QDeclarativeLayouts::test_qml() -{ - QDeclarativeView *canvas = createView(SRCDIR "/data/layouts.qml"); - - qApp->processEvents(); - QDeclarativeLayoutItem *left = static_cast(canvas->rootObject()->findChild("left")); - QVERIFY(left != 0); - - QDeclarativeLayoutItem *right = static_cast(canvas->rootObject()->findChild("right")); - QVERIFY(right != 0); - - qreal l = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin); - qreal r = QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin); - qreal t = QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin); - qreal b = QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin); - QVERIFY2(l == r && r == t && t == b, "Test assumes equal margins."); - qreal gvMargin = l; - - QDeclarativeItem *rootItem = qobject_cast(canvas->rootObject()); - QVERIFY(rootItem != 0); - - //Preferred Size - rootItem->setWidth(300 + 2*gvMargin); - rootItem->setHeight(300 + 2*gvMargin); - - QCOMPARE(left->x(), gvMargin); - QCOMPARE(left->y(), gvMargin); - QCOMPARE(left->width(), 100.0); - QCOMPARE(left->height(), 300.0); - - QCOMPARE(right->x(), 100.0 + gvMargin); - QCOMPARE(right->y(), 0.0 + gvMargin); - QCOMPARE(right->width(), 200.0); - QCOMPARE(right->height(), 300.0); - - //Minimum Size - rootItem->setWidth(10+2*gvMargin); - rootItem->setHeight(10+2*gvMargin); - - QCOMPARE(left->x(), gvMargin); - QCOMPARE(left->width(), 100.0); - QCOMPARE(left->height(), 100.0); - - QCOMPARE(right->x(), 100.0 + gvMargin); - QCOMPARE(right->width(), 100.0); - QCOMPARE(right->height(), 100.0); - - //Between preferred and Maximum Size - /*Note that if set to maximum size (or above) GraphicsLinearLayout behavior - is to shrink them down to preferred size. So the exact maximum size can't - be used*/ - rootItem->setWidth(670 + 2*gvMargin); - rootItem->setHeight(300 + 2*gvMargin); - - QCOMPARE(left->x(), gvMargin); - QCOMPARE(left->width(), 270.0); - QCOMPARE(left->height(), 300.0); - - QCOMPARE(right->x(), 270.0 + gvMargin); - QCOMPARE(right->width(), 400.0); - QCOMPARE(right->height(), 300.0); - - delete canvas; -} - -void tst_QDeclarativeLayouts::test_cpp() -{ - //TODO: This test! -} - -QDeclarativeView *tst_QDeclarativeLayouts::createView(const QString &filename) -{ - QDeclarativeView *canvas = new QDeclarativeView(0); - canvas->setSource(QUrl::fromLocalFile(filename)); - - return canvas; -} - - -QTEST_MAIN(tst_QDeclarativeLayouts) - -#include "tst_qdeclarativelayouts.moc" -- cgit v0.12 From 39e992988f21553df7e839f36ced75ca5bf8588c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 5 May 2010 18:06:20 +1000 Subject: Fix i18n example. Add french translation to photoviewer demo. --- .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 2 +- demos/declarative/photoviewer/i18n/base.ts | 30 +++++++++++++++++++++ demos/declarative/photoviewer/i18n/qml_fr.qm | Bin 0 -> 268 bytes demos/declarative/photoviewer/i18n/qml_fr.ts | 30 +++++++++++++++++++++ demos/declarative/photoviewer/photoviewer.qml | 6 ++--- examples/declarative/i18n/i18n.qml | 30 ++++++++++++--------- 6 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 demos/declarative/photoviewer/i18n/base.ts create mode 100644 demos/declarative/photoviewer/i18n/qml_fr.qm create mode 100644 demos/declarative/photoviewer/i18n/qml_fr.ts diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index 142735f..71d3cdc 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -56,7 +56,7 @@ Component { Tag { anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } - frontLabel: tag; backLabel: "Delete"; flipped: mainWindow.editMode + frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode onTagChanged: rssModel.tags = tag onBackClicked: if (mainWindow.editMode) photosModel.remove(index); } diff --git a/demos/declarative/photoviewer/i18n/base.ts b/demos/declarative/photoviewer/i18n/base.ts new file mode 100644 index 0000000..1accfd2 --- /dev/null +++ b/demos/declarative/photoviewer/i18n/base.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + + + + + photoviewer + + + Add + + + + + Edit + + + + + Back + + + + diff --git a/demos/declarative/photoviewer/i18n/qml_fr.qm b/demos/declarative/photoviewer/i18n/qml_fr.qm new file mode 100644 index 0000000..c24fcbc Binary files /dev/null and b/demos/declarative/photoviewer/i18n/qml_fr.qm differ diff --git a/demos/declarative/photoviewer/i18n/qml_fr.ts b/demos/declarative/photoviewer/i18n/qml_fr.ts new file mode 100644 index 0000000..9f892db --- /dev/null +++ b/demos/declarative/photoviewer/i18n/qml_fr.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + Supprimer + + + + photoviewer + + + Add + Ajouter + + + + Edit + Éditer + + + + Back + Retour + + + diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml index 4094294..e384f46 100644 --- a/demos/declarative/photoviewer/photoviewer.qml +++ b/demos/declarative/photoviewer/photoviewer.qml @@ -27,7 +27,7 @@ Rectangle { Column { spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } Button { - id: newButton; label: "New"; rotation: 3 + id: newButton; label: qsTr("Add"); rotation: 3 anchors.horizontalCenter: parent.horizontalCenter onClicked: { mainWindow.editMode = false @@ -36,7 +36,7 @@ Rectangle { } } Button { - id: deleteButton; label: "Delete"; rotation: -2; + id: deleteButton; label: qsTr("Edit"); rotation: -2; onClicked: mainWindow.editMode = !mainWindow.editMode anchors.horizontalCenter: parent.horizontalCenter } @@ -49,7 +49,7 @@ Rectangle { ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } - Button { id: backButton; label: "Back"; rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } + Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml index 3b1279a..c3030b2 100644 --- a/examples/declarative/i18n/i18n.qml +++ b/examples/declarative/i18n/i18n.qml @@ -6,8 +6,9 @@ import Qt 4.7 // // The files are created/updated by running: // -// lupdate i18n.qml -ts i18n/*.ts +// lupdate i18n.qml -ts i18n/base.ts // +// Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts // The .ts files can then be edited with Linguist: // // linguist i18n/qml_fr.ts @@ -16,18 +17,21 @@ import Qt 4.7 // // lrelease i18n/*.ts // -// Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts -// and editing the result with Linguist. -// -Column { - Text { - text: "If a translation is available for the system language (eg. Franch) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'." - width: 200 - wrapMode: Text.WordWrap - } - Text { - text: qsTr("Hello") - font.pointSize: 25 +Rectangle { + width: 640; height: 480 + + Column { + anchors.fill: parent; spacing: 20 + + Text { + text: "If a translation is available for the system language (eg. French) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'." + width: parent.width; wrapMode: Text.WordWrap + } + + Text { + text: qsTr("Hello") + font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter + } } } -- cgit v0.12 From 0e5924bc207d7de29b28fb223a2027d5d2d694fa Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 5 May 2010 10:37:08 +0200 Subject: qdoc: Removed [module name] from class ref pages. The module name is now a breadcrumb. --- tools/qdoc3/htmlgenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 801e199..3120473 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1243,6 +1243,8 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" << Atom(Atom::LineBreak); +#if 0 + // No longer used because the modeule name is a breadcrumb. QString fixedModule = inner->moduleName(); if (fixedModule == "Qt3SupportLight") fixedModule = "Qt3Support"; @@ -1263,6 +1265,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "]"; } } +#endif generateHeader(title, inner, marker); sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); -- cgit v0.12 From a976ba471d35fd57857b05cee5fdb4d6aa64c961 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 5 May 2010 10:15:20 +0200 Subject: correct misleading note in configure on Windows the option given in the note would not work if used as described. Reviewed-by: Zeno Albisser Task-number: QTBUG-2089 --- configure.exe | Bin 1319424 -> 1318912 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index 35116ff..161fa1d 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index bfa7445..79864f8 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3457,7 +3457,7 @@ void Configure::displayConfig() cout << "NOTE: When linking against OpenSSL, you can override the default" << endl; cout << "library names through OPENSSL_LIBS." << endl; cout << "For example:" << endl; - cout << " configure -openssl-linked OPENSSL_LIBS='-lssleay32 -llibeay32'" << endl; + cout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl; } if( dictionary[ "ZLIB_FORCED" ] == "yes" ) { QString which_zlib = "supplied"; -- cgit v0.12 From 6b02a101cb96dee4bc574ebec1f91c9243f278fb Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 5 May 2010 11:19:00 +0200 Subject: Some minor code cleanup Removes unused code from gkt and cleanlooks. Reviewed-by: Trust Me --- src/gui/styles/qcleanlooksstyle.cpp | 3 --- src/gui/styles/qgtkstyle.cpp | 17 ----------------- 2 files changed, 20 deletions(-) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index ba24d97..d9f7df0 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -1397,7 +1397,6 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o dark.lighter(135), 60); QColor highlight = option->palette.highlight().color(); - QColor highlightText = option->palette.highlightedText().color(); switch(element) { case CE_RadioButton: //fall through @@ -2723,7 +2722,6 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp { // Fill title bar gradient QColor titlebarColor = QColor(active ? highlight: palette.background().color()); - QColor titleBarGradientStop(active ? highlight.darker(150): palette.background().color().darker(120)); QLinearGradient gradient(option->rect.center().x(), option->rect.top(), option->rect.center().x(), option->rect.bottom()); @@ -2986,7 +2984,6 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp painter->fillRect(option->rect, option->palette.background()); - QRect rect = scrollBar->rect; QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 0988fd8..6c8d561 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1163,7 +1163,6 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast(option)) { QRect tabRect = tbb->rect; - QRegion region(tabRect); painter->save(); painter->setPen(QPen(option->palette.dark().color().dark(110), 0)); switch (tbb->shape) { @@ -1245,8 +1244,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom else alphaCornerColor = mergedColors(option->palette.background().color(), darkOutline); - QPalette palette = option->palette; - switch (control) { case CC_TitleBar: @@ -1333,11 +1330,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom bool isEnabled = (comboBox->state & State_Enabled); bool focus = isEnabled && (comboBox->state & State_HasFocus); - QColor buttonShadow = option->palette.dark().color(); GtkStateType state = gtkPainter.gtkState(option); int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget); - QPixmap cache; - QString pixmapName; QStyleOptionComboBox comboBoxCopy = *comboBox; comboBoxCopy.rect = option->rect; @@ -1345,8 +1339,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QRect rect = option->rect; QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxArrow, widget); - QRect editRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, - SC_ComboBoxEditField, widget); GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ? GTK_SHADOW_IN : GTK_SHADOW_OUT; @@ -1414,9 +1406,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom else if (option->state & State_MouseOver && comboBox->activeSubControls & SC_ComboBoxArrow) buttonState = GTK_STATE_PRELIGHT; - QRect buttonrect = QRect(gtkToggleButton->allocation.x, gtkToggleButton->allocation.y, - gtkToggleButton->allocation.width, gtkToggleButton->allocation.height); - Q_ASSERT(gtkToggleButton); gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState, shadow, gtkToggleButton->style, buttonPath.toString() + @@ -1436,8 +1425,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (focus) GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); - QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") - : QHashableLatin1Literal("GtkComboBox.GtkToggleButton"); // Draw the separator between label and arrows QHashableLatin1Literal vSeparatorPath = comboBox->editable @@ -2557,7 +2544,6 @@ void QGtkStyle::drawControl(ControlElement element, d->gtkWidget("GtkMenu.GtkMenuItem"); style = gtkPainter.getStyle(gtkMenuItem); - QColor borderColor = option->palette.background().color().darker(160); QColor shadow = option->palette.dark().color(); if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { @@ -2782,8 +2768,6 @@ void QGtkStyle::drawControl(ControlElement element, // Arrow if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow - QPoint buttonShift(pixelMetric(PM_ButtonShiftHorizontal, option, widget), - proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); QFontMetrics fm(menuitem->font); int arrow_size = fm.ascent() + fm.descent() - 2 * gtkMenuItem->style->ythickness; @@ -3130,7 +3114,6 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple case CC_ComboBox: if (const QStyleOptionComboBox *box = qstyleoption_cast(option)) { // We employ the gtk widget to position arrows and separators for us - QString comboBoxPath = box->editable ? QLS("GtkComboBoxEntry") : QLS("GtkComboBox"); GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry") : d->gtkWidget("GtkComboBox"); d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); -- cgit v0.12 From 95a69f37ec156a2506b140e5e349bb7f68e112a5 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 26 Apr 2010 14:33:05 +0200 Subject: QHostInfo: Immediately delete aborted lookup requests. Reviewed-by: Thiago --- src/network/kernel/qhostinfo.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index f287630..fd39347 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -596,6 +596,23 @@ void QHostInfoLookupManager::abortLookup(int id) return; QMutexLocker locker(&this->mutex); + + // is postponed? delete and return + for (int i = 0; i < postponedLookups.length(); i++) { + if (postponedLookups.at(i)->id == id) { + delete postponedLookups.takeAt(i); + return; + } + } + + // is scheduled? delete and return + for (int i = 0; i < scheduledLookups.length(); i++) { + if (scheduledLookups.at(i)->id == id) { + delete scheduledLookups.takeAt(i); + return; + } + } + if (!abortedLookups.contains(id)) abortedLookups.append(id); } -- cgit v0.12 From ff2b6ddfd2763b6b365c7466d51a1e2374e4bd4b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 5 May 2010 12:37:21 +0200 Subject: QHostInfo: Emit postponed lookup results when finishing current Reviewed-by: Thiago --- src/network/kernel/qhostinfo.cpp | 12 ++++++++++++ src/network/kernel/qhostinfo_p.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index fd39347..28a6c84 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -471,6 +471,18 @@ void QHostInfoRunnable::run() hostInfo.setLookupId(id); resultEmitter.emitResultsReady(hostInfo); + // now also iterate through the postponed ones + QMutableListIterator iterator(manager->postponedLookups); + while (iterator.hasNext()) { + QHostInfoRunnable* postponed = iterator.next(); + if (toBeLookedUp == postponed->toBeLookedUp) { + // we can now emit + iterator.remove(); + hostInfo.setLookupId(postponed->id); + postponed->resultEmitter.emitResultsReady(hostInfo); + } + } + manager->lookupFinished(this); // thread goes back to QThreadPool diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index e11766b..af270d8 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -173,6 +173,8 @@ public: bool wasAborted(int id); QHostInfoCache cache; + + friend class QHostInfoRunnable; protected: QList currentLookups; // in progress QList postponedLookups; // postponed because in progress for same host -- cgit v0.12 From 260212083c19e76e8e53dfe2ae44de70003769d7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 5 May 2010 14:13:24 +0200 Subject: QHostInfo: Avoid one tiny copy of QHostInfo object when emitting Thanks rittk! Reviewed-by: Olivier --- src/network/kernel/qhostinfo_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index af270d8..85d14c2 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -84,7 +84,7 @@ public Q_SLOTS: } Q_SIGNALS: - void resultsReady(const QHostInfo info); + void resultsReady(const QHostInfo &info); }; // needs to be QObject because fromName calls tr() -- cgit v0.12 From 6bc32600d2367e78ddc39dd93694e01d4d75958d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 5 May 2010 13:59:31 +0200 Subject: Don't leak QVistaHelper from QWizard The default QObject constructor was not called, meaning the vista helper was never registered as a child of the QWizard (and therefore never deleted when the QWizard was destructed). Task-number: QTBUG-10203 Reviewed-by: olivier --- src/gui/dialogs/qwizard_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 1390b21..e406cba 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -237,7 +237,8 @@ void QVistaBackButton::paintEvent(QPaintEvent *) */ QVistaHelper::QVistaHelper(QWizard *wizard) - : pressed(false) + : QObject(wizard) + , pressed(false) , wizard(wizard) , backButton_(0) { -- cgit v0.12 From bfbf4d4ccdfb4cf35592c61674f6bffc28932787 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Wed, 5 May 2010 13:57:29 +0200 Subject: Fix build key on Windows with MinGW. Also, rebuilt configure.exe Reviewed-by: Thiago Macieira --- configure.exe | Bin 1318912 -> 1318912 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index 161fa1d..69e98dd 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 79864f8..e264426 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2373,7 +2373,7 @@ void Configure::generateBuildKey() + buildSymbianKey + "\"\n" "#else\n" // Debug builds - "# if (defined(_DEBUG) || defined(DEBUG))\n" + "# if (!QT_NO_DEBUG)\n" "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + build64Key.arg("debug") + "\"\n" "# else\n" -- cgit v0.12 From b4bbb3d79a59c1225e1de58b6625f24de7df2013 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 5 May 2010 15:26:47 +0200 Subject: doc: Began reorganization of the top doc page. Much more to come. --- doc/src/frameworks-technologies/animation.qdoc | 1 + .../frameworks-technologies/eventsandfilters.qdoc | 3 ++- doc/src/frameworks-technologies/graphicsview.qdoc | 1 + .../model-view-programming.qdoc | 1 + doc/src/frameworks-technologies/threads.qdoc | 1 + doc/src/objectmodel/metaobjects.qdoc | 3 ++- doc/src/objectmodel/object.qdoc | 3 ++- doc/src/objectmodel/objecttrees.qdoc | 3 ++- doc/src/objectmodel/properties.qdoc | 3 ++- doc/src/objectmodel/signalsandslots.qdoc | 3 ++- doc/src/overviews.qdoc | 23 ++++++++++++++++++++++ doc/src/painting-and-printing/paintsystem.qdoc | 1 + doc/src/widgets-and-layouts/layout.qdoc | 1 + doc/src/widgets-and-layouts/styles.qdoc | 1 + doc/src/widgets-and-layouts/widgets.qdoc | 1 + doc/src/windows-and-dialogs/dialogs.qdoc | 1 + doc/src/windows-and-dialogs/mainwindow.qdoc | 1 + tools/qdoc3/test/qt-html-templates.qdocconf | 19 ++++++------------ 18 files changed, 51 insertions(+), 19 deletions(-) diff --git a/doc/src/frameworks-technologies/animation.qdoc b/doc/src/frameworks-technologies/animation.qdoc index 5548b57..dc705ba 100644 --- a/doc/src/frameworks-technologies/animation.qdoc +++ b/doc/src/frameworks-technologies/animation.qdoc @@ -47,6 +47,7 @@ /*! \page animation-overview.html \title The Animation Framework + \ingroup qt-gui-concepts \brief An overview of the Animation Framework diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc index 96ee18c..0cd60b8 100644 --- a/doc/src/frameworks-technologies/eventsandfilters.qdoc +++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc @@ -54,7 +54,8 @@ /*! \page eventsandfilters.html - \title Events and Event Filters + \title The Event System + \ingroup qt-basic-concepts \brief A guide to event handling in Qt. \ingroup frameworks-technologies diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc index 6844aed..95b3182 100644 --- a/doc/src/frameworks-technologies/graphicsview.qdoc +++ b/doc/src/frameworks-technologies/graphicsview.qdoc @@ -47,6 +47,7 @@ /*! \page graphicsview.html \title The Graphics View Framework + \ingroup qt-gui-concepts \brief An overview of the Graphics View framework for interactive 2D graphics. diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc index 7568981..e02f1eb 100644 --- a/doc/src/frameworks-technologies/model-view-programming.qdoc +++ b/doc/src/frameworks-technologies/model-view-programming.qdoc @@ -50,6 +50,7 @@ \startpage index.html Qt Reference Documentation \title Model/View Programming + \ingroup qt-gui-concepts \brief A guide to the extensible model/view architecture used by Qt's item view classes. diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc index fd6bebb..f7dde59 100644 --- a/doc/src/frameworks-technologies/threads.qdoc +++ b/doc/src/frameworks-technologies/threads.qdoc @@ -47,6 +47,7 @@ /*! \page threads.html \title Thread Support in Qt + \ingroup qt-basic-concepts \brief A detailed discussion of thread handling in Qt. \ingroup frameworks-technologies diff --git a/doc/src/objectmodel/metaobjects.qdoc b/doc/src/objectmodel/metaobjects.qdoc index c1b0ea6..e891183 100644 --- a/doc/src/objectmodel/metaobjects.qdoc +++ b/doc/src/objectmodel/metaobjects.qdoc @@ -41,7 +41,8 @@ /*! \page metaobjects.html - \title Meta-Object System + \title The Meta-Object System + \ingroup qt-basic-concepts \brief An overview of Qt's meta-object system and introspection capabilities. \keyword meta-object diff --git a/doc/src/objectmodel/object.qdoc b/doc/src/objectmodel/object.qdoc index 2f06004..e0ba6ed 100644 --- a/doc/src/objectmodel/object.qdoc +++ b/doc/src/objectmodel/object.qdoc @@ -41,7 +41,8 @@ /*! \page object.html - \title Qt Object Model + \title Object Model + \ingroup qt-basic-concepts \brief A description of the powerful features made possible by Qt's dynamic object model. \ingroup frameworks-technologies diff --git a/doc/src/objectmodel/objecttrees.qdoc b/doc/src/objectmodel/objecttrees.qdoc index 11824ae..97d646a 100644 --- a/doc/src/objectmodel/objecttrees.qdoc +++ b/doc/src/objectmodel/objecttrees.qdoc @@ -41,7 +41,8 @@ /*! \page objecttrees.html - \title Object Trees and Object Ownership + \title Object Trees & Ownership + \ingroup qt-basic-concepts \brief Information about the parent-child pattern used to describe object ownership in Qt. diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc index a807caf..bc9554c 100644 --- a/doc/src/objectmodel/properties.qdoc +++ b/doc/src/objectmodel/properties.qdoc @@ -41,7 +41,8 @@ /*! \page properties.html - \title Qt's Property System + \title The Property System + \ingroup qt-basic-concepts \brief An overview of Qt's property system. Qt provides a sophisticated property system similar to the ones diff --git a/doc/src/objectmodel/signalsandslots.qdoc b/doc/src/objectmodel/signalsandslots.qdoc index 0f3f618..f33badf 100644 --- a/doc/src/objectmodel/signalsandslots.qdoc +++ b/doc/src/objectmodel/signalsandslots.qdoc @@ -41,7 +41,8 @@ /*! \page signalsandslots.html - \title Signals and Slots + \title Signals & Slots + \ingroup qt-basic-concepts \brief An overview of Qt's signals and slots inter-object communication mechanism. diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc index 7302e30..bc994af 100644 --- a/doc/src/overviews.qdoc +++ b/doc/src/overviews.qdoc @@ -48,6 +48,29 @@ */ /*! + \group qt-basic-concepts + \title Qt Basic Concepts + + \brief The basic concepts of the Qt cross-platform application and UI framework. + + Qt is a cross-platform application and UI framework for writing + web-enabled applications for desktop, mobile, and embedded + operating systems. These pages explain basic architectural + concepts of Qt: + + \generatelist {related} + */ + +/*! + \group qt-gui-concepts + \title Qt GUI Components + + \brief The Qt components for constructing graphical user intefaces. + + \generatelist {related} + */ + +/*! \group frameworks-technologies \title Frameworks and Technologies diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc index 802751f..56b638c 100644 --- a/doc/src/painting-and-printing/paintsystem.qdoc +++ b/doc/src/painting-and-printing/paintsystem.qdoc @@ -61,6 +61,7 @@ /*! \page paintsystem.html \title The Paint System + \ingroup qt-gui-concepts \ingroup frameworks-technologies Qt's paint system enables painting on screen and print devices diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc index 0cfde22..2ca202f 100644 --- a/doc/src/widgets-and-layouts/layout.qdoc +++ b/doc/src/widgets-and-layouts/layout.qdoc @@ -47,6 +47,7 @@ /*! \page layout.html \title Layout Management + \ingroup qt-gui-concepts \brief A tour of the standard layout managers and an introduction to custom layouts. diff --git a/doc/src/widgets-and-layouts/styles.qdoc b/doc/src/widgets-and-layouts/styles.qdoc index 9a28715..b4bec8c 100644 --- a/doc/src/widgets-and-layouts/styles.qdoc +++ b/doc/src/widgets-and-layouts/styles.qdoc @@ -48,6 +48,7 @@ /*! \page style-reference.html \title Implementing Styles and Style Aware Widgets + \ingroup qt-gui-concepts \brief An overview of styles and the styling of widgets. \ingroup frameworks-technologies diff --git a/doc/src/widgets-and-layouts/widgets.qdoc b/doc/src/widgets-and-layouts/widgets.qdoc index 7bd27b6..ac0bf77 100644 --- a/doc/src/widgets-and-layouts/widgets.qdoc +++ b/doc/src/widgets-and-layouts/widgets.qdoc @@ -42,6 +42,7 @@ /*! \page widgets-and-layouts.html \title Widgets and Layouts + \ingroup qt-gui-concepts \ingroup frameworks-technologies diff --git a/doc/src/windows-and-dialogs/dialogs.qdoc b/doc/src/windows-and-dialogs/dialogs.qdoc index acee0c5..0b0a842 100644 --- a/doc/src/windows-and-dialogs/dialogs.qdoc +++ b/doc/src/windows-and-dialogs/dialogs.qdoc @@ -52,6 +52,7 @@ /*! \page dialogs.html \title Dialog Windows + \ingroup qt-gui-concepts \brief An overview over dialog windows. \previouspage The Application Main Window diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc index 6adfa75..b282dab 100644 --- a/doc/src/windows-and-dialogs/mainwindow.qdoc +++ b/doc/src/windows-and-dialogs/mainwindow.qdoc @@ -47,6 +47,7 @@ /*! \page application-windows.html \title Application Windows and Dialogs + \ingroup qt-gui-concepts \ingroup frameworks-technologies \nextpage The Application Main Window diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 00af376..48ecd2c 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -50,7 +50,7 @@ HTML.postheader = "
    \n" \ "
  • All classes
  • \n" \ "
  • All functions
  • \n" \ "
  • All namespaces
  • \n" \ - "
  • Platform specifics
  • \n" \ + "
  • QML elements
  • \n" \ " \n" \ "
    \n" \ "
    \n" \ @@ -58,24 +58,17 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ - " API Topics

    \n" \ + " Qt Topics

    \n" \ "
    \n" \ " \n " \ " " \ " \n" \ "
    \n" \ "
    \n" \ @@ -83,7 +76,7 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ - " API Examples

    \n" \ + " Qt Examples\n" \ "
    \n" \ " \n " \ - " " \ - "
    \n" \ "
    \n" \ @@ -58,17 +54,20 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ - " Qt Topics

    \n" \ + " API Topics\n" \ "
    \n" \ - " \n " \ - " " \ - "
    \n" \ "
    \n" \ @@ -76,18 +75,14 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ - " Qt Examples

    \n" \ + " API Examples\n" \ "
    \n" \ - " \n " \ - " " \ - "
    \n" \ "
    \n" \ -- cgit v0.12 From db64d17f233f92ce7a425271ee60586bd846705d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 5 May 2010 16:34:38 +0200 Subject: whitespace fixes --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index ff79c09..db8548d 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -522,8 +522,8 @@ public: active->connectToHost("127.0.0.1", server.serverPort()); #ifndef Q_OS_SYMBIAN // need more time as working with embedded - // device and testing from emualtor - // things tend to get slower + // device and testing from emualtor + // things tend to get slower if (!active->waitForConnected(1000)) return false; @@ -929,7 +929,7 @@ void tst_QNetworkReply::invalidProtocol() void tst_QNetworkReply::getFromData_data() { - QTest::addColumn("request"); + QTest::addColumn("request"); QTest::addColumn("expected"); QTest::addColumn("mimeType"); @@ -1025,7 +1025,7 @@ void tst_QNetworkReply::getFromData() void tst_QNetworkReply::getFromFile() { - // create the file: + // create the file: QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX"); file.setAutoRemove(true); QVERIFY(file.open()); @@ -1077,7 +1077,7 @@ void tst_QNetworkReply::getFromFileSpecial_data() void tst_QNetworkReply::getFromFileSpecial() { - QFETCH(QString, fileName); + QFETCH(QString, fileName); QFETCH(QString, url); // open the resource so we can find out its size @@ -1107,7 +1107,7 @@ void tst_QNetworkReply::getFromFtp_data() void tst_QNetworkReply::getFromFtp() { - QFETCH(QString, referenceName); + QFETCH(QString, referenceName); QFETCH(QString, url); QFile reference(referenceName); @@ -1136,7 +1136,7 @@ void tst_QNetworkReply::getFromHttp_data() void tst_QNetworkReply::getFromHttp() { - QFETCH(QString, referenceName); + QFETCH(QString, referenceName); QFETCH(QString, url); QFile reference(referenceName); @@ -3456,8 +3456,8 @@ void tst_QNetworkReply::downloadProgress_data() QTest::newRow("big") << 4096; #else // it can run even with 4096 - // but it takes lot time - //especially on emulator + // but it takes lot time + //especially on emulator QTest::newRow("big") << 1024; #endif } @@ -3646,7 +3646,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data() void tst_QNetworkReply::receiveCookiesFromHttp() { - QFETCH(QString, cookieString); + QFETCH(QString, cookieString); QByteArray data = cookieString.toLatin1() + '\n'; QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/set-cookie.cgi"); -- cgit v0.12 From e41217d6d2e592e79a9a8a83c9e49491d66ad18e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 5 May 2010 16:36:10 +0200 Subject: tst_qnetworkreply: add a test for getting from SMB Reviewed-By: Markus Goetz --- tests/auto/qnetworkreply/smb-file.txt | 1 + tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 tests/auto/qnetworkreply/smb-file.txt diff --git a/tests/auto/qnetworkreply/smb-file.txt b/tests/auto/qnetworkreply/smb-file.txt new file mode 100644 index 0000000..73c3ac2 --- /dev/null +++ b/tests/auto/qnetworkreply/smb-file.txt @@ -0,0 +1 @@ +This is 34 bytes. Do not change... \ No newline at end of file diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index db8548d..9d942bf 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -1073,6 +1073,9 @@ void tst_QNetworkReply::getFromFileSpecial_data() QTest::newRow("resource") << ":/resource" << "qrc:/resource"; QTest::newRow("search-path") << "srcdir:/rfc3252.txt" << "srcdir:/rfc3252.txt"; QTest::newRow("bigfile-path") << "srcdir:/bigfile" << "srcdir:/bigfile"; +#ifdef Q_OS_WIN + QTest::newRow("smb-path") << "srcdir:/smb-file.txt" << "file://" + QtNetworkSettings::winServerName() + "/testshare/test.pri"; +#endif } void tst_QNetworkReply::getFromFileSpecial() -- cgit v0.12 From a2f797b52c4274a62a7cf1f0939aca1429afe211 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 5 May 2010 16:48:21 +0200 Subject: Improve QUrl handling of local file paths Add QUrl::isLocalFile for a faster and more consistent checking of whether the URL is local or not. Improve the documentation to indicate that QUrl always treats SMB-like file paths as local, even if the system cannot open them (non-Windows). Add a test to ensure that "FILE:/a.txt" is considered local too (RFC 3986 requires schemes to be interpreted in case-insensitive fashion). Remove broken code that supported empty schemes as local file paths. Reviewed-by: Markus Goetz --- src/corelib/io/qurl.cpp | 73 +++++++++++++++++++++++++++++++------------- src/corelib/io/qurl.h | 1 + tests/auto/qurl/tst_qurl.cpp | 11 ++++++- 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 4e580dd..7b5bfed 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5970,19 +5970,22 @@ bool QUrl::isDetached() const /*! - Returns a QUrl representation of \a localFile, interpreted as a - local file. + Returns a QUrl representation of \a localFile, interpreted as a local + file. This function accepts paths separated by slashes as well as the + native separator for this platform. - \sa toLocalFile() + This function also accepts paths with a doubled leading slash (or + backslash) to indicate a remote file, as in + "//servername/path/to/file.txt". Note that only certain platforms can + actually open this file using QFile::open(). + + \sa toLocalFile(), isLocalFile(), QDir::toNativeSeparators */ QUrl QUrl::fromLocalFile(const QString &localFile) { QUrl url; url.setScheme(QLatin1String("file")); - QString deslashified = localFile; - deslashified.replace(QLatin1Char('\\'), QLatin1Char('/')); - - + QString deslashified = QDir::toNativeSeparators(localFile); // magic for drives on windows if (deslashified.length() > 1 && deslashified.at(1) == QLatin1Char(':') && deslashified.at(0) != QLatin1Char('/')) { @@ -6001,35 +6004,61 @@ QUrl QUrl::fromLocalFile(const QString &localFile) } /*! - Returns the path of this URL formatted as a local file path. + Returns the path of this URL formatted as a local file path. The path + returned will use forward slashes, even if it was originally created + from one with backslashes. - \sa fromLocalFile() + If this URL contains a non-empty hostname, it will be encoded in the + returned value in the form found on SMB networks (for example, + "//servername/path/to/file.txt"). + + \sa fromLocalFile(), isLocalFile() */ QString QUrl::toLocalFile() const { - if (!d) return QString(); - if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse(); + // the call to isLocalFile() also ensures that we're parsed + if (!isLocalFile()) + return QString(); QString tmp; QString ourPath = path(); - if (d->scheme.isEmpty() || QString::compare(d->scheme, QLatin1String("file"), Qt::CaseInsensitive) == 0) { - // magic for shared drive on windows - if (!d->host.isEmpty()) { - tmp = QLatin1String("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') - ? QLatin1Char('/') + ourPath : ourPath); - } else { - tmp = ourPath; - // magic for drives on windows - if (ourPath.length() > 2 && ourPath.at(0) == QLatin1Char('/') && ourPath.at(2) == QLatin1Char(':')) - tmp.remove(0, 1); - } + // magic for shared drive on windows + if (!d->host.isEmpty()) { + tmp = QLatin1String("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') + ? QLatin1Char('/') + ourPath : ourPath); + } else { + tmp = ourPath; + // magic for drives on windows + if (ourPath.length() > 2 && ourPath.at(0) == QLatin1Char('/') && ourPath.at(2) == QLatin1Char(':')) + tmp.remove(0, 1); } return tmp; } /*! + \since 4.7 + Returns true if this URL is pointing to a local file path. A URL is a + local file path if the scheme is "file". + + Note that this function considers URLs with hostnames to be local file + paths, even if the eventual file path cannot be opened with + QFile::open(). + + \sa fromLocalFile(), toLocalFile() +*/ +bool QUrl::isLocalFile() const +{ + if (!d) return false; + if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse(); + + if (d->scheme.compare(QLatin1String("file"), Qt::CaseInsensitive) != 0) + return false; // not file + return true; +} + +/*! Returns true if this URL is a parent of \a childUrl. \a childUrl is a child of this URL if the two URLs share the same scheme and authority, and this URL's path is a parent of the path of \a childUrl. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 6f8331a..162aa7c 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -183,6 +183,7 @@ public: static QUrl fromLocalFile(const QString &localfile); QString toLocalFile() const; + bool isLocalFile() const; QString toString(FormattingOptions options = None) const; diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index fa42adc..67bf0c1 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -314,6 +314,7 @@ void tst_QUrl::constructing() QUrl buildUNC; + buildUNC.setScheme(QString::fromLatin1("file")); buildUNC.setHost(QString::fromLatin1("somehost")); buildUNC.setPath(QString::fromLatin1("somepath")); QCOMPARE(buildUNC.toLocalFile(), QString::fromLatin1("//somehost/somepath")); @@ -1757,7 +1758,15 @@ void tst_QUrl::toLocalFile_data() QTest::newRow("data7") << QString::fromLatin1("file://somehost/") << QString::fromLatin1("//somehost/"); QTest::newRow("data8") << QString::fromLatin1("file://somehost") << QString::fromLatin1("//somehost"); QTest::newRow("data9") << QString::fromLatin1("file:////somehost/somedir/somefile") << QString::fromLatin1("//somehost/somedir/somefile"); - + QTest::newRow("data10") << QString::fromLatin1("FILE:/a.txt") << QString::fromLatin1("/a.txt"); + + // and some that result in empty (i.e., not local) + QTest::newRow("xdata0") << QString::fromLatin1("/a.txt") << QString(); + QTest::newRow("xdata1") << QString::fromLatin1("//a.txt") << QString(); + QTest::newRow("xdata2") << QString::fromLatin1("///a.txt") << QString(); + QTest::newRow("xdata3") << QString::fromLatin1("foo:/a.txt") << QString(); + QTest::newRow("xdata4") << QString::fromLatin1("foo://a.txt") << QString(); + QTest::newRow("xdata5") << QString::fromLatin1("foo:///a.txt") << QString(); } void tst_QUrl::toLocalFile() -- cgit v0.12 From ebddf7a8739d7f4aaa7d9cb8a41a14eebb65e4f4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 5 May 2010 16:51:41 +0200 Subject: Use QUrl::isLocalFile and fix the scheme checking in local URLs. RFC 3986 requires that schemes be compared case-insensitively, so "QRC:/" is allowed for Qt resources. Also document the use of file engines and search paths. Reviewed-by: Markus Goetz --- src/network/access/qnetworkaccessfilebackend.cpp | 11 ++++++++--- src/network/access/qnetworkaccessmanager.cpp | 11 +++++------ tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 6 ++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp index 4560153..710c258 100644 --- a/src/network/access/qnetworkaccessfilebackend.cpp +++ b/src/network/access/qnetworkaccessfilebackend.cpp @@ -65,10 +65,15 @@ QNetworkAccessFileBackendFactory::create(QNetworkAccessManager::Operation op, } QUrl url = request.url(); - if (url.scheme() == QLatin1String("qrc") || !url.toLocalFile().isEmpty()) + if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0 || url.isLocalFile()) { return new QNetworkAccessFileBackend; - else if (!url.isEmpty() && url.authority().isEmpty()) { - // check if QFile could, in theory, open this URL + } else if (!url.scheme().isEmpty() && url.authority().isEmpty()) { + // check if QFile could, in theory, open this URL via the file engines + // it has to be in the format: + // prefix:path/to/file + // or prefix:/path/to/file + // + // this construct here must match the one below in open() QFileInfo fi(url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery)); if (fi.exists() || (op == QNetworkAccessManager::PutOperation && fi.dir().exists())) return new QNetworkAccessFileBackend; diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 1c7661d..10fdc6f 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -907,21 +907,20 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera { Q_D(QNetworkAccessManager); + bool isLocalFile = req.url().isLocalFile(); + // fast path for GET on file:// URLs - // Also if the scheme is empty we consider it a file. // The QNetworkAccessFileBackend will right now only be used // for PUT or qrc:// if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) - && (req.url().scheme() == QLatin1String("file") - || req.url().scheme().isEmpty())) { + && isLocalFile) { return new QFileNetworkReply(this, req, op); } #ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. - if (!d->networkAccessible && !(req.url().scheme() == QLatin1String("file") || - req.url().scheme().isEmpty())) { + if (!d->networkAccessible && !isLocalFile) { return new QDisabledNetworkReply(this, req, op); } @@ -963,7 +962,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera QUrl url = request.url(); QNetworkReplyImpl *reply = new QNetworkReplyImpl(this); #ifndef QT_NO_BEARERMANAGEMENT - if (req.url().scheme() != QLatin1String("file") && !req.url().scheme().isEmpty()) { + if (!isLocalFile) { connect(this, SIGNAL(networkSessionConnected()), reply, SLOT(_q_networkSessionConnected())); } diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 9d942bf..c4d458f 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -1166,6 +1166,12 @@ void tst_QNetworkReply::getErrors_data() QTest::addColumn("httpStatusCode"); QTest::addColumn("dataIsEmpty"); + // empties + QTest::newRow("empty-url") << QString() << int(QNetworkReply::ProtocolUnknownError) << 0 << true; + QTest::newRow("empty-scheme-host") << SRCDIR "/rfc3252.txt" << int(QNetworkReply::ProtocolUnknownError) << 0 << true; + QTest::newRow("empty-scheme") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" + << int(QNetworkReply::ProtocolUnknownError) << 0 << true; + // file: errors QTest::newRow("file-host") << "file://this-host-doesnt-exist.troll.no/foo.txt" #if !defined Q_OS_WIN -- cgit v0.12 From a9fb306a1cf1308a3f8b9bb12ed01aed1f6f6f8d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 5 May 2010 16:55:02 +0200 Subject: [QNAM FTP] Check for the "ftp" scheme case-insensitively --- src/network/access/qnetworkaccessftpbackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index 1a59011..da336d0 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -77,7 +77,7 @@ QNetworkAccessFtpBackendFactory::create(QNetworkAccessManager::Operation op, } QUrl url = request.url(); - if (url.scheme() == QLatin1String("ftp")) + if (url.scheme().compare(QLatin1String("ftp"), Qt::CaseInsensitive) == 0) return new QNetworkAccessFtpBackend; return 0; } -- cgit v0.12 From 0a8379d9f01118d7ff0121e6ecbbc0307e1e7f63 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 6 May 2010 04:54:19 +1000 Subject: Make component.createObject require a parent argument For graphical objects (the common case) a common mistake is to not parent a dynamically created item. Since you almost always want to add a parent, and it's hard for a beginner to diagnose this problem, a parent is now a required argument and dealt with by the createObject function. Task-number: QTBUG-10110 --- demos/declarative/samegame/SamegameCore/samegame.js | 3 +-- demos/declarative/snake/content/snake.js | 6 ++---- doc/src/declarative/dynamicobjects.qdoc | 4 +++- doc/src/declarative/globalobject.qdoc | 5 ++++- doc/src/snippets/declarative/componentCreation.js | 8 ++------ doc/src/snippets/declarative/dynamicObjects.qml | 3 +-- examples/declarative/dynamic/qml/itemCreation.js | 3 +-- .../tutorials/samegame/samegame2/samegame.js | 3 +-- .../tutorials/samegame/samegame3/samegame.js | 3 +-- .../tutorials/samegame/samegame4/content/samegame.js | 3 +-- src/declarative/qml/qdeclarativecomponent.cpp | 20 +++++++++++++++++++- src/declarative/qml/qdeclarativecomponent.h | 2 +- .../qdeclarativeecmascript/data/dynamicCreation.qml | 4 ++-- 13 files changed, 39 insertions(+), 28 deletions(-) diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js index cc0a70d..f9c6184 100755 --- a/demos/declarative/samegame/SamegameCore/samegame.js +++ b/demos/declarative/samegame/SamegameCore/samegame.js @@ -176,14 +176,13 @@ function createBlock(column,row){ // not be ready immediately. There is a statusChanged signal on the // component you could use if you want to wait to load remote files. if(component.status == Component.Ready){ - var dynamicObject = component.createObject(); + var dynamicObject = component.createObject(gameCanvas); if(dynamicObject == null){ console.log("error creating block"); console.log(component.errorsString()); return false; } dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.parent = gameCanvas; dynamicObject.x = column*gameCanvas.blockSize; dynamicObject.targetX = column*gameCanvas.blockSize; dynamicObject.targetY = row*gameCanvas.blockSize; diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index 102bd87..f5c231e 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -59,8 +59,7 @@ function startNewGame() console.log("Still loading linkComponent"); continue;//TODO: Better error handling? } - var link = linkComponent.createObject(); - link.parent = playfield; + var link = linkComponent.createObject(playfield); link.z = numRows * numColumns + 1 - i; link.type = i == 0 ? 2 : 0; link.spawned = false; @@ -300,8 +299,7 @@ function createCookie(value) { console.log("Still loading cookieComponent"); return;//TODO: Better error handling? } - cookie = cookieComponent.createObject(); - cookie.parent = head.parent; + cookie = cookieComponent.createObject(head.parent); cookie.value = value; cookie.row = row; cookie.column = column; diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index dc0277d..2688ee5 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -69,7 +69,9 @@ This function takes the URL of the QML file as its only argument and returns a component object which can be used to create and load that QML file. Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of -the component. +the component. This function takes exactly one argument, which 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 null to this function. Here is an example. Here is a \c Sprite.qml, which defines a simple QML component: diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 7c27ae4..bc9830a 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -258,7 +258,10 @@ The methods and properties of the Component element are defined in its own page, but when using it dynamically only two methods are usually used. \c Component.createObject() returns the created object or \c null if there is an error. If there is an error, \l {Component::errorsString()}{Component.errorsString()} describes -the error that occurred. +the error that occurred. Note that createObject() takes exactly one argument, which is set +to the parent of the created object. Graphical objects without a parent will not appear +on the scene, but if you do not wish to parent the item at this point you can safely pass +in null. If you want to just create an arbitrary string of QML, instead of loading a QML file, consider the \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()} function. diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js index be928f0..f6fb379 100644 --- a/doc/src/snippets/declarative/componentCreation.js +++ b/doc/src/snippets/declarative/componentCreation.js @@ -4,11 +4,10 @@ var sprite; function finishCreation() { if (component.status == Component.Ready) { - sprite = component.createObject(); + sprite = component.createObject(appWindow); if (sprite == null) { // Error Handling } else { - sprite.parent = appWindow; sprite.x = 100; sprite.y = 100; // ... @@ -32,13 +31,12 @@ else //![2] component = Qt.createComponent("Sprite.qml"); -sprite = component.createObject(); +sprite = component.createObject(appWindow); if (sprite == null) { // Error Handling console.log("Error loading component:", component.errorsString()); } else { - sprite.parent = appWindow; sprite.x = 100; sprite.y = 100; // ... @@ -47,5 +45,3 @@ if (sprite == null) { } -createSpriteObjects(); - diff --git a/doc/src/snippets/declarative/dynamicObjects.qml b/doc/src/snippets/declarative/dynamicObjects.qml index dd55d78..6a8c927 100644 --- a/doc/src/snippets/declarative/dynamicObjects.qml +++ b/doc/src/snippets/declarative/dynamicObjects.qml @@ -21,8 +21,7 @@ Rectangle { } function createRectangle() { - var object = rectComponent.createObject(); - object.parent = rootItem; + var object = rectComponent.createObject(rootItem); } Component.onCompleted: createRectangle() diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js index 3c1b975..08f5320 100644 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ b/examples/declarative/dynamic/qml/itemCreation.js @@ -42,8 +42,7 @@ function loadComponent() { function createItem() { if (itemComponent.status == Component.Ready && draggedItem == null) { - draggedItem = itemComponent.createObject(); - draggedItem.parent = window; + draggedItem = itemComponent.createObject(window); draggedItem.image = itemButton.image; draggedItem.x = xOffset; draggedItem.y = yOffset; diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js index bcfb5b6..0dbe6a6 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js @@ -41,13 +41,12 @@ function createBlock(column, row) { // Loading and we should wait for the component's statusChanged() signal to // know when the file is downloaded and ready before calling createObject(). if (component.status == Component.Ready) { - var dynamicObject = component.createObject(); + var dynamicObject = component.createObject(background); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } - dynamicObject.parent = background; dynamicObject.x = column * blockSize; dynamicObject.y = row * blockSize; dynamicObject.width = blockSize; diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js index 4256aee..e5ba6e0 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js @@ -38,14 +38,13 @@ function createBlock(column, row) { // Loading and we should wait for the component's statusChanged() signal to // know when the file is downloaded and ready before calling createObject(). if (component.status == Component.Ready) { - var dynamicObject = component.createObject(); + var dynamicObject = component.createObject(gameCanvas); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.parent = gameCanvas; dynamicObject.x = column * gameCanvas.blockSize; dynamicObject.y = row * gameCanvas.blockSize; dynamicObject.width = gameCanvas.blockSize; diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index 961cd66..159c9a7 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -49,14 +49,13 @@ function createBlock(column, row) { // Loading and we should wait for the component's statusChanged() signal to // know when the file is downloaded and ready before calling createObject(). if (component.status == Component.Ready) { - var dynamicObject = component.createObject(); + var dynamicObject = component.createObject(gameCanvas); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.parent = gameCanvas; dynamicObject.x = column * gameCanvas.blockSize; dynamicObject.targetX = column * gameCanvas.blockSize; dynamicObject.targetY = row * gameCanvas.blockSize; diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 3ca0707..e7b9c9e 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -59,6 +59,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -557,8 +558,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q /*! \internal A version of create which returns a scriptObject, for use in script + + Sets graphics object parent because forgetting to do this is a frequent + and serious problem. */ -QScriptValue QDeclarativeComponent::createObject() +QScriptValue QDeclarativeComponent::createObject(QObject* parent) { Q_D(QDeclarativeComponent); QDeclarativeContext* ctxt = creationContext(); @@ -567,6 +571,20 @@ QScriptValue QDeclarativeComponent::createObject() QObject* ret = create(ctxt); if (!ret) return QScriptValue(QScriptValue::NullValue); + + QGraphicsObject* gobj = qobject_cast(ret); + bool needParent = (gobj != 0); + if(parent){ + ret->setParent(parent); + QGraphicsObject* gparent = qobject_cast(parent); + if(gparent){ + gobj->setParentItem(gparent); + needParent = false; + } + } + if(needParent) + qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene."); + QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine); QDeclarativeData::get(ret, true)->setImplicitDestructible(); return priv->objectClass->newQObject(ret, QMetaType::QObjectStar); diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/declarative/qml/qdeclarativecomponent.h index b078174..688e233 100644 --- a/src/declarative/qml/qdeclarativecomponent.h +++ b/src/declarative/qml/qdeclarativecomponent.h @@ -109,7 +109,7 @@ Q_SIGNALS: protected: QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent); - Q_INVOKABLE QScriptValue createObject(); + Q_INVOKABLE QScriptValue createObject(QObject* parent); private: QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent); diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml index 3047e9b..7b132e1 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml @@ -11,7 +11,7 @@ MyQmlObject{ function createTwo() { var component = Qt.createComponent('dynamicCreation.helper.qml'); - obj.objectProperty = component.createObject(); + obj.objectProperty = component.createObject(obj); } function createThree() @@ -22,6 +22,6 @@ MyQmlObject{ function dontCrash() { var component = Qt.createComponent('file-doesnt-exist.qml'); - obj.objectProperty = component.createObject(); + obj.objectProperty = component.createObject(obj); } } -- cgit v0.12 From 053fcebb7ef1b3899b656d511437a8139ee012b7 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 6 May 2010 08:45:13 +1000 Subject: Initialize variable and crash less. --- tools/qml/qmlruntime.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 1229df2..fe0f67c 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -469,6 +469,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) , m_scriptOptions(0) , tester(0) , useQmlFileBrowser(true) + , translator(0) { QDeclarativeViewer::registerTypes(); setWindowTitle(tr("Qt Qml Runtime")); -- cgit v0.12 From 2df493e9f0660be7d9b5ba691883e13fa12cde72 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 6 May 2010 09:18:36 +1000 Subject: Fix compile in namespace. --- tools/qml/loggerwidget.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h index b68ecc5..fd20c41 100644 --- a/tools/qml/loggerwidget.h +++ b/tools/qml/loggerwidget.h @@ -86,8 +86,8 @@ private: Visibility m_visibility; }; -Q_DECLARE_METATYPE(LoggerWidget::Visibility); - QT_END_NAMESPACE +Q_DECLARE_METATYPE(LoggerWidget::Visibility) + #endif // LOGGERWIDGET_H -- cgit v0.12 From 8e023477777982d3aeb53d26ed61f7e8c1eb753c Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 6 May 2010 09:34:51 +1000 Subject: Another initialization fix. Unleak. --- tools/qml/main.cpp | 2 +- tools/qml/qmlruntime.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 78f0c87..fb687ac 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -54,7 +54,7 @@ QT_USE_NAMESPACE -QtMsgHandler systemMsgOutput; +QtMsgHandler systemMsgOutput = 0; #if defined (Q_OS_SYMBIAN) #include diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index fe0f67c..d49b0f1 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -543,6 +543,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) QDeclarativeViewer::~QDeclarativeViewer() { + delete loggerWindow; canvas->engine()->setNetworkAccessManagerFactory(0); delete namFactory; } -- cgit v0.12 From 2df39e548264617b8e10fae32bdafbfe2edcd895 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 6 May 2010 09:39:31 +1000 Subject: Fix some compiler warnings. --- src/declarative/qml/qdeclarativeengine.cpp | 46 +++++++++++++++--------------- src/declarative/qml/qdeclarativeinfo.cpp | 3 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 6ddd01e..cc6c5fe 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -962,7 +962,7 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS Q_ASSERT(context); if(ctxt->argumentCount() != 1) { - return ctxt->throwError("Qt.createComponent(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.createComponent(): Invalid arguments")); }else{ QString arg = ctxt->argument(0).toString(); if (arg.isEmpty()) @@ -982,7 +982,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QDeclarativeEngine* activeEngine = activeEnginePriv->q_func(); if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3) - return ctxt->throwError("Qt.createQmlObject(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Invalid arguments")); QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt); Q_ASSERT(context); @@ -1002,7 +1002,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); if(!parentArg) - return ctxt->throwError("Qt.createQmlObject(): Missing parent object"); + return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Missing parent object")); QDeclarativeComponent component(activeEngine); component.setData(qml.toUtf8(), url); @@ -1027,7 +1027,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS } if (!component.isReady()) - return ctxt->throwError("Qt.createQmlObject(): Component is not ready"); + return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Component is not ready")); QObject *obj = component.beginCreate(context->asQDeclarativeContext()); if(obj) @@ -1076,7 +1076,7 @@ QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScript QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 3) - return ctxt->throwError("Qt.vector(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.vector(): Invalid arguments")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); qsreal z = ctxt->argument(2).toNumber(); @@ -1087,7 +1087,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError("Qt.formatDate(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid arguments")); QDate date = ctxt->argument(0).toDateTime().date(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1098,7 +1098,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else { - return ctxt->throwError("Qt.formatDate(): Invalid date format"); + return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid date format")); } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); @@ -1108,7 +1108,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError("Qt.formatTime(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid arguments")); QTime date = ctxt->argument(0).toDateTime().time(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1119,7 +1119,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else { - return ctxt->throwError("Qt.formatTime(): Invalid time format"); + return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid time format")); } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); @@ -1129,7 +1129,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError("Qt.formatDateTime(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid arguments")); QDateTime date = ctxt->argument(0).toDateTime(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1140,7 +1140,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else { - return ctxt->throwError("Qt.formatDateTime(): Invalid datetime format"); + return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid datetime format")); } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); @@ -1150,7 +1150,7 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return ctxt->throwError("Qt.rgba(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.rgba(): Invalid arguments")); qsreal r = ctxt->argument(0).toNumber(); qsreal g = ctxt->argument(1).toNumber(); qsreal b = ctxt->argument(2).toNumber(); @@ -1172,7 +1172,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return ctxt->throwError("Qt.hsla(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.hsla(): Invalid arguments")); qsreal h = ctxt->argument(0).toNumber(); qsreal s = ctxt->argument(1).toNumber(); qsreal l = ctxt->argument(2).toNumber(); @@ -1193,7 +1193,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 4) - return ctxt->throwError("Qt.rect(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.rect(): Invalid arguments")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); @@ -1209,7 +1209,7 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError("Qt.point(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.point(): Invalid arguments")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QPointF(x, y))); @@ -1218,7 +1218,7 @@ QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngin QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError("Qt.size(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.size(): Invalid arguments")); qsreal w = ctxt->argument(0).toNumber(); qsreal h = ctxt->argument(1).toNumber(); return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QSizeF(w, h))); @@ -1227,7 +1227,7 @@ QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2) - return ctxt->throwError("Qt.lighter(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.lighter(): Invalid arguments")); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1249,7 +1249,7 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2) - return ctxt->throwError("Qt.darker(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.darker(): Invalid arguments")); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1282,7 +1282,7 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScriptEngine *e) { if(ctxt->argumentCount() != 0) - return ctxt->throwError("Qt.fontFamilies(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.fontFamilies(): Invalid arguments")); QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(e); QFontDatabase database; @@ -1292,7 +1292,7 @@ QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScri QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *) { if (ctxt->argumentCount() != 1) - return ctxt->throwError("Qt.md5(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.md5(): Invalid arguments")); QByteArray data = ctxt->argument(0).toString().toUtf8(); QByteArray result = QCryptographicHash::hash(data, QCryptographicHash::Md5); @@ -1303,7 +1303,7 @@ QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *) { if (ctxt->argumentCount() != 1) - return ctxt->throwError("Qt.btoa(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.btoa(): Invalid arguments")); QByteArray data = ctxt->argument(0).toString().toUtf8(); @@ -1313,7 +1313,7 @@ QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *) { if (ctxt->argumentCount() != 1) - return ctxt->throwError("Qt.atob(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.atob(): Invalid arguments")); QByteArray data = ctxt->argument(0).toString().toUtf8(); @@ -1414,7 +1414,7 @@ QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptE QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError("Qt.tint(): Invalid arguments"); + return ctxt->throwError(QLatin1String("Qt.tint(): Invalid arguments")); //get color QVariant v = ctxt->argument(0).toVariant(); QColor color; diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index ffed14e..c980a2a 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -78,8 +78,9 @@ QT_BEGIN_NAMESPACE \endcode */ -struct QDeclarativeInfoPrivate +class QDeclarativeInfoPrivate { +public: QDeclarativeInfoPrivate() : ref (1), object(0) {} int ref; -- cgit v0.12 From ac0b3eec9fbf25fb72d5368fa7ba31b58bb7ed30 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 6 May 2010 09:46:49 +1000 Subject: Doc: more clarification of cacheBuffer --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 3 +++ src/declarative/graphicsitems/qdeclarativelistview.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index ef6d3df..869826c 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1415,6 +1415,9 @@ void QDeclarativeGridView::setWrapEnabled(bool wrap) set to 40, then up to 2 delegates above and 2 delegates below the visible area may be retained. + Note that cacheBuffer is not a pixel buffer - it only maintains additional + instantiated delegates. + Setting this value can make scrolling the list smoother at the expense of additional memory usage. It is not a substitute for creating efficient delegates; the fewer elements in a delegate, the faster a view may be diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 8485071..0811278 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1848,6 +1848,9 @@ void QDeclarativeListView::setWrapEnabled(bool wrap) set to 40, then up to 2 delegates above and 2 delegates below the visible area may be retained. + Note that cacheBuffer is not a pixel buffer - it only maintains additional + instantiated delegates. + Setting this value can make scrolling the list smoother at the expense of additional memory usage. It is not a substitute for creating efficient delegates; the fewer elements in a delegate, the faster a view may be -- cgit v0.12 From c13db7e74887b648960161b5f4fa04ed8dfd3e64 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 10:16:25 +1000 Subject: doc fixes --- doc/src/declarative/animation.qdoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index 88aca1b..6e98949 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -73,9 +73,9 @@ Rectangle { y: 0 SequentialAnimation on y { loops: Animation.Infinite - NumberAnimation { to: 200-img.height; easing.type: "OutBounce"; duration: 2000 } + NumberAnimation { to: 200-img.height; easing.type: Easing.OutBounce; duration: 2000 } PauseAnimation { duration: 1000 } - NumberAnimation { to: 0; easing.type: "OutQuad"; duration: 1000 } + NumberAnimation { to: 0; easing.type: Easing.OutQuad; duration: 1000 } } } } @@ -136,7 +136,7 @@ transitions: [ Transition { NumberAnimation { properties: "x,y" - easing.type: "OutBounce" + easing.type: Easing.OutBounce duration: 200 } } @@ -157,7 +157,7 @@ Transition { SequentialAnimation { NumberAnimation { duration: 1000 - easing.type: "OutBounce" + easing.type: Easing.OutBounce // animate myItem's x and y if they have changed in the state target: myItem properties: "x,y" @@ -199,7 +199,7 @@ Transition { ParallelAnimation { NumberAnimation { duration: 1000 - easing.type: "OutBounce" + easing.type: Easing.OutBounce targets: box1 properties: "x,y" } @@ -227,7 +227,7 @@ Rectangle { id: redRect color: "red" width: 100; height: 100 - Behavior on x { NumberAnimation { duration: 300; easing.type: "InOutQuad" } } + Behavior on x { NumberAnimation { duration: 300; easing.type: Easing.InOutQuad } } } \endqml -- cgit v0.12 From d6da01355fb436a04932131373579938dc4b7d8d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 6 May 2010 10:49:57 +1000 Subject: Compile --- tests/auto/declarative/declarative.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 9b3b3d0..b8e33cf 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -29,7 +29,6 @@ SUBDIRS += \ qdeclarativeitem \ # Cover qdeclarativelistview \ # Cover qdeclarativeloader \ # Cover - qdeclarativelayouts \ # Cover qdeclarativemousearea \ # Cover qdeclarativeparticles \ # Cover qdeclarativepathview \ # Cover -- cgit v0.12 From c628213c5b64b50e914d173d207f4fe64629d5e2 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 6 May 2010 10:50:04 +1000 Subject: Add QML_XHR_DUMP option --- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index b7e1832..94205fe 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -46,6 +46,7 @@ #include "private/qdeclarativerefcount_p.h" #include "private/qdeclarativeengine_p.h" #include "private/qdeclarativeexpression_p.h" +#include "qdeclarativeglobal_p.h" #include #include @@ -94,6 +95,8 @@ QT_BEGIN_NAMESPACE +DEFINE_BOOL_CONFIG_OPTION(xhrDump, QML_XHR_DUMP); + class DocumentImpl; class NodeImpl { @@ -1131,6 +1134,14 @@ void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url) } } + if (xhrDump()) { + qWarning().nospace() << "XMLHttpRequest: " << qPrintable(m_method) << " " << qPrintable(url.toString()); + if (!m_data.isEmpty()) { + qWarning().nospace() << " " + << qPrintable(QString::fromUtf8(m_data)); + } + } + if (m_method == QLatin1String("GET")) m_network = networkAccessManager()->get(request); else if (m_method == QLatin1String("HEAD")) @@ -1264,6 +1275,16 @@ void QDeclarativeXMLHttpRequest::finished() if (cbv.isError()) printError(cbv); } m_responseEntityBody.append(m_network->readAll()); + + if (xhrDump()) { + qWarning().nospace() << "XMLHttpRequest: RESPONSE " << qPrintable(m_url.toString()); + if (!m_responseEntityBody.isEmpty()) { + qWarning().nospace() << " " + << qPrintable(QString::fromUtf8(m_responseEntityBody)); + } + } + + m_data.clear(); destroyNetwork(); if (m_state < Loading) { -- cgit v0.12 From 1eb430a1f1ddb3d88ec44294606b365e119b2e01 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 6 May 2010 10:55:13 +1000 Subject: Fix autotest --- tests/auto/declarative/examples/tst_examples.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index 058fda1..4f10a98 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -87,6 +87,7 @@ tst_examples::tst_examples() excludedDirs << "examples/declarative/gestures"; excludedDirs << "examples/declarative/imageprovider"; + excludedDirs << "examples/declarative/layouts/graphicsLayouts"; excludedDirs << "demos/declarative/minehunt"; excludedDirs << "doc/src/snippets/declarative/graphicswidgets"; -- cgit v0.12 From 4b0c60c6246fb7aacea3d74787a9e5a0cc507edd Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 6 May 2010 11:00:51 +1000 Subject: Add missing test file. --- .../qdeclarativevisualdatamodel/data/objectlist.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml new file mode 100644 index 0000000..f5198c9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml @@ -0,0 +1,16 @@ +import Qt 4.7 + +ListView { + width: 100 + height: 100 + anchors.fill: parent + model: myModel + delegate: Component { + Rectangle { + height: 25 + width: 100 + color: model.modelData.color + Text { objectName: "name"; text: name } + } + } +} -- cgit v0.12 From c16cc8c4d03cb062c5164295cad75509ec31feaf Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 11:16:45 +1000 Subject: Use enum for drag.axis in doc and examples. --- demos/declarative/flickr/common/Slider.qml | 2 +- doc/src/snippets/declarative/drag.qml | 2 +- examples/declarative/dial/dial-example.qml | 2 +- examples/declarative/mousearea/mouse.qml | 2 +- examples/declarative/slideswitch/content/Switch.qml | 2 +- examples/declarative/velocity/Day.qml | 2 +- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/demos/declarative/flickr/common/Slider.qml b/demos/declarative/flickr/common/Slider.qml index 4da370e..76f6303 100644 --- a/demos/declarative/flickr/common/Slider.qml +++ b/demos/declarative/flickr/common/Slider.qml @@ -29,7 +29,7 @@ Item { MouseArea { anchors.fill: parent; drag.target: parent - drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: slider.xMax+2 + drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2 onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; } } } diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml index 9465efb..79469e3 100644 --- a/doc/src/snippets/declarative/drag.qml +++ b/doc/src/snippets/declarative/drag.qml @@ -9,7 +9,7 @@ Rectangle { MouseArea { anchors.fill: parent drag.target: pic - drag.axis: "XAxis" + drag.axis: Drag.XAxis drag.minimumX: 0 drag.maximumX: blurtest.width-pic.width } diff --git a/examples/declarative/dial/dial-example.qml b/examples/declarative/dial/dial-example.qml index fd899a5..2e102b0 100644 --- a/examples/declarative/dial/dial-example.qml +++ b/examples/declarative/dial/dial-example.qml @@ -37,7 +37,7 @@ Rectangle { MouseArea { anchors.fill: parent - drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: container.width - 32 + drag.target: parent; drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: container.width - 32 } } } diff --git a/examples/declarative/mousearea/mouse.qml b/examples/declarative/mousearea/mouse.qml index 67302a8..06134b7 100644 --- a/examples/declarative/mousearea/mouse.qml +++ b/examples/declarative/mousearea/mouse.qml @@ -33,7 +33,7 @@ Rectangle { MouseArea { anchors.fill: parent drag.target: parent - drag.axis: "XAxis" + drag.axis: Drag.XAxis drag.minimumX: 0 drag.maximumX: 150 diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/slideswitch/content/Switch.qml index 1aa7696..526a171 100644 --- a/examples/declarative/slideswitch/content/Switch.qml +++ b/examples/declarative/slideswitch/content/Switch.qml @@ -45,7 +45,7 @@ Item { MouseArea { anchors.fill: parent - drag.target: knob; drag.axis: "XAxis"; drag.minimumX: 1; drag.maximumX: 78 + drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78 onClicked: toggle() onReleased: dorelease() } diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml index 433295b..350c1c4 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/velocity/Day.qml @@ -61,7 +61,7 @@ Component { id: mouse anchors.fill: parent drag.target: stickyPage - drag.axis: "XandYAxis" + drag.axis: Drag.XandYAxis drag.minimumY: 0 drag.maximumY: page.height - 80 drag.minimumX: 100 diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index d178107..c5a995e 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -746,7 +746,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() /*! \qmlproperty Item MouseArea::drag.target \qmlproperty bool MouseArea::drag.active - \qmlproperty Axis MouseArea::drag.axis + \qmlproperty enumeration MouseArea::drag.axis \qmlproperty real MouseArea::drag.minimumX \qmlproperty real MouseArea::drag.maximumX \qmlproperty real MouseArea::drag.minimumY @@ -757,7 +757,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() \list \i \c target specifies the item to drag. \i \c active specifies if the target item is being currently dragged. - \i \c axis specifies whether dragging can be done horizontally (XAxis), vertically (YAxis), or both (XandYAxis) + \i \c axis specifies whether dragging can be done horizontally (Drag.XAxis), vertically (Drag.YAxis), or both (Drag.XandYAxis) \i the minimum and maximum properties limit how far the target can be dragged along the corresponding axes. \endlist -- cgit v0.12 From 3e4116ff5337d41466904b2e381dfa74267264a8 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 12:42:36 +1000 Subject: Cleanup --- examples/declarative/animations/color-animation.qml | 5 ++--- examples/declarative/animations/property-animation.qml | 1 - examples/declarative/connections/connections-example.qml | 1 - examples/declarative/dynamic/qml/PerspectiveItem.qml | 3 +-- examples/declarative/listview/dynamic.qml | 16 +++++++--------- examples/declarative/parallax/qml/ParallaxView.qml | 15 +++++++-------- examples/declarative/parallax/qml/Smiley.qml | 3 +-- 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animations/color-animation.qml index 3616a31..61737e9 100644 --- a/examples/declarative/animations/color-animation.qml +++ b/examples/declarative/animations/color-animation.qml @@ -31,15 +31,14 @@ Item { // the sun, moon, and stars Item { width: parent.width; height: 2 * parent.height - transformOrigin: Item.Center NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite } Image { source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -3 * parent.rotation + rotation: -3 * parent.rotation } Image { source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -parent.rotation + rotation: -parent.rotation } Particles { x: 0; y: parent.height/2; width: parent.width; height: parent.height/2 diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animations/property-animation.qml index 6360511..87ac8ec 100644 --- a/examples/declarative/animations/property-animation.qml +++ b/examples/declarative/animations/property-animation.qml @@ -26,7 +26,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "images/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml index 1dd10ab..e65a280 100644 --- a/examples/declarative/connections/connections-example.qml +++ b/examples/declarative/connections/connections-example.qml @@ -13,7 +13,6 @@ Rectangle { id: image source: "content/bg1.jpg" anchors.centerIn: parent - transformOrigin: Item.Center rotation: window.angle Behavior on rotation { diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 3cbe64a..6d763c3 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -4,13 +4,12 @@ Image { id: tree property bool created: false property double scaleFactor: Math.max((y+height-250)*0.01, 0.3) - property double scaledBottom: y + (height+height*scaleFactor)/2 + property double scaledBottom: y + (height+height*scaleFactor)/2 property bool onLand: scaledBottom > window.height/2 property string image //Needed for compatibility with GenericItem opacity: onLand ? 1 : 0.25 onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } scale: scaleFactor - transformOrigin: "Center" source: image; smooth: true onYChanged: z = scaledBottom } diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index 236a9c5..952f6a7 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -56,7 +56,7 @@ Rectangle { Item { width: container.width; height: 55 - + Column { id: moveButtons x: 5; width: childrenRect.width; anchors.verticalCenter: parent.verticalCenter @@ -84,7 +84,7 @@ Rectangle { spacing: 5 Repeater { model: attributes - Component { + Component { Text { text: description; color: "White" } } } @@ -95,13 +95,12 @@ Rectangle { id: itemButtons anchors { right: removeButton.left; rightMargin: 35; verticalCenter: parent.verticalCenter } - width: childrenRect.width + width: childrenRect.width spacing: 10 Image { source: "content/pics/list-add.png" scale: clickUp.isPressed ? 0.9 : 1 - transformOrigin: Item.Center ClickAutoRepeating { id: clickUp @@ -115,9 +114,8 @@ Rectangle { Image { source: "content/pics/list-remove.png" scale: clickDown.isPressed ? 0.9 : 1 - transformOrigin: Item.Center - ClickAutoRepeating { + ClickAutoRepeating { id: clickDown anchors.fill: parent onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25)) @@ -158,7 +156,7 @@ Rectangle { } transitions: Transition { NumberAnimation { properties: "opacity"; duration: 400 } - } + } } Row { @@ -198,10 +196,10 @@ Rectangle { } } - Image { + Image { source: "content/pics/archive-remove.png" - MouseArea { + MouseArea { anchors.fill: parent onClicked: fruitModel.clear() } diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/parallax/qml/ParallaxView.qml index 4b38d45..e869a21 100644 --- a/examples/declarative/parallax/qml/ParallaxView.qml +++ b/examples/declarative/parallax/qml/ParallaxView.qml @@ -18,9 +18,9 @@ Item { id: list currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex + onCurrentIndexChanged: root.currentIndex = currentIndex - orientation: "Horizontal" + orientation: Qt.Horizontal boundsBehavior: Flickable.DragOverBounds anchors.fill: parent model: VisualItemModel { id: visualModel } @@ -45,10 +45,10 @@ Item { anchors.horizontalCenter: parent.horizontalCenter width: Math.min(count * 50, parent.width - 20) interactive: width == parent.width - 20 - orientation: "Horizontal" + orientation: Qt.Horizontal - delegate: Item { - width: 50; height: 50 + delegate: Item { + width: 50; height: 50 id: delegateRoot Image { @@ -56,7 +56,6 @@ Item { source: modelData.icon smooth: true scale: 0.8 - transformOrigin: "Center" } MouseArea { @@ -64,10 +63,10 @@ Item { onClicked: { root.currentIndex = index } } - states: State { + states: State { name: "Selected" when: delegateRoot.ListView.isCurrentItem == true - PropertyChanges { + PropertyChanges { target: image scale: 1 y: -5 diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/parallax/qml/Smiley.qml index cfa4fed..662addc 100644 --- a/examples/declarative/parallax/qml/Smiley.qml +++ b/examples/declarative/parallax/qml/Smiley.qml @@ -8,7 +8,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "../pics/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) @@ -32,7 +31,7 @@ Item { from: smiley.minHeight; to: smiley.maxHeight easing.type: Easing.OutExpo; duration: 300 } - + // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight -- cgit v0.12 From e909d9a200c7a75dc23542f4603ce86fdc135bab Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 13:11:48 +1000 Subject: Cleanup --- demos/declarative/snake/snake.qml | 6 +++--- demos/declarative/webbrowser/content/FlickableWebView.qml | 6 +++--- doc/src/declarative/elements.qdoc | 1 + examples/declarative/fonts/fonts.qml | 6 +++--- examples/declarative/listview/sections.qml | 2 +- examples/declarative/webview/alerts.qml | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index 47bced4..bc4a974 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -60,7 +60,7 @@ Rectangle { Image { id: title source: "content/pics/snake.jpg" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter @@ -69,7 +69,7 @@ Rectangle { Text { color: "white" font.pointSize: 24 - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter text: "Last Score:\t" + lastScore + "\nHighscore:\t" + highScores.topScore; anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom @@ -78,7 +78,7 @@ Rectangle { } source: "content/pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop anchors.left: parent.left anchors.right: parent.right diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 46f45e0..50ea97d 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -105,14 +105,14 @@ Flickable { property: "scale" from: 1 to: 0 // set before calling - easing.type: "Linear" + easing.type: Easing.Linear duration: 200 } NumberAnimation { id: flickVX target: flickable property: "contentX" - easing.type: "Linear" + easing.type: Easing.Linear duration: 200 from: 0 // set before calling to: 0 // set before calling @@ -121,7 +121,7 @@ Flickable { id: flickVY target: flickable property: "contentY" - easing.type: "Linear" + easing.type: Easing.Linear duration: 200 from: 0 // set before calling to: 0 // set before calling diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 79fe909..1dbc51b 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -142,6 +142,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt \o \l Loader \o \l Repeater \o \l SystemPalette +\o \l FontLoader \o \l LayoutItem \endlist diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml index ae31b03..f3eac48 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/fonts/fonts.qml @@ -51,9 +51,9 @@ Rectangle { } Text { text: { - if (webFont.status == 1) myText - else if (webFont.status == 2) "Loading..." - else if (webFont.status == 3) "Error loading font" + if (webFont.status == FontLoader.Ready) myText + else if (webFont.status == FontLoader.Loading) "Loading..." + else if (webFont.status == FontLoader.Error) "Error loading font" } color: "lightsteelblue" width: parent.width diff --git a/examples/declarative/listview/sections.qml b/examples/declarative/listview/sections.qml index 0a81f63..21f9f03 100644 --- a/examples/declarative/listview/sections.qml +++ b/examples/declarative/listview/sections.qml @@ -61,7 +61,7 @@ Rectangle { height: 20 Text { x: 2; height: parent.height - verticalAlignment: 'AlignVCenter' + verticalAlignment: Text.AlignVCenter text: section font.bold: true } diff --git a/examples/declarative/webview/alerts.qml b/examples/declarative/webview/alerts.qml index 6a5a0d2..7684c3e 100644 --- a/examples/declarative/webview/alerts.qml +++ b/examples/declarative/webview/alerts.qml @@ -52,7 +52,7 @@ WebView { font.pixelSize: 20 width: webView.width*0.75 wrapMode: Text.WordWrap - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter } } } -- cgit v0.12 From 2dfa4fbcdc901b8cdd8df0087ecf5e3fa2523603 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 14:14:36 +1000 Subject: More cleanup --- demos/declarative/flickr/mobile/GridDelegate.qml | 2 +- demos/declarative/flickr/mobile/ImageDetails.qml | 12 ++++++++---- demos/declarative/twitter/TwitterCore/FatDelegate.qml | 2 +- demos/declarative/twitter/TwitterCore/HomeTitleBar.qml | 2 +- examples/declarative/listview/dynamic.qml | 2 +- examples/declarative/listview/itemlist.qml | 4 ++-- examples/declarative/listview/listview-example.qml | 4 ++-- examples/declarative/scrollbar/ScrollBar.qml | 16 ++++++++-------- examples/declarative/scrollbar/display.qml | 4 ++-- 9 files changed, 26 insertions(+), 22 deletions(-) diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index eccdc34..df608bc 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -38,7 +38,7 @@ states: [ State { - name: "Show"; when: thumb.status == 1 + name: "Show"; when: thumb.status == Image.Ready PropertyChanges { target: scaleMe; scale: 1 } }, State { diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 310c9df..caf1571 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -54,7 +54,11 @@ Flipable { Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 } - Common.Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 } + Common.Progress { + anchors.centerIn: parent; width: 200; height: 18 + progress: bigImage.progress; visible: bigImage.status != Image.Ready + } + Flickable { id: flickable; anchors.fill: parent; clip: true contentWidth: imageContainer.width; contentHeight: imageContainer.height @@ -69,7 +73,7 @@ Flipable { anchors.centerIn: parent; smooth: !flickable.moving onStatusChanged : { // Default scale shows the entire image. - if (status == 1 && width != 0) { + if (status == Image.Ready && width != 0) { slider.minimum = Math.min(flickable.width / width, flickable.height / height); prevScale = Math.min(slider.minimum, 1); slider.value = prevScale; @@ -81,12 +85,12 @@ Flipable { Text { text: "Image Unavailable" - visible: bigImage.status == 'Error' + visible: bigImage.status == Image.Error anchors.centerIn: parent; color: "white"; font.bold: true } Common.Slider { - id: slider; visible: { bigImage.status == 1 && maximum > minimum } + id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum } anchors { bottom: parent.bottom; bottomMargin: 65 left: parent.left; leftMargin: 25 diff --git a/demos/declarative/twitter/TwitterCore/FatDelegate.qml b/demos/declarative/twitter/TwitterCore/FatDelegate.qml index 62ee11a..72e5ecc 100644 --- a/demos/declarative/twitter/TwitterCore/FatDelegate.qml +++ b/demos/declarative/twitter/TwitterCore/FatDelegate.qml @@ -27,7 +27,7 @@ Component { id: whiteRect; x: 6; width: 50; height: 50; color: "white"; smooth: true anchors.verticalCenter: parent.verticalCenter - Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != 1 } + Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready } Image { id: realImage; source: userImage; x: 1; y: 1; width:48; height:48 } } Text { id:txt; y:4; x: 56 diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index 11aa74f..26ad1a9 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -37,7 +37,7 @@ Item { UserModel { user: rssModel.authName; id: userModel } Component { id: imgDelegate; Item { - Loading { width:48; height:48; visible: realImage.status != 1 } + Loading { width:48; height:48; visible: realImage.status != Image.Ready } Image { source: image; width:48; height:48; id: realImage } } } diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index 952f6a7..9b05ad5 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -145,7 +145,7 @@ Rectangle { width: 8; height: view.height; anchors.right: view.right opacity: 0 - orientation: "Vertical" + orientation: Qt.Vertical position: view.visibleArea.yPosition pageSize: view.visibleArea.heightRatio diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/listview/itemlist.qml index e387f28..b73b3a3 100644 --- a/examples/declarative/listview/itemlist.qml +++ b/examples/declarative/listview/itemlist.qml @@ -33,7 +33,7 @@ Rectangle { anchors { fill: parent; bottomMargin: 30 } model: itemModel preferredHighlightBegin: 0; preferredHighlightEnd: 0 - highlightRangeMode: "StrictlyEnforceRange" + highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem; flickDeceleration: 2000 } @@ -55,7 +55,7 @@ Rectangle { radius: 3 color: view.currentIndex == index ? "blue" : "white" - MouseArea { + MouseArea { width: 20; height: 20 anchors.centerIn: parent onClicked: view.currentIndex = index diff --git a/examples/declarative/listview/listview-example.qml b/examples/declarative/listview/listview-example.qml index 6feedf6..2e8cdda 100644 --- a/examples/declarative/listview/listview-example.qml +++ b/examples/declarative/listview/listview-example.qml @@ -75,7 +75,7 @@ Rectangle { highlight: petHighlight currentIndex: list1.currentIndex preferredHighlightBegin: 80; preferredHighlightEnd: 220 - highlightRangeMode: "ApplyRange" + highlightRangeMode: ListView.ApplyRange } ListView { @@ -87,7 +87,7 @@ Rectangle { highlight: Rectangle { color: "lightsteelblue" } currentIndex: list1.currentIndex preferredHighlightBegin: 125; preferredHighlightEnd: 125 - highlightRangeMode: "StrictlyEnforceRange" + highlightRangeMode: ListView.StrictlyEnforceRange flickDeceleration: 1000 } } diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml index 5433156..c628a20 100644 --- a/examples/declarative/scrollbar/ScrollBar.qml +++ b/examples/declarative/scrollbar/ScrollBar.qml @@ -7,26 +7,26 @@ Item { // position and pageSize are in the range 0.0 - 1.0. They are relative to the // height of the page, i.e. a pageSize of 0.5 means that you can see 50% // of the height of the view. - // orientation can be either 'Vertical' or 'Horizontal' + // orientation can be either Qt.Vertical or Qt.Horizontal property real position property real pageSize - property variant orientation : "Vertical" + property variant orientation : Qt.Vertical // A light, semi-transparent background Rectangle { id: background anchors.fill: parent - radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1) + radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) color: "white" opacity: 0.3 } // Size the bar to the required size, depending upon the orientation. Rectangle { - x: orientation == 'Vertical' ? 1 : (scrollBar.position * (scrollBar.width-2) + 1) - y: orientation == 'Vertical' ? (scrollBar.position * (scrollBar.height-2) + 1) : 1 - width: orientation == 'Vertical' ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2)) - height: orientation == 'Vertical' ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2) - radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1) + x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1) + y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1 + width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2)) + height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2) + radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) color: "black" opacity: 0.7 } diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/scrollbar/display.qml index cb1da16..b8a5e36 100644 --- a/examples/declarative/scrollbar/display.qml +++ b/examples/declarative/scrollbar/display.qml @@ -37,7 +37,7 @@ Rectangle { width: 12; height: view.height-12 anchors.right: view.right opacity: 0 - orientation: "Vertical" + orientation: Qt.Vertical position: view.visibleArea.yPosition pageSize: view.visibleArea.heightRatio } @@ -47,7 +47,7 @@ Rectangle { width: view.width-12; height: 12 anchors.bottom: view.bottom opacity: 0 - orientation: "Horizontal" + orientation: Qt.Horizontal position: view.visibleArea.xPosition pageSize: view.visibleArea.widthRatio } -- cgit v0.12 From f95a53ec1f88f819424aa3e894f91c1b875fd749 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 6 May 2010 14:29:27 +1000 Subject: Make sure to call base class implementation. --- src/declarative/graphicsitems/qdeclarativepainteditem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp index 6430fae..ce9b69f 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp +++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp @@ -210,6 +210,7 @@ void QDeclarativePaintedItem::geometryChanged(const QRectF &newGeometry, if (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height()) clearCache(); + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); } QVariant QDeclarativePaintedItem::itemChange(GraphicsItemChange change, -- cgit v0.12 From 3323eb86586240d8ddcde985d052478809a6bffb Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 15:01:36 +1000 Subject: TextInput echoMode doc. --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index a1fa8c6..9ae4e1a 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -706,14 +706,15 @@ bool QDeclarativeTextInput::hasAcceptableInput() const } /*! - \qmlproperty TextInput.EchoMode TextInput::echoMode + \qmlproperty enumeration TextInput::echoMode Specifies how the text should be displayed in the TextInput. - The default is Normal, which displays the text as it is. Other values - are Password, which displays asterixes instead of characters, NoEcho, - which displays nothing, and PasswordEchoOnEdit, which displays all but the - current character as asterixes. - + \list + \o TextInput.Normal - Displays the text as it is. (Default) + \o TextInput.Password - Displays asterixes instead of characters. + \o TextInput.NoEcho - Displays nothing. + \o TextInput.PasswordEchoOnEdit - Displays all but the current character as asterixes. + \endlist */ QDeclarativeTextInput::EchoMode QDeclarativeTextInput::echoMode() const { @@ -1084,7 +1085,7 @@ void QDeclarativeTextInput::setPasswordCharacter(const QString &str) \qmlproperty string TextInput::displayText This is the text displayed in the TextInput. - + If \l echoMode is set to TextInput::Normal, this holds the same value as the TextInput::text property. Otherwise, this property holds the text visible to the user, while -- cgit v0.12 From d0a56df355cebc60176c3f449c1aee7bafd5562b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 15:52:38 +1000 Subject: qdoc fixes --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeitem.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativepathview.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 +- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 12 ++++++------ 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 869826c..0094213 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1054,7 +1054,7 @@ void QDeclarativeGridView::setModel(const QVariant &model) } /*! - \qmlproperty component GridView::delegate + \qmlproperty Component GridView::delegate The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible \c index property. Properties of the @@ -1172,7 +1172,7 @@ int QDeclarativeGridView::count() const } /*! - \qmlproperty component GridView::highlight + \qmlproperty Component GridView::highlight This property holds the component to use as the highlight. An instance of the highlight component will be created for each view. diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 0395766..9433ba0 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -720,7 +720,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event) */ /*! - \qmlproperty List Keys::forwardTo + \qmlproperty list Keys::forwardTo This property provides a way to forward key presses, key releases, and keyboard input coming from input methods to other items. This can be useful when you want diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 0811278..cff345e 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1488,7 +1488,7 @@ void QDeclarativeListView::setModel(const QVariant &model) } /*! - \qmlproperty component ListView::delegate + \qmlproperty Component ListView::delegate The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible \c index property. Properties of the @@ -1608,7 +1608,7 @@ int QDeclarativeListView::count() const } /*! - \qmlproperty component ListView::highlight + \qmlproperty Component ListView::highlight This property holds the component to use as the highlight. An instance of the highlight component will be created for each list. diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 5c3a3c0..040fc98 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -561,7 +561,7 @@ void QDeclarativePathViewPrivate::setOffset(qreal o) } /*! - \qmlproperty component PathView::highlight + \qmlproperty Component PathView::highlight This property holds the component to use as the highlight. An instance of the highlight component will be created for each view. @@ -790,7 +790,7 @@ void QDeclarativePathView::setInteractive(bool interactive) } /*! - \qmlproperty component PathView::delegate + \qmlproperty Component PathView::delegate The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible \c index property. Properties of the diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index d0ee2ee..d095dbe 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -728,7 +728,7 @@ void QDeclarativeTextEdit::setPersistentSelection(bool on) } /* - \qmlproperty number TextEdit::textMargin + \qmlproperty real TextEdit::textMargin The margin, in pixels, around the text in the TextEdit. */ diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index f01d4c2..306443b 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -759,7 +759,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) } /*! - \qmlproperty component VisualDataModel::delegate + \qmlproperty Component VisualDataModel::delegate The delegate provides a template defining each item instantiated by a view. The index is exposed as an accessible \c index property. Properties of the diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 206621b..0f7c946 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -755,7 +755,7 @@ void QDeclarativeScriptAction::setScript(const QDeclarativeScriptString &script) } /*! - \qmlproperty QString ScriptAction::scriptName + \qmlproperty string ScriptAction::scriptName This property holds the the name of the StateChangeScript to run. This property is only valid when ScriptAction is used as part of a transition. @@ -791,7 +791,7 @@ void QDeclarativeScriptActionPrivate::execute() if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expr.evaluate(); - if (expr.hasError()) + if (expr.hasError()) qmlInfo(q) << expr.error(); } } @@ -844,7 +844,7 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation() The PropertyAction is immediate - the target property is not animated to the selected value in any way. - + \sa QtDeclarative */ /*! @@ -2347,7 +2347,7 @@ QDeclarativeParentAnimation::~QDeclarativeParentAnimation() } /*! - \qmlproperty item ParentAnimation::target + \qmlproperty Item ParentAnimation::target The item to reparent. When used in a transition, if no target is specified all @@ -2370,7 +2370,7 @@ void QDeclarativeParentAnimation::setTarget(QDeclarativeItem *target) } /*! - \qmlproperty item ParentAnimation::newParent + \qmlproperty Item ParentAnimation::newParent The new parent to animate to. If not set, then the parent defined in the end state of the transition. @@ -2392,7 +2392,7 @@ void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent) } /*! - \qmlproperty item ParentAnimation::via + \qmlproperty Item ParentAnimation::via The item to reparent via. This provides a way to do an unclipped animation when both the old parent and new parent are clipped -- cgit v0.12 From bf965a3b74a10636a63f72d72ad41e169a9851e3 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 6 May 2010 16:16:08 +1000 Subject: Avoid warnings as delegates with bindings to parent are created and destroyed. Task-number: QTBUG-10359 --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 4 +++- src/declarative/graphicsitems/qdeclarativelistview.cpp | 4 +++- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 8 ++++++++ src/declarative/qml/qdeclarativecontext.cpp | 17 +++++++++++------ src/declarative/qml/qdeclarativecontext_p.h | 1 + src/declarative/qml/qdeclarativeengine.cpp | 4 +++- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 869826c..75b9d3c 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -378,9 +378,11 @@ FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex) if (model->completePending()) { // complete listItem->item->setZValue(1); + listItem->item->setParentItem(q->viewport()); model->completeItem(); + } else { + listItem->item->setParentItem(q->viewport()); } - listItem->item->setParentItem(q->viewport()); unrequestedItems.remove(listItem->item); } requestedIndex = -1; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 0811278..064a33f 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -573,9 +573,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex) if (model->completePending()) { // complete listItem->item->setZValue(1); + listItem->item->setParentItem(q->viewport()); model->completeItem(); + } else { + listItem->item->setParentItem(q->viewport()); } - listItem->item->setParentItem(q->viewport()); QDeclarativeItemPrivate *itemPrivate = static_cast(QGraphicsItemPrivate::get(item)); itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry); if (sectionCriteria && sectionCriteria->delegate()) { diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index f01d4c2..c6a6b81 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -44,6 +44,7 @@ #include "qdeclarativeitem.h" #include +#include #include #include #include @@ -963,6 +964,13 @@ QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(Q } if (d->m_cache.releaseItem(obj)) { + // Remove any bindings to avoid warnings due to parent change. + QObjectPrivate *p = QObjectPrivate::get(obj); + Q_ASSERT(p->declarativeData); + QDeclarativeData *d = static_cast(p->declarativeData); + if (d->ownContext && d->context) + d->context->clearExpressions(); + if (inPackage) { emit destroyingPackage(qobject_cast(obj)); } else { diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index ae4223e..b61b8cb 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -528,13 +528,8 @@ void QDeclarativeContextData::invalidate() parent = 0; } -void QDeclarativeContextData::destroy() +void QDeclarativeContextData::clearExpressions() { - if (linkedContext) - linkedContext->destroy(); - - if (engine) invalidate(); - QDeclarativeAbstractExpression *expression = expressions; while (expression) { QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression; @@ -546,6 +541,16 @@ void QDeclarativeContextData::destroy() expression = nextExpression; } expressions = 0; +} + +void QDeclarativeContextData::destroy() +{ + if (linkedContext) + linkedContext->destroy(); + + if (engine) invalidate(); + + clearExpressions(); while (contextObjects) { QDeclarativeData *co = contextObjects; diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index c7fb099..6b6cd0a 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -113,6 +113,7 @@ class QDeclarativeContextData public: QDeclarativeContextData(); QDeclarativeContextData(QDeclarativeContext *); + void clearExpressions(); void destroy(); void invalidate(); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index cc6c5fe..9f5cafe 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -329,8 +329,10 @@ void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o) QObjectPrivate *p = QObjectPrivate::get(o); Q_ASSERT(p->declarativeData); QDeclarativeData *d = static_cast(p->declarativeData); - if (d->ownContext) + if (d->ownContext && d->context) { d->context->destroy(); + d->context = 0; + } } void QDeclarativeData::destroyed(QAbstractDeclarativeData *d, QObject *o) -- cgit v0.12 From d1ab59da5de38ce0df0e6b9961fc5bf6580e5607 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 6 May 2010 17:04:55 +1000 Subject: qdoc fixes. --- doc/src/declarative/elements.qdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 1dbc51b..574a187 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -120,11 +120,22 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt \list \o \l Item \o \l Rectangle + \list + \o \l Gradient + \list + \o \l GradientStop + \endlist + \endlist \o \l Image \o \l BorderImage \o \l AnimatedImage \o \l Text \o \l TextInput + \list + \o \l IntValidator + \o \l DoubleValidator + \o \l RegExpValidator + \endlist \o \l TextEdit \endlist -- cgit v0.12 From a0ff96a8fd1cbf1206afd12e0062949fa035f64f Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 6 May 2010 17:42:53 +1000 Subject: Call QDeclarativeItem::geometryChanged() base implementation --- src/declarative/graphicsitems/qdeclarativepainteditem.cpp | 2 ++ .../qdeclarativetextedit/data/geometrySignals.qml | 12 ++++++++++++ .../qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 13 ++++++++++++- .../qdeclarativetextinput/data/geometrySignals.qml | 12 ++++++++++++ .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 11 +++++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml create mode 100644 tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp index 6430fae..c4f0b86 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp +++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp @@ -210,6 +210,8 @@ void QDeclarativePaintedItem::geometryChanged(const QRectF &newGeometry, if (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height()) clearCache(); + + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); } QVariant QDeclarativePaintedItem::itemChange(GraphicsItemChange change, diff --git a/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml new file mode 100644 index 0000000..b39ba5b --- /dev/null +++ b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml @@ -0,0 +1,12 @@ +import Qt 4.7 + +Item { + width: 400; height: 500; + property int bindingWidth: text.width + property int bindingHeight: text.height + + TextInput { + id: text + anchors.fill: parent + } +} diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 3307b7c..8cc0e3f 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -84,7 +84,7 @@ private slots: void navigation(); void readOnly(); void sendRequestSoftwareInputPanelEvent(); - + void geometrySignals(); private: void simulateKey(QDeclarativeView *, int key); QDeclarativeView *createView(const QString &filename); @@ -808,6 +808,17 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent() QApplication::processEvents(); QCOMPARE(ic.softwareInputPanelEventReceived, true); } + +void tst_qdeclarativetextedit::geometrySignals() +{ + QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml"); + QObject *o = component.create(); + QVERIFY(o); + QCOMPARE(o->property("bindingWidth").toInt(), 400); + QCOMPARE(o->property("bindingHeight").toInt(), 500); + delete o; +} + QTEST_MAIN(tst_qdeclarativetextedit) #include "tst_qdeclarativetextedit.moc" diff --git a/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml new file mode 100644 index 0000000..a9b50fe --- /dev/null +++ b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml @@ -0,0 +1,12 @@ +import Qt 4.7 + +Item { + width: 400; height: 500; + property int bindingWidth: text.width + property int bindingHeight: text.height + + TextEdit { + id: text + anchors.fill: parent + } +} diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 83ebe6c..0065ccf 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -76,6 +76,7 @@ private slots: void focusOutClearSelection(); void echoMode(); + void geometrySignals(); private: void simulateKey(QDeclarativeView *, int key); QDeclarativeView *createView(const QString &filename); @@ -805,6 +806,16 @@ void tst_qdeclarativetextinput::focusOutClearSelection() QTRY_COMPARE(input.selectedText(), QLatin1String("")); } +void tst_qdeclarativetextinput::geometrySignals() +{ + QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml"); + QObject *o = component.create(); + QVERIFY(o); + QCOMPARE(o->property("bindingWidth").toInt(), 400); + QCOMPARE(o->property("bindingHeight").toInt(), 500); + delete o; +} + QTEST_MAIN(tst_qdeclarativetextinput) #include "tst_qdeclarativetextinput.moc" -- cgit v0.12 From 4620b0fc7a48c643400a42eb9e9cc0a82ad0be9a Mon Sep 17 00:00:00 2001 From: Robin Helgelin Date: Wed, 21 Apr 2010 12:14:02 +0200 Subject: Keep support for maximum pending connections in derived QTcpServer By adding a new function to the class QTcpServer it's now possible to extend QTcpserver functionality with for instance SSL capabilities and still keep the support for maximum pending connections. Task-number: QTBUG-1875 Reviewed-by: Peter Hartmann Reviewed-by: Markus Goetz Merge-Request: 568 --- src/network/socket/qtcpserver.cpp | 15 +++++++++++++++ src/network/socket/qtcpserver.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index 932126d..a259eee 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -572,6 +572,21 @@ void QTcpServer::incomingConnection(int socketDescriptor) QTcpSocket *socket = new QTcpSocket(this); socket->setSocketDescriptor(socketDescriptor); + addPendingConnection(socket); +} + +/*! + This function is called by QTcpServer::incomingConnection() + to add a socket to the list of pending incoming connections. + + \note Don't forget to call this member from reimplemented + incomingConnection() if you do not want to break the + Pending Connections mechanism. + + \sa incomingConnection() +*/ +void QTcpServer::addPendingConnection(QTcpSocket* socket) +{ d_func()->pendingConnections.append(socket); } diff --git a/src/network/socket/qtcpserver.h b/src/network/socket/qtcpserver.h index 7aebffe..b206678 100644 --- a/src/network/socket/qtcpserver.h +++ b/src/network/socket/qtcpserver.h @@ -93,6 +93,7 @@ public: protected: virtual void incomingConnection(int handle); + void addPendingConnection(QTcpSocket* socket); Q_SIGNALS: void newConnection(); -- cgit v0.12 From efb26a325dcea5e60d7801fef00e650bd028c16d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 6 May 2010 09:57:19 +0200 Subject: QTcpServer: Fix documentation for previous commit --- src/network/socket/qtcpserver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index a259eee..55f926d 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -562,7 +562,7 @@ QTcpSocket *QTcpServer::nextPendingConnection() to the other thread and create the QTcpSocket object there and use its setSocketDescriptor() method. - \sa newConnection(), nextPendingConnection() + \sa newConnection(), nextPendingConnection(), addPendingConnection() */ void QTcpServer::incomingConnection(int socketDescriptor) { @@ -584,6 +584,7 @@ void QTcpServer::incomingConnection(int socketDescriptor) Pending Connections mechanism. \sa incomingConnection() + \since 4.7 */ void QTcpServer::addPendingConnection(QTcpSocket* socket) { -- cgit v0.12 From ae786d63683db1aea1a4ad7eea2c4e20d5c1752d Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 4 May 2010 16:03:27 +0200 Subject: isOnActiveSpace is available from 10.6. The fix for qtcreatorbug-827 included a call to isOnActiveSpace, which is only available from 10.6 so this patch adds a runtime check for it. Since it is a runtime check there is no need for multiple builds. Notice that the fix for qtcreatorbug-827 will work only on 10.6+ Task-number: QTCREATORBUG-827 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 81dd746..f12c956 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3835,13 +3835,20 @@ void QWidgetPrivate::raise_sys() // required we will introduce special handling for some of them. if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) { OSWindowRef window = qt_mac_window_for(q); - if(![window isOnActiveSpace]) { - QWidget *parentWidget = q->parentWidget(); - if(parentWidget) { - OSWindowRef parentWindow = qt_mac_window_for(parentWidget); - if(parentWindow && [parentWindow isOnActiveSpace]) { - recreateMacWindow(); - window = qt_mac_window_for(q); + // isOnActiveSpace is available only from 10.6 onwards, so we need to check if it is + // available before calling it. + if([window respondsToSelector:@selector(isOnActiveSpace)]) { + if(![window performSelector:@selector(isOnActiveSpace)]) { + QWidget *parentWidget = q->parentWidget(); + if(parentWidget) { + OSWindowRef parentWindow = qt_mac_window_for(parentWidget); + if(parentWindow && [parentWindow isOnActiveSpace]) { + // The window was created in a different space. Therefore if we want + // to show it in the current space we need to recreate it in the new + // space. + recreateMacWindow(); + window = qt_mac_window_for(q); + } } } } -- cgit v0.12 From 250f7a34d3b1e6b946f2bfc7ce69c135e426b204 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 6 May 2010 13:47:32 +0300 Subject: Fix thread synchronization issues in Symbian QFileSystemWatcher In Symbian the QSymbianFileSystemWatcherEngine thread now stays running as long as the instance is alive to avoid repeatedly stopping and restarting the thread as watched paths are removed and added. Also fixed issue of misreporting adding failure in cases where both adds and removes were done in quick succession. Task-number: QTBUG-10091 Reviewed-by: Shane Kearns --- src/corelib/io/qfilesystemwatcher_symbian.cpp | 63 +++++++++------------------ src/corelib/io/qfilesystemwatcher_symbian_p.h | 6 +-- 2 files changed, 24 insertions(+), 45 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index 69daae7..6136742 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -106,7 +106,7 @@ void QNotifyChangeEvent::DoCancel() } QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() : - errorCode(KErrNone), watcherStarted(false) + watcherStarted(false) { moveToThread(this); } @@ -122,11 +122,7 @@ QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths, QMutexLocker locker(&mutex); QStringList p = paths; - if (!startWatcher()) { - qWarning("Could not start QSymbianFileSystemWatcherEngine thread"); - - return p; - } + startWatcher(); QMutableListIterator it(p); while (it.hasNext()) { @@ -150,18 +146,17 @@ QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths, filePath += QChar(L'/'); } - currentEvent = NULL; + currentAddEvent = NULL; QMetaObject::invokeMethod(this, "addNativeListener", Qt::QueuedConnection, Q_ARG(QString, filePath)); syncCondition.wait(&mutex); + if (currentAddEvent) { + currentAddEvent->isDir = isDir; - if (currentEvent) { - currentEvent->isDir = isDir; - - activeObjectToPath.insert(currentEvent, path); + activeObjectToPath.insert(currentAddEvent, path); it.remove(); if (isDir) @@ -185,10 +180,10 @@ QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &path while (it.hasNext()) { QString path = it.next(); - currentEvent = activeObjectToPath.key(path); - if (!currentEvent) + currentRemoveEvent = activeObjectToPath.key(path); + if (!currentRemoveEvent) continue; - activeObjectToPath.remove(currentEvent); + activeObjectToPath.remove(currentRemoveEvent); QMetaObject::invokeMethod(this, "removeNativeListener", @@ -202,9 +197,6 @@ QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &path directories->removeAll(path); } - if (activeObjectToPath.size() == 0) - stop(); - return p; } @@ -228,44 +220,31 @@ void QSymbianFileSystemWatcherEngine::stop() } // This method must be called inside mutex -bool QSymbianFileSystemWatcherEngine::startWatcher() +void QSymbianFileSystemWatcherEngine::startWatcher() { - bool retval = true; - if (!watcherStarted) { setStackSize(0x5000); start(); syncCondition.wait(&mutex); - - if (errorCode != KErrNone) { - retval = false; - } else { - watcherStarted = true; - } + watcherStarted = true; } - return retval; } void QSymbianFileSystemWatcherEngine::run() { - // Initialize file session - mutex.lock(); syncCondition.wakeOne(); mutex.unlock(); - if (errorCode == KErrNone) { - exec(); + exec(); - foreach(QNotifyChangeEvent *e, activeObjectToPath.keys()) { - e->Cancel(); - delete e; - } - - activeObjectToPath.clear(); - watcherStarted = false; + foreach(QNotifyChangeEvent *e, activeObjectToPath.keys()) { + e->Cancel(); + delete e; } + + activeObjectToPath.clear(); } void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath) @@ -273,16 +252,16 @@ void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directory QMutexLocker locker(&mutex); QString nativeDir(QDir::toNativeSeparators(directoryPath)); TPtrC ptr(qt_QString2TPtrC(nativeDir)); - currentEvent = new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive)); + currentAddEvent = new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive)); syncCondition.wakeOne(); } void QSymbianFileSystemWatcherEngine::removeNativeListener() { QMutexLocker locker(&mutex); - currentEvent->Cancel(); - delete currentEvent; - currentEvent = NULL; + currentRemoveEvent->Cancel(); + delete currentRemoveEvent; + currentRemoveEvent = NULL; syncCondition.wakeOne(); } diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h index 7e3f045..e687a4a 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian_p.h +++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h @@ -113,14 +113,14 @@ private: friend class QNotifyChangeEvent; void emitPathChanged(QNotifyChangeEvent *e); - bool startWatcher(); + void startWatcher(); QHash activeObjectToPath; QMutex mutex; QWaitCondition syncCondition; - int errorCode; bool watcherStarted; - QNotifyChangeEvent *currentEvent; + QNotifyChangeEvent *currentAddEvent; + QNotifyChangeEvent *currentRemoveEvent; }; #endif // QT_NO_FILESYSTEMWATCHER -- cgit v0.12 From fdee454d73c2a1c255e8315d35df663ab726e4db Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:08:07 +0200 Subject: cosmetics: change enum value the existing values are fixed-point representations of the msvc versions, so adhere to it. --- qmake/generators/win32/msvc_objectmodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 3f60a13..97f8570 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -59,7 +59,7 @@ enum DotNET { NET2003 = 0x71, NET2005 = 0x80, NET2008 = 0x90, - NET2010 = 0x91 + NET2010 = 0xa0 }; /* -- cgit v0.12 From 1c79ac10db1cf2b413ea3872641faec134664b8e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:08:46 +0200 Subject: remove extraneous return statement --- qmake/generators/win32/msvc_vcxproj.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index da93fe3..05c1511 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -89,7 +89,6 @@ bool VcxprojGenerator::writeMakefile(QTextStream &t) return true; } return project->isActiveConfig("build_pass"); - return true; } -- cgit v0.12 From 106d8714fa9e09ef7e71c71c02a226c9a91d09f2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:09:34 +0200 Subject: fix qmake project file following msvc2010 addition this is relevant only for maintainers, but still. --- qmake/qmake.pri | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 0163839..6e0f8a2 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -13,7 +13,8 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/xmloutput.cpp generators/win32/borland_bmake.cpp \ generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \ generators/win32/msvc_vcproj.cpp \ - generators/win32/msvc_objectmodel.cpp \ + generators/win32/msvc_vcxproj.cpp \ + generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp \ generators/symbian/symbiancommon.cpp \ generators/symbian/symmake.cpp \ generators/symbian/symmake_abld.cpp \ @@ -24,11 +25,12 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ - generators/win32/winmakefile.h generators/projectgenerator.h \ + generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \ generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \ generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \ generators/win32/msvc_vcproj.h \ - generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \ + generators/win32/msvc_vcxproj.h \ + generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h \ generators/symbian/symbiancommon.h \ generators/symbian/symmake.h \ generators/symbian/symmake_abld.h \ -- cgit v0.12 From 86260a117c9ce64d3dee71ab241559c0529f2ef5 Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Thu, 6 May 2010 14:11:32 +0200 Subject: Fix syntax error in configure script ./configure: line 5883: [: missing `]' ./configure: line 5883: no: command not found It's either if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then or if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then but not if [ "$CFG_OPENGL" = "es1" || "$CFG_OPENGL" = "es2" ]; then Merge-request: 616 Reviewed-by: Oswald Buddenhagen --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 47eec92..3ed017d 100755 --- a/configure +++ b/configure @@ -5880,7 +5880,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then fi CFG_EGL=no # If QtOpenGL would be built against OpenGL ES, disable it as we can't to that if EGL is missing - if [ "$CFG_OPENGL" = "es1" || "$CFG_OPENGL" = "es2" ]; then + if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then CFG_OPENGL=no fi fi -- cgit v0.12 From 573be7e7ba19a2e826d17f5f78e272ee250831d0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 6 May 2010 14:48:05 +0200 Subject: doc: Second attempt to begin reorganizing the top doc page. This change actually changes the left panels. Much more to come. --- doc/src/frameworks-technologies/graphicsview.qdoc | 2 +- doc/src/overviews.qdoc | 13 +++++++++-- doc/src/painting-and-printing/coordsys.qdoc | 1 + doc/src/painting-and-printing/paintsystem.qdoc | 2 +- tools/qdoc3/htmlgenerator.cpp | 3 +++ tools/qdoc3/test/qt-html-templates.qdocconf | 27 +++++++++-------------- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc index 95b3182..740fcac 100644 --- a/doc/src/frameworks-technologies/graphicsview.qdoc +++ b/doc/src/frameworks-technologies/graphicsview.qdoc @@ -47,7 +47,7 @@ /*! \page graphicsview.html \title The Graphics View Framework - \ingroup qt-gui-concepts + \ingroup qt-graphics \brief An overview of the Graphics View framework for interactive 2D graphics. diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc index bc994af..b2ba3a1 100644 --- a/doc/src/overviews.qdoc +++ b/doc/src/overviews.qdoc @@ -63,9 +63,18 @@ /*! \group qt-gui-concepts - \title Qt GUI Components + \title Qt GUI Construction - \brief The Qt components for constructing graphical user intefaces. + \brief The Qt components for constructing Graphical User Intefaces. + + \generatelist {related} + */ + +/*! + \group qt-graphics + \title Qt Graphics + + \brief The Qt components for doing graphics. \generatelist {related} */ diff --git a/doc/src/painting-and-printing/coordsys.qdoc b/doc/src/painting-and-printing/coordsys.qdoc index 5807f57..b0ba093 100644 --- a/doc/src/painting-and-printing/coordsys.qdoc +++ b/doc/src/painting-and-printing/coordsys.qdoc @@ -42,6 +42,7 @@ /*! \page coordsys.html \title The Coordinate System + \ingroup qt-graphics \brief Information about the coordinate system used by the paint system. diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc index 56b638c..b711b2f 100644 --- a/doc/src/painting-and-printing/paintsystem.qdoc +++ b/doc/src/painting-and-printing/paintsystem.qdoc @@ -61,7 +61,7 @@ /*! \page paintsystem.html \title The Paint System - \ingroup qt-gui-concepts + \ingroup qt-graphics \ingroup frameworks-technologies Qt's paint system enables painting on screen and print devices diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 373fa3d..dfba368 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1243,6 +1243,8 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" << Atom(Atom::LineBreak); +#if 0 + // No longer used because the modeule name is a breadcrumb. QString fixedModule = inner->moduleName(); if (fixedModule == "Qt3SupportLight") fixedModule = "Qt3Support"; @@ -1263,6 +1265,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "]"; } } +#endif generateHeader(title, inner, marker); sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 1450149..8b007db 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -42,11 +42,12 @@ HTML.postheader = "
    \n" \ " API Lookup\n" \ "
    \n" \ " \n" \ "
    \n" \ "
    \n" \ @@ -54,20 +55,14 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ - " API Topics

    \n" \ + " Qt Topics\n" \ "
    \n" \ " \n" \ "
    \n" \ "
    \n" \ -- cgit v0.12 From 6629adee4741c3a72a83316671331ac996d046a5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 May 2010 14:46:38 +0200 Subject: Doc - mention vcsubdirs as a possible value for TEMPLATE It is usually the result of using subdirs in the .pro file and then using -tp vc to turn it into vcsubdirs. Reviewed-by: Oswald Buddenhagen --- doc/src/development/qmake-manual.qdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 688122b..c63e96c 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -347,6 +347,7 @@ \row \o vcapp \o Creates a Visual Studio Project file to build an application. \row \o vclib \o Creates a Visual Studio Project file to build a library. + \row \o vcsubdirs \o Creates a Visual Studio Solution file to build projects in sub-directories. \endtable See the \l{qmake Tutorial} for advice on writing project files for -- cgit v0.12 From fff6751d0ae61837f08874bce5ad04c4b9536894 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 6 May 2010 14:02:59 +0100 Subject: Check for existance of sis file parameter to runonphone Previously, it would skip over a non existant sis file - which could cause invalid test results if a previous version of the sis was already installed. Now, it checks if the file exists and exits with an error message if asked to install a sis file that doesn't exist. Task-number: QTBUG-9290 Reviewed-by: Miikka Heikkinen --- tools/runonphone/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index 37e4548..885d029 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -102,6 +102,10 @@ int main(int argc, char *argv[]) else if (arg == "--sis" || arg == "-s") { CHECK_PARAMETER_EXISTS sisFile = it.next(); + if (!QFileInfo(sisFile).exists()) { + errstream << "Sis file (" << sisFile << ") doesn't exist" << endl; + return 1; + } } else if (arg == "--download" || arg == "-d") { CHECK_PARAMETER_EXISTS -- cgit v0.12 From 92c4ccd5083e7efb3357bd190c07a95db604b9eb Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 6 May 2010 15:30:05 +0200 Subject: my changelog --- dist/changes-4.7.0 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index d156bd7..4035bfe 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -51,6 +51,10 @@ Third party components QtCore ------ + - QXmlStreamReader + * [QTBUG-9196] fixed crash when parsing + + QtGui ----- @@ -67,6 +71,21 @@ QtGui * Fixed a bug that led to missing text pixels in QTabBar when using small font sizes. (QTBUG-7137) + +QtNetwork +--------- + + - [QTBUG-8206] QNetworkAccessManager: add method to send custom requests + - [QTBUG-9618] [MR 2372] send secure cookies only over secure connections + +QtXmlPatterns +------------- + + - [QTBUG-8920] fixed crash with anonymous types in XsdSchemaChecker + - [QTBUG-8394] include/import/redefine schemas only once + - QXmlSchema: fix crash with referencing elements + + **************************************************************************** * Database Drivers * **************************************************************************** -- cgit v0.12 From 7770690dc220c4e75ed1411d2adf2e819092f7f2 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 6 May 2010 15:52:07 +0200 Subject: Doc: updating html and search feature Doc: implementing the search feature in the online docs Reviewed-by: Morten Engvoldsen --- doc/src/template/scripts/functions.js | 279 +++++++++------------------------- doc/src/template/style/style.css | 31 ++-- tools/qdoc3/htmlgenerator.cpp | 28 +--- 3 files changed, 90 insertions(+), 248 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 800660e..4b3107f 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -3,7 +3,6 @@ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); /*document.getElementById(this.id).style.cursor='pointer';*/ }); - /* END non link areas */ $('#smallA').click(function() { $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); @@ -38,120 +37,62 @@ $('#bigA').click(function() { var lookupCount = 0; var articleCount = 0; var exampleCount = 0; -var qturl = ""; // change to 0 +var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links + function processNokiaData(response){ + // debug $('.content').prepend('
  • handling search results
  • '); // debuging var propertyTags = response.getElementsByTagName('page'); - var ulStartElement = "
      "; - var ulEndElement = "
    "; - - for (var i=0; i< propertyTags.length; i++) { + + for (var i=0; i< propertyTags.length; i++) { + var linkStart = "
  • " + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue - + '
  • ' ; - -// $('#list002 li').remove(); -// $('#tbl002').prepend('
  • foo1
  • '); -// $('#tbl002').prepend('
  • bar2
  • '); - - $('ul001').prepend(full_address_lookup); + if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ + lookupCount=0; + //$('.live001').css('display','block'); + + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ + full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; + $('#ul001').prepend(full_li_element); } } - - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ - articleCount = 0; - document.getElementById('live002').style.display = "block"; - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_address_topic = full_address_topic + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_address_topic = full_address_topic + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue - + ''; + + if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ + articleCount = 0; + //$('.live002').css('display','block'); + + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ + full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - $('ul002').prepend(full_address_lookup); - } - } - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ - exampleCount = 0; - document.getElementById('live003').style.display = "block"; - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_address_examples = full_address_examples + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_address_examples = full_address_examples + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue - + ''; + $('#ul002').prepend(full_li_element); + } + } + if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ + exampleCount = 0; + //$('.live003').css('display','block'); + + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ + full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - $('ul003').prepend(full_address_lookup); - } - } - + $('#ul003').prepend(full_li_element); + } + } } - - - if(lookupCount == 0){loadLookupList();} - if(articleCount == 0){loadArticleList();} - if(exampleCount == 0){loadExampleList();} + if(lookupCount == 0){$('#ul001').prepend('
  • no result
  • ');$('#ul001 li').css('display','block');} + if(articleCount == 0){$('#ul002').prepend('
  • no result
  • ');$('#ul002 li').css('display','block');} + if(exampleCount == 0){$('#ul003').prepend('
  • no result
  • ');$('#ul003 li').css('display','block');} // reset count variables; lookupCount=0; articleCount = 0; exampleCount = 0; } -function removeResults() { - -// get hold of the non-default li elements and delete them - $('.live li').remove(); - - - /* var resultsTableLookup = document.getElementById('div001'); - var recordslookup = resultsTableLookup.rows.length; - - for (var i=(recordslookup-1); i> 0; i--){ - // resultsTableLookup.deleteRow(i); - - } - - var resultsTableTopic = document.getElementById('div002'); - var recordstopic = resultsTableTopic.rows.length; - for (var i=(recordstopic-1); i> 0; i--){ - // alert("delete: " + i); - // resultsTableTopic.deleteRow(i); - } - - var resultsTableexample = document.getElementById('div003'); - var recordsexample = resultsTableexample.rows.length; - for (var i=(recordsexample-1); i> 0; i--) - // resultsTableexample.deleteRow(i); - - removeList(); */ -} - -function removeList(){ - // var resultsTableLookuplist = document.getElementById('ul001'); - // var recordlookuplist = resultsTableLookuplist.rows.length; - // for (var i=(recordlookuplist-1); i> 0; i--) - // resultsTableLookuplist.deleteRow(i); - - // var resultsTableArticlelist = document.getElementById('ul002'); - // var recordArticlelist = resultsTableArticlelist.rows.length; - // for (var i=(recordArticlelist-1); i> 0; i--) - // resultsTableArticlelist.deleteRow(i); - - // var resultsTableExamplelist = document.getElementById('ul003'); - // var recordExamplelist = resultsTableExamplelist.rows.length; - // for (var i=(recordExamplelist-1); i> 0; i--) - // resultsTableExamplelist.deleteRow(i); - } - //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; function CheckEmptyAndLoadList() @@ -161,114 +102,44 @@ function CheckEmptyAndLoadList() { //empty inputbox // load default li elements into the ul if empty - loadAllList(); - //alert("loadAllList"); - document.getElementById('live001').style.display = "none"; - document.getElementById('live002').style.display = "none"; - document.getElementById('live003').style.display = "none"; - document.getElementById('list001').style.display = "block"; - document.getElementById('list002').style.display = "block"; - document.getElementById('list003').style.display = "block"; + // loadAllList(); // replaced + $('.defaultLink').css('display','block'); + // $('.liveResult').css('display','none'); }else{ - removeList(); - //alert("removeList"); - document.getElementById('live001').style.display = "block"; - document.getElementById('live002').style.display = "block"; - document.getElementById('live003').style.display = "block"; - - } -} -function loadAllList(){ - - /*var fullAddressListLookup = ""; - // var rowlistlookup = document.getElementById('ul001').insertRow(-1); - // var celllistlookup = rowlistlookup.insertCell(-1); - // celllistlookup.style.padding="0 0 0 0"; - //celllistlookup.style.width="10px"; - //celllistlookup.style.background = "yellow"; - //celllistlookup.innerHTML = fullAddressListLookup ; - - - - - var fullAddressListArticle = ""; - // var rowlistarticle = document.getElementById('ul002').insertRow(-1); - // var celllistarticle = rowlistarticle.insertCell(-1); - // celllistarticle.style.padding="0 0 0 0"; - //celllistarticle.innerHTML = fullAddressListArticle ; - - - var fullAddressListExample = ""; - // var rowlistexample = document.getElementById('ul003').insertRow(-1); - // var celllistexample = rowlistexample.insertCell(-1); - // celllistexample.style.padding="0 0 0 0"; - //celllistexample.innerHTML = fullAddressListExample ;*/ - -} - -function loadLookupList(){ - - /*var fullAddressListLookup = ""; - // var rowlistlookup = document.getElementById('ul001').insertRow(-1); - // var celllistlookup = rowlistlookup.insertCell(-1); - // celllistlookup.style.padding="0 0 0 0"; - //celllistlookup.style.width="10px"; - //celllistlookup.style.background = "yellow"; - celllistlookup.innerHTML = fullAddressListLookup ; - document.getElementById('live001').style.display = "none"; - document.getElementById('list001').style.display = "block"; - //alert("loadLookupList") -*/ -} -function loadArticleList(){ - /* - var fullAddressListArticle = ""; - // var rowlistarticle = document.getElementById('ul002').insertRow(-1); - // var celllistarticle = rowlistarticle.insertCell(-1); - // celllistarticle.style.padding="0 0 0 0"; - celllistarticle.innerHTML = fullAddressListArticle ; - document.getElementById('live002').style.display = "none"; - document.getElementById('list002').style.display = "block";*/ + $('.defaultLink').css('display','none'); } - -function loadExampleList(){ - /* - var fullAddressListExample = ""; - // var rowlistexample = document.getElementById('ul003').insertRow(-1); - // var celllistexample = rowlistexample.insertCell(-1); - // celllistexample.style.padding="0 0 0 0"; - celllistexample.innerHTML = fullAddressListExample ; - document.getElementById('live003').style.display = "none"; - document.getElementById('list003').style.display = "block";*/ - } +// Loads on doc ready + $(document).ready(function () { + $('#pageType').keyup(function () { + var searchString = $('#pageType').val() ; + if ((searchString == null) || (searchString.length < 3)) { + $('.liveResult').remove(); // replaces removeResults(); + CheckEmptyAndLoadList(); + $('.report').remove(); + // debug$('.content').prepend('
  • too short or blank
  • '); // debug + return; + } + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + // debug$('.content').prepend('
  • new search started
  • ');// debug + // debug$('.content').prepend('

    Search string ' +searchString +'

    '); // debug + + $.ajax({ + contentType: "application/x-www-form-urlencoded", + url: 'http://' + location.host + '/nokiasearch/GetDataServlet', + data: 'searchString='+searchString, + dataType:'xml', + type: 'post', + success: function (response, textStatus) { + + $('.liveResult').remove(); // replaces removeResults(); + processNokiaData(response); + + } + }); + }, 500); + }); + }); diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 220afb9..6bcb0db 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1020,6 +1020,11 @@ overflow:hidden; } + +.indexboxcont .section { + float: left; +} + .indexboxcont .section p { padding-top: 20px; @@ -1028,7 +1033,7 @@ .indexboxcont .sectionlist { display: inline-block; - width: 33%; + width: 32.5%; padding: 0; } .indexboxcont .sectionlist ul @@ -1057,6 +1062,12 @@ color: #00732f; text-decoration: none; } + + .indexbox .indexIcon { + width: 11%; + } + + .indexbox .indexIcon span { display: block; @@ -1085,25 +1096,11 @@ clear: both; visibility: hidden; } - /* - - + - .lastcol - { - display: inline-block; - vertical-align: top; - padding: 0; - max-width: 25%; - } + /* end of screen media */ - .tricol .lastcol - { - margin-left: -6px; - } - */ - /* end indexbox */ } /* end of screen media */ diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index dfba368..93b0218 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1795,32 +1795,7 @@ void HtmlGenerator::generateHeader(const QString& title, //out() << " Qt Reference Documentation"; out() << " \n"; out() << " \n"; - out() << " \n"; + out() << " \n"; out() << "\n"; if (offlineDocs) @@ -1868,7 +1843,6 @@ void HtmlGenerator::generateFooter(const Node *node) out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); - out() << " \n"; out() << "\n"; out() << "\n"; } -- cgit v0.12 From 6af3db7e24527731124ad1233f926bc8d1c890b3 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 6 May 2010 16:48:28 +0200 Subject: My changelog entries for core and network --- dist/changes-4.7.0 | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 4035bfe..df782c0 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -53,7 +53,8 @@ QtCore - QXmlStreamReader * [QTBUG-9196] fixed crash when parsing - + - QTimer + * singleShot with 0 timeout will now avoid allocating objects QtGui ----- @@ -74,9 +75,25 @@ QtGui QtNetwork --------- - - - [QTBUG-8206] QNetworkAccessManager: add method to send custom requests - - [QTBUG-9618] [MR 2372] send secure cookies only over secure connections + - QHostInfo: Added a small 60 second DNS cache + - QNetworkAccessManager + * Performance improvements for file:// and http:// + * Crash fixes + * Improvements on HTTP pipelining + * Fix problem with canReadLine() + * Fix problem with HTTP 100 reply + * Some new attributes for QNetworkRequest + * [QTBUG-8206] add method to send custom requests + * [QTBUG-9618] [MR 2372] send secure cookies only over secure connections + * [QTBUG-7713] Fix bug related to re-sending request + * [QTBUG-7673] Fix issue with some webservers + - Sockets + * Better support for derived QTcpServer + * [QTBUG-7054] Fix error handling with waitFor*() for socket engine + * [QTBUG-7316, QTBUG-7317] Also handle unknown errors from socket engine + - SSL + * [QTBUG-2515] Do not make OpenSSL prompt for a password + * [QTBUG-6504, QTBUG-8924, QTBUG-5645] Fix memleak QtXmlPatterns ------------- -- cgit v0.12 From 8cd1773d49fc86e57e37a2b146dad1ef96105b04 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 6 May 2010 13:09:27 +0200 Subject: Fix compilation in C++0x mode (narrowing of constants) --- src/gui/painting/qprintengine_pdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp index 0a747e7..2955e39 100644 --- a/src/gui/painting/qprintengine_pdf.cpp +++ b/src/gui/painting/qprintengine_pdf.cpp @@ -1225,7 +1225,7 @@ void QPdfEnginePrivate::printString(const QString &string) { const ushort *utf16 = string.utf16(); for (int i=0; i < string.size(); ++i) { - char part[2] = {(*(utf16 + i)) >> 8, (*(utf16 + i)) & 0xff}; + char part[2] = {char((*(utf16 + i)) >> 8), char((*(utf16 + i)) & 0xff)}; for(int j=0; j < 2; ++j) { if (part[j] == '(' || part[j] == ')' || part[j] == '\\') array.append('\\'); -- cgit v0.12 From 932f0b32eb22fbd7d3dcbbd69740457f65ab5d1a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 6 May 2010 15:01:52 +0200 Subject: Add missing newline to static XML snippet --- src/dbus/qdbusinternalfilters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp index 8fc219a..78abf94 100644 --- a/src/dbus/qdbusinternalfilters.cpp +++ b/src/dbus/qdbusinternalfilters.cpp @@ -87,7 +87,7 @@ static const char propertiesInterfaceXml[] = " \n" " \n" " \n" - " " + " \n" " \n" " \n"; -- cgit v0.12 From c06c9ecf3f37ca8ff8a4be14c9f4e1c2e483250a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 6 May 2010 15:02:34 +0200 Subject: QDBusXmlGenerator: get the true name from QMetaType for the return type --- src/dbus/qdbusxmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index 9c25d82..463ac73 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -160,7 +160,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method // do we need to describe this argument? if (QDBusMetaType::signatureToType(typeName) == QVariant::Invalid) xml += QString::fromLatin1(" \n") - .arg(typeNameToXml(mm.typeName())); + .arg(typeNameToXml(QVariant::typeToName(QVariant::Type(typeId)))); } else continue; } -- cgit v0.12 From dbc2cfffd2e71ce4244e8e700b4928a8ab5d5a04 Mon Sep 17 00:00:00 2001 From: Mirko Damiani Date: Thu, 6 May 2010 16:50:22 +0200 Subject: Don't initialize Wintab if QT_NO_TABLETEVENT is defined. Functions qt_tablet_init() and qt_tablet_init_wce() are now wrapped with QT_NO_TABLETEVENT macro. Merge-request: 2383 Reviewed-by: Benjamin Poulain --- src/gui/kernel/qwidget_win.cpp | 2 ++ src/gui/kernel/qwidget_wince.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 7d647b7..4912291 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -512,8 +512,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO DestroyWindow(destroyw); } +#ifndef QT_NO_TABLETEVENT if (q != qt_tablet_widget && QWidgetPrivate::mapper) qt_tablet_init(); +#endif // QT_NO_TABLETEVENT if (q->testAttribute(Qt::WA_DropSiteRegistered)) registerDropSite(true); diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index 509847b..e352f5c 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -358,8 +358,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO DestroyWindow(destroyw); } +#ifndef QT_NO_TABLETEVENT if (q != qt_tablet_widget && QWidgetPrivate::mapper) qt_tablet_init_wce(); +#endif // QT_NO_TABLETEVENT if (q->testAttribute(Qt::WA_DropSiteRegistered)) registerDropSite(true); -- cgit v0.12 From 3a9c669816c2b0784b5c9e1790bc3bbd036cf013 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 6 May 2010 14:39:01 +0200 Subject: Make QCompleter cope with restricted screen real estate (mobile devices) Always prefer the bottom area for the list popup - if that doesn't work out use the maximum available space (top or bottom) and resize the popup if it still does not fit. RevBy: Dominik Holland RevBy: ogoffart --- src/gui/util/qcompleter.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 8e7ec80..05fe744 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -873,7 +873,7 @@ void QCompleterPrivate::showPopup(const QRect& rect) const QRect screen = QApplication::desktop()->availableGeometry(widget); Qt::LayoutDirection dir = widget->layoutDirection(); QPoint pos; - int rw, rh, w; + int rh, w; int h = (popup->sizeHintForRow(0) * qMin(maxVisibleItems, popup->model()->rowCount()) + 3) + 3; QScrollBar *hsb = popup->horizontalScrollBar(); if (hsb && hsb->isVisible()) @@ -881,21 +881,30 @@ void QCompleterPrivate::showPopup(const QRect& rect) if (rect.isValid()) { rh = rect.height(); - w = rw = rect.width(); + w = rect.width(); pos = widget->mapToGlobal(dir == Qt::RightToLeft ? rect.bottomRight() : rect.bottomLeft()); } else { rh = widget->height(); - rw = widget->width(); pos = widget->mapToGlobal(QPoint(0, widget->height() - 2)); w = widget->width(); } - if ((pos.x() + rw) > (screen.x() + screen.width())) + if (w > screen.width()) + w = screen.width(); + if ((pos.x() + w) > (screen.x() + screen.width())) pos.setX(screen.x() + screen.width() - w); if (pos.x() < screen.x()) pos.setX(screen.x()); - if (((pos.y() + rh) > (screen.y() + screen.height())) && ((pos.y() - h - rh) >= 0)) - pos.setY(pos.y() - qMax(h, popup->minimumHeight()) - rh + 2); + + int top = pos.y() - rh - screen.top() + 2; + int bottom = screen.bottom() - pos.y(); + h = qMax(h, popup->minimumHeight()); + if (h > bottom) { + h = qMin(qMax(top, bottom), h); + + if (top > bottom) + pos.setY(pos.y() - h - rh + 2); + } popup->setGeometry(pos.x(), pos.y(), w, h); -- cgit v0.12 From 9439d7475e7ba558a5b455a8f2b7f90adf26db79 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 7 May 2010 09:14:54 +1000 Subject: Avoid repeated create/destroy at top list boundary with sub-pixel movement. --- src/declarative/graphicsitems/qdeclarativelistview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 328f319..416e0a8 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -650,7 +650,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) FxListItem *item = 0; int pos = itemEnd + 1; while (modelIndex < model->count() && pos <= fillTo) { - //qDebug() << "refill: append item" << modelIndex << "pos" << pos; +// qDebug() << "refill: append item" << modelIndex << "pos" << pos; if (!(item = createItem(modelIndex))) break; item->setPosition(pos); @@ -661,8 +661,8 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) if (doBuffer) // never buffer more than one item per frame break; } - while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > fillFrom) { - //qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos; + while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos-1 >= fillFrom) { +// qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos; if (!(item = createItem(visibleIndex-1))) break; --visibleIndex; @@ -678,7 +678,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endPosition() < bufferFrom) { if (item->attached->delayRemove()) break; - //qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition(); +// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition(); if (item->index != -1) visibleIndex++; visibleItems.removeFirst(); @@ -688,7 +688,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) { if (item->attached->delayRemove()) break; - //qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1; +// qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position(); visibleItems.removeLast(); releaseItem(item); changed = true; -- cgit v0.12 From 65d04843759d14f15f559c78df94626568bc0cb8 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 7 May 2010 10:16:28 +1000 Subject: Compile with opengl enabled. --- src/multimedia/mediaservices/mediaservices.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/multimedia/mediaservices/mediaservices.pro b/src/multimedia/mediaservices/mediaservices.pro index d5b0e4c..8a065f4 100644 --- a/src/multimedia/mediaservices/mediaservices.pro +++ b/src/multimedia/mediaservices/mediaservices.pro @@ -2,6 +2,8 @@ TARGET = QtMediaServices QPRO_PWD = $$PWD QT = core gui multimedia +contains(QT_CONFIG, opengl): QT += opengl + DEFINES += QT_BUILD_MEDIASERVICES_LIB QT_NO_USING_NAMESPACE unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtMultimedia -- cgit v0.12 From 7c945e152c9abd0478bed5a4d251012944d93b44 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 5 May 2010 14:57:53 +1000 Subject: Resize qmlruntime window to new dimensions when orientation changes Task-number: Reviewed-by: Warwick Allison --- src/declarative/util/qdeclarativeview.cpp | 16 ++- tests/auto/declarative/declarative.pro | 1 + .../qdeclarativeview/tst_qdeclarativeview.cpp | 4 +- .../qdeclarativeviewer/data/orientation.qml | 10 ++ .../qdeclarativeviewer/qdeclarativeviewer.pro | 11 +++ .../qdeclarativeviewer/tst_qdeclarativeviewer.cpp | 108 +++++++++++++++++++++ tools/qml/qmlruntime.cpp | 19 +++- tools/qml/qmlruntime.h | 5 +- 8 files changed, 156 insertions(+), 18 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeviewer/data/orientation.qml create mode 100644 tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro create mode 100644 tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 62d913c..833e284 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -484,10 +484,7 @@ QSize QDeclarativeViewPrivate::rootObjectSize() QSize rootObjectSize(0,0); int widthCandidate = -1; int heightCandidate = -1; - if (declarativeItemRoot) { - widthCandidate = declarativeItemRoot->width(); - heightCandidate = declarativeItemRoot->height(); - } else if (root) { + if (root) { QSizeF size = root->boundingRect().size(); widthCandidate = size.width(); heightCandidate = size.height(); @@ -614,16 +611,15 @@ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e) /*! \internal - Preferred size follows the root object in - resize mode SizeViewToRootObject and - the view in resize mode SizeRootObjectToView. + Preferred size follows the root object geometry. */ QSize QDeclarativeView::sizeHint() const { - if (d->resizeMode == SizeRootObjectToView) { + QSize rootObjectSize = d->rootObjectSize(); + if (rootObjectSize.isEmpty()) { return size(); - } else { // d->resizeMode == SizeViewToRootObject - return d->rootObjectSize(); + } else { + return rootObjectSize; } } diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index b8e33cf..05c4c26 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -64,6 +64,7 @@ SUBDIRS += \ qdeclarativestyledtext \ # Cover qdeclarativesqldatabase \ # Cover qdeclarativevisualdatamodel \ # Cover + qdeclarativeviewer \ # Cover qmlvisual # Cover contains(QT_CONFIG, webkit) { diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp index 1ed51c1..dd2f46e 100644 --- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp +++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp @@ -147,7 +147,7 @@ void tst_QDeclarativeView::resizemodedeclarativeitem() declarativeItem->setHeight(80); QCOMPARE(canvas->width(), 80); QCOMPARE(canvas->height(), 100); - QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(QSize(declarativeItem->width(), declarativeItem->height()), canvas->sizeHint()); QCOMPARE(sceneResizedSpy2.count(), 2); // size update from view @@ -230,7 +230,7 @@ void tst_QDeclarativeView::resizemodegraphicswidget() canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); graphicsWidget->resize(QSizeF(60,80)); QCOMPARE(canvas->size(), QSize(80,100)); - QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(QSize(graphicsWidget->size().width(), graphicsWidget->size().height()), canvas->sizeHint()); QCOMPARE(sceneResizedSpy2.count(), 2); // size update from view diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml new file mode 100644 index 0000000..687fac6 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml @@ -0,0 +1,10 @@ +import Qt 4.7 +Rectangle { + color: "black" + width: (runtime.orientation == Orientation.Landscape) ? 300 : 200 + height: (runtime.orientation == Orientation.Landscape) ? 200 : 300 + Text { + text: runtime.orientation == Orientation.Landscape ? "Landscape" : "Portrait" + color: "white" + } +} \ No newline at end of file diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro new file mode 100644 index 0000000..dc10f5b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro @@ -0,0 +1,11 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +include(../../../../tools/qml/qml.pri) + +SOURCES += tst_qdeclarativeviewer.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" + +CONFIG += parallel_test diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp new file mode 100644 index 0000000..9429dc9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include "qmlruntime.h" + +class tst_QDeclarativeViewer : public QObject + +{ + Q_OBJECT +public: + tst_QDeclarativeViewer(); + +private slots: + void orientation(); + +private: + QDeclarativeEngine engine; +}; + +tst_QDeclarativeViewer::tst_QDeclarativeViewer() +{ +} + +void tst_QDeclarativeViewer::orientation() +{ + QWidget window; + QDeclarativeViewer *viewer = new QDeclarativeViewer(&window); + QVERIFY(viewer); + viewer->open(SRCDIR "/data/orientation.qml"); + QVERIFY(viewer->view()); + QVERIFY(viewer->menuBar()); + QDeclarativeItem* rootItem = qobject_cast(viewer->view()->rootObject()); + QVERIFY(rootItem); + window.show(); + + QCOMPARE(rootItem->width(), 200.0); + QCOMPARE(rootItem->height(), 300.0); + QCOMPARE(viewer->view()->size(), QSize(200, 300)); + QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300)); + QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height())); + QCOMPARE(viewer->size(), viewer->sizeHint()); + + viewer->toggleOrientation(); + qApp->processEvents(); + + QCOMPARE(rootItem->width(), 300.0); + QCOMPARE(rootItem->height(), 200.0); + QCOMPARE(viewer->view()->size(), QSize(300, 200)); + QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(300, 200)); + QCOMPARE(viewer->size(), QSize(300, 200+viewer->menuBar()->height())); + QCOMPARE(viewer->size(), viewer->sizeHint()); + + viewer->toggleOrientation(); + qApp->processEvents(); + + QCOMPARE(rootItem->width(), 200.0); + QCOMPARE(rootItem->height(), 300.0); + QCOMPARE(viewer->view()->size(), QSize(200, 300)); + QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300)); + QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height())); + QCOMPARE(viewer->size(), viewer->sizeHint()); +} + +QTEST_MAIN(tst_QDeclarativeViewer) + +#include "tst_qdeclarativeviewer.moc" diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index d49b0f1..06fa004 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -535,6 +535,8 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) connect(&autoStartTimer, SIGNAL(triggered()), this, SLOT(autoStartRecording())); connect(&autoStopTimer, SIGNAL(triggered()), this, SLOT(autoStopRecording())); connect(&recordTimer, SIGNAL(triggered()), this, SLOT(recordFrame())); + connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()), + this, SLOT(orientationChanged()), Qt::QueuedConnection); autoStartTimer.setRunning(false); autoStopTimer.setRunning(false); recordTimer.setRunning(false); @@ -968,10 +970,8 @@ void QDeclarativeViewer::statusChanged() if (canvas->status() == QDeclarativeView::Ready) { initialSize = canvas->sizeHint(); if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) { - QSize newWindowSize = initialSize; - newWindowSize.setHeight(newWindowSize.height()+menuBarHeight()); updateSizeHints(); - resize(newWindowSize); + resize(QSize(initialSize.width(), initialSize.height()+menuBarHeight())); } } } @@ -1425,6 +1425,19 @@ void QDeclarativeViewer::recordFrame() } } +void QDeclarativeViewer::orientationChanged() +{ + if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) { + if (canvas->rootObject()) { + QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size(); + QSize newSize(rootObjectSize.width(), rootObjectSize.height()+menuBarHeight()); + if (size() != newSize) { + resize(newSize); + } + } + } +} + void QDeclarativeViewer::setDeviceKeys(bool on) { devicemode = on; diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 655feea..9551090 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -125,6 +125,7 @@ public slots: void showProxySettings (); void proxySettingsChanged (); void setScaleView(); + void toggleOrientation(); void statusChanged(); void setSlowMode(bool); void launch(const QString &); @@ -132,7 +133,6 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); virtual bool event(QEvent *); - void createMenu(QMenuBar *menu, QMenu *flatmenu); private slots: @@ -144,9 +144,9 @@ private slots: void setScaleSkin(); void setPortrait(); void setLandscape(); - void toggleOrientation(); void startNetwork(); void toggleFullScreen(); + void orientationChanged(); void showWarnings(bool show); void warningsWidgetOpened(); @@ -199,7 +199,6 @@ private: QNetworkReply *wgtreply; QString wgtdir; - NetworkAccessManagerFactory *namFactory; bool useQmlFileBrowser; -- cgit v0.12 From d7ef9666e2a3c8d06c5f32b7f47f602b177a74f6 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 6 May 2010 15:48:34 +1000 Subject: Avoid emitting release when the mouse is ungrabbed Added an onCanceled signal to mouse area, which is triggered when the mouse area rejects the event (propagates to the nearest mouse area beneath) or some other element steals the mouse grab (flickable, for example). Task-number: QTBUG-10162 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativemousearea.cpp | 19 ++++++++-- .../graphicsitems/qdeclarativemousearea_p.h | 1 + .../tst_qdeclarativemousearea.cpp | 44 ++++++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index c5a995e..74f2338 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -288,6 +288,17 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() */ /*! + \qmlsignal MouseArea::onCanceled() + + This handler is called when the mouse events are canceled, either because the event was not accepted or + another element stole the mouse event handling. This signal is for advanced users, it's useful in case there + is more than one mouse areas handling input, or when there is a mouse area inside a flickable. In the latter + case, if you do some logic on pressed and then start dragging, the flickable will steal the mouse handling + from the mouse area. In these cases, to reset the logic when there is no mouse handling anymore, you should + use onCanceled, in addition to onReleased. +*/ + +/*! \internal \class QDeclarativeMouseArea \brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within Qml. @@ -562,10 +573,12 @@ bool QDeclarativeMouseArea::sceneEvent(QEvent *event) // state d->pressed = false; setKeepMouseGrab(false); - QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, false); - emit released(&me); + emit canceled(); emit pressedChanged(); - setHovered(false); + if (d->hovered) { + d->hovered = false; + emit hoveredChanged(); + } } } return rv; diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index e3f523b..df77ac6 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -163,6 +163,7 @@ Q_SIGNALS: void doubleClicked(QDeclarativeMouseEvent *mouse); void entered(); void exited(); + void canceled(); protected: void setHovered(bool); diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index eb4aa12..96e6b8c 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -56,6 +56,8 @@ private slots: void updateMouseAreaPosOnClick(); void updateMouseAreaPosOnResize(); void noOnClickedWithPressAndHold(); + void onMousePressRejected(); + private: QDeclarativeView *createView(); }; @@ -330,6 +332,48 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold() QVERIFY(canvas->rootObject()->property("held").toBool()); } +void tst_QDeclarativeMouseArea::onMousePressRejected() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rejectEvent.qml")); + canvas->show(); + canvas->setFocus(); + QVERIFY(canvas->rootObject() != 0); + + QVERIFY(!canvas->rootObject()->property("mr1_pressed").toBool()); + QVERIFY(!canvas->rootObject()->property("mr1_released").toBool()); + QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool()); + QVERIFY(!canvas->rootObject()->property("mr2_pressed").toBool()); + QVERIFY(!canvas->rootObject()->property("mr2_released").toBool()); + QVERIFY(!canvas->rootObject()->property("mr2_canceled").toBool()); + + QGraphicsScene *scene = canvas->scene(); + QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); + pressEvent.setScenePos(QPointF(100, 100)); + pressEvent.setButton(Qt::LeftButton); + pressEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &pressEvent); + + QVERIFY(canvas->rootObject()->property("mr1_pressed").toBool()); + QVERIFY(!canvas->rootObject()->property("mr1_released").toBool()); + QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool()); + QVERIFY(canvas->rootObject()->property("mr2_pressed").toBool()); + QVERIFY(!canvas->rootObject()->property("mr2_released").toBool()); + QVERIFY(canvas->rootObject()->property("mr2_canceled").toBool()); + + QTest::qWait(200); + + QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); + releaseEvent.setScenePos(QPointF(100, 100)); + releaseEvent.setButton(Qt::LeftButton); + releaseEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &releaseEvent); + + QVERIFY(canvas->rootObject()->property("mr1_released").toBool()); + QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool()); + QVERIFY(!canvas->rootObject()->property("mr2_released").toBool()); +} + QTEST_MAIN(tst_QDeclarativeMouseArea) #include "tst_qdeclarativemousearea.moc" -- cgit v0.12 From 705a6ee8f08b1c0b360f1438301ce049e96ed450 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 6 May 2010 16:06:43 +1000 Subject: Fix autotest bug in MouseArea Reviewed-by: Martin Jones --- .../declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 96e6b8c..ff3bf45 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -322,7 +322,7 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold() QTest::qWait(1000); - QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMousePress); + QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); releaseEvent.setScenePos(QPointF(100, 100)); releaseEvent.setButton(Qt::LeftButton); releaseEvent.setButtons(Qt::LeftButton); -- cgit v0.12 From abd2c025d088064c31fd1b0e9c5ea29996e51bbe Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Fri, 7 May 2010 10:57:56 +1000 Subject: Update mouse area qmlvisual test to follow change QTBUG-10162 Reviewed-by: Michael Brasser --- .../qmlvisual/qdeclarativemousearea/mousearea-flickable.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml index a0b787f..e223f5e 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml @@ -25,7 +25,7 @@ Rectangle { MouseArea { anchors.fill: parent onPressed: blue.color = "lightsteelblue" - onReleased: blue.color = "steelblue" + onCanceled: blue.color = "steelblue" } } Rectangle { @@ -36,7 +36,7 @@ Rectangle { MouseArea { anchors.fill: parent onEntered: { red.color = "darkred"; tooltip.opacity = 1 } - onExited: { red.color = "red"; tooltip.opacity = 0 } + onCanceled: { red.color = "red"; tooltip.opacity = 0 } } Rectangle { id: tooltip -- cgit v0.12 From 62a65081a37ed9a51b0d39d1e740345d77f7bec0 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 7 May 2010 12:10:33 +1000 Subject: Clean up example code, add white background behind text --- examples/declarative/dynamic/dynamic.qml | 193 +++++++++++---------- examples/declarative/dynamic/qml/Button.qml | 36 ++-- examples/declarative/dynamic/qml/GenericItem.qml | 13 -- examples/declarative/dynamic/qml/PaletteItem.qml | 16 +- .../declarative/dynamic/qml/PerspectiveItem.qml | 29 ++-- examples/declarative/dynamic/qml/Sun.qml | 32 +++- examples/declarative/dynamic/qml/itemCreation.js | 58 +++---- 7 files changed, 206 insertions(+), 171 deletions(-) delete mode 100644 examples/declarative/dynamic/qml/GenericItem.qml diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index 0e6e197..52c7c1e 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -4,44 +4,49 @@ import "qml" Item { id: window + + property int activeSuns: 0 + //This is a desktop-sized example width: 1024; height: 512 - property int activeSuns: 0 - //This is the message that pops up when there's an error - Rectangle{ + //This is the message box that pops up when there's an error + Rectangle { id: dialog + opacity: 0 anchors.centerIn: parent - width: dialogText.width + 6 - height: dialogText.height + 6 + width: dialogText.width + 6; height: dialogText.height + 6 border.color: 'black' color: 'lightsteelblue' z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. + function show(str){ dialogText.text = str; dialogAnim.start(); } - Text{ + + Text { id: dialogText - x:3 - y:3 + x: 3; y: 3 font.pixelSize: 14 } - SequentialAnimation{ + + SequentialAnimation { id: dialogAnim - NumberAnimation{target: dialog; property:"opacity"; to: 1; duration: 1000} - PauseAnimation{duration: 5000} - NumberAnimation{target: dialog; property:"opacity"; to: 0; duration: 1000} + NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 } + PauseAnimation { duration: 5000 } + NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 } } } // sky - Rectangle { id: sky + Rectangle { + id: sky anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter } gradient: Gradient { - GradientStop { id: stopA; position: 0.0; color: "#0E1533" } - GradientStop { id: stopB; position: 1.0; color: "#437284" } + GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" } + GradientStop { id: gradientStopB; position: 1.0; color: "#437284" } } } @@ -49,109 +54,123 @@ Item { Particles { id: stars x: 0; y: 0; width: parent.width; height: parent.height / 2 - source: "images/star.png"; angleDeviation: 360; velocity: 0 - velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800 + source: "images/star.png" + angleDeviation: 360 + velocity: 0; velocityDeviation: 0 + count: parent.width / 10 + fadeInDuration: 2800 opacity: 1 } - // ground, which has a z such that the sun can set behind it + // ground Rectangle { id: ground - z: 2 - anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.right; bottom: parent.bottom } + z: 2 // just above the sun so that the sun can set behind it + anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom } gradient: Gradient { GradientStop { position: 0.0; color: "ForestGreen" } GradientStop { position: 1.0; color: "DarkGreen" } } } - //Day state, for when you place a sun - states: State { - name: "Day"; when: window.activeSuns > 0 - PropertyChanges { target: stopA; color: "DeepSkyBlue"} - PropertyChanges { target: stopB; color: "SkyBlue"} - PropertyChanges { target: stars; opacity: 0 } - } - - transitions: Transition { - PropertyAnimation { duration: 3000 } - ColorAnimation { duration: 3000 } - } - SystemPalette { id: activePalette } - // toolbox + // right-hand panel Rectangle { id: toolbox - z: 3 //Above ground - color: activePalette.window; + width: 480 - anchors { right: parent.right; top:parent.top; bottom: parent.bottom } - Rectangle { //Not a child of any positioner - border.color: "black"; - width: toolRow.width + 4 - height: toolRow.height + 4 - x: toolboxPositioner.x + toolRow.x - 2 - y: toolboxPositioner.y + toolRow.y - 2 - } + color: activePalette.window + anchors { right: parent.right; top: parent.top; bottom: parent.bottom } + Column { - id: toolboxPositioner anchors.centerIn: parent spacing: 8 + Text { text: "Drag an item into the scene." } - Row { - id: toolRow - spacing: 8; - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "Sun.qml"; - image: "../images/sun.png" - } - PaletteItem { - file: "GenericItem.qml" - image: "../images/moon.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/tree_s.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/rabbit_brown.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/rabbit_bw.png" + + Rectangle { + width: childrenRect.width + 10; height: childrenRect.height + 10 + border.color: "black" + + Row { + anchors.centerIn: parent + spacing: 8 + + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "Sun.qml" + image: "../images/sun.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "GenericSceneItem.qml" + image: "../images/moon.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/tree_s.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_brown.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_bw.png" + } } } + Text { text: "Active Suns: " + activeSuns } - Rectangle { width: 440; height: 1; color: "black" } - Text { text: "Arbitrary QML: " } - TextEdit { - id: qmlText - width: 460 - height: 220 - readOnly: false - focusOnPress: true - font.pixelSize: 14 - - text: "import Qt 4.7\nImage {\n id: smile;\n x: 500*Math.random();\n y: 200*Math.random(); \n source: 'images/face-smile.png';\n NumberAnimation on opacity { \n to: 0; duration: 1500;\n }\n Component.onCompleted: smile.destroy(1500);\n}" + + Rectangle { width: parent.width; height: 1; color: "black" } + + Text { text: "Arbitrary QML:" } + + Rectangle { + width: 460; height: 240 + + TextEdit { + id: qmlText + anchors.fill: parent; anchors.margins: 5 + readOnly: false + focusOnPress: true + font.pixelSize: 14 + + text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}" + } } + Button { text: "Create" - function makeCustom() { - try{ + onClicked: { + try { Qt.createQmlObject(qmlText.text, window, 'CustomObject'); - }catch(err){ - dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message ); + } catch(err) { + dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message); } } - onClicked: makeCustom(); } } } + //Day state, for when a sun is added to the scene + states: State { + name: "Day" + when: window.activeSuns > 0 + + PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" } + PropertyChanges { target: gradientStopB; color: "SkyBlue" } + PropertyChanges { target: stars; opacity: 0 } + } + + transitions: Transition { + PropertyAnimation { duration: 3000 } + ColorAnimation { duration: 3000 } + } + } diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml index 53588bb..963a850 100644 --- a/examples/declarative/dynamic/qml/Button.qml +++ b/examples/declarative/dynamic/qml/Button.qml @@ -6,19 +6,35 @@ Rectangle { property variant text signal clicked - SystemPalette { id: activePalette } - height: text.height + 10 - width: text.width + 20 + height: text.height + 10; width: text.width + 20 border.width: 1 - radius: 4; smooth: true + radius: 4 + smooth: true + gradient: Gradient { - GradientStop { position: 0.0; - color: if(!mr.pressed){activePalette.light;}else{activePalette.button;} + GradientStop { + position: 0.0 + color: !mouseArea.pressed ? activePalette.light : activePalette.button } - GradientStop { position: 1.0; - color: if(!mr.pressed){activePalette.button;}else{activePalette.dark;} + GradientStop { + position: 1.0 + color: !mouseArea.pressed ? activePalette.button : activePalette.dark } } - MouseArea { id:mr; anchors.fill: parent; onClicked: container.clicked() } - Text { id: text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text; color: activePalette.buttonText } + + SystemPalette { id: activePalette } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked() + } + + Text { + id: text + anchors.centerIn:parent + font.pointSize: 10 + text: parent.text + color: activePalette.buttonText + } } diff --git a/examples/declarative/dynamic/qml/GenericItem.qml b/examples/declarative/dynamic/qml/GenericItem.qml deleted file mode 100644 index faac06d..0000000 --- a/examples/declarative/dynamic/qml/GenericItem.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt 4.7 - -Item{ - property bool created: false - property string image - width: imageItem.width - height: imageItem.height - z: 2 - Image{ - id: imageItem - source: image; - } -} diff --git a/examples/declarative/dynamic/qml/PaletteItem.qml b/examples/declarative/dynamic/qml/PaletteItem.qml index e8f2ed4..dcb5cc3 100644 --- a/examples/declarative/dynamic/qml/PaletteItem.qml +++ b/examples/declarative/dynamic/qml/PaletteItem.qml @@ -1,13 +1,19 @@ import Qt 4.7 import "itemCreation.js" as Code -GenericItem { - id: itemButton - property string file +Image { + id: paletteItem + + property string componentFile + property string image + + source: image + MouseArea { - anchors.fill: parent; + anchors.fill: parent + onPressed: Code.startDrag(mouse); - onPositionChanged: Code.moveDrag(mouse); + onPositionChanged: Code.continueDrag(mouse); onReleased: Code.endDrag(mouse); } } diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 3cbe64a..c04d3dc 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -1,16 +1,25 @@ import Qt 4.7 Image { - id: tree + id: rootItem + property bool created: false - property double scaleFactor: Math.max((y+height-250)*0.01, 0.3) - property double scaledBottom: y + (height+height*scaleFactor)/2 - property bool onLand: scaledBottom > window.height/2 - property string image //Needed for compatibility with GenericItem + property string image + + property double scaledBottom: y + (height + height*scale) / 2 + property bool onLand: scaledBottom > window.height / 2 + + source: image opacity: onLand ? 1 : 0.25 - onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } - scale: scaleFactor - transformOrigin: "Center" - source: image; smooth: true - onYChanged: z = scaledBottom + scale: Math.max((y + height - 250) * 0.01, 0.3) + smooth: true + + onCreatedChanged: { + if (created && !onLand) + rootItem.destroy(); + else + z = scaledBottom; + } + + onYChanged: z = scaledBottom; } diff --git a/examples/declarative/dynamic/qml/Sun.qml b/examples/declarative/dynamic/qml/Sun.qml index 3627964..43dcb9a 100644 --- a/examples/declarative/dynamic/qml/Sun.qml +++ b/examples/declarative/dynamic/qml/Sun.qml @@ -2,23 +2,37 @@ import Qt 4.7 Image { id: sun + property bool created: false property string image: "../images/sun.png" - onCreatedChanged: if(created){window.activeSuns++;}else{window.activeSuns--;} - source: image; - z: 1 + source: image - //x and y get set when instantiated - //head offscreen + // once item is created, start moving offscreen NumberAnimation on y { - to: window.height / 2; + to: window.height / 2 running: created - onRunningChanged: if (running) duration = (window.height - sun.y) * 10; else state = "OffScreen"; + onRunningChanged: { + if (running) + duration = (window.height - sun.y) * 10; + else + state = "OffScreen" + } } states: State { - name: "OffScreen"; - StateChangeScript { script: { sun.created = false; sun.destroy() } } + name: "OffScreen" + StateChangeScript { + script: { sun.created = false; sun.destroy() } + } + } + + onCreatedChanged: { + if (created) { + sun.z = 1; // above the sky but below the ground layer + window.activeSuns++; + } else { + window.activeSuns--; + } } } diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js index 3c1b975..92d345d 100644 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ b/examples/declarative/dynamic/qml/itemCreation.js @@ -1,54 +1,39 @@ var itemComponent = null; var draggedItem = null; var startingMouse; -var startingZ; -//Until QT-2385 is resolved we need to convert to scene coordinates manually -var xOffset; -var yOffset; -function setSceneOffset() -{ - xOffset = 0; - yOffset = 0; - var p = itemButton; - while(p != window){ - xOffset += p.x; - yOffset += p.y; - p = p.parent; - } -} +var posnInWindow; function startDrag(mouse) { - setSceneOffset(); + posnInWindow = paletteItem.mapToItem(null, 0, 0); startingMouse = { x: mouse.x, y: mouse.y } loadComponent(); } -//Creation is split into two functions due to an asyncronous wait while +//Creation is split into two functions due to an asynchronous wait while //possible external files are loaded. function loadComponent() { - if (itemComponent != null) //Already loaded the component + if (itemComponent != null) { // component has been previously loaded createItem(); + return; + } - itemComponent = Qt.createComponent(itemButton.file); - //console.log(itemButton.file) - if(itemComponent.status == Component.Loading){ - component.statusChanged.connect(finishCreation); - }else{//Depending on the content, it can be ready or error immediately + itemComponent = Qt.createComponent(paletteItem.componentFile); + if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately + component.statusChanged.connect(createItem); + else createItem(); - } } function createItem() { if (itemComponent.status == Component.Ready && draggedItem == null) { draggedItem = itemComponent.createObject(); draggedItem.parent = window; - draggedItem.image = itemButton.image; - draggedItem.x = xOffset; - draggedItem.y = yOffset; - startingZ = draggedItem.z; - draggedItem.z = 4;//On top + draggedItem.image = paletteItem.image; + draggedItem.x = posnInWindow.x; + draggedItem.y = posnInWindow.y; + draggedItem.z = 3; // make sure created item is above the ground layer } else if (itemComponent.status == Component.Error) { draggedItem = null; console.log("error creating component"); @@ -56,25 +41,24 @@ function createItem() { } } -function moveDrag(mouse) +function continueDrag(mouse) { - if(draggedItem == null) + if (draggedItem == null) return; - draggedItem.x = mouse.x + xOffset - startingMouse.x; - draggedItem.y = mouse.y + yOffset - startingMouse.y; + draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x; + draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y; } function endDrag(mouse) { - if(draggedItem == null) + if (draggedItem == null) return; - if(draggedItem.x + draggedItem.width > toolbox.x){ //Don't drop it in the toolbox + if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox draggedItem.destroy(); draggedItem = null; - }else{ - draggedItem.z = startingZ; + } else { draggedItem.created = true; draggedItem = null; } -- cgit v0.12 From 4600f2053802ad41550a84573bdcbe4b50fb5a67 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 7 May 2010 13:29:34 +1000 Subject: Doc fix Task-number: QTBUG-10458 --- src/declarative/util/qdeclarativelistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 3810256..0985a6b 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -591,7 +591,7 @@ void QDeclarativeListModel::set(int index, const QScriptValue& valuemap) Changes the \a property of the item at \a index in the list model to \a value. \code - fruitModel.set(3, "cost", 5.95) + fruitModel.setProperty(3, "cost", 5.95) \endcode The \a index must be an element in the list. -- cgit v0.12 From 17837067e9dbda02669487bdd64419c38e8a2ebd Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Fri, 7 May 2010 14:17:27 +1000 Subject: Add missing qml file to qdeclarativemousearea --- .../qdeclarativemousearea/data/rejectEvent.qml | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml diff --git a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml new file mode 100644 index 0000000..fecfadf --- /dev/null +++ b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml @@ -0,0 +1,28 @@ +import Qt 4.7 + +Rectangle { + id: root + color: "#ffffff" + width: 320; height: 240 + property bool mr1_pressed: false + property bool mr1_released: false + property bool mr1_canceled: false + property bool mr2_pressed: false + property bool mr2_released: false + property bool mr2_canceled: false + + MouseArea { + id: mouseRegion1 + anchors.fill: parent + onPressed: {console.log("press111"); root.mr1_pressed = true} + onReleased: {console.log("release111"); root.mr1_released = true} + onCanceled: {console.log("ungrab1111"); root.mr1_canceled = true} + } + MouseArea { + id: mouseRegion2 + width: 120; height: 120 + onPressed: {console.log("press222"); root.mr2_pressed = true; mouse.accepted = false} + onReleased: {console.log("release2222"); root.mr2_released = true} + onCanceled: {console.log("ungrab2222"); root.mr2_canceled = true} + } +} -- cgit v0.12 From 60a06af7200217aa16c8c130a1ed0afce31812ed Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 7 May 2010 14:23:56 +1000 Subject: Fix autotests (remove import Qt.widgets) --- .../auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml | 1 - tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml index 91973a3..d430c2c 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml @@ -1,5 +1,4 @@ import Qt 4.7 -import Qt.widgets 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml index 9bb0b37..3b851c1 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml @@ -1,5 +1,4 @@ import Qt 4.7 -import Qt.widgets 4.6 QGraphicsWidget { size: "250x250" -- cgit v0.12 From 32c2d17680a04fced714aa103b40d7de24d9eb26 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 7 May 2010 14:41:00 +1000 Subject: Fix autotests --- src/imports/imports.pro | 2 +- tests/auto/declarative/declarative.pro | 1 - tests/auto/declarative/examples/tst_examples.cpp | 23 +++---- .../graphicswidgets/data/graphicswidgets.qml | 52 --------------- .../graphicswidgets/graphicswidgets.pro | 10 --- .../graphicswidgets/tst_graphicswidgets.cpp | 74 ---------------------- 6 files changed, 9 insertions(+), 153 deletions(-) delete mode 100644 tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml delete mode 100644 tests/auto/declarative/graphicswidgets/graphicswidgets.pro delete mode 100644 tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 1754908..a9d600e 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS += particles +SUBDIRS += particles gestures contains(QT_CONFIG, webkit): SUBDIRS += webkit contains(QT_CONFIG, mediaservices): SUBDIRS += multimedia diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 05c4c26..a9b069c 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs SUBDIRS += \ examples \ - graphicswidgets \ # Cover parserstress \ # Cover qmetaobjectbuilder \ # Cover qdeclarativeanimations \ # Cover diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index 4f10a98..3759cb5 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -80,16 +80,6 @@ tst_examples::tst_examples() // Add directories you want excluded here - excludedDirs << "examples/declarative/extending"; - excludedDirs << "examples/declarative/tutorials/extending"; - excludedDirs << "examples/declarative/plugins"; - excludedDirs << "examples/declarative/proxywidgets"; - excludedDirs << "examples/declarative/gestures"; - - excludedDirs << "examples/declarative/imageprovider"; - excludedDirs << "examples/declarative/layouts/graphicsLayouts"; - excludedDirs << "demos/declarative/minehunt"; - excludedDirs << "doc/src/snippets/declarative/graphicswidgets"; #ifdef QT_NO_WEBKIT @@ -160,11 +150,14 @@ QStringList tst_examples::findQmlFiles(const QDir &d) QStringList rv; - QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"), - QDir::Files); - foreach (const QString &file, files) { - if (file.at(0).isLower()) { - rv << d.absoluteFilePath(file); + QStringList cppfiles = d.entryList(QStringList() << QLatin1String("*.cpp"), QDir::Files); + if (cppfiles.isEmpty()) { + QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"), + QDir::Files); + foreach (const QString &file, files) { + if (file.at(0).isLower()) { + rv << d.absoluteFilePath(file); + } } } diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml deleted file mode 100644 index d6cf4de..0000000 --- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml +++ /dev/null @@ -1,52 +0,0 @@ -import Qt 4.7 -import Qt.widgets 4.7 - -QGraphicsWidget { - geometry: "20,0,600x400" - layout: QGraphicsLinearLayout { - orientation: Qt.Horizontal - QGraphicsWidget { - layout: QGraphicsLinearLayout { - spacing: 10; orientation: Qt.Vertical - LayoutItem { - QGraphicsLinearLayout.stretchFactor: 1 - QGraphicsLinearLayout.spacing: 1 - objectName: "left" - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent } - } - LayoutItem { - QGraphicsLinearLayout.stretchFactor: 10 - QGraphicsLinearLayout.spacing: 10 - objectName: "left" - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { objectName: "yellowRect"; color: "blue"; anchors.fill: parent } - } - } - } - QGraphicsWidget { - layout: QGraphicsLinearLayout { - spacing: 10; orientation: Qt.Horizontal; contentsMargin: 10 - LayoutItem { - objectName: "left" - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { objectName: "yellowRect"; color: "red"; anchors.fill: parent } - } - LayoutItem { - objectName: "left" - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { objectName: "yellowRect"; color: "green"; anchors.fill: parent } - } - } - } - } -} - diff --git a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro deleted file mode 100644 index b77b430..0000000 --- a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro +++ /dev/null @@ -1,10 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui -macx:CONFIG -= app_bundle - -SOURCES += tst_graphicswidgets.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" - -CONFIG += parallel_test diff --git a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp b/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp deleted file mode 100644 index f1a71d5..0000000 --- a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include - -class tst_graphicswidgets : public QObject - -{ - Q_OBJECT -public: - tst_graphicswidgets(); - -private slots: - void widgets(); -}; - -tst_graphicswidgets::tst_graphicswidgets() -{ -} - -void tst_graphicswidgets::widgets() -{ - QDeclarativeEngine engine; - QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/graphicswidgets.qml")); - QGraphicsWidget *obj = qobject_cast(c.create()); - - QVERIFY(obj != 0); - delete obj; -} - -QTEST_MAIN(tst_graphicswidgets) - -#include "tst_graphicswidgets.moc" -- cgit v0.12 From bdfa2d47fa1a6abee6e966f82fadf7a3d97bab0b Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 7 May 2010 15:48:58 +1000 Subject: Doc --- src/imports/webkit/qdeclarativewebview.cpp | 33 ++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp index 5db812c..9571470 100644 --- a/src/imports/webkit/qdeclarativewebview.cpp +++ b/src/imports/webkit/qdeclarativewebview.cpp @@ -437,24 +437,39 @@ void QDeclarativeWebView::paintPage(const QRect& r) /*! \qmlproperty list WebView::javaScriptWindowObjects - This property is a list of object that are available from within - the webview's JavaScript context. + A list of QML objects to expose to the web page. - The \a object will be inserted as a child of the frame's window - object, under the name given by the attached property \c WebView.windowObjectName. + Each object will be added as a property of the web frame's window object. The + property name is controlled by the value of \c WebView.windowObjectName + attached property. + + Exposing QML objects to a web page allows JavaScript executing in the web + page itself to communicate with QML, by reading and writing properties and + by calling methods of the exposed QML objects. + + This example shows how to call into a QML method using a window object. \qml WebView { - javaScriptWindowObjects: Object { - WebView.windowObjectName: "coordinates" + javaScriptWindowObjects: QtObject { + WebView.windowObjectName: "qml" + + function qmlCall() { + console.log("This call is in QML!"); + } } + + html: "" } \endqml - Properties of the object will be exposed as JavaScript properties and slots as - JavaScript methods. + The output of the example will be: + \code + This is in WebKit! + This call is in QML! + \endcode - If Javascript is not enabled for this page, then this property does nothing. + If Javascript is not enabled for the page, then this property does nothing. */ QDeclarativeListProperty QDeclarativeWebView::javaScriptWindowObjects() { -- cgit v0.12 From 4976130171033abdd8323a19229dcbfc5b008cfe Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 7 May 2010 16:15:37 +1000 Subject: Avoid many unnecessary allocations, so so that paint engines attached to pixmaps do not consume excessive amounts of memory, and so can still be reasonably kept cached with the pixmap. Saves 8K for every pixmaps drawn to on raster paint engine. Saves about 2K for other graphicssystems. Task-number: QTBUG-10215 Reviewed-by: Gunnar --- src/gui/painting/qdatabuffer_p.h | 19 +++++++-- src/gui/painting/qoutlinemapper.cpp | 3 +- src/gui/painting/qoutlinemapper_p.h | 11 ++++- src/gui/painting/qpaintengine_raster.cpp | 47 ++++++++++++---------- src/gui/painting/qpaintengine_raster_p.h | 6 ++- src/gui/painting/qpaintengineex.cpp | 3 +- src/gui/painting/qpathclipper.cpp | 23 +++++++---- src/gui/painting/qpathclipper_p.h | 7 +++- src/gui/painting/qpolygonclipper_p.h | 3 +- src/gui/painting/qrasterizer.cpp | 8 +++- src/gui/painting/qstroker.cpp | 2 +- src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | 4 +- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 + .../gl2paintengineex/qtriangulatingstroker.cpp | 5 ++- .../gl2paintengineex/qtriangulatingstroker_p.h | 1 + src/opengl/gl2paintengineex/qtriangulator.cpp | 12 +++--- src/opengl/qpaintengine_opengl.cpp | 3 ++ 17 files changed, 107 insertions(+), 51 deletions(-) diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index bc5f1ef..8f8544f 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -60,16 +60,20 @@ QT_BEGIN_NAMESPACE template class QDataBuffer { public: - QDataBuffer(int res = 64) + QDataBuffer(int res) { capacity = res; - buffer = (Type*) qMalloc(capacity * sizeof(Type)); + if (res) + buffer = (Type*) qMalloc(capacity * sizeof(Type)); + else + buffer = 0; siz = 0; } ~QDataBuffer() { - qFree(buffer); + if (buffer) + qFree(buffer); } inline void reset() { siz = 0; } @@ -104,6 +108,8 @@ public: inline void reserve(int size) { if (size > capacity) { + if (capacity == 0) + capacity = 1; while (capacity < size) capacity *= 2; buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type)); @@ -112,7 +118,12 @@ public: inline void shrink(int size) { capacity = size; - buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type)); + if (size) + buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type)); + else { + qFree(buffer); + buffer = 0; + } } inline void swap(QDataBuffer &other) { diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index ad0c2eb..1b01960 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -154,7 +154,8 @@ QT_FT_Outline *QOutlineMapper::convertPath(const QVectorPath &path) // ### We can kill this copying and just use the buffer straight... m_elements.resize(count); - memcpy(m_elements.data(), path.points(), count* sizeof(QPointF)); + if (count) + memcpy(m_elements.data(), path.points(), count* sizeof(QPointF)); m_element_types.resize(0); } diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index d0ce1a9..39b7593 100644 --- a/src/gui/painting/qoutlinemapper_p.h +++ b/src/gui/painting/qoutlinemapper_p.h @@ -87,8 +87,15 @@ const int QT_RASTER_COORD_LIMIT = 32767; class QOutlineMapper { public: - QOutlineMapper() - : m_round_coords(false) + QOutlineMapper() : + m_element_types(0), + m_elements(0), + m_elements_dev(0), + m_points(0), + m_tags(0), + m_contours(0), + m_polygon_dev(0), + m_round_coords(false) { } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 9148ac2..483bc0c 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -336,17 +336,6 @@ void QRasterPaintEngine::init() d->hdc = 0; #endif - d->rasterPoolSize = 8192; - d->rasterPoolBase = -#if defined(Q_WS_WIN64) - // We make use of setjmp and longjmp in qgrayraster.c which requires - // 16-byte alignment, hence we hardcode this requirement here.. - (unsigned char *) _aligned_malloc(d->rasterPoolSize, sizeof(void*) * 2); -#else - (unsigned char *) malloc(d->rasterPoolSize); -#endif - Q_CHECK_PTR(d->rasterPoolBase); - // The antialiasing raster. d->grayRaster.reset(new QT_FT_Raster); Q_CHECK_PTR(d->grayRaster.data()); @@ -354,8 +343,6 @@ void QRasterPaintEngine::init() QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc - qt_ft_grays_raster.raster_reset(*d->grayRaster.data(), d->rasterPoolBase, d->rasterPoolSize); - d->rasterizer.reset(new QRasterizer); d->rasterBuffer.reset(new QRasterBuffer()); d->outlineMapper.reset(new QOutlineMapper); @@ -437,12 +424,6 @@ QRasterPaintEngine::~QRasterPaintEngine() { Q_D(QRasterPaintEngine); -#if defined(Q_WS_WIN64) - _aligned_free(d->rasterPoolBase); -#else - free(d->rasterPoolBase); -#endif - qt_ft_grays_raster.raster_done(*d->grayRaster.data()); } @@ -4090,6 +4071,22 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, return; } + const int rasterPoolInitialSize = 8192; + int rasterPoolSize = rasterPoolInitialSize; + unsigned char *rasterPoolBase; +#if defined(Q_WS_WIN64) + rasterPoolBase = + // We make use of setjmp and longjmp in qgrayraster.c which requires + // 16-byte alignment, hence we hardcode this requirement here.. + (unsigned char *) _aligned_malloc(rasterPoolSize, sizeof(void*) * 2); +#else + unsigned char rasterPoolOnStack[rasterPoolInitialSize]; + rasterPoolBase = rasterPoolOnStack; +#endif + Q_CHECK_PTR(rasterPoolBase); + + qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize); + void *data = userData; QT_FT_BBox clip_box = { deviceRect.x(), @@ -4122,13 +4119,14 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, int new_size = rasterPoolSize * 2; if (new_size > 1024 * 1024) { qWarning("QPainter: Rasterization of primitive failed"); - return; + break; } #if defined(Q_WS_WIN64) _aligned_free(rasterPoolBase); #else - free(rasterPoolBase); + if (rasterPoolBase != rasterPoolOnStack) // initially on the stack + free(rasterPoolBase); #endif rasterPoolSize = new_size; @@ -4149,6 +4147,13 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, done = true; } } + +#if defined(Q_WS_WIN64) + _aligned_free(rasterPoolBase); +#else + if (rasterPoolBase != rasterPoolOnStack) // initially on the stack + free(rasterPoolBase); +#endif } void QRasterPaintEnginePrivate::recalculateFastImages() diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 55eb82e..0a0b0b2 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -300,6 +300,10 @@ QRasterPaintEnginePrivate : public QPaintEngineExPrivate { Q_DECLARE_PUBLIC(QRasterPaintEngine) public: + QRasterPaintEnginePrivate() : QPaintEngineExPrivate(), + cachedLines(0) + { + } void rasterizeLine_dashed(QLineF line, qreal width, int *dashIndex, qreal *dashOffset, bool *inDash); @@ -354,8 +358,6 @@ public: QScopedPointer dashStroker; QScopedPointer grayRaster; - unsigned long rasterPoolSize; - unsigned char *rasterPoolBase; QDataBuffer cachedLines; QSpanData image_filler; diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index a78cafb..fda937e 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -149,6 +149,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path) struct StrokeHandler { + StrokeHandler(int reserve) : pts(reserve), types(reserve) {} QDataBuffer pts; QDataBuffer types; }; @@ -394,7 +395,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) return; if (!d->strokeHandler) { - d->strokeHandler = new StrokeHandler; + d->strokeHandler = new StrokeHandler(path.elementCount()+4); d->stroker.setMoveToHook(qpaintengineex_moveTo); d->stroker.setLineToHook(qpaintengineex_lineTo); d->stroker.setCubicToHook(qpaintengineex_cubicTo); diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index c910024..78553c9 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -278,7 +278,8 @@ private: }; SegmentTree::SegmentTree(QPathSegments &segments) - : m_segments(segments) + : m_segments(segments), + m_intersections(0) { m_bounds.x1 = qt_inf(); m_bounds.y1 = qt_inf(); @@ -806,7 +807,7 @@ void QWingedEdge::intersectAndAdd() for (int i = 0; i < m_segments.points(); ++i) addVertex(m_segments.pointAt(i)); - QDataBuffer intersections; + QDataBuffer intersections(m_segments.segments()); for (int i = 0; i < m_segments.segments(); ++i) { intersections.reset(); @@ -857,11 +858,17 @@ void QWingedEdge::intersectAndAdd() } } -QWingedEdge::QWingedEdge() +QWingedEdge::QWingedEdge() : + m_edges(0), + m_vertices(0), + m_segments(0) { } -QWingedEdge::QWingedEdge(const QPainterPath &subject, const QPainterPath &clip) +QWingedEdge::QWingedEdge(const QPainterPath &subject, const QPainterPath &clip) : + m_edges(subject.length()), + m_vertices(subject.length()), + m_segments(subject.length()) { m_segments.setPath(subject); m_segments.addPath(clip); @@ -1414,9 +1421,9 @@ bool QPathClipper::intersect() else if (clipIsRect) return subjectPath.intersects(r2); - QPathSegments a; + QPathSegments a(subjectPath.length()); a.setPath(subjectPath); - QPathSegments b; + QPathSegments b(clipPath.length()); b.setPath(clipPath); QIntersectionFinder finder; @@ -1459,9 +1466,9 @@ bool QPathClipper::contains() if (clipIsRect) return subjectPath.contains(r2); - QPathSegments a; + QPathSegments a(subjectPath.length()); a.setPath(subjectPath); - QPathSegments b; + QPathSegments b(clipPath.length()); b.setPath(clipPath); QIntersectionFinder finder; diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index 7962400..fab618d 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -199,7 +199,7 @@ public: }; - QPathSegments(); + QPathSegments(int reserve); void setPath(const QPainterPath &path); void addPath(const QPainterPath &path); @@ -345,7 +345,10 @@ inline QPathVertex::operator QPointF() const return QPointF(x, y); } -inline QPathSegments::QPathSegments() +inline QPathSegments::QPathSegments(int reserve) : + m_points(reserve), + m_segments(reserve), + m_intersections(reserve) { } diff --git a/src/gui/painting/qpolygonclipper_p.h b/src/gui/painting/qpolygonclipper_p.h index 1b4cbb3..cdaac1c 100644 --- a/src/gui/painting/qpolygonclipper_p.h +++ b/src/gui/painting/qpolygonclipper_p.h @@ -62,7 +62,8 @@ QT_BEGIN_NAMESPACE template class QPolygonClipper { public: - QPolygonClipper() + QPolygonClipper() : + buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 51d01c9..f8f8afb 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -198,9 +198,11 @@ public: }; QScanConverter::QScanConverter() - : m_alloc(0) + : m_lines(0) + , m_alloc(0) , m_size(0) , m_intersections(0) + , m_active(0) { } @@ -310,6 +312,10 @@ struct QBoolToType template void qScanConvert(QScanConverter &d, T allVertical) { + if (!d.m_lines.size()) { + d.m_active.reset(); + return; + } qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder)); int line = 0; for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) { diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index e43544c..9b8e099 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -187,7 +187,7 @@ static inline qreal adapted_angle_on_x(const QLineF &line) } QStrokerOps::QStrokerOps() - : m_customData(0), m_moveTo(0), m_lineTo(0), m_cubicTo(0) + : m_elements(0), m_customData(0), m_moveTo(0), m_lineTo(0), m_cubicTo(0) { } diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h index adc69ee..46029b9 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h @@ -100,8 +100,10 @@ class QGL2PEXVertexArray { public: QGL2PEXVertexArray() : + vertexArray(0), vertexArrayStops(0), maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10), - boundingRectDirty(true) {} + boundingRectDirty(true) + { } inline void addRect(const QRectF &rect) { diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 6ba0c42..0a046dc 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -177,6 +177,7 @@ public: ctx(0), useSystemClip(true), elementIndicesVBOId(0), + opacityArray(0), snapToPixelGrid(false), addOffset(false), nativePaintingActive(false), diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp index f677ce1..9bc099d 100644 --- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp +++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp @@ -481,7 +481,8 @@ static void qdashprocessor_cubicTo(qreal, qreal, qreal, qreal, qreal, qreal, voi } QDashedStrokeProcessor::QDashedStrokeProcessor() - : m_dash_stroker(0), m_inv_scale(1) + : m_points(0), m_types(0), + m_dash_stroker(0), m_inv_scale(1) { m_dash_stroker.setMoveToHook(qdashprocessor_moveTo); m_dash_stroker.setLineToHook(qdashprocessor_lineTo); @@ -499,6 +500,8 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c m_points.reset(); m_types.reset(); + m_points.reserve(path.elementCount()); + m_types.reserve(path.elementCount()); qreal width = qpen_widthf(pen); if (width == 0) diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h index 956d7cc..ab27ed6 100644 --- a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h +++ b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE class QTriangulatingStroker { public: + QTriangulatingStroker() : m_vertices(0) {} void process(const QVectorPath &path, const QPen &pen, const QRectF &clip); inline int vertexCount() const { return m_vertices.size(); } diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index ce917ff..df7cbc2 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -510,6 +510,7 @@ template class QMaxHeap { public: + QMaxHeap() : m_data(0) {} inline int size() const {return m_data.size();} inline bool empty() const {return m_data.isEmpty();} inline bool isEmpty() const {return m_data.isEmpty();} @@ -1299,7 +1300,8 @@ public: class ComplexToSimple { public: - inline ComplexToSimple(QTriangulator *parent) : m_parent(parent) { } + inline ComplexToSimple(QTriangulator *parent) : m_parent(parent), + m_edges(0), m_events(0), m_splits(0) { } void decompose(); private: struct Edge @@ -1412,7 +1414,7 @@ public: class SimpleToMonotone { public: - inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent) { } + inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { } void decompose(); private: enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex}; @@ -1486,7 +1488,7 @@ public: int m_length; }; - inline QTriangulator() { } + inline QTriangulator() : m_vertices(0) { } // Call this only once. void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix); @@ -2709,7 +2711,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() return; Q_ASSERT(!m_edgeList.root); - QDataBuffer > diagonals; + QDataBuffer > diagonals(m_upperVertex.size()); int i = 0; for (int index = 1; index < m_edges.size(); ++index) { @@ -2853,7 +2855,7 @@ bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j void QTriangulator::MonotoneToTriangles::decompose() { QVector result; - QDataBuffer stack; + QDataBuffer stack(m_parent->m_indices.size()); m_first = 0; // Require at least three more indices. while (m_first + 3 <= m_parent->m_indices.size()) { diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 306fd8b..d2b0d4f 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -668,6 +668,7 @@ public: , last_created_state(0) , shader_ctx(0) , grad_palette(0) + , tess_points(0) , drawable_texture(0) , ref_cleaner(this) {} @@ -1950,6 +1951,8 @@ void QOpenGLPaintEnginePrivate::pathToVertexArrays(const QPainterPath &path) void QOpenGLPaintEnginePrivate::drawVertexArrays() { + if (tess_points_stops.count() == 0) + return; glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(2, GL_DOUBLE, 0, tess_points.data()); int previous_stop = 0; -- cgit v0.12 From 175eedd991d321d0902ea0065f9b288c62958a5d Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 4 May 2010 17:46:48 +0200 Subject: Add configure time checks for symbian environment Adding test for various compile time components like rcomp and the compiler actually working should make it failing much more transparant. Reviewed-by: Thiago --- config.tests/symbian/simple/main.cpp | 6 +++++ config.tests/symbian/simple/simple.pro | 4 ++++ configure | 41 +++++++++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 config.tests/symbian/simple/main.cpp create mode 100644 config.tests/symbian/simple/simple.pro diff --git a/config.tests/symbian/simple/main.cpp b/config.tests/symbian/simple/main.cpp new file mode 100644 index 0000000..41371da --- /dev/null +++ b/config.tests/symbian/simple/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int, char **) { + printf("test\n"); + return 0; +} diff --git a/config.tests/symbian/simple/simple.pro b/config.tests/symbian/simple/simple.pro new file mode 100644 index 0000000..fa086c9 --- /dev/null +++ b/config.tests/symbian/simple/simple.pro @@ -0,0 +1,4 @@ +TEMPLATE = app +QT = +SOURCES += main.cpp + diff --git a/configure b/configure index 6194eb5..a0ccf9a 100755 --- a/configure +++ b/configure @@ -780,7 +780,7 @@ L_FLAGS= RPATH_FLAGS= l_FLAGS= QCONFIG_FLAGS= -XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" +XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian/linux-gcce" PLATFORM=$QMAKESPEC QT_CROSS_COMPILE=no OPT_CONFIRM_LICENSE=no @@ -4057,7 +4057,7 @@ if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then EOF fi -if echo "$XPLATFORM" | grep symbian > /dev/null ; then +case "$XPLATFORM" in *symbian*) cat << EOF Qt for Symbian only: @@ -4069,7 +4069,8 @@ Qt for Symbian only: -no-usedeffiles .... Disable the usage of DEF files. * -usedeffiles ....... Enable the usage of DEF files. EOF -fi +;; +esac [ "x$ERROR" = "xyes" ] && exit 1 exit 0 @@ -4697,6 +4698,40 @@ if [ "$CFG_ZLIB" = "auto" ]; then fi fi +case "$XPLATFORM" in *symbian*) + if test -z "$EPOCROOT"; then + echo "Please export EPOCROOT. It should point to the sdk install dir" + exit 1 + fi + if test ! -d "$EPOCROOT/epoc32"; then + echo "Could not find the 'epoc32' dir in your EPOCROOT." + exit 1 + fi + + # the main commands needed to compile; + (cd config.tests/symbian + mkdir -p rcomp + cd rcomp + rm -f rcomp_test.rsg + touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss + rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null + if test ! -f rcomp_test.rsg; then + echo "Finding a working rcomp in your PATH failed." + echo "Fatal error. Make sure you have the epoc tools working and in your PATH"; + exit 1; + fi + ) + + # compile a simple main that uses printf + if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS + then + echo "Testing your compiler failed. Could not compile a simple application." + echo "Fatal error; Rerun configure with -verbose to get more details." + exit 1; + fi + ;; +esac + if [ "$CFG_S60" = "auto" ]; then if echo "$XPLATFORM" | grep symbian > /dev/null; then CFG_S60=yes -- cgit v0.12 From 9cd2a03b09cbe4b024304b1d5d761b464c6c05e4 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 7 May 2010 10:12:07 +0200 Subject: my changes --- dist/changes-4.7.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index df782c0..3766c88 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -72,6 +72,8 @@ QtGui * Fixed a bug that led to missing text pixels in QTabBar when using small font sizes. (QTBUG-7137) + - QImage + * Added QImage::bitPlaneCount(). (QTBUG-7982) QtNetwork --------- @@ -102,6 +104,20 @@ QtXmlPatterns - [QTBUG-8394] include/import/redefine schemas only once - QXmlSchema: fix crash with referencing elements +Qt Plugins +---------- + + - Jpeg image IO plugin + * Fixed failure to store certain QImage formats as jpeg (QTBUG-7780) + * Optimized smoothscaling + * Optimized to avoid data copy when reading from memory device (QTBUG-9095) + + - SVG image IO plugin + * Added support for svgz format (QTBUG-8227) + * Fixed canRead() so that it can be used also for non-sequential + devices. (QTBUG-9053) + * Added support for clipping and scaling and backgroundcolor + * Optimized to avoid data copy when reading from memory device (QTBUG-9095) **************************************************************************** * Database Drivers * -- cgit v0.12 From f5366aea8594946e78106c5f93ecb2d47f121d32 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 May 2010 10:00:28 +0200 Subject: QUrl::fromLocalFile: fix silly mistake: it's fromNativeSeparators, not to --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 7b5bfed..67119b5 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5985,7 +5985,7 @@ QUrl QUrl::fromLocalFile(const QString &localFile) { QUrl url; url.setScheme(QLatin1String("file")); - QString deslashified = QDir::toNativeSeparators(localFile); + QString deslashified = QDir::fromNativeSeparators(localFile); // magic for drives on windows if (deslashified.length() > 1 && deslashified.at(1) == QLatin1Char(':') && deslashified.at(0) != QLatin1Char('/')) { -- cgit v0.12 From aebc59dde62651bbe60af626f289a587d475e73a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 May 2010 10:19:25 +0200 Subject: tst_qxmlquery: Fix misuse of absolute paths as URLs Reviewed-By: Peter Hartmann --- tests/auto/qxmlquery/tst_qxmlquery.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index be0d708..6fd9b93 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -857,7 +857,7 @@ void tst_QXmlQuery::bindVariableXSLTSuccess() const stylesheet.bindVariable(QLatin1String("paramSelectWithTypeIntBoundWithBindVariableRequired"), QVariant(QLatin1String("param5"))); - stylesheet.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl")))); + stylesheet.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl")))); QVERIFY(stylesheet.isValid()); @@ -1798,11 +1798,11 @@ void tst_QXmlQuery::setFocusQUrl() const { QXmlQuery query(QXmlQuery::XSLT20); - const TestURIResolver resolver(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); + const TestURIResolver resolver(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); query.setUriResolver(&resolver); QVERIFY(query.setFocus(QUrl(QLatin1String("arbitraryURI")))); - query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl")))); + query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl")))); QVERIFY(query.isValid()); QBuffer result; @@ -2997,7 +2997,7 @@ void tst_QXmlQuery::setInitialTemplateNameQXmlName() const QCOMPARE(query.initialTemplateName(), name); - query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl")))); + query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl")))); QVERIFY(query.isValid()); QBuffer result; @@ -3059,7 +3059,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const /* Ensure fn:doc() picks up the right QNetworkAccessManager. */ { NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")), - QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")))); + QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")))); QXmlQuery query; query.setNetworkAccessManager(&networkOverrider); @@ -3075,7 +3075,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const /* Ensure setQuery() is using the right network manager. */ { NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")), - QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq")))); + QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq")))); QXmlQuery query; query.setNetworkAccessManager(&networkOverrider); @@ -3135,7 +3135,7 @@ void tst_QXmlQuery::multipleDocsAndFocus() const query.setQuery(QLatin1String("string(doc('") + inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")) + QLatin1String("'))")); - query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); + query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); query.setQuery(QLatin1String("string(.)")); QStringList result; @@ -3159,11 +3159,11 @@ void tst_QXmlQuery::multipleEvaluationsWithDifferentFocus() const QXmlQuery query; QStringList result; - query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); + query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); query.setQuery(QLatin1String("string(.)")); QVERIFY(query.evaluateTo(&result)); - query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); + query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml")))); QVERIFY(query.evaluateTo(&result)); } -- cgit v0.12 From db1254131c8d372e1d47acbaaa7c5c2b2be5b7d7 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 7 May 2010 11:51:10 +0300 Subject: Fix fetchedRoot test variable to work also in Symbian RVCT builds cannot seem to be able to deal with data symbols at runtime, so made accessors for fetchedRoot test variable. Also moved it out of QFileInfoGatherer class as there is no need to have it there. Reviewed-by: Janne Koskinen --- src/gui/dialogs/qfileinfogatherer.cpp | 15 +++++++++++++-- src/gui/dialogs/qfileinfogatherer_p.h | 3 --- tests/auto/qfiledialog2/tst_qfiledialog2.cpp | 16 +++++++++++----- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 3b279ae..af0506f 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -55,7 +55,18 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_FILESYSTEMMODEL -bool QFileInfoGatherer::fetchedRoot = false; +#ifdef QT_BUILD_INTERNAL +static bool fetchedRoot = false; +Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot() +{ + fetchedRoot = false; +} + +Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot() +{ + return fetchedRoot; +} +#endif /*! Creates thread @@ -278,7 +289,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil // List drives if (path.isEmpty()) { -#if defined Q_AUTOTEST_EXPORT +#ifdef QT_BUILD_INTERNAL fetchedRoot = true; #endif QFileInfoList infoList; diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index 5abcd94..8681eb5 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -195,9 +195,6 @@ private: uint userId; uint groupId; #endif -public : - //for testing purpose - static bool fetchedRoot; }; #endif // QT_NO_FILESYSTEMMODEL diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp index 6bfa8be..eee495f 100644 --- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp @@ -76,6 +76,13 @@ # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" #endif +#if defined QT_BUILD_INTERNAL +QT_BEGIN_NAMESPACE +Q_GUI_EXPORT bool qt_test_isFetchedRoot(); +Q_GUI_EXPORT void qt_test_resetFetchedRoot(); +QT_END_NAMESPACE +#endif + class QNonNativeFileDialog : public QFileDialog { Q_OBJECT @@ -139,7 +146,7 @@ private: }; tst_QFileDialog2::tst_QFileDialog2() -{ +{ #if defined(Q_OS_WINCE) qApp->setAutoMaximizeThreshold(-1); #endif @@ -177,19 +184,18 @@ void tst_QFileDialog2::listRoot() QFileInfoGatherer fileInfoGatherer; fileInfoGatherer.start(); QTest::qWait(1500); - - QFileInfoGatherer::fetchedRoot = false; + qt_test_resetFetchedRoot(); QString dir(QDir::currentPath()); QNonNativeFileDialog fd(0, QString(), dir); fd.show(); - QCOMPARE(QFileInfoGatherer::fetchedRoot,false); + QCOMPARE(qt_test_isFetchedRoot(),false); fd.setDirectory(""); #ifdef Q_OS_WINCE QTest::qWait(1500); #else QTest::qWait(500); #endif - QCOMPARE(QFileInfoGatherer::fetchedRoot,true); + QCOMPARE(qt_test_isFetchedRoot(),true); #endif } -- cgit v0.12 From 070a3dbbb368f3e1b817a5ecff15127302458e7a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 May 2010 11:54:47 +0200 Subject: Add some debugging (disabled) to QUrl::resolved --- src/corelib/io/qurl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 67119b5..d6ded9d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5557,6 +5557,12 @@ QUrl QUrl::resolved(const QUrl &relative) const removeDotsFromPath(&t.d->encodedPath); t.d->path.clear(); +#if defined(QURL_DEBUG) + qDebug("QUrl(\"%s\").resolved(\"%s\") = \"%s\"", + toEncoded().constData(), + relative.toEncoded().constData(), + t.toEncoded().constData()); +#endif return t; } -- cgit v0.12 From 91337cb62bca653c9df7e8b8f43f451facc1efb8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 May 2010 11:56:50 +0200 Subject: QtDeclarative: RFC 3986 requires schemes to be considered case-insensitively Reviewed-By: Alan Alpert --- src/declarative/qml/qdeclarativecompositetypemanager.cpp | 2 +- src/declarative/qml/qdeclarativeengine.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index 0eb7e1b..b0c9a43 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -338,7 +338,7 @@ void QDeclarativeCompositeTypeManager::resourceReplyFinished() // WARNING, there is a copy of this function in qdeclarativeengine.cpp static QString toLocalFileOrQrc(const QUrl& url) { - if (url.scheme() == QLatin1String("qrc")) { + if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) { if (url.authority().isEmpty()) return QLatin1Char(':') + url.path(); return QString(); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 0ee6dfe..1387432 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1526,7 +1526,7 @@ QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val // WARNING, there is a copy of this function in qdeclarativecompositetypemanager.cpp static QString toLocalFileOrQrc(const QUrl& url) { - if (url.scheme() == QLatin1String("qrc")) { + if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) { if (url.authority().isEmpty()) return QLatin1Char(':') + url.path(); return QString(); -- cgit v0.12 From 694822cbe757f2b742740f593319337127b04d17 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 May 2010 11:59:06 +0200 Subject: QtDeclarative: avoid waiting for a network load on URIs with empty schemes. The proper fix would be to have QNetworkAccessManager notify immediately that this load cannot work (and it knows it can't work). Then QtDeclarative can simply check what QNAM found. Reviewed-By: Alan Alpert --- .../qml/qdeclarativecompositetypemanager.cpp | 37 +++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index b0c9a43..625356c 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -360,7 +360,10 @@ void QDeclarativeCompositeTypeManager::loadResource(QDeclarativeCompositeTypeRes } else { resource->status = QDeclarativeCompositeTypeResource::Error; } + } else if (url.scheme().isEmpty()) { + // We can't open this, so just declare as an error + resource->status = QDeclarativeCompositeTypeResource::Error; } else { QNetworkReply *reply = @@ -382,27 +385,29 @@ void QDeclarativeCompositeTypeManager::loadSource(QDeclarativeCompositeTypeData if (file.open(QFile::ReadOnly)) { QByteArray data = file.readAll(); setData(unit, data, url); - } else { - QString errorDescription; - // ### - Fill in error - errorDescription = QLatin1String("File error for URL ") + url.toString(); - unit->status = QDeclarativeCompositeTypeData::Error; - // ### FIXME - QDeclarativeError error; - error.setDescription(errorDescription); - unit->errorType = QDeclarativeCompositeTypeData::AccessError; - unit->errors << error; - doComplete(unit); + return; // success } - - } else { + } else if (!url.scheme().isEmpty()) { QNetworkReply *reply = engine->networkAccessManager()->get(QNetworkRequest(url)); QObject::connect(reply, SIGNAL(finished()), this, SLOT(replyFinished())); QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(requestProgress(qint64,qint64))); + return; // waiting } + + // error happened + QString errorDescription; + // ### - Fill in error + errorDescription = QLatin1String("File error for URL ") + url.toString(); + unit->status = QDeclarativeCompositeTypeData::Error; + // ### FIXME + QDeclarativeError error; + error.setDescription(errorDescription); + unit->errorType = QDeclarativeCompositeTypeData::AccessError; + unit->errors << error; + doComplete(unit); } void QDeclarativeCompositeTypeManager::requestProgress(qint64 received, qint64 total) @@ -724,8 +729,10 @@ void QDeclarativeCompositeTypeManager::compile(QDeclarativeCompositeTypeData *un } } - QUrl importUrl = unit->imports.baseUrl().resolved(QUrl(QLatin1String("qmldir"))); - if (toLocalFileOrQrc(importUrl).isEmpty()) + QUrl importUrl; + if (!unit->imports.baseUrl().scheme().isEmpty()) + importUrl = unit->imports.baseUrl().resolved(QUrl(QLatin1String("qmldir"))); + if (!importUrl.scheme().isEmpty() && toLocalFileOrQrc(importUrl).isEmpty()) resourceList.prepend(importUrl); for (int ii = 0; ii < resourceList.count(); ++ii) { -- cgit v0.12 From 14fdf300795032b21fe51a256b5b22d3c14ca301 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 7 May 2010 13:20:14 +0200 Subject: Doc: Chages to search feature, css and table order Changes the search results Fixed table css Added odd&even classes to tables generated by the thmlgenerator Reviewed-by: Morten Engvoldsen --- doc/src/template/scripts/functions.js | 7 ++-- doc/src/template/style/style.css | 29 ++++++++++++++--- tools/qdoc3/htmlgenerator.cpp | 60 ++++++++++++++++++++++++++++------- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 4b3107f..306b628 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -83,9 +83,9 @@ function processNokiaData(response){ } } - if(lookupCount == 0){$('#ul001').prepend('
  • no result
  • ');$('#ul001 li').css('display','block');} - if(articleCount == 0){$('#ul002').prepend('
  • no result
  • ');$('#ul002 li').css('display','block');} - if(exampleCount == 0){$('#ul003').prepend('
  • no result
  • ');$('#ul003 li').css('display','block');} + if(lookupCount == 0){$('#ul001').prepend('
  • Found no result
  • ');$('#ul001 li').css('display','block');} + if(articleCount == 0){$('#ul002').prepend('
  • Found no result
  • ');$('#ul002 li').css('display','block');} + if(exampleCount == 0){$('#ul003').prepend('
  • Found no result
  • ');$('#ul003 li').css('display','block');} // reset count variables; lookupCount=0; articleCount = 0; @@ -97,6 +97,7 @@ function processNokiaData(response){ var blankRE=/^\s*$/; function CheckEmptyAndLoadList() { + $('.liveResult').remove(); var value = document.getElementById('pageType').value; if((blankRE.test(value)) || (value.length < 3)) { diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 6bcb0db..644e56b 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -460,12 +460,12 @@ padding-left: 12px; background: url(../images/bullet_sq.png) no-repeat 0 5px; font: normal 400 10pt/1 Verdana; - color: #44a51c; + /* color: #44a51c;*/ margin-bottom: 10px; } .content li:hover { - text-decoration: underline; + /* text-decoration: underline;*/ } .offline .wrap .content @@ -747,11 +747,23 @@ th { padding: 5px 15px 5px 15px; + background-color: #E1E1E1; + border-bottom: 1px solid #E6E6E6; + border-left: 1px solid #E6E6E6; + border-right: 1px solid #E6E6E6; } td { padding: 3px 15px 3px 20px; + border-left: 1px solid #E6E6E6; + border-right: 1px solid #E6E6E6; + } + tr.odd td:hover, tr.even td:hover + { + /* border-right: 1px solid #C3C3C3; + border-left: 1px solid #C3C3C3;*/ } + td.rightAlign { padding: 3px 15px 3px 10px; @@ -879,13 +891,22 @@ font: 600 12px/1.2 Arial; } - .generic{} + .generic{ + max-width:100%; + } + .generic td{ + padding:0; + } + .alignedsummary{} .propsummary{} .memItemLeft{} .memItemRight{} .bottomAlign{} - .highlightedCode{} + .highlightedCode + { + margin:10px; + } .LegaleseLeft{} .valuelist{} .annotated{} diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 93b0218..6560b68 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -912,8 +912,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == ATOM_LIST_VALUE) { threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { - out() << "" - << "" + out() << "
    Constant
    "; + // << "" + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + + out() << "" << "" << "\n"; } @@ -1093,7 +1099,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, } if (!atom->string().isEmpty()) { if (atom->string().contains("%")) - out() << "
    ConstantValueDescription
    string() << "\">\n "; + out() << "
    \n "; // width=\"" << atom->string() << "\">\n "; else { out() << "
    \n"; } @@ -2456,7 +2462,13 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "
    \n"; for (k = 0; k < numRows; k++) { - out() << "\n"; + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + //break; + +// out() << "\n"; for (i = 0; i < NumColumns; i++) { if (currentOffset[i] >= firstOffset[i + 1]) { // this column is finished @@ -3159,8 +3171,13 @@ void HtmlGenerator::generateSectionList(const Section& section, twoColumn = (section.members.count() >= 5); } if (twoColumn) - out() << "
    \n" - << "
    "; + out() << "\n"; + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + +// << "
    "; out() << "
      \n"; int i = 0; @@ -4367,8 +4384,12 @@ void HtmlGenerator::generateQmlSummary(const Section& section, twoColumn = (count >= 5); } if (twoColumn) - out() << "\n" - << "
      "; + out() << "\n"; + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + // << ""; + else + out() << ""; + + out() << "
      "; out() << "
        \n"; int row = 0; @@ -4410,7 +4431,14 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { qpn = static_cast(*p); - out() << "
      "; + + if (++numTableRows % 2 == 1) + out() << "
      "; + //out() << "
      "; // old out() << ""; if (!qpn->isWritable()) out() << "read-only"; @@ -4436,7 +4464,12 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, const FunctionNode* qsn = static_cast(node); out() << "
      "; out() << ""; - out() << ""; + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + out() << ""; else out() << ""; - out() << ""; + out() << "

      "; out() << "
      "; + //out() << "
      "; out() << ""; generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); //generateQmlItem(qsn,relative,marker,false); @@ -4448,7 +4481,12 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, const FunctionNode* qmn = static_cast(node); out() << "
      "; out() << ""; - out() << ""; + if (++numTableRows % 2 == 1) + out() << ""; + else + out() << ""; + out() << ""; -- cgit v0.12 From 137e196dc1ae2364265e7c1eb79c880120a79bb9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 7 May 2010 13:45:39 +0200 Subject: qdoc: Reorganized examples panel. --- doc/src/declarative/examples.qdoc | 5 +- doc/src/getting-started/examples.qdoc | 92 ++++++++++++++++++++++++++++- tools/qdoc3/test/qt-html-templates.qdocconf | 18 +++--- 3 files changed, 103 insertions(+), 12 deletions(-) diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index e01459f..481617e 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -40,8 +40,9 @@ ****************************************************************************/ /*! -\page qdeclarativeexamples.html -\title QML Examples and Demos + \page qdeclarativeexamples.html + \title QML Examples and Demos + \ingroup all-examples \previouspage Graphics View Examples \contentspage Qt Examples diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 542f672..0088817 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -50,6 +50,39 @@ */ /*! + \group all-examples + \title Qt Examples + + Qt includes a set of examples that cover nearly every aspect of Qt + development. They aren't meant to be impressive when you run them, + but in each case the source code has been carefully written to + illustrate one or more best Qt programming practices. + + You can run the examples from the \l{Examples and Demos Launcher} + application (except see \l{QML Examples and Demos} {QML Examples} + for special instructions for running thos examples). + + The examples are listed below by functional area. Each example + listed in a particular functional area is meant to illustrate how + best to use Qt to do some particular task in that functional area, + but the examples will often use features from other functional + areas as well for completeness. + + If you are new to Qt, you should probably start by going through + the \l{Tutorials}, and then begin with the + \l{mainwindows/application} {Application} example. + + In addition to these examples and the \l{Tutorials}{tutorials}, Qt + includes a \l{Qt Demonstrations}{selection of demos} that + deliberately show off Qt's features. You might want to look at + these as well. + + \section1 Examples by functional area + + \generatelist{related} +*/ + +/*! \page examples.html \title Qt Examples \brief The example programs provided with Qt. @@ -459,8 +492,18 @@ */ /*! + \group gui-examples + \title GUI Examples + \brief These pages list examples of constructing GUI components. + + \generatelist{related} +*/ + +/*! \page examples-widgets.html \title Widgets Examples + \ingroup all-examples + \ingroup gui-examples \contentspage Qt Examples \nextpage Dialog Examples @@ -509,7 +552,9 @@ /*! \page examples-dialogs.html + \ingroup all-examples \title Dialog Examples + \ingroup gui-examples \previouspage Widgets Examples \contentspage Qt Examples @@ -539,7 +584,9 @@ /*! \page examples-mainwindow.html + \ingroup all-examples \title Main Window Examples + \ingroup gui-examples \previouspage Dialog Examples \contentspage Qt Examples @@ -567,7 +614,9 @@ /*! \page examples-layouts.html + \ingroup all-examples \title Layout Examples + \ingroup gui-examples \previouspage Main Window Examples \contentspage Qt Examples @@ -594,6 +643,7 @@ /*! \page examples-itemviews.html + \ingroup all-examples \title Item Views Examples \previouspage Layout Examples @@ -631,8 +681,18 @@ */ /*! + \group graphics-examples + \title Graphics Examples + \brief These pages list examples of doing graphics. + + \generatelist{related} +*/ + +/*! \page examples-graphicsview.html + \ingroup all-examples \title Graphics View Examples + \ingroup graphics-examples \previouspage Item Views Examples \contentspage Qt Examples @@ -677,7 +737,9 @@ /*! \page examples-painting.html + \ingroup all-examples \title Painting Examples + \ingroup graphics-examples \previouspage QML Examples and Demos \contentspage Qt Examples @@ -709,6 +771,7 @@ /*! \page examples-richtext.html + \ingroup all-examples \title Rich Text Examples \previouspage Painting Examples @@ -732,6 +795,7 @@ /*! \page examples-desktop.html + \ingroup all-examples \title Desktop Examples \previouspage Rich Text Examples @@ -755,7 +819,9 @@ /*! \page examples-draganddrop.html + \ingroup all-examples \title Drag and Drop Examples + \ingroup gui-examples \previouspage Desktop Examples \contentspage Qt Examples @@ -783,6 +849,7 @@ /*! \page examples-threadandconcurrent.html + \ingroup all-examples \title Threading and Concurrent Programming Examples \previouspage Drag and Drop Examples @@ -823,6 +890,7 @@ /*! \page examples.tools.html + \ingroup all-examples \title Tools Examples \previouspage Threading and Concurrent Programming Examples @@ -861,6 +929,7 @@ /*! \page examples-network.html + \ingroup all-examples \title Network Examples \previouspage Tools Examples @@ -899,6 +968,7 @@ /*! \page examples-ipc.html + \ingroup all-examples \title Inter-Process Communication Examples \previouspage Network Examples @@ -916,7 +986,9 @@ /*! \page examples-opengl.html + \ingroup all-examples \title OpenGL Examples + \ingroup graphics-examples \previouspage Inter-Process Communication Examples \contentspage Qt Examples @@ -950,7 +1022,9 @@ /*! \page examples-openvg.html + \ingroup all-examples \title OpenVG Examples + \ingroup graphics-examples \previouspage OpenGL Examples \contentspage Qt Examples @@ -971,6 +1045,7 @@ /*! \page examples-multimedia.html + \ingroup all-examples \title Multimedia Examples \previouspage OpenGL Examples @@ -1020,6 +1095,7 @@ /*! \page examples-sql.html + \ingroup all-examples \title SQL Examples \previouspage Multimedia Examples @@ -1049,6 +1125,7 @@ /*! \page examples-xml.html + \ingroup all-examples \title XML Examples \previouspage SQL Examples @@ -1085,6 +1162,7 @@ /*! \page examples-designer.html + \ingroup all-examples \title Qt Designer Examples \previouspage XML Examples @@ -1110,6 +1188,7 @@ /*! \page examples-uitools.html + \ingroup all-examples \title UiTools Examples \previouspage Qt Designer Examples @@ -1126,6 +1205,7 @@ /*! \page examples-linguist.html + \ingroup all-examples \title Qt Linguist Examples \previouspage UiTools Examples @@ -1146,6 +1226,7 @@ /*! \page examples-script.html + \ingroup all-examples \title Qt Script Examples \previouspage Qt Linguist Examples @@ -1175,6 +1256,7 @@ /*! \page examples-webkit.html + \ingroup all-examples \title WebKit Examples \previouspage Qt Script Examples @@ -1215,7 +1297,8 @@ */ /*! - \page examples-helpsystem.html + \page examples-helpsystem.html + \ingroup all-examples \title Help System Examples \previouspage WebKit Examples @@ -1239,6 +1322,7 @@ /*! \page examples-statemachine.html + \ingroup all-examples \title State Machine Examples \previouspage Help System Examples @@ -1265,6 +1349,7 @@ /*! \page examples-animation.html + \ingroup all-examples \title Animation Framework Examples \previouspage State Machine Examples @@ -1287,6 +1372,7 @@ /*! \page examples-multitouch.html + \ingroup all-examples \title Multi-Touch Examples \previouspage Animation Framework Examples @@ -1306,6 +1392,7 @@ /*! \page examples-gestures.html + \ingroup all-examples \title Gestures Examples \previouspage Multi-Touch Examples @@ -1322,6 +1409,7 @@ /*! \page examples-dbus.html + \ingroup all-examples \title D-Bus Examples \previouspage Gestures Examples @@ -1341,6 +1429,7 @@ /*! \page examples-embeddedlinux.html + \ingroup all-examples \title Qt for Embedded Linux Examples \previouspage D-Bus Examples @@ -1363,6 +1452,7 @@ /*! \page examples-activeqt.html + \ingroup all-examples \title ActiveQt Examples \previouspage Qt for Embedded Linux Examples diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 8b007db..b94bb81 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -44,10 +44,10 @@ HTML.postheader = "
      \n" \ " \n" \ "
      \n" \ "
      \n" \ @@ -62,7 +62,7 @@ HTML.postheader = "
      \n" \ "
    • Painting & Graphics
    • \n" \ "
    • GUI Components
    • \n" \ "
    • Qt Quick
    • \n" \ - "
    • Platform specifics
    • \n" \ + "
    • Platform specific
    • \n" \ " \n" \ "
      \n" \ "
      \n" \ @@ -70,14 +70,14 @@ HTML.postheader = "
      \n" \ "
      \n" \ "
      \n" \ "

      \n" \ - " API Examples

      \n" \ + " Qt Examples\n" \ "
      \n" \ " \n" \ "
      \n" \ "
      \n" \ -- cgit v0.12 From 7af5c4c01207960a23a349a55372ca7ecd8824f4 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 7 May 2010 14:03:45 +0200 Subject: Doc: Tuning search script Reviewed-by: Morten Engvoldsen --- doc/src/template/scripts/functions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 306b628..108590f 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -48,37 +48,37 @@ function processNokiaData(response){ var linkEnd = ""; if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ - lookupCount=0; + lookupCount++; //$('.live001').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; - $('#ul001').prepend(full_li_element); + $('#ul001').append(full_li_element); } } if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ - articleCount = 0; + articleCount++; //$('.live002').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - $('#ul002').prepend(full_li_element); + $('#ul002').append(full_li_element); } } if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ - exampleCount = 0; + exampleCount++; //$('.live003').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - $('#ul003').prepend(full_li_element); + $('#ul003').append(full_li_element); } } } -- cgit v0.12 From 011620f153b6115ba3bde672ee90fce69d771a59 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 7 May 2010 14:14:36 +0200 Subject: qdoc: Fixed annotated list generation to use
      "; else out() << ""; - out() << ""; if (!(node->type() == Node::Fake)) { Text brief = node->doc().trimmedBriefText(name); -- cgit v0.12 From a260024eeb58b1b70ff8083773d9c34434cb360a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 7 May 2010 15:21:28 +0200 Subject: My 4.7.0 changelog entries. --- dist/changes-4.7.0 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 3766c88..6bf7ea5 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -72,9 +72,38 @@ QtGui * Fixed a bug that led to missing text pixels in QTabBar when using small font sizes. (QTBUG-7137) + - QGraphicsEffect + * Fixed rendering bugs when scrolling graphics items with drop + shadows. + - QImage + * [QTBUG-9640] Prevented unneccessary copy in + QImage::setAlphaChannel(). * Added QImage::bitPlaneCount(). (QTBUG-7982) + - QPainter + * [QTBUG-10018] Fixed image drawing inconsistencies when drawing + 1x1 source rects with rotating / shear / perspective transforms. + * Optimized various blending and rendering operations for ARM + processors with a NEON vector unit. + * Fixed some performance issues when drawing sub-pixmaps of large + pixmaps and falling back to raster in the X11 paint engine. + + - QPainterPath + * [QTBUG-3778] Fixed bug in painter path polygon intersection code. + * [QTBUG-7396] Optimized painter path intersections for when at + least one of the paths is a rectangle by special casing. + * [QTBUG-8035] Got rid of bezier intersection code in the boolean + operators (intersect, subtract, unite) to prevent numerical + stability issues. + + - QRegion + * [QTBUG-7699] Fixed crash caused by large x-coordinates. + + - QTransform + * [QTBUG-8557] Fixed bug in QTransform::type() potentially occuring + after using operator/ or operator* or their overloads. + QtNetwork --------- - QHostInfo: Added a small 60 second DNS cache -- cgit v0.12 From 346aa62e0ca4d02c32cae227165db004d2f15214 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 10 May 2010 10:32:59 +1000 Subject: Avoid changing header dependencies. (should fix compile on Symbian) --- src/gui/painting/qpaintengine_raster.cpp | 5 +++++ src/gui/painting/qpaintengine_raster_p.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 483bc0c..6f395f6 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -251,6 +251,11 @@ static void qt_debug_path(const QPainterPath &path) } #endif +QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : + QPaintEngineExPrivate(), + cachedLines(0) +{ +} /*! diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 0a0b0b2..1016f8d 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -300,10 +300,7 @@ QRasterPaintEnginePrivate : public QPaintEngineExPrivate { Q_DECLARE_PUBLIC(QRasterPaintEngine) public: - QRasterPaintEnginePrivate() : QPaintEngineExPrivate(), - cachedLines(0) - { - } + QRasterPaintEnginePrivate(); void rasterizeLine_dashed(QLineF line, qreal width, int *dashIndex, qreal *dashOffset, bool *inDash); -- cgit v0.12 From 1ca5742e83b650750d45d03882e8109c61c1f392 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 10 May 2010 10:54:32 +1000 Subject: There is no Qt.widgets Task-number: QTBUG-10469 --- examples/declarative/layouts/layoutItem/layoutItem.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/declarative/layouts/layoutItem/layoutItem.qml b/examples/declarative/layouts/layoutItem/layoutItem.qml index 9b9db22..460c564 100644 --- a/examples/declarative/layouts/layoutItem/layoutItem.qml +++ b/examples/declarative/layouts/layoutItem/layoutItem.qml @@ -1,5 +1,4 @@ import Qt 4.7 -import Qt.widgets 4.7 LayoutItem {//Sized by the layout id: resizable -- cgit v0.12 From b524e356424fe386eae56f65600077ce52ca6f92 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Mon, 10 May 2010 03:43:12 +0200 Subject: Optimize QGW constructor. Mostly by avoiding sending useless QVariant at construction time. itemChange is virtual, the user implementation will never be called. Worst case the QGW one. Reviewed-by:janarve --- src/gui/graphicsview/qgraphicsitem.cpp | 7 ++++--- src/gui/graphicsview/qgraphicswidget.cpp | 3 --- src/gui/graphicsview/qgraphicswidget_p.cpp | 9 ++++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ba674dd..b2bdc5c 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1090,6 +1090,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q if (newParent == parent) return; + if (isWidget) + static_cast(this)->fixFocusChainBeforeReparenting((newParent && + newParent->isWidget()) ? static_cast(newParent) : 0, + scene); if (scene) { // Deliver the change to the index if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex) @@ -1796,9 +1800,6 @@ static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::Graphics */ void QGraphicsItem::setFlags(GraphicsItemFlags flags) { - if (isWindow()) - flags |= ItemIsPanel; - // Notify change and check for adjustment. if (quint32(d_ptr->flags) == quint32(flags)) return; diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index b264447..478c0c3 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1105,9 +1105,6 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & } break; case ItemParentChange: { - QGraphicsItem *parent = qVariantValue(value); - d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast(parent) : 0, scene()); - // Deliver ParentAboutToChange. QEvent event(QEvent::ParentAboutToChange); QApplication::sendEvent(this, &event); diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp index 6e397b6..50b315a 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.cpp +++ b/src/gui/graphicsview/qgraphicswidget_p.cpp @@ -71,14 +71,17 @@ void QGraphicsWidgetPrivate::init(QGraphicsItem *parentItem, Qt::WindowFlags wFl adjustWindowFlags(&wFlags); windowFlags = wFlags; - q->setParentItem(parentItem); + if (parentItem) + setParentItemHelper(parentItem, 0, 0); + q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::DefaultType)); q->setGraphicsItem(q); resolveLayoutDirection(); q->unsetWindowFrameMargins(); - q->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); - q->setFlag(QGraphicsItem::ItemSendsGeometryChanges); + flags |= QGraphicsItem::ItemUsesExtendedStyleOption | QGraphicsItem::ItemSendsGeometryChanges; + if (windowFlags & Qt::Window) + flags |= QGraphicsItem::ItemIsPanel; } qreal QGraphicsWidgetPrivate::titleBarHeight(const QStyleOptionTitleBar &options) const -- cgit v0.12 From 6ab242e23832f0ab10ef26a3b7b505cf086ddf43 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 10 May 2010 12:04:18 +1000 Subject: Prevent handling of Up/Down on Mac OS X, for consistency with other platforms. Task-number: QTBUG-10438 --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 9 +++++++-- .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 9ae4e1a..604f508 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -62,6 +62,9 @@ QT_BEGIN_NAMESPACE Input constraints include setting a QValidator, an input mask, or a maximum input length. + + On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled. + If you want such bindings (on any platform), you will need to construct them in QML. */ QDeclarativeTextInput::QDeclarativeTextInput(QDeclarativeItem* parent) : QDeclarativePaintedItem(*(new QDeclarativeTextInputPrivate), parent) @@ -860,10 +863,12 @@ void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus) void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev) { Q_D(QDeclarativeTextInput); - if(((d->control->cursor() == 0 && ev->key() == Qt::Key_Left) + if (((ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier) // Don't allow MacOSX up/down support, and we don't allow a completer. + || (((d->control->cursor() == 0 && ev->key() == Qt::Key_Left) || (d->control->cursor() == d->control->text().length() && ev->key() == Qt::Key_Right)) - && (d->lastSelectionStart == d->lastSelectionEnd)){ + && (d->lastSelectionStart == d->lastSelectionEnd))) + { //ignore when moving off the end //unless there is a selection, because then moving will do something (deselect) ev->ignore(); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 0065ccf..c00390d 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -576,6 +576,14 @@ void tst_qdeclarativetextinput::navigation() simulateKey(canvas, Qt::Key_Left); QVERIFY(input->hasFocus() == true); + // Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438). + input->setCursorPosition(2); + QCOMPARE(input->cursorPosition(),2); + simulateKey(canvas, Qt::Key_Up); + QCOMPARE(input->cursorPosition(),2); + simulateKey(canvas, Qt::Key_Down); + QCOMPARE(input->cursorPosition(),2); + delete canvas; } -- cgit v0.12 From c4d8435f80ef72fa419591a666b4e989ccb2c173 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 10 May 2010 12:19:16 +1000 Subject: Remove debug messages from mousearea autotest file --- .../declarative/qdeclarativemousearea/data/rejectEvent.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml index fecfadf..c01e938 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml @@ -14,15 +14,15 @@ Rectangle { MouseArea { id: mouseRegion1 anchors.fill: parent - onPressed: {console.log("press111"); root.mr1_pressed = true} - onReleased: {console.log("release111"); root.mr1_released = true} - onCanceled: {console.log("ungrab1111"); root.mr1_canceled = true} + onPressed: { root.mr1_pressed = true } + onReleased: { root.mr1_released = true } + onCanceled: { root.mr1_canceled = true } } MouseArea { id: mouseRegion2 width: 120; height: 120 - onPressed: {console.log("press222"); root.mr2_pressed = true; mouse.accepted = false} - onReleased: {console.log("release2222"); root.mr2_released = true} - onCanceled: {console.log("ungrab2222"); root.mr2_canceled = true} + onPressed: { root.mr2_pressed = true; mouse.accepted = false } + onReleased: { root.mr2_released = true } + onCanceled: { root.mr2_canceled = true } } } -- cgit v0.12 From b1b8d79cecb40e94ddaf91c0e319209849d27f9e Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 10 May 2010 12:29:13 +1000 Subject: Fixes doc of mouse area's onEntered Task-number: QTBUG-9227 --- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 74f2338..1947c00 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -197,8 +197,8 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() This handler is called when the mouse enters the mouse area. By default the onEntered handler is only called while a button is - pressed. Setting hoverEnabled to true enables handling of - onExited when no mouse button is pressed. + pressed. Setting hoverEnabled to true enables handling of + onEntered when no mouse button is pressed. \sa hoverEnabled */ @@ -209,7 +209,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() This handler is called when the mouse exists the mouse area. By default the onExited handler is only called while a button is - pressed. Setting hoverEnabled to true enables handling of + pressed. Setting hoverEnabled to true enables handling of onExited when no mouse button is pressed. \sa hoverEnabled -- cgit v0.12 From 9fabb4624a3b1209bc7fb5a4edd919c62df20233 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 10 May 2010 12:56:43 +1000 Subject: Add some test asserts --- src/declarative/util/qdeclarativepropertychanges.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index c7e3bc5..6e88259 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -163,11 +163,13 @@ public: virtual void execute(Reason) { ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); + Q_ASSERT(expression != ownedExpression); } virtual bool isReversable() { return true; } virtual void reverse(Reason) { ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); + Q_ASSERT(reverseExpression != ownedExpression); } virtual void saveOriginals() { @@ -177,6 +179,7 @@ public: virtual void rewind() { ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); + Q_ASSERT(rewindExpression != ownedExpression); } virtual void saveCurrentValues() { rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); -- cgit v0.12 From 5280485f2b614c7b0417e37f91b959b689835b42 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 10 May 2010 16:25:01 +1000 Subject: Removed multimedia effects from tvtennis declarative example The multimedia elements are not part of 4.7 anymore. Reviewed-by: Martin Jones --- examples/declarative/tvtennis/click.wav | Bin 3056 -> 0 bytes examples/declarative/tvtennis/paddle.wav | Bin 5320 -> 0 bytes examples/declarative/tvtennis/tvtennis.qml | 8 -------- 3 files changed, 8 deletions(-) delete mode 100644 examples/declarative/tvtennis/click.wav delete mode 100644 examples/declarative/tvtennis/paddle.wav diff --git a/examples/declarative/tvtennis/click.wav b/examples/declarative/tvtennis/click.wav deleted file mode 100644 index 26c46f8..0000000 Binary files a/examples/declarative/tvtennis/click.wav and /dev/null differ diff --git a/examples/declarative/tvtennis/paddle.wav b/examples/declarative/tvtennis/paddle.wav deleted file mode 100644 index 604e0e5..0000000 Binary files a/examples/declarative/tvtennis/paddle.wav and /dev/null differ diff --git a/examples/declarative/tvtennis/tvtennis.qml b/examples/declarative/tvtennis/tvtennis.qml index 354a16f..c90d9c5 100644 --- a/examples/declarative/tvtennis/tvtennis.qml +++ b/examples/declarative/tvtennis/tvtennis.qml @@ -1,5 +1,4 @@ import Qt 4.7 -import Qt.multimedia 4.7 Rectangle { id: page @@ -17,17 +16,12 @@ Rectangle { x: 20; width: 20; height: 20; z: 1 color: "Lime" - SoundEffect { id: paddle; source: "paddle.wav" } - SoundEffect { id: wall; source: "click.wav" } - // Move the ball to the right and back to the left repeatedly SequentialAnimation on x { loops: Animation.Infinite NumberAnimation { to: page.width - 40; duration: 2000 } - ScriptAction { script: paddle.play() } PropertyAction { target: ball; property: "direction"; value: "left" } NumberAnimation { to: 20; duration: 2000 } - ScriptAction { script: paddle.play() } PropertyAction { target: ball; property: "direction"; value: "right" } } @@ -37,10 +31,8 @@ Rectangle { // Detect the ball hitting the top or bottom of the view and bounce it onYChanged: { if (y <= 0) { - wall.play(); targetY = page.height - 20; } else if (y >= page.height - 20) { - wall.play(); targetY = 0; } } -- cgit v0.12 From abcec6ba4b126358c50bf4c539253f88da6bb2d6 Mon Sep 17 00:00:00 2001 From: Nicolai de Haan Date: Wed, 5 May 2010 16:54:34 +0200 Subject: Opt out of visual-config size checks with extension EGL_NV_post_convert_replication. QTBUG-9444. Task-number: QTBUG-9444 Merge-request: 612 Reviewed-by: Trond --- src/gui/egl/qegl_x11.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp index cb8dcda..969acc4 100644 --- a/src/gui/egl/qegl_x11.cpp +++ b/src/gui/egl/qegl_x11.cpp @@ -163,6 +163,11 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config) int matchingCount = 0; chosenVisualInfo = XGetVisualInfo(X11->display, VisualIDMask, &visualInfoTemplate, &matchingCount); if (chosenVisualInfo) { + // Skip size checks if implementation supports non-matching visual + // and config (http://bugreports.qt.nokia.com/browse/QTBUG-9444). + if (QEgl::hasExtension("EGL_NV_post_convert_replication")) + return visualId; + int visualRedSize = countBits(chosenVisualInfo->red_mask); int visualGreenSize = countBits(chosenVisualInfo->green_mask); int visualBlueSize = countBits(chosenVisualInfo->blue_mask); -- cgit v0.12 From 346215c3d9f0be621a833e7c735501504c7aa0b0 Mon Sep 17 00:00:00 2001 From: Jakub Wieczorek Date: Mon, 10 May 2010 11:02:37 +0200 Subject: tst_SuiteTest: Fix a meaningless switch statement The switch statement, that specifies which test handler should be used to run a test suite was missing break; statements, which made it always fall back to the XML Schema test suite. Merge-request: 619 Reviewed-by: Benjamin Poulain --- tests/auto/xmlpatternsxqts/tst_suitetest.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp index 64120c7..ec63858 100644 --- a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp @@ -89,10 +89,17 @@ void tst_SuiteTest::runTestSuite() const TestSuite::SuiteType suiteType; switch (m_suiteType) { - case XQuerySuite: suiteType = TestSuite::XQuerySuite; - case XsltSuite: suiteType = TestSuite::XsltSuite; - case XsdSuite: suiteType = TestSuite::XsdSuite; - default: break; + case XQuerySuite: + suiteType = TestSuite::XQuerySuite; + break; + case XsltSuite: + suiteType = TestSuite::XsltSuite; + break; + case XsdSuite: + suiteType = TestSuite::XsdSuite; + break; + default: + break; } TestSuite *const ts = TestSuite::openCatalog(catalogPath, errMsg, true, suiteType); -- cgit v0.12 From 48d22dbcf4a8608b0e5242b25f0b4f771656b683 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 10 May 2010 12:51:37 +0200 Subject: Doc: Updates to the html template and javascript Reviewed-by: Morten Engvoldsen --- doc/src/template/scripts/functions.js | 9 +++++++++ tools/qdoc3/htmlgenerator.cpp | 1 + tools/qdoc3/test/qt-html-templates.qdocconf | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 108590f..2362bc4 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -50,6 +50,8 @@ function processNokiaData(response){ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ lookupCount++; //$('.live001').css('display','block'); + $('#ul001 .defaultLink').css('display','none'); + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; @@ -62,6 +64,8 @@ function processNokiaData(response){ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ articleCount++; //$('.live002').css('display','block'); + $('#ul002 .defaultLink').css('display','none'); + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; @@ -73,6 +77,8 @@ function processNokiaData(response){ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ exampleCount++; //$('.live003').css('display','block'); + $('#ul003 .defaultLink').css('display','none'); + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; @@ -114,6 +120,9 @@ function CheckEmptyAndLoadList() // Loads on doc ready $(document).ready(function () { + var pageTitle = $('title').html(); + $('#feedform').append(''); + $('#pageType').keyup(function () { var searchString = $('#pageType').val() ; if ((searchString == null) || (searchString.length < 3)) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 67aa6c6..638ae94 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1849,6 +1849,7 @@ void HtmlGenerator::generateFooter(const Node *node) out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); + out() << " \n"; out() << "\n"; out() << "\n"; } diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b94bb81..534f19f 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -127,8 +127,9 @@ HTML.footer = " \n" \ "
      \n" \ " X\n" \ "
      \n" \ - "
      \n" \ - "

      \n" \ + " \n" \ + "

      \n" \ + " \n" \ "

      \n" \ " \n" \ -- cgit v0.12 From 20b7f5773777b8999f21f50e55b8f446a29fd976 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 10 May 2010 14:18:53 +0300 Subject: Workaround for Symbian Open C bug in socket connect. Socket connect in Symbian may return non-standard EPIPE error, after which the connection is terminated. Added Symbian specific workaround to set socket to UnconnectedState if EPIPE errno is received. In addition a bug report for Open C is created: http://developer.symbian.org/bugs/show_bug.cgi?id=2676 Task-number: QT-3362 Reviewed-by: Aleksandar Sasha Babic Reviewed-by: Markus Goetz --- src/network/socket/qnativesocketengine_unix.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index d155357..70bb0da 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -425,6 +425,9 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16 case EBADF: case EFAULT: case ENOTSOCK: +#ifdef Q_OS_SYMBIAN + case EPIPE: +#endif socketState = QAbstractSocket::UnconnectedState; default: break; -- cgit v0.12 From 5e07004df26cbf65a0fe0096a3417a5329f72431 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 10 May 2010 14:14:38 +0200 Subject: Doc correction to css Reviewed-by: Morten Engvoldsen --- doc/src/template/style/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 644e56b..2e01af6 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1026,8 +1026,8 @@ { display: inline-block; width: 49%; - /* *width:42%; - _width:42%;*/ + *width:42%; + _width:42%; padding:0 2% 0 1%; vertical-align:top; @@ -1036,8 +1036,8 @@ .indexboxcont .indexIcon { width: 11%; - /* *width:18%; - _width:18%;*/ + *width:18%; + _width:18%; overflow:hidden; } -- cgit v0.12 From 147ef453d130fc7817b3b4406502b1b887ab6c79 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 May 2010 14:20:47 +0200 Subject: qdoc: Another revision of the top doc page. More to come. --- doc/src/getting-started/examples.qdoc | 31 ++++++----------------------- doc/src/index.qdoc | 22 ++++++++++---------- doc/src/overviews.qdoc | 13 ++++++++---- tools/qdoc3/test/qt-html-templates.qdocconf | 13 ++++++------ 4 files changed, 32 insertions(+), 47 deletions(-) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 0088817..400714f 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -492,18 +492,10 @@ */ /*! - \group gui-examples - \title GUI Examples - \brief These pages list examples of constructing GUI components. - - \generatelist{related} -*/ - -/*! \page examples-widgets.html \title Widgets Examples \ingroup all-examples - \ingroup gui-examples + \brief Lots of examples of how to use different kinds of widgets. \contentspage Qt Examples \nextpage Dialog Examples @@ -554,7 +546,7 @@ \page examples-dialogs.html \ingroup all-examples \title Dialog Examples - \ingroup gui-examples + \brief Using Qt's standard dialogs and building and using custom dialogs. \previouspage Widgets Examples \contentspage Qt Examples @@ -586,7 +578,7 @@ \page examples-mainwindow.html \ingroup all-examples \title Main Window Examples - \ingroup gui-examples + \building applications around a main window. \previouspage Dialog Examples \contentspage Qt Examples @@ -616,7 +608,7 @@ \page examples-layouts.html \ingroup all-examples \title Layout Examples - \ingroup gui-examples + Using Qt's layout-based approach to widget management. \previouspage Main Window Examples \contentspage Qt Examples @@ -645,6 +637,7 @@ \page examples-itemviews.html \ingroup all-examples \title Item Views Examples + \brief Using the model/view design pattern to separate presentation from data. \previouspage Layout Examples \contentspage Qt Examples @@ -681,18 +674,10 @@ */ /*! - \group graphics-examples - \title Graphics Examples - \brief These pages list examples of doing graphics. - - \generatelist{related} -*/ - -/*! \page examples-graphicsview.html \ingroup all-examples \title Graphics View Examples - \ingroup graphics-examples + \brief Using Qt to manage and interact with a large (potentially) number of graphics items. \previouspage Item Views Examples \contentspage Qt Examples @@ -739,7 +724,6 @@ \page examples-painting.html \ingroup all-examples \title Painting Examples - \ingroup graphics-examples \previouspage QML Examples and Demos \contentspage Qt Examples @@ -821,7 +805,6 @@ \page examples-draganddrop.html \ingroup all-examples \title Drag and Drop Examples - \ingroup gui-examples \previouspage Desktop Examples \contentspage Qt Examples @@ -988,7 +971,6 @@ \page examples-opengl.html \ingroup all-examples \title OpenGL Examples - \ingroup graphics-examples \previouspage Inter-Process Communication Examples \contentspage Qt Examples @@ -1024,7 +1006,6 @@ \page examples-openvg.html \ingroup all-examples \title OpenVG Examples - \ingroup graphics-examples \previouspage OpenGL Examples \contentspage Qt Examples diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 92f91e6..e6efe4d 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -70,26 +70,26 @@
      • Canvas UI with Graphics View
      • -
      • UI design & Qt Quick
      • Input/output
      • Integrating Web Content
      • X-platform, debug & deploy
      • diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc index b2ba3a1..cb6541d 100644 --- a/doc/src/overviews.qdoc +++ b/doc/src/overviews.qdoc @@ -49,9 +49,9 @@ /*! \group qt-basic-concepts - \title Qt Basic Concepts + \title Basic Qt Architecture - \brief The basic concepts of the Qt cross-platform application and UI framework. + \brief The basic architecture of the Qt cross-platform application and UI framework. Qt is a cross-platform application and UI framework for writing web-enabled applications for desktop, mobile, and embedded @@ -63,9 +63,14 @@ /*! \group qt-gui-concepts - \title Qt GUI Construction + \title Qt Desktop UI Components - \brief The Qt components for constructing Graphical User Intefaces. + \brief The Qt components for constructing native look & feel desktop UI's. + + These pages are about Qt's traditional set of GUI components for + building both native look ^ feel and custom UI's for the desktop + environment. Use \l {declarativeui.html} {Qt Quick} for building + UI's for mobile devices. \generatelist {related} */ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b94bb81..e691705 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -47,7 +47,7 @@ HTML.postheader = "
        \n" \ "
      • Modules
      • \n" \ "
      • Namespaces
      • \n" \ "
      • Global stuff
      • \n" \ - "
      • QML Elements
      • \n" \ + "
      • QML elements
      • \n" \ "
      \n" \ "
      \n" \ "
      \n" \ @@ -58,11 +58,10 @@ HTML.postheader = "
      \n" \ " Qt Topics\n" \ "
      \n" \ " \n" \ "
      \n" \ "
      \n" \ @@ -70,7 +69,7 @@ HTML.postheader = "
      \n" \ "
      \n" \ "
      \n" \ "

      \n" \ - " Qt Examples

      \n" \ + " Examples\n" \ "
      \n" \ "
        \n" \ "
      • Examples
      • \n" \ -- cgit v0.12 From 0828b63ce77846f14994f7c47468f0db8b42fbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 10 May 2010 12:39:52 +0200 Subject: Revert "Use QUrl::isLocalFile and fix the scheme checking in local URLs." This reverts commit ebddf7a8739d7f4aaa7d9cb8a41a14eebb65e4f4. --- src/network/access/qnetworkaccessfilebackend.cpp | 11 +++-------- src/network/access/qnetworkaccessmanager.cpp | 11 ++++++----- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 6 ------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp index 710c258..4560153 100644 --- a/src/network/access/qnetworkaccessfilebackend.cpp +++ b/src/network/access/qnetworkaccessfilebackend.cpp @@ -65,15 +65,10 @@ QNetworkAccessFileBackendFactory::create(QNetworkAccessManager::Operation op, } QUrl url = request.url(); - if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0 || url.isLocalFile()) { + if (url.scheme() == QLatin1String("qrc") || !url.toLocalFile().isEmpty()) return new QNetworkAccessFileBackend; - } else if (!url.scheme().isEmpty() && url.authority().isEmpty()) { - // check if QFile could, in theory, open this URL via the file engines - // it has to be in the format: - // prefix:path/to/file - // or prefix:/path/to/file - // - // this construct here must match the one below in open() + else if (!url.isEmpty() && url.authority().isEmpty()) { + // check if QFile could, in theory, open this URL QFileInfo fi(url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery)); if (fi.exists() || (op == QNetworkAccessManager::PutOperation && fi.dir().exists())) return new QNetworkAccessFileBackend; diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 10fdc6f..1c7661d 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -907,20 +907,21 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera { Q_D(QNetworkAccessManager); - bool isLocalFile = req.url().isLocalFile(); - // fast path for GET on file:// URLs + // Also if the scheme is empty we consider it a file. // The QNetworkAccessFileBackend will right now only be used // for PUT or qrc:// if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) - && isLocalFile) { + && (req.url().scheme() == QLatin1String("file") + || req.url().scheme().isEmpty())) { return new QFileNetworkReply(this, req, op); } #ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. - if (!d->networkAccessible && !isLocalFile) { + if (!d->networkAccessible && !(req.url().scheme() == QLatin1String("file") || + req.url().scheme().isEmpty())) { return new QDisabledNetworkReply(this, req, op); } @@ -962,7 +963,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera QUrl url = request.url(); QNetworkReplyImpl *reply = new QNetworkReplyImpl(this); #ifndef QT_NO_BEARERMANAGEMENT - if (!isLocalFile) { + if (req.url().scheme() != QLatin1String("file") && !req.url().scheme().isEmpty()) { connect(this, SIGNAL(networkSessionConnected()), reply, SLOT(_q_networkSessionConnected())); } diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index c4d458f..9d942bf 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -1166,12 +1166,6 @@ void tst_QNetworkReply::getErrors_data() QTest::addColumn("httpStatusCode"); QTest::addColumn("dataIsEmpty"); - // empties - QTest::newRow("empty-url") << QString() << int(QNetworkReply::ProtocolUnknownError) << 0 << true; - QTest::newRow("empty-scheme-host") << SRCDIR "/rfc3252.txt" << int(QNetworkReply::ProtocolUnknownError) << 0 << true; - QTest::newRow("empty-scheme") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" - << int(QNetworkReply::ProtocolUnknownError) << 0 << true; - // file: errors QTest::newRow("file-host") << "file://this-host-doesnt-exist.troll.no/foo.txt" #if !defined Q_OS_WIN -- cgit v0.12 From 82433177590490e6a69074c2d86adaa7741b4913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 10 May 2010 14:11:54 +0200 Subject: Revert "QUrl::fromLocalFile: fix silly mistake: it's fromNativeSeparators, not to" This reverts commit f5366aea8594946e78106c5f93ecb2d47f121d32. --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index d6ded9d..7e5c622 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5991,7 +5991,7 @@ QUrl QUrl::fromLocalFile(const QString &localFile) { QUrl url; url.setScheme(QLatin1String("file")); - QString deslashified = QDir::fromNativeSeparators(localFile); + QString deslashified = QDir::toNativeSeparators(localFile); // magic for drives on windows if (deslashified.length() > 1 && deslashified.at(1) == QLatin1Char(':') && deslashified.at(0) != QLatin1Char('/')) { -- cgit v0.12 From cc422e939d671bba8d70a5d02abfb893627303cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 10 May 2010 14:12:42 +0200 Subject: Revert "[QNAM FTP] Check for the "ftp" scheme case-insensitively" This reverts commit a9fb306a1cf1308a3f8b9bb12ed01aed1f6f6f8d. --- src/network/access/qnetworkaccessftpbackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index da336d0..1a59011 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -77,7 +77,7 @@ QNetworkAccessFtpBackendFactory::create(QNetworkAccessManager::Operation op, } QUrl url = request.url(); - if (url.scheme().compare(QLatin1String("ftp"), Qt::CaseInsensitive) == 0) + if (url.scheme() == QLatin1String("ftp")) return new QNetworkAccessFtpBackend; return 0; } -- cgit v0.12 From 98e935eed5549e479f6666680aed1711dc42111c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 10 May 2010 14:12:52 +0200 Subject: Revert "Improve QUrl handling of local file paths" This reverts commit a2f797b52c4274a62a7cf1f0939aca1429afe211. --- src/corelib/io/qurl.cpp | 73 +++++++++++++------------------------------- src/corelib/io/qurl.h | 1 - tests/auto/qurl/tst_qurl.cpp | 11 +------ 3 files changed, 23 insertions(+), 62 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 7e5c622..d4b8b5f 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5976,22 +5976,19 @@ bool QUrl::isDetached() const /*! - Returns a QUrl representation of \a localFile, interpreted as a local - file. This function accepts paths separated by slashes as well as the - native separator for this platform. + Returns a QUrl representation of \a localFile, interpreted as a + local file. - This function also accepts paths with a doubled leading slash (or - backslash) to indicate a remote file, as in - "//servername/path/to/file.txt". Note that only certain platforms can - actually open this file using QFile::open(). - - \sa toLocalFile(), isLocalFile(), QDir::toNativeSeparators + \sa toLocalFile() */ QUrl QUrl::fromLocalFile(const QString &localFile) { QUrl url; url.setScheme(QLatin1String("file")); - QString deslashified = QDir::toNativeSeparators(localFile); + QString deslashified = localFile; + deslashified.replace(QLatin1Char('\\'), QLatin1Char('/')); + + // magic for drives on windows if (deslashified.length() > 1 && deslashified.at(1) == QLatin1Char(':') && deslashified.at(0) != QLatin1Char('/')) { @@ -6010,61 +6007,35 @@ QUrl QUrl::fromLocalFile(const QString &localFile) } /*! - Returns the path of this URL formatted as a local file path. The path - returned will use forward slashes, even if it was originally created - from one with backslashes. + Returns the path of this URL formatted as a local file path. - If this URL contains a non-empty hostname, it will be encoded in the - returned value in the form found on SMB networks (for example, - "//servername/path/to/file.txt"). - - \sa fromLocalFile(), isLocalFile() + \sa fromLocalFile() */ QString QUrl::toLocalFile() const { - // the call to isLocalFile() also ensures that we're parsed - if (!isLocalFile()) - return QString(); + if (!d) return QString(); + if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse(); QString tmp; QString ourPath = path(); + if (d->scheme.isEmpty() || QString::compare(d->scheme, QLatin1String("file"), Qt::CaseInsensitive) == 0) { - // magic for shared drive on windows - if (!d->host.isEmpty()) { - tmp = QLatin1String("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') - ? QLatin1Char('/') + ourPath : ourPath); - } else { - tmp = ourPath; - // magic for drives on windows - if (ourPath.length() > 2 && ourPath.at(0) == QLatin1Char('/') && ourPath.at(2) == QLatin1Char(':')) - tmp.remove(0, 1); + // magic for shared drive on windows + if (!d->host.isEmpty()) { + tmp = QLatin1String("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') + ? QLatin1Char('/') + ourPath : ourPath); + } else { + tmp = ourPath; + // magic for drives on windows + if (ourPath.length() > 2 && ourPath.at(0) == QLatin1Char('/') && ourPath.at(2) == QLatin1Char(':')) + tmp.remove(0, 1); + } } return tmp; } /*! - \since 4.7 - Returns true if this URL is pointing to a local file path. A URL is a - local file path if the scheme is "file". - - Note that this function considers URLs with hostnames to be local file - paths, even if the eventual file path cannot be opened with - QFile::open(). - - \sa fromLocalFile(), toLocalFile() -*/ -bool QUrl::isLocalFile() const -{ - if (!d) return false; - if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse(); - - if (d->scheme.compare(QLatin1String("file"), Qt::CaseInsensitive) != 0) - return false; // not file - return true; -} - -/*! Returns true if this URL is a parent of \a childUrl. \a childUrl is a child of this URL if the two URLs share the same scheme and authority, and this URL's path is a parent of the path of \a childUrl. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 162aa7c..6f8331a 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -183,7 +183,6 @@ public: static QUrl fromLocalFile(const QString &localfile); QString toLocalFile() const; - bool isLocalFile() const; QString toString(FormattingOptions options = None) const; diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 67bf0c1..fa42adc 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -314,7 +314,6 @@ void tst_QUrl::constructing() QUrl buildUNC; - buildUNC.setScheme(QString::fromLatin1("file")); buildUNC.setHost(QString::fromLatin1("somehost")); buildUNC.setPath(QString::fromLatin1("somepath")); QCOMPARE(buildUNC.toLocalFile(), QString::fromLatin1("//somehost/somepath")); @@ -1758,15 +1757,7 @@ void tst_QUrl::toLocalFile_data() QTest::newRow("data7") << QString::fromLatin1("file://somehost/") << QString::fromLatin1("//somehost/"); QTest::newRow("data8") << QString::fromLatin1("file://somehost") << QString::fromLatin1("//somehost"); QTest::newRow("data9") << QString::fromLatin1("file:////somehost/somedir/somefile") << QString::fromLatin1("//somehost/somedir/somefile"); - QTest::newRow("data10") << QString::fromLatin1("FILE:/a.txt") << QString::fromLatin1("/a.txt"); - - // and some that result in empty (i.e., not local) - QTest::newRow("xdata0") << QString::fromLatin1("/a.txt") << QString(); - QTest::newRow("xdata1") << QString::fromLatin1("//a.txt") << QString(); - QTest::newRow("xdata2") << QString::fromLatin1("///a.txt") << QString(); - QTest::newRow("xdata3") << QString::fromLatin1("foo:/a.txt") << QString(); - QTest::newRow("xdata4") << QString::fromLatin1("foo://a.txt") << QString(); - QTest::newRow("xdata5") << QString::fromLatin1("foo:///a.txt") << QString(); + } void tst_QUrl::toLocalFile() -- cgit v0.12 From dc63ab9018b1a7db94e822e710346600a83a4bc6 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Mon, 10 May 2010 14:12:46 +0200 Subject: Allow EPOCROOT env var to be without trailing slash. --- mkspecs/symbian/linux-gcce/qmake.conf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian/linux-gcce/qmake.conf index 57bb56a..faac2f1 100644 --- a/mkspecs/symbian/linux-gcce/qmake.conf +++ b/mkspecs/symbian/linux-gcce/qmake.conf @@ -83,13 +83,13 @@ for(line, QMAKE_GCC_SEARCH_DIRS) { } } -QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib - -INCLUDEPATH = ${EPOCROOT}epoc32/include/ \ - $${EPOCROOT}epoc32/include/variant \ - $${EPOCROOT}epoc32/include/stdapis \ - $${EPOCROOT}epoc32/include/gcce \ - ${EPOCROOT}epoc32/include/stdapis/sys \ - ${EPOCROOT}epoc32/include/stdapis/stlport \ +QMAKE_LIBDIR += $${EPOCROOT}/epoc32/release/armv5/lib + +INCLUDEPATH = ${EPOCROOT}/epoc32/include/ \ + $${EPOCROOT}/epoc32/include/variant \ + $${EPOCROOT}/epoc32/include/stdapis \ + $${EPOCROOT}/epoc32/include/gcce \ + ${EPOCROOT}/epoc32/include/stdapis/sys \ + ${EPOCROOT}/epoc32/include/stdapis/stlport \ $$INCLUDEPATH -- cgit v0.12 From 4ad58161814a80409f790bf8269e147551adfee0 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Mon, 10 May 2010 15:16:55 +0200 Subject: Documentation updates for Qt/Symbian on Linux development --- doc/src/getting-started/installation.qdoc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 3ea351e..36abc10 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -703,21 +703,19 @@ If you are using pre-built binaries, follow the instructions given in the \ingroup qtsymbian \brief How to install Qt on the Symbian platform using Linux. -\note Qt for the Symbian platform has some requirements that are given in more detail -in the \l{Qt for the Symbian platform Requirements} document. TODO list requirements like SDK here. - \note \bold {This document describes how to install and configure Qt for the Symbian platform from scratch, using Linux as the build host. -Qt does not come with a binary package for Linux yet, but if you want to avoid -the full build of Qt and start developing applications right away, you can -download drop-in binaries from here: TODO} +Qt for Symbian binaries can be downloaded directly so development of +applications using Qt for Symbian can start right away.} \list 1 \o Setup the development environment - TODO Make sure your Symbian development environment is correctly installed and - patched as explained in the \l{Qt for the Symbian platform Requirements} document. + \note Qt for the Symbian platform has some requirements on the development + platform. The Symbian SDK for Linux as well as a cross compiler for the ARM + processor used on Symbian devices should be present on the development machine. + See {http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details. \o Install Qt @@ -770,7 +768,7 @@ download drop-in binaries from here: TODO} The Qt libraries are built with "All -Tcb" capability, so that they can support all types of applications. However, these - capabilities are automatically lowered if you make a selfsigned + capabilities are automatically lowered if you make a self-signed package. \o Building a Qt package with a Symbian developer certificate @@ -826,7 +824,7 @@ download drop-in binaries from here: TODO} Note the identifier on the line where your Symbian device appears. Then execute the following, using the first and - second part of the identifier in place of \c XXXX, + second part of the identifier in place of \c XXX, respectively. \snippet doc/src/snippets/code/doc_src_installation.qdoc 44 -- cgit v0.12 From ae09e6a14dce54190758428a9ea369cd28d36d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 10 May 2010 15:23:09 +0200 Subject: Made paint engine texture drawing work in GL ES 2 and updated docs. Now QGLWidget::drawTexture() can be used on OpenGL ES 2.0 when there's an active painter. Task-number: QTBUG-10420 Reviewed-by: Trond --- src/opengl/qgl.cpp | 73 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index cfacf26..a3c1bac 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2773,23 +2773,27 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex /*! \since 4.4 - Draws the given texture, \a textureId, to the given target rectangle, - \a target, in OpenGL model space. The \a textureTarget should be a 2D - texture target. + This function supports the following use cases: + + \list + \i On OpenGL and OpenGL ES 1.x it draws the given texture, \a textureId, + to the given target rectangle, \a target, in OpenGL model space. The + \a textureTarget should be a 2D texture target. + \i On OpenGL and OpenGL ES 2.x, if a painter is active, not inside a + beginNativePainting / endNativePainting block, and uses the + engine with type QPaintEngine::OpenGL2, the function will draw the given + texture, \a textureId, to the given target rectangle, \a target, + respecting the current painter state. This will let you draw a texture + with the clip, transform, render hints, and composition mode set by the + painter. Note that the texture target needs to be GL_TEXTURE_2D for this + use case, and that this is the only supported use case under OpenGL ES 2.x. + \endlist - \note This function is not supported under OpenGL/ES 2.0. */ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) { -#ifndef QT_OPENGL_ES_2 -#ifdef QT_OPENGL_ES - if (textureTarget != GL_TEXTURE_2D) { - qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES"); - return; - } -#else - - if (d_ptr->active_engine && +#if !defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) + if (d_ptr->active_engine && d_ptr->active_engine->type() == QPaintEngine::OpenGL2) { QGL2PaintEngineEx *eng = static_cast(d_ptr->active_engine); if (!eng->isNativePaintingActive()) { @@ -2799,7 +2803,15 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text return; } } +#endif +#ifndef QT_OPENGL_ES_2 +#ifdef QT_OPENGL_ES + if (textureTarget != GL_TEXTURE_2D) { + qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES"); + return; + } +#else const bool wasEnabled = glIsEnabled(GL_TEXTURE_2D); GLint oldTexture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTexture); @@ -2821,7 +2833,7 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text Q_UNUSED(target); Q_UNUSED(textureId); Q_UNUSED(textureTarget); - qWarning("drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) not supported with OpenGL ES/2.0"); + qWarning("drawTexture() with OpenGL ES 2.0 requires an active OpenGL2 paint engine"); #endif } @@ -2836,14 +2848,26 @@ void QGLContext::drawTexture(const QRectF &target, QMacCompatGLuint textureId, Q /*! \since 4.4 - Draws the given texture at the given \a point in OpenGL model - space. The \a textureTarget should be a 2D texture target. + This function supports the following use cases: + + \list + \i By default it draws the given texture, \a textureId, + at the given \a point in OpenGL model space. The + \a textureTarget should be a 2D texture target. + \i If a painter is active, not inside a + beginNativePainting / endNativePainting block, and uses the + engine with type QPaintEngine::OpenGL2, the function will draw the given + texture, \a textureId, at the given \a point, + respecting the current painter state. This will let you draw a texture + with the clip, transform, render hints, and composition mode set by the + painter. Note that the texture target needs to be GL_TEXTURE_2D for this + use case. + \endlist - \note This function is not supported under OpenGL/ES. + \note This function is not supported under any version of OpenGL ES. */ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget) { - // this would be ok on OpenGL ES 2.0, but currently we don't have a define for that #ifdef QT_OPENGL_ES Q_UNUSED(point); Q_UNUSED(textureId); @@ -4911,11 +4935,8 @@ void QGLWidget::deleteTexture(QMacCompatGLuint id) /*! \since 4.4 - Draws the given texture, \a textureId to the given target rectangle, - \a target, in OpenGL model space. The \a textureTarget should be a 2D - texture target. - - Equivalent to the corresponding QGLContext::drawTexture(). + Calls the corresponding QGLContext::drawTexture() on + this widget's context. */ void QGLWidget::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) { @@ -4935,10 +4956,8 @@ void QGLWidget::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QM /*! \since 4.4 - Draws the given texture, \a textureId, at the given \a point in OpenGL - model space. The \a textureTarget should be a 2D texture target. - - Equivalent to the corresponding QGLContext::drawTexture(). + Calls the corresponding QGLContext::drawTexture() on + this widget's context. */ void QGLWidget::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget) { -- cgit v0.12 From e5622ab31b8cd20074fe29c1d597c1d7f4c6e6e8 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Mon, 10 May 2010 16:34:51 +0200 Subject: Fix typos in Elastic Nodes example documentation. Among other things, use \c instead of \e (courier instead of italic). --- doc/src/examples/elasticnodes.qdoc | 124 +++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 59 deletions(-) diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc index edc62d8..e6e6594 100644 --- a/doc/src/examples/elasticnodes.qdoc +++ b/doc/src/examples/elasticnodes.qdoc @@ -83,7 +83,7 @@ also reimplements \l{QGraphicsItem::shape()}{shape()} to ensure its hit area has an elliptic shape (as opposed to the default bounding rectangle). - For edge management purposes the node provides a simple API for adding + For edge management purposes, the node provides a simple API for adding edges to a node, and for listing all connected edges. The \l{QGraphicsItem::advance()}{advance()} reimplementation is called @@ -126,16 +126,21 @@ \snippet examples/graphicsview/elasticnodes/node.cpp 2 - The \e calculateForces() function implements the elastic forces effect that - pulls and pushes on nodes in the grid. In addition to this algorithm, the - user can move one node around with the mouse. Because we do not want the - two to interfere, we start by checking if this \c Node is the current mouse - grabber item (i.e., QGraphicsScene::mouseGrabberItem()). Because we need to - find all neighboring (but not necessarily connected) nodes, we also make - sure the item is part of a scene in the first place. + There are two ways to move a node. The \c calculateForces() function + implements the elastic effect that pulls and pushes on nodes in the grid. + In addition, the user can directly move one node around with the mouse. + Because we do not want the two approaches to operate at the same time on + the same node, we start \c calculateForces() by checking if this \c Node is + the current mouse grabber item (i.e., QGraphicsScene::mouseGrabberItem()). + Because we need to find all neighboring (but not necessarily connected) + nodes, we also make sure the item is part of a scene in the first place. \snippet examples/graphicsview/elasticnodes/node.cpp 3 + The "elastic" effect comes from an algorithm that applies pushing and + pulling forces. The effect is impressive, and surprisingly simple to + implement. + The algorithm has two steps: the first is to calculate the forces that push the nodes apart, and the second is to subtract the forces that pull the nodes together. First we need to find all the nodes in the graph. We call @@ -143,19 +148,20 @@ qgraphicsitem_cast() to look for \c Node instances. We make use of \l{QGraphicsItem::mapFromItem()}{mapFromItem()} to create a - vector pointing from this node to each other node, in \l{The Graphics View - Coordinate System}{local coordinates}. We use the decomposed components of - this vector to determine the direction and strength of force that apply to - the node. The forces are added up for each node, and weighted so that the - closest nodes are given the strongest force. The sum of all forces are - stored in \e xvel (X-velocity) and \e yvel (Y-velocity). + temporary vector pointing from this node to each other node, in \l{The + Graphics View Coordinate System}{local coordinates}. We use the decomposed + components of this vector to determine the direction and strength of force + that should apply to the node. The forces accumulate for each node, and are + then adjusted so that the closest nodes are given the strongest force, with + rapid degradation when distance increases. The sum of all forces is stored + in \c xvel (X-velocity) and \c yvel (Y-velocity). \snippet examples/graphicsview/elasticnodes/node.cpp 4 - The edges between the nodes represent the forces that pull the nodes - together. By visiting each edge that is connected to this node, we can use - a similar approach as above to find the direction and strength of all - forces. These forces are subtracted from \e xvel and \e yvel. + The edges between the nodes represent forces that pull the nodes together. + By visiting each edge that is connected to this node, we can use a similar + approach as above to find the direction and strength of all pulling forces. + These forces are subtracted from \c xvel and \c yvel. \snippet examples/graphicsview/elasticnodes/node.cpp 5 @@ -166,20 +172,20 @@ \snippet examples/graphicsview/elasticnodes/node.cpp 6 - The final step of \e calculateForces() determines the node's new position. + The final step of \c calculateForces() determines the node's new position. We add the force to the node's current position. We also make sure the new position stays inside of our defined boundaries. We don't actually move the - item in this function; that's done in a separate step, from \e advance(). + item in this function; that's done in a separate step, from \c advance(). \snippet examples/graphicsview/elasticnodes/node.cpp 7 - The \e advance() function updates the item's current position. It is called - from \e GraphWidget::timerEvent(). If the node's position changed, the + The \c advance() function updates the item's current position. It is called + from \c GraphWidget::timerEvent(). If the node's position changed, the function returns true; otherwise false is returned. \snippet examples/graphicsview/elasticnodes/node.cpp 8 - The \e Node's bounding rectangle is a 20x20 sized rectangle centered around + The \c Node's bounding rectangle is a 20x20 sized rectangle centered around its origin (0, 0), adjusted by 2 units in all directions to compensate for the node's outline stroke, and by 3 units down and to the right to make room for a simple drop shadow. @@ -188,8 +194,8 @@ The shape is a simple ellipse. This ensures that you must click inside the node's elliptic shape in order to drag it around. You can test this effect - by running the example, and zooming far enough in so that the nodes become - very large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the + by running the example, and zooming far in so that the nodes are very + large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the item's hit area would be identical to its bounding rectangle (i.e., rectangular). @@ -197,7 +203,7 @@ This function implements the node's painting. We start by drawing a simple dark gray elliptic drop shadow at (-7, -7), that is, (3, 3) units down and - to the right. + to the right from the top-left corner (-10, -10) of the ellipse. We then draw an ellipse with a radial gradient fill. This fill is either Qt::yellow to Qt::darkYellow when raised, or the opposite when sunken. In @@ -217,8 +223,8 @@ calculations. This notification is the only reason why the nodes need to keep a pointer - back to the \e GraphWidget. Another approach could be to provide such - notification using a signal; in such case, \e Node would need to inherit + back to the \c GraphWidget. Another approach could be to provide such + notification using a signal; in such case, \c Node would need to inherit from QGraphicsObject. \snippet examples/graphicsview/elasticnodes/node.cpp 12 @@ -226,14 +232,14 @@ Because we have set the \l{QGraphicsItem::ItemIsMovable}{ItemIsMovable} flag, we don't need to implement the logic that moves the node according to mouse input; this is already provided for us. We still need to reimplement - the mouse press and release handlers though, to update the nodes' visual + the mouse press and release handlers, though, to update the nodes' visual appearance (i.e., sunken or raised). \section1 Edge Class Definition - The \e Edge class represents the arrow-lines between the nodes in this + The \c Edge class represents the arrow-lines between the nodes in this example. The class is very simple: it maintains a source- and destination - node pointer, and provides an \e adjust() function that makes sure the line + node pointer, and provides an \c adjust() function that makes sure the line starts at the position of the source, and ends at the position of the destination. The edges are the only items that change continuously as forces pull and push on the nodes. @@ -242,13 +248,13 @@ \snippet examples/graphicsview/elasticnodes/edge.h 0 - \e Edge inherits from QGraphicsItem, as it's a simple class that has no use + \c Edge inherits from QGraphicsItem, as it's a simple class that has no use for signals, slots, and properties (compare to QGraphicsObject). The constructor takes two node pointers as input. Both pointers are mandatory in this example. We also provide get-functions for each node. - The \e adjust() function repositions the edge, and the item also implements + The \c adjust() function repositions the edge, and the item also implements \l{QGraphicsItem::boundingRect()}{boundingRect()} and \{QGraphicsItem::paint()}{paint()}. @@ -256,7 +262,7 @@ \snippet examples/graphicsview/elasticnodes/edge.cpp 0 - The \e Edge constructor initializes its arrowSize data member to 10 units; + The \c Edge constructor initializes its \c arrowSize data member to 10 units; this determines the size of the arrow which is drawn in \l{QGraphicsItem::paint()}{paint()}. @@ -265,7 +271,7 @@ This ensures that the edge items are not considered for mouse input at all (i.e., you cannot click the edges). Then, the source and destination pointers are updated, this edge is registered with each node, and we call - \e adjust() to update this edge's start end end position. + \c adjust() to update this edge's start end end position. \snippet examples/graphicsview/elasticnodes/edge.cpp 1 @@ -274,7 +280,7 @@ \snippet examples/graphicsview/elasticnodes/edge.cpp 2 - In \e adjust(), we define two points: \e sourcePoint, and \e destPoint, + In \c adjust(), we define two points: \c sourcePoint, and \c destPoint, pointing at the source and destination nodes' origins respectively. Each point is calculated using \l{The Graphics View Coordinate System}{local coordinates}. @@ -295,7 +301,7 @@ It's important to notice that we call \l{QGraphicsItem::prepareGeometryChange()}{prepareGeometryChange()} in this - function. The reason is that the variables \e sourcePoint and \e destPoint + function. The reason is that the variables \c sourcePoint and \c destPoint are used directly when painting, and they are returned from the \l{QGraphicsItem::boundingRect()}{boundingRect()} reimplementation. We must always call @@ -338,26 +344,26 @@ \section1 GraphWidget Class Definition - \e GraphWidget is a subclass of QGraphicsView, which provides the main + \c GraphWidget is a subclass of QGraphicsView, which provides the main window with scrollbars. \snippet examples/graphicsview/elasticnodes/graphwidget.h 0 - It provides a basic constructor that initializes the scene, an \e + The class provides a basic constructor that initializes the scene, an \c itemMoved() function to notify changes in the scene's node graph, a few event handlers, a reimplementation of \l{QGraphicsView::drawBackground()}{drawBackground()}, and a helper - function for scaling the view by mouse or keyboard. + function for scaling the view by using the mouse wheel or keyboard. \snippet examples/graphicsview/elasticnodes/graphwidget.cpp 0 - \e GraphicsWidget's constructor creates the scene, and because most items - move around most of the time, it sets QGraphicsScene::NoIndex. Then the - scene gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}. - The scene is then assigned to the \e GraphWidget view. + \c GraphicsWidget's constructor creates the scene, and because most items + move around most of the time, it sets QGraphicsScene::NoIndex. The scene + then gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}, and is + assigned to the \c GraphWidget view. The view enables QGraphicsView::CacheBackground to cache rendering of its - static and somewhat complex background. Because the graph renders a close + static, and somewhat complex, background. Because the graph renders a close collection of small items that all move around, it's unnecessary for Graphics View to waste time finding accurate update regions, so we set the QGraphicsView::BoundingRectViewportUpdate viewport update mode. The default @@ -381,15 +387,15 @@ \snippet examples/graphicsview/elasticnodes/graphwidget.cpp 2 - \e GraphWidget is notified of node movement through this \e itemMoved() + \c GraphWidget is notified of node movement through this \c itemMoved() function. Its job is simply to restart the main timer in case it's not running already. The timer is designed to stop when the graph stabilizes, and start once it's unstable again. \snippet examples/graphicsview/elasticnodes/graphwidget.cpp 3 - This is \e GraphWidget's key event handler. The arrow keys move the center - node around, the '+' and '-' keys zoom in and out by calling \e + This is \c GraphWidget's key event handler. The arrow keys move the center + node around, the '+' and '-' keys zoom in and out by calling \c scaleView(), and the enter and space keys randomize the positions of the nodes. All other key events (e.g., page up and page down) are handled by QGraphicsView's default implementation. @@ -398,16 +404,16 @@ The timer event handler's job is to run the whole force calculation machinery as a smooth animation. Each time the timer is triggered, the - handler will find all nodes in the scene, and call \e + handler will find all nodes in the scene, and call \c Node::calculateForces() on each node, one at a time. Then, in a final step - it will call \e Node::advance() to move all nodes to their new positions. - By checking the return value of \e advance(), we can decide if the grid + it will call \c Node::advance() to move all nodes to their new positions. + By checking the return value of \c advance(), we can decide if the grid stabilized (i.e., no nodes moved). If so, we can stop the timer. \snippet examples/graphicsview/elasticnodes/graphwidget.cpp 5 In the wheel event handler, we convert the mouse wheel delta to a scale - factor, and pass this factor to \e scaleView(). This approach takes into + factor, and pass this factor to \c scaleView(). This approach takes into account the speed that the wheel is rolled. The faster you roll the mouse wheel, the faster the view will zoom. @@ -415,24 +421,24 @@ The view's background is rendered in a reimplementation of QGraphicsView::drawBackground(). We draw a large rectangle filled with a - linear gradient, with a drop shadow, and then render text in top. The text - is rendered twice to give a similar simple drop-shadow effect. + linear gradient, add a drop shadow, and then render text on top. The text + is rendered twice for a simple drop-shadow effect. This background rendering is quite expensive; this is why the view enables QGraphicsView::CacheBackground. \snippet examples/graphicsview/elasticnodes/graphwidget.cpp 7 - The \e scaleView() helper function checks that the scale factor stays + The \c scaleView() helper function checks that the scale factor stays within certain limits (i.e., you cannot zoom too far in nor too far out), - and then applies this scale. + and then applies this scale to the view. \section1 The main() Function - In contrast to the complexity of the rest of this example, the \e main() + In contrast to the complexity of the rest of this example, the \c main() function is very simple: We create a QApplication instance, seed the - randomizer using qsrand(), and then create and show an instance of \e - GraphWidget. Because all nodes in the grid are moved initially, the \e + randomizer using qsrand(), and then create and show an instance of \c + GraphWidget. Because all nodes in the grid are moved initially, the \c GraphWidget timer will start immediately after control has returned to the event loop. */ -- cgit v0.12 From 2df5a9567ff83a547c3c66e4b523844b78968108 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 6 May 2010 17:34:58 +0100 Subject: Run autotests with minimal capabilities The autotests were previously run with ALL-Tcb capability which gives them more access to the filesystem etc. than a typical Qt application. To have more realistic testing environmnent, tests are run with no capabilities other than those required for the Qt APIs they use. i.e. NetworkServices for network tests, None for others. Reviewed-by: Liang Qi --- mkspecs/features/qttest_p4.prf | 2 +- tests/auto/languagechange/tst_languagechange.cpp | 4 ++-- tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro | 1 + tests/auto/qabstractsocket/qabstractsocket.pro | 1 + tests/auto/qdirmodel/tst_qdirmodel.cpp | 5 +++++ tests/auto/qftp/qftp.pro | 1 + tests/auto/qhostaddress/qhostaddress.pro | 1 + tests/auto/qhostinfo/qhostinfo.pro | 1 + tests/auto/qhttp/qhttp.pro | 1 + tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro | 2 ++ tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro | 1 + tests/auto/qhttpsocketengine/qhttpsocketengine.pro | 1 + tests/auto/qiodevice/qiodevice.pro | 1 + tests/auto/qlocalsocket/qlocalsocket.pro | 1 + tests/auto/qnativesocketengine/qnativesocketengine.pro | 1 + tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro | 1 + .../qnetworkaccessmanager_and_qprogressdialog.pro | 1 + tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro | 2 ++ tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro | 1 + tests/auto/qnetworkcookie/qnetworkcookie.pro | 1 + tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro | 1 + tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro | 1 + tests/auto/qnetworkinterface/qnetworkinterface.pro | 1 + tests/auto/qnetworkproxy/qnetworkproxy.pro | 1 + tests/auto/qnetworkreply/qnetworkreply.pro | 1 + tests/auto/qnetworkrequest/qnetworkrequest.pro | 1 + tests/auto/qnetworksession/qnetworksession.pro | 1 + tests/auto/qsocketnotifier/qsocketnotifier.pro | 1 + tests/auto/qsocks5socketengine/qsocks5socketengine.pro | 1 + tests/auto/qsslcertificate/qsslcertificate.pro | 1 + tests/auto/qsslcipher/qsslcipher.pro | 1 + tests/auto/qsslerror/qsslerror.pro | 1 + tests/auto/qsslkey/qsslkey.pro | 1 + tests/auto/qsslsocket/qsslsocket.pro | 2 +- tests/auto/qtcpserver/qtcpserver.pro | 1 + tests/auto/qtcpsocket/qtcpsocket.pro | 1 + tests/auto/qudpsocket/qudpsocket.pro | 1 + tests/auto/qurl/qurl.pro | 1 + 38 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf index e3faef1..d2011d0 100644 --- a/mkspecs/features/qttest_p4.prf +++ b/mkspecs/features/qttest_p4.prf @@ -6,7 +6,7 @@ qtAddLibrary(QtTest) symbian:{ TARGET.EPOCHEAPSIZE = 0x100000 0x2000000 # DEFINES += QTEST_NO_SPECIALIZATIONS - TARGET.CAPABILITY="ALL -TCB" + TARGET.CAPABILITY="None" RSS_RULES ="group_name=\"QtTests\";" } diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index d04707e..bcc3be4 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -238,8 +238,8 @@ void tst_languageChange::retranslatability() QString fooName = tmpParentDir + "/foo"; QDir dir; QCOMPARE(dir.mkpath(tmpDir), true); -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // Just create a new file instead of copying exe, because exe is not there in emulator +#if defined(Q_OS_SYMBIAN) + // Just create a new file instead of copying exe, because there is no read access to /sys/bin { QFile fooFile(fooName); QVERIFY(fooFile.open(QIODevice::WriteOnly | QIODevice::Text)); diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro index a57c56f..2e2577d 100644 --- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro @@ -9,3 +9,4 @@ wince*|symbian: { DEPLOYMENT += testFiles } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qabstractsocket/qabstractsocket.pro b/tests/auto/qabstractsocket/qabstractsocket.pro index 59999af..814a7d2 100644 --- a/tests/auto/qabstractsocket/qabstractsocket.pro +++ b/tests/auto/qabstractsocket/qabstractsocket.pro @@ -7,4 +7,5 @@ QT = core network SOURCES += tst_qabstractsocket.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index 1bc5b7f..41bbd87 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -613,6 +613,11 @@ void tst_QDirModel::task196768_sorting() //this task showed that the persistent model indexes got corrupted when sorting QString path = SRCDIR; +#ifdef Q_OS_SYMBIAN + if(!RProcess().HasCapability(ECapabilityAllFiles)) + QEXPECT_FAIL("", "QTBUG-9746", Continue); +#endif + QDirModel model; /* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro index c060296..33d479a 100644 --- a/tests/auto/qftp/qftp.pro +++ b/tests/auto/qftp/qftp.pro @@ -14,6 +14,7 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" + TARGET.CAPABILITY = NetworkServices } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qhostaddress/qhostaddress.pro b/tests/auto/qhostaddress/qhostaddress.pro index b208214..7bcbfb0 100644 --- a/tests/auto/qhostaddress/qhostaddress.pro +++ b/tests/auto/qhostaddress/qhostaddress.pro @@ -12,3 +12,4 @@ wince*: { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhostinfo/qhostinfo.pro b/tests/auto/qhostinfo/qhostinfo.pro index 9bfe576..06a4b17 100644 --- a/tests/auto/qhostinfo/qhostinfo.pro +++ b/tests/auto/qhostinfo/qhostinfo.pro @@ -10,4 +10,5 @@ wince*: { win32:LIBS += -lws2_32 } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index 8678a19..23a73c4 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -21,6 +21,7 @@ wince*: { addFiles.sources = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi + TARGET.CAPABILITY = NetworkServices } else:vxworks*: { DEFINES += SRCDIR=\\\"\\\" } else { diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro index 0021bc1..d9e2dce 100644 --- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -4,3 +4,5 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib requires(contains(QT_CONFIG,private_tests)) QT = core network + +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro index 1782b43..36d56c6 100644 --- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro +++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro @@ -4,3 +4,4 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib requires(contains(QT_CONFIG,private_tests)) QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro index f6ad073..d76ebb6 100644 --- a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro +++ b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro @@ -8,5 +8,6 @@ MOC_DIR=tmp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro index e695bf6..716cdce 100644 --- a/tests/auto/qiodevice/qiodevice.pro +++ b/tests/auto/qiodevice/qiodevice.pro @@ -14,6 +14,7 @@ wince*: { addFiles.sources = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles + TARGET.CAPABILITY = NetworkServices } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" contains(QT_CONFIG, qt3support):QT += qt3support diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro index 0849453..287e946 100644 --- a/tests/auto/qlocalsocket/qlocalsocket.pro +++ b/tests/auto/qlocalsocket/qlocalsocket.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs SUBDIRS = lackey test !wince*:!symbian*: SUBDIRS += example +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnativesocketengine/qnativesocketengine.pro b/tests/auto/qnativesocketengine/qnativesocketengine.pro index ad40d53..0275d37 100644 --- a/tests/auto/qnativesocketengine/qnativesocketengine.pro +++ b/tests/auto/qnativesocketengine/qnativesocketengine.pro @@ -9,4 +9,5 @@ MOC_DIR=tmp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro index e2889c1..3ccbffb 100644 --- a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro +++ b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro @@ -2,4 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaccessmanager.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro index 7ed5b07..378deba 100644 --- a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro +++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro @@ -2,4 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp QT += network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro index 8feb95f..885dbf7 100644 --- a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro +++ b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro @@ -2,3 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaddressentry.cpp QT = core network + +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro index b24fe00..77ad347 100644 --- a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro +++ b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro @@ -2,4 +2,5 @@ load(qttest_p4) QT += network SOURCES += tst_qnetworkcachemetadata.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcookie/qnetworkcookie.pro b/tests/auto/qnetworkcookie/qnetworkcookie.pro index 95d8b6e..2f31138 100644 --- a/tests/auto/qnetworkcookie/qnetworkcookie.pro +++ b/tests/auto/qnetworkcookie/qnetworkcookie.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkcookie.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro index 3a8e61b..6d75fab 100644 --- a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro +++ b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkcookiejar.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro index f47d6d7..3b13087 100644 --- a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro +++ b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro @@ -2,4 +2,5 @@ load(qttest_p4) QT += network SOURCES += tst_qnetworkdiskcache.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkinterface/qnetworkinterface.pro b/tests/auto/qnetworkinterface/qnetworkinterface.pro index 26095e9..1c5feee 100644 --- a/tests/auto/qnetworkinterface/qnetworkinterface.pro +++ b/tests/auto/qnetworkinterface/qnetworkinterface.pro @@ -3,4 +3,5 @@ SOURCES += tst_qnetworkinterface.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkproxy/qnetworkproxy.pro b/tests/auto/qnetworkproxy/qnetworkproxy.pro index 8ffc80c..fc0a216 100644 --- a/tests/auto/qnetworkproxy/qnetworkproxy.pro +++ b/tests/auto/qnetworkproxy/qnetworkproxy.pro @@ -7,4 +7,5 @@ QT = core network SOURCES += tst_qnetworkproxy.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkreply/qnetworkreply.pro b/tests/auto/qnetworkreply/qnetworkreply.pro index fd8454c..86d3155 100644 --- a/tests/auto/qnetworkreply/qnetworkreply.pro +++ b/tests/auto/qnetworkreply/qnetworkreply.pro @@ -4,3 +4,4 @@ SUBDIRS = test requires(contains(QT_CONFIG,private_tests)) !wince*:SUBDIRS += echo +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkrequest/qnetworkrequest.pro b/tests/auto/qnetworkrequest/qnetworkrequest.pro index f576ba2..f96fd3b 100644 --- a/tests/auto/qnetworkrequest/qnetworkrequest.pro +++ b/tests/auto/qnetworkrequest/qnetworkrequest.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkrequest.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworksession/qnetworksession.pro b/tests/auto/qnetworksession/qnetworksession.pro index a85925b..34761e5 100644 --- a/tests/auto/qnetworksession/qnetworksession.pro +++ b/tests/auto/qnetworksession/qnetworksession.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs SUBDIRS = lackey test +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsocketnotifier/qsocketnotifier.pro b/tests/auto/qsocketnotifier/qsocketnotifier.pro index ec924c1..c43c96a 100644 --- a/tests/auto/qsocketnotifier/qsocketnotifier.pro +++ b/tests/auto/qsocketnotifier/qsocketnotifier.pro @@ -6,5 +6,6 @@ requires(contains(QT_CONFIG,private_tests)) include(../qnativesocketengine/qsocketengine.pri) +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro index 4a32852..cd5e6e7 100644 --- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro @@ -11,6 +11,7 @@ QT = core network # Symbian toolchain does not support correct include semantics symbian:INCPATH+=..\..\..\include\QtNetwork\private +symbian: TARGET.CAPABILITY = NetworkServices requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro index b237f2e..d7671ea 100644 --- a/tests/auto/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/qsslcertificate/qsslcertificate.pro @@ -24,4 +24,5 @@ wince*: { DEFINES += SRCDIR=\\\".\\\" } else:!symbian { DEFINES += SRCDIR=\\\"$$PWD/\\\" + TARGET.CAPABILITY = NetworkServices } diff --git a/tests/auto/qsslcipher/qsslcipher.pro b/tests/auto/qsslcipher/qsslcipher.pro index 6eae588..78fd387 100644 --- a/tests/auto/qsslcipher/qsslcipher.pro +++ b/tests/auto/qsslcipher/qsslcipher.pro @@ -14,4 +14,5 @@ win32 { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsslerror/qsslerror.pro b/tests/auto/qsslerror/qsslerror.pro index ee5872b..5b907fb 100644 --- a/tests/auto/qsslerror/qsslerror.pro +++ b/tests/auto/qsslerror/qsslerror.pro @@ -14,4 +14,5 @@ win32 { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro index 32138f8..e3eeef9 100644 --- a/tests/auto/qsslkey/qsslkey.pro +++ b/tests/auto/qsslkey/qsslkey.pro @@ -24,4 +24,5 @@ wince*: { DEFINES += SRCDIR=\\\".\\\" } else:!symbian { DEFINES+= SRCDIR=\\\"$$PWD\\\" + TARGET.CAPABILITY = NetworkServices } diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 541b2d9..3557fc8 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -24,7 +24,7 @@ wince* { } else:symbian { DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND TARGET.EPOCHEAPSIZE="0x100 0x1000000" - TARGET.CAPABILITY="ALL -TCB" + TARGET.CAPABILITY=NetworkServices certFiles.sources = certs ssl.tar.gz certFiles.path = . diff --git a/tests/auto/qtcpserver/qtcpserver.pro b/tests/auto/qtcpserver/qtcpserver.pro index fe5ea37..a3744a2 100644 --- a/tests/auto/qtcpserver/qtcpserver.pro +++ b/tests/auto/qtcpserver/qtcpserver.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test crashingServer +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro index 3d4eba3..370a695 100644 --- a/tests/auto/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/qtcpsocket/qtcpsocket.pro @@ -6,3 +6,4 @@ wince*|symbian*|vxworks* : SUBDIRS = test requires(contains(QT_CONFIG,private_tests)) +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qudpsocket/qudpsocket.pro b/tests/auto/qudpsocket/qudpsocket.pro index 4ef8a40..8fd3545 100644 --- a/tests/auto/qudpsocket/qudpsocket.pro +++ b/tests/auto/qudpsocket/qudpsocket.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test clientserver +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qurl/qurl.pro b/tests/auto/qurl/qurl.pro index 72c93bc..018bb38 100644 --- a/tests/auto/qurl/qurl.pro +++ b/tests/auto/qurl/qurl.pro @@ -1,3 +1,4 @@ load(qttest_p4) SOURCES += tst_qurl.cpp QT = core +symbian: TARGET.CAPABILITY = NetworkServices -- cgit v0.12 From 48acfd970f5fab740fd16ecdc31656c56ec2356b Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 10 May 2010 15:26:12 +0100 Subject: Fix compile errors Added #ifdef QT_BUILD_INTERNAL for autotests which rely on AUTOTEST_EXPORT symbols (only available in internal developer configurations) Reviewed-by: Liang Qi --- tests/auto/qwidget/tst_qwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 76e20b9..5d47aed 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9514,6 +9514,8 @@ void tst_QWidget::destroyBackingStore() w.update(); QApplication::processEvents(); QCOMPARE(w.numPaintEvents, 2); +#else + QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll); #endif } @@ -9992,6 +9994,7 @@ void tst_QWidget::focusProxyAndInputMethods() delete toplevel; } +#ifdef QT_BUILD_INTERNAL class scrollWidgetWBS : public QWidget { public: @@ -10011,9 +10014,11 @@ public: } } }; +#endif void tst_QWidget::scrollWithoutBackingStore() { +#ifdef QT_BUILD_INTERNAL scrollWidgetWBS scrollable; scrollable.resize(100,100); QLabel child(QString("@"),&scrollable); @@ -10027,6 +10032,9 @@ void tst_QWidget::scrollWithoutBackingStore() QCOMPARE(child.pos(),QPoint(25,25)); scrollable.enableBackingStore(); QCOMPARE(child.pos(),QPoint(25,25)); +#else + QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll); +#endif } void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy() -- cgit v0.12 From a21d6927e58a72ac5123d2479cbcc06bd764dfa4 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 10 May 2010 16:45:05 +0100 Subject: Remove test cases which cause stack overflow These test cases are not considered reasonable for a small screen device (625 widgets). Patching the QWidget code to use iteration rather than recursion is considered too risky, as the code is performance critical. Task-number: QTBUG-8512 Reviewed-by: Bjoern Erik Nilsen --- tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp index 8c30be4..7015bd1 100644 --- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp +++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp @@ -159,12 +159,17 @@ void tst_QWidget::update_data() QTest::newRow("10x10x1 opaque") << 10 << 10 << 1 << true; QTest::newRow("10x10x10 opaque") << 10 << 10 << 10 << true; QTest::newRow("10x10x100 opaque") << 10 << 10 << 100 << true; +#ifndef Q_OS_SYMBIAN + //These test cases cause stack overflow in QWidgetPrivate::paintSiblingsRecursive + //see http://bugreports.qt.nokia.com/browse/QTBUG-8512 + //Symbian threads have a hard limit of 80kB user stack QTest::newRow("25x25x1 transparent ") << 25 << 25 << 1 << false; QTest::newRow("25x25x10 transparent") << 25 << 25 << 10 << false; QTest::newRow("25x25x100 transparent") << 25 << 25 << 100 << false; QTest::newRow("25x25x1 opaque") << 25 << 25 << 1 << true; QTest::newRow("25x25x10 opaque") << 25 << 25 << 10 << true; QTest::newRow("25x25x100 opaque") << 25 << 25 << 100 << true; +#endif } void tst_QWidget::update() -- cgit v0.12 From 121e325e7bb2f14f4c9e4e25078ac16b47dcd372 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 10 May 2010 21:13:21 +0200 Subject: Really fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux If there is no window manager the current coordinate are taken in account even if WA_Moved is false. When a dockwidget is hidden, it is sent far in the negative coordinate. The test was failing because the WM is assync and may take some time to update the geometry. --- src/gui/widgets/qdockwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index ae00710..11f0a94 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1269,8 +1269,11 @@ void QDockWidget::setFloating(bool floating) QRect r = d->undockedGeometry; d->setWindowState(floating, false, floating ? r : QRect()); + if (floating && r.isNull()) { - setAttribute(Qt::WA_Moved, false); //we want it at the default position + if (x() < 0 || y() < 0) //may happen if we have been hidden + move(QPoint()); + setAttribute(Qt::WA_Moved, false); //we want it at the default position } } -- cgit v0.12 From da8d6c23ceaeb1f266c9c499e98c9fedb1d1e20d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 11 May 2010 08:13:33 +1000 Subject: Error message on QWS appears to have changed. --- .../declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index dc9c2b2..d68b3e3 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -123,7 +123,7 @@ void tst_qdeclarativefontloader::failLocalFont() QString componentStr = "import Qt 4.7\nFontLoader { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" }"; QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData()); #ifdef Q_WS_QWS - QTest::ignoreMessage(QtDebugMsg, QString("FT_New_Face failed with index 0 : 51 ").toLatin1()); + QTest::ignoreMessage(QtDebugMsg, QString("FT_New_Face failed with index 0 : 2 ").toLatin1()); #endif QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); -- cgit v0.12 From cd70183a86f3586eb34c15f11af03746f28f4acc Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 11 May 2010 08:57:17 +1000 Subject: Remove unnecesary check for debug output. --- .../declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index d68b3e3..36908d9 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -122,9 +122,6 @@ void tst_qdeclarativefontloader::failLocalFont() { QString componentStr = "import Qt 4.7\nFontLoader { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" }"; QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData()); -#ifdef Q_WS_QWS - QTest::ignoreMessage(QtDebugMsg, QString("FT_New_Face failed with index 0 : 2 ").toLatin1()); -#endif QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeFontLoader *fontObject = qobject_cast(component.create()); -- cgit v0.12 From 129940723d9145a4380f7e44c06cbaa88ee4053b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 11 May 2010 11:07:23 +1000 Subject: Correct ownership of signal handlers in state changes. When a state uses override, we may apply the same replacesignalhandler on top of itself. Make sure we update ownership accordingly. Task-number: QTBUG-10523 --- .../util/qdeclarativepropertychanges.cpp | 35 +++++++++++++++++----- .../data/signalOverrideCrash2.qml | 24 +++++++++++++++ .../qdeclarativestates/tst_qdeclarativestates.cpp | 16 ++++++++++ 3 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 6e88259..94780c4 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -161,15 +161,22 @@ public: QDeclarativeExpression *rewindExpression; QDeclarativeGuard ownedExpression; + virtual bool changesBindings() { return true; } + virtual void clearBindings() { + ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, 0); + } + virtual void execute(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); - Q_ASSERT(expression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, expression); + if (ownedExpression == expression) + ownedExpression = 0; } virtual bool isReversable() { return true; } virtual void reverse(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); - Q_ASSERT(reverseExpression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); + if (ownedExpression == reverseExpression) + ownedExpression = 0; } virtual void saveOriginals() { @@ -177,12 +184,26 @@ public: reverseExpression = rewindExpression; } + virtual void copyOriginals(QDeclarativeActionEvent *other) + { + QDeclarativeReplaceSignalHandler *rsh = static_cast(other); + saveCurrentValues(); + if (rsh == this) + return; + reverseExpression = rsh->reverseExpression; + if (rsh->ownedExpression == reverseExpression) { + ownedExpression = rsh->ownedExpression; + rsh->ownedExpression = 0; + } + } + virtual void rewind() { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); - Q_ASSERT(rewindExpression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); + if (ownedExpression == rewindExpression) + ownedExpression = 0; } virtual void saveCurrentValues() { - rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); + rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); } virtual bool override(QDeclarativeActionEvent*other) { diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml new file mode 100644 index 0000000..2215ee4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml @@ -0,0 +1,24 @@ +import Qt 4.7 + +Rectangle { + id: myRect + width: 400 + height: 400 + + states: [ + State { + name: "state1" + PropertyChanges { + target: myRect + onHeightChanged: console.log("Hello World") + color: "green" + } + }, + State { + name: "state2"; extend: "state1" + PropertyChanges { + target: myRect + color: "red" + } + }] +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 13992ad..ea074a4 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -87,6 +87,7 @@ private slots: void basicBinding(); void signalOverride(); void signalOverrideCrash(); + void signalOverrideCrash2(); void parentChange(); void parentChangeErrors(); void anchorChanges(); @@ -449,6 +450,21 @@ void tst_qdeclarativestates::signalOverrideCrash() rect->doSomething(); } +void tst_qdeclarativestates::signalOverrideCrash2() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash2.qml"); + QDeclarativeRectangle *rect = qobject_cast(rectComponent.create()); + QVERIFY(rect != 0); + + QDeclarativeItemPrivate::get(rect)->setState("state1"); + QDeclarativeItemPrivate::get(rect)->setState("state2"); + QDeclarativeItemPrivate::get(rect)->setState("state1"); + + delete rect; +} + void tst_qdeclarativestates::parentChange() { QDeclarativeEngine engine; -- cgit v0.12 From aa40b01fcda22e654790aaf93a6b14f947cdea72 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 11 May 2010 13:09:49 +1000 Subject: Round ideal width up to prevent incorrect word wrapping on Mac OS X QTBUG-10539 --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 4 +++- .../declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index d095dbe..6d86e58 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -46,6 +46,8 @@ #include #include +#include + #include #include #include @@ -1107,7 +1109,7 @@ void QDeclarativeTextEdit::updateSize() setBaselineOffset(fm.ascent() + yoff + d->textMargin); //### need to comfirm cost of always setting these - int newWidth = (int)d->document->idealWidth(); + int newWidth = qCeil(d->document->idealWidth()); d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well? int cursorWidth = 1; if(d->cursor) diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 8cc0e3f..b92024f 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -202,7 +202,7 @@ void tst_qdeclarativetextedit::width() QFont f; QFontMetricsF fm(f); qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - metricWidth = floor(metricWidth); + metricWidth = ceil(metricWidth); QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); @@ -219,7 +219,7 @@ void tst_qdeclarativetextedit::width() document.setHtml(richText.at(i)); document.setDocumentMargin(0); - int documentWidth = document.idealWidth(); + int documentWidth = ceil(document.idealWidth()); QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); -- cgit v0.12 From 367798c3cfaac56d82b29a90061d621e2b5854a5 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 11 May 2010 14:08:17 +1000 Subject: Correct Flipable back item based on parent, not scene transform Flipable transformation consists of two parts: 1. Detecting that the back face is visible 2. Transforming the back item as though "it were on the front" These are two steps. The first should be done in scene coordinates, and the second relative to the Flipable parent. QTBUG-10532 --- src/declarative/graphicsitems/qdeclarativeflipable.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index e2fc809..d926119 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -190,12 +190,15 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent() QPointF p2(1, 0); QPointF p3(1, 1); - p1 = sceneTransform.map(p1); - p2 = sceneTransform.map(p2); - p3 = sceneTransform.map(p3); - - qreal cross = (p1.x() - p2.x()) * (p3.y() - p2.y()) - - (p1.y() - p2.y()) * (p3.x() - p2.x()); + QPointF scenep1 = sceneTransform.map(p1); + QPointF scenep2 = sceneTransform.map(p2); + QPointF scenep3 = sceneTransform.map(p3); + p1 = q->mapToParent(p1); + p2 = q->mapToParent(p2); + p3 = q->mapToParent(p3); + + qreal cross = (scenep1.x() - scenep2.x()) * (scenep3.y() - scenep2.y()) - + (scenep1.y() - scenep2.y()) * (scenep3.x() - scenep2.x()); wantBackYFlipped = p1.x() >= p2.x(); wantBackXFlipped = p2.y() >= p3.y(); -- cgit v0.12 From 2445d7adc19bb1355cbba8361345feb9d4cf10f9 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 11 May 2010 09:21:50 +0200 Subject: Emit numFlagsChanged Task-number: QTBUG-10552 --- demos/declarative/minehunt/minehunt.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp index 93cd1c1..2a4ed10 100644 --- a/demos/declarative/minehunt/minehunt.cpp +++ b/demos/declarative/minehunt/minehunt.cpp @@ -212,6 +212,8 @@ void MinehuntGame::reset() } nMines = 12; nFlags = 0; + emit numMinesChanged(); + emit numFlagsChanged(); setPlaying(false); QTimer::singleShot(600,this, SLOT(setBoard())); } -- cgit v0.12 From 952ab3f97a77c1f15b526df13c96602f6501f8ea Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 11 May 2010 17:44:12 +1000 Subject: Cleanup and simplify the webbrowser demo. --- demos/declarative/webbrowser/content/Button.qml | 18 ++ .../webbrowser/content/FlickableWebView.qml | 2 +- demos/declarative/webbrowser/content/Header.qml | 69 ++++++++ .../webbrowser/content/RectSoftShadow.qml | 32 ---- .../content/RetractingWebBrowserHeader.qml | 113 ------------- demos/declarative/webbrowser/content/ScrollBar.qml | 66 ++++++++ demos/declarative/webbrowser/content/UrlInput.qml | 44 +++++ .../webbrowser/content/fieldtext/FieldText.qml | 157 ------------------ .../webbrowser/content/fieldtext/pics/cancel.png | Bin 1038 -> 0 bytes .../webbrowser/content/fieldtext/pics/ok.png | Bin 655 -> 0 bytes .../webbrowser/content/pics/addressbar-filled.png | Bin 694 -> 0 bytes .../webbrowser/content/pics/addressbar-filled.sci | 6 - .../webbrowser/content/pics/addressbar.png | Bin 467 -> 0 bytes .../webbrowser/content/pics/addressbar.sci | 6 - .../webbrowser/content/pics/back-disabled.png | Bin 475 -> 0 bytes demos/declarative/webbrowser/content/pics/back.png | Bin 707 -> 0 bytes .../webbrowser/content/pics/display.png | Bin 0 -> 998 bytes .../webbrowser/content/pics/edit-delete.png | Bin 0 -> 1333 bytes .../declarative/webbrowser/content/pics/footer.png | Bin 200 -> 0 bytes .../declarative/webbrowser/content/pics/footer.sci | 6 - .../webbrowser/content/pics/forward-disabled.png | Bin 471 -> 0 bytes .../webbrowser/content/pics/forward.png | Bin 682 -> 0 bytes .../webbrowser/content/pics/go-next-view.png | Bin 0 -> 1187 bytes .../webbrowser/content/pics/go-previous-view.png | Bin 0 -> 1226 bytes .../declarative/webbrowser/content/pics/header.png | Bin 193 -> 0 bytes .../declarative/webbrowser/content/pics/reload.png | Bin 1283 -> 0 bytes .../webbrowser/content/pics/scrollbar.png | Bin 0 -> 161 bytes .../webbrowser/content/pics/softshadow-bottom.png | Bin 186 -> 0 bytes .../webbrowser/content/pics/softshadow-left.png | Bin 598 -> 0 bytes .../webbrowser/content/pics/softshadow-left.sci | 5 - .../webbrowser/content/pics/softshadow-right.png | Bin 636 -> 0 bytes .../webbrowser/content/pics/softshadow-right.sci | 5 - .../webbrowser/content/pics/softshadow-top.png | Bin 186 -> 0 bytes .../webbrowser/content/pics/titlebar-bg.png | Bin 0 -> 213 bytes .../webbrowser/content/pics/view-refresh.png | Bin 0 -> 2182 bytes demos/declarative/webbrowser/webbrowser.qml | 183 +++------------------ 36 files changed, 225 insertions(+), 487 deletions(-) create mode 100644 demos/declarative/webbrowser/content/Button.qml create mode 100644 demos/declarative/webbrowser/content/Header.qml delete mode 100644 demos/declarative/webbrowser/content/RectSoftShadow.qml delete mode 100644 demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml create mode 100644 demos/declarative/webbrowser/content/ScrollBar.qml create mode 100644 demos/declarative/webbrowser/content/UrlInput.qml delete mode 100644 demos/declarative/webbrowser/content/fieldtext/FieldText.qml delete mode 100644 demos/declarative/webbrowser/content/fieldtext/pics/cancel.png delete mode 100644 demos/declarative/webbrowser/content/fieldtext/pics/ok.png delete mode 100644 demos/declarative/webbrowser/content/pics/addressbar-filled.png delete mode 100644 demos/declarative/webbrowser/content/pics/addressbar-filled.sci delete mode 100644 demos/declarative/webbrowser/content/pics/addressbar.png delete mode 100644 demos/declarative/webbrowser/content/pics/addressbar.sci delete mode 100644 demos/declarative/webbrowser/content/pics/back-disabled.png delete mode 100644 demos/declarative/webbrowser/content/pics/back.png create mode 100644 demos/declarative/webbrowser/content/pics/display.png create mode 100644 demos/declarative/webbrowser/content/pics/edit-delete.png delete mode 100644 demos/declarative/webbrowser/content/pics/footer.png delete mode 100644 demos/declarative/webbrowser/content/pics/footer.sci delete mode 100644 demos/declarative/webbrowser/content/pics/forward-disabled.png delete mode 100644 demos/declarative/webbrowser/content/pics/forward.png create mode 100644 demos/declarative/webbrowser/content/pics/go-next-view.png create mode 100644 demos/declarative/webbrowser/content/pics/go-previous-view.png delete mode 100644 demos/declarative/webbrowser/content/pics/header.png delete mode 100644 demos/declarative/webbrowser/content/pics/reload.png create mode 100644 demos/declarative/webbrowser/content/pics/scrollbar.png delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-bottom.png delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-left.png delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-left.sci delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-right.png delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-right.sci delete mode 100644 demos/declarative/webbrowser/content/pics/softshadow-top.png create mode 100644 demos/declarative/webbrowser/content/pics/titlebar-bg.png create mode 100644 demos/declarative/webbrowser/content/pics/view-refresh.png diff --git a/demos/declarative/webbrowser/content/Button.qml b/demos/declarative/webbrowser/content/Button.qml new file mode 100644 index 0000000..a1baf16 --- /dev/null +++ b/demos/declarative/webbrowser/content/Button.qml @@ -0,0 +1,18 @@ +import Qt 4.7 + +Item { + property alias image: icon.source + property variant action + + width: 40; height: parent.height + + Image { + id: icon; anchors.centerIn: parent + opacity: action.enabled ? 1.0 : 0.4 + } + + MouseArea { + anchors { fill: parent; topMargin: -10; bottomMargin: -10 } + onClicked: action.trigger() + } +} diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 50ea97d..2862cc4 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -15,7 +15,7 @@ Flickable { contentWidth: Math.max(parent.width,webView.width*webView.scale) contentHeight: Math.max(parent.height,webView.height*webView.scale) anchors.top: headerSpace.bottom - anchors.bottom: footer.top + anchors.bottom: parent.top anchors.left: parent.left anchors.right: parent.right pressDelay: 200 diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml new file mode 100644 index 0000000..7c93580 --- /dev/null +++ b/demos/declarative/webbrowser/content/Header.qml @@ -0,0 +1,69 @@ +import Qt 4.7 + +Image { + property alias editUrl: urlInput.url + + source: "pics/titlebar-bg.png"; fillMode: Image.TileHorizontally + + x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width + ? -webView.contentX+webView.contentWidth-webView.width : 0 + + y: { + if (webView.progress < 1.0) + return 0; + else { + webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY + } + } + + Column { + width: parent.width + + Item { + width: parent.width; height: 20 + Text { + anchors.centerIn: parent + text: webView.title; font.pixelSize: 14; font.bold: true + color: "white"; styleColor: "black"; style: Text.Sunken + } + } + + Item { + width: parent.width; height: 40 + + Button { + id: backButton + action: webView.back; image: "pics/go-previous-view.png" + anchors { left: parent.left; bottom: parent.bottom } + } + + Button { + id: nextButton + anchors.left: backButton.right + action: webView.forward; image: "pics/go-next-view.png" + } + + UrlInput { + id: urlInput + anchors { left: nextButton.right; right: reloadButton.left } + image: "pics/display.png" + onUrlEntered: { + webBrowser.urlString = url + webBrowser.focus = true + } + } + + Button { + id: reloadButton + anchors { right: parent.right; rightMargin: 4 } + action: webView.reload; image: "pics/view-refresh.png"; visible: webView.progress == 1.0 + } + + Button { + id: stopButton + anchors { right: parent.right; rightMargin: 4 } + action: webView.stop; image: "pics/edit-delete.png"; visible: webView.progress < 1.0 + } + } + } +} diff --git a/demos/declarative/webbrowser/content/RectSoftShadow.qml b/demos/declarative/webbrowser/content/RectSoftShadow.qml deleted file mode 100644 index 53d098c..0000000 --- a/demos/declarative/webbrowser/content/RectSoftShadow.qml +++ /dev/null @@ -1,32 +0,0 @@ -import Qt 4.7 - -Item { - BorderImage { - source: "pics/softshadow-left.sci" - x: -16 - y: -16 - width: 16 - height: parent.height+32 - } - BorderImage { - source: "pics/softshadow-right.sci" - x: parent.width - y: -16 - width: 16 - height: parent.height+32 - } - Image { - source: "pics/softshadow-top.png" - x: 0 - y: -16 - width: parent.width - height: 16 - } - Image { - source: "pics/softshadow-bottom.png" - x: 0 - y: parent.height - width: parent.width - height: 16 - } -} diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml deleted file mode 100644 index b02a5bf..0000000 --- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml +++ /dev/null @@ -1,113 +0,0 @@ -import Qt 4.7 - -import "fieldtext" - -Image { - property alias editUrl: editUrl.text - - id: header - source: "pics/header.png" - width: parent.width - height: 60 - x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width - ? -webView.contentX+webView.contentWidth-webView.width : 0 - y: webView.contentY < 0 ? -webView.contentY : progressOff* - (webView.contentY>height?-height:-webView.contentY) - Row { - id: headerTitle - - anchors.top: header.top - anchors.topMargin: 4 - x: parent.width > headerIcon.width+headerText.width+6 ? (parent.width-headerIcon.width-headerText.width-6)/2 : 0 - spacing: 6 - - Image { - id: headerIcon - pixmap: webView.icon - } - - Text { - id: headerText - - text: webView.title!='' || webView.progress == 1.0 ? webView.title : 'Loading...' - - color: "white" - styleColor: "black" - style: Text.Raised - - font.family: "Helvetica" - font.pointSize: 10 - font.bold: true - - horizontalAlignment: Text.AlignHCenter - } - } - Item { - width: parent.width - anchors.top: headerTitle.bottom - anchors.topMargin: 2 - anchors.bottom: parent.bottom - - Item { - id: urlBox - height: 31 - anchors.left: parent.left - anchors.leftMargin: 12 - anchors.right: parent.right - anchors.rightMargin: 12 - anchors.top: parent.top - clip: true - property bool mouseGrabbed: false - - BorderImage { - source: "pics/addressbar.sci" - anchors.fill: urlBox - } - - BorderImage { - id: urlBoxhl - source: "pics/addressbar-filled.sci" - width: parent.width*webView.progress - height: parent.height - opacity: 1-header.progressOff - clip: true - } - - FieldText { - id: editUrl - mouseGrabbed: parent.mouseGrabbed - - text: webBrowser.urlString - label: "url:" - onConfirmed: { webBrowser.urlString = editUrl.text; webView.focus=true } - onCancelled: { webView.focus=true } - onStartEdit: { webView.focus=false } - - anchors.left: urlBox.left - anchors.right: urlBox.right - anchors.leftMargin: 6 - anchors.verticalCenter: urlBox.verticalCenter - anchors.verticalCenterOffset: 1 - } - } - } - - property real progressOff : 1 - states: [ - State { - name: "ProgressShown" - when: webView.progress < 1.0 - PropertyChanges { target: header; progressOff: 0; } - } - ] - transitions: [ - Transition { - NumberAnimation { - targets: header - properties: "progressOff" - easing.type: Easing.InOutQuad - duration: 300 - } - } - ] -} diff --git a/demos/declarative/webbrowser/content/ScrollBar.qml b/demos/declarative/webbrowser/content/ScrollBar.qml new file mode 100644 index 0000000..976297b --- /dev/null +++ b/demos/declarative/webbrowser/content/ScrollBar.qml @@ -0,0 +1,66 @@ +import Qt 4.7 + +Item { + id: container + + property variant scrollArea + property variant orientation: Qt.Vertical + + opacity: 0 + + function position() + { + var ny = 0; + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + if (ny > 2) return ny; else return 2; + } + + function size() + { + var nh, ny; + + if (container.orientation == Qt.Vertical) + nh = scrollArea.visibleArea.heightRatio * container.height; + else + nh = scrollArea.visibleArea.widthRatio * container.width; + + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + + if (ny > 3) { + var t; + if (container.orientation == Qt.Vertical) + t = Math.ceil(container.height - 3 - ny); + else + t = Math.ceil(container.width - 3 - ny); + if (nh > t) return t; else return nh; + } else return nh + ny; + } + + Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.5 } + + BorderImage { + source: "pics/scrollbar.png" + border { left: 1; right: 1; top: 1; bottom: 1 } + x: container.orientation == Qt.Vertical ? 2 : position() + width: container.orientation == Qt.Vertical ? container.width - 4 : size() + y: container.orientation == Qt.Vertical ? position() : 2 + height: container.orientation == Qt.Vertical ? size() : container.height - 4 + } + + states: State { + name: "visible" + when: scrollArea.moving + PropertyChanges { target: container; opacity: 1.0 } + } + + transitions: Transition { + from: "visible"; to: "" + NumberAnimation { properties: "opacity"; duration: 600 } + } +} diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml new file mode 100644 index 0000000..9f7fc38 --- /dev/null +++ b/demos/declarative/webbrowser/content/UrlInput.qml @@ -0,0 +1,44 @@ +import Qt 4.7 + +Item { + id: container + + property alias image: bg.source + property alias url: urlText.text + + signal urlEntered(string url) + + width: parent.height; height: parent.height + + BorderImage { + id: bg; rotation: 180 + x: 8; width: parent.width - 16; height: 30; + anchors.verticalCenter: parent.verticalCenter + border { left: 10; top: 10; right: 10; bottom: 10 } + } + + Rectangle { + anchors.bottom: bg.bottom + x: 18; height: 4; color: "#63b1ed" + width: (bg.width - 20) * webView.progress + opacity: webView.progress == 1.0 ? 0.0 : 1.0 + } + + TextInput { + id: urlText + horizontalAlignment: TextEdit.AlignLeft + font.pixelSize: 14; focusOnPress: true + Keys.onEscapePressed: { + urlText.text = webView.url + webView.focus = true + } + Keys.onReturnPressed: { + container.urlEntered(urlText.text) + webView.focus = true + } + anchors { + left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18 + verticalCenter: parent.verticalCenter + } + } +} diff --git a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml deleted file mode 100644 index d1d003f..0000000 --- a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml +++ /dev/null @@ -1,157 +0,0 @@ -import Qt 4.7 - -Item { - id: fieldText - height: 30 - property string text: "" - property string label: "" - property bool mouseGrabbed: false - signal confirmed - signal cancelled - signal startEdit - - function edit() { - if (!mouseGrabbed) { - fieldText.startEdit(); - fieldText.state='editing'; - mouseGrabbed=true; - } - } - - function confirm() { - fieldText.state=''; - fieldText.text = textEdit.text; - mouseGrabbed=false; - fieldText.confirmed(); - } - - function reset() { - textEdit.text = fieldText.text; - fieldText.state=''; - mouseGrabbed=false; - fieldText.cancelled(); - } - - Image { - id: cancelIcon - width: 22 - height: 22 - anchors.right: parent.right - anchors.rightMargin: 4 - anchors.verticalCenter: parent.verticalCenter - source: "pics/cancel.png" - opacity: 0 - } - - Image { - id: confirmIcon - width: 22 - height: 22 - anchors.left: parent.left - anchors.leftMargin: 4 - anchors.verticalCenter: parent.verticalCenter - source: "pics/ok.png" - opacity: 0 - } - - TextInput { - id: textEdit - text: fieldText.text - focus: false - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.verticalCenter: parent.verticalCenter - color: "black" - font.bold: true - readOnly: true - onAccepted: confirm() - Keys.onEscapePressed: reset() - } - - Text { - id: textLabel - x: 5 - width: parent.width-10 - anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: Text.AlignHCenter - color: fieldText.state == "editing" ? "#505050" : "#AAAAAA" - font.italic: true - font.bold: true - text: label - opacity: textEdit.text == '' ? 1 : 0 - Behavior on opacity { - NumberAnimation { - property: "opacity" - duration: 250 - } - } - } - - MouseArea { - anchors.fill: cancelIcon - onClicked: { reset() } - } - - MouseArea { - anchors.fill: confirmIcon - onClicked: { confirm() } - } - - MouseArea { - id: editRegion - anchors.fill: textEdit - onClicked: { edit() } - } - - states: [ - State { - name: "editing" - PropertyChanges { - target: confirmIcon - opacity: 1 - } - PropertyChanges { - target: cancelIcon - opacity: 1 - } - PropertyChanges { - target: textEdit - color: "black" - readOnly: false - focus: true - selectionStart: 0 - selectionEnd: -1 - } - PropertyChanges { - target: editRegion - opacity: 0 - } - PropertyChanges { - target: textEdit.anchors - leftMargin: 34 - } - PropertyChanges { - target: textEdit.anchors - rightMargin: 34 - } - } - ] - - transitions: [ - Transition { - from: "" - to: "*" - reversible: true - NumberAnimation { - properties: "opacity,leftMargin,rightMargin" - duration: 200 - } - ColorAnimation { - property: "color" - duration: 150 - } - } - ] -} diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png b/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png deleted file mode 100644 index ecc9533..0000000 Binary files a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png b/demos/declarative/webbrowser/content/fieldtext/pics/ok.png deleted file mode 100644 index 5795f04..0000000 Binary files a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.png b/demos/declarative/webbrowser/content/pics/addressbar-filled.png deleted file mode 100644 index d8452ec..0000000 Binary files a/demos/declarative/webbrowser/content/pics/addressbar-filled.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci b/demos/declarative/webbrowser/content/pics/addressbar-filled.sci deleted file mode 100644 index 96c5efb..0000000 --- a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci +++ /dev/null @@ -1,6 +0,0 @@ -border.left: 7 -border.top: 7 -border.bottom: 7 -border.right: 7 -source: addressbar-filled.png - diff --git a/demos/declarative/webbrowser/content/pics/addressbar.png b/demos/declarative/webbrowser/content/pics/addressbar.png deleted file mode 100644 index 3278f58..0000000 Binary files a/demos/declarative/webbrowser/content/pics/addressbar.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/addressbar.sci b/demos/declarative/webbrowser/content/pics/addressbar.sci deleted file mode 100644 index 8f1cd18..0000000 --- a/demos/declarative/webbrowser/content/pics/addressbar.sci +++ /dev/null @@ -1,6 +0,0 @@ -border.left: 7 -border.top: 7 -border.bottom: 7 -border.right: 7 -source: addressbar.png - diff --git a/demos/declarative/webbrowser/content/pics/back-disabled.png b/demos/declarative/webbrowser/content/pics/back-disabled.png deleted file mode 100644 index 91b9e76..0000000 Binary files a/demos/declarative/webbrowser/content/pics/back-disabled.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/back.png b/demos/declarative/webbrowser/content/pics/back.png deleted file mode 100644 index 9988dd3..0000000 Binary files a/demos/declarative/webbrowser/content/pics/back.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/display.png b/demos/declarative/webbrowser/content/pics/display.png new file mode 100644 index 0000000..9507f43 Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/display.png differ diff --git a/demos/declarative/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/content/pics/edit-delete.png new file mode 100644 index 0000000..351659b Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/edit-delete.png differ diff --git a/demos/declarative/webbrowser/content/pics/footer.png b/demos/declarative/webbrowser/content/pics/footer.png deleted file mode 100644 index 8391a93..0000000 Binary files a/demos/declarative/webbrowser/content/pics/footer.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/footer.sci b/demos/declarative/webbrowser/content/pics/footer.sci deleted file mode 100644 index 7be58f1..0000000 --- a/demos/declarative/webbrowser/content/pics/footer.sci +++ /dev/null @@ -1,6 +0,0 @@ -border.left: 5 -border.top: 0 -border.bottom: 0 -border.right: 5 -source: footer.png - diff --git a/demos/declarative/webbrowser/content/pics/forward-disabled.png b/demos/declarative/webbrowser/content/pics/forward-disabled.png deleted file mode 100644 index cb87f4f..0000000 Binary files a/demos/declarative/webbrowser/content/pics/forward-disabled.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/forward.png b/demos/declarative/webbrowser/content/pics/forward.png deleted file mode 100644 index 83870ee..0000000 Binary files a/demos/declarative/webbrowser/content/pics/forward.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/content/pics/go-next-view.png new file mode 100644 index 0000000..3bce02d Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/go-next-view.png differ diff --git a/demos/declarative/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/content/pics/go-previous-view.png new file mode 100644 index 0000000..3ec011e Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/go-previous-view.png differ diff --git a/demos/declarative/webbrowser/content/pics/header.png b/demos/declarative/webbrowser/content/pics/header.png deleted file mode 100644 index 26588c3..0000000 Binary files a/demos/declarative/webbrowser/content/pics/header.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/reload.png b/demos/declarative/webbrowser/content/pics/reload.png deleted file mode 100644 index 45b5535..0000000 Binary files a/demos/declarative/webbrowser/content/pics/reload.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/scrollbar.png b/demos/declarative/webbrowser/content/pics/scrollbar.png new file mode 100644 index 0000000..0228dcf Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/scrollbar.png differ diff --git a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png b/demos/declarative/webbrowser/content/pics/softshadow-bottom.png deleted file mode 100644 index 85b0b44..0000000 Binary files a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.png b/demos/declarative/webbrowser/content/pics/softshadow-left.png deleted file mode 100644 index 02926d1..0000000 Binary files a/demos/declarative/webbrowser/content/pics/softshadow-left.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.sci b/demos/declarative/webbrowser/content/pics/softshadow-left.sci deleted file mode 100644 index 45c88d5..0000000 --- a/demos/declarative/webbrowser/content/pics/softshadow-left.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 0 -border.top: 16 -border.bottom: 16 -border.right: 0 -source: softshadow-left.png diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.png b/demos/declarative/webbrowser/content/pics/softshadow-right.png deleted file mode 100644 index e459f4f..0000000 Binary files a/demos/declarative/webbrowser/content/pics/softshadow-right.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.sci b/demos/declarative/webbrowser/content/pics/softshadow-right.sci deleted file mode 100644 index 4d459c0..0000000 --- a/demos/declarative/webbrowser/content/pics/softshadow-right.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 0 -border.top: 16 -border.bottom: 16 -border.right: 0 -source: softshadow-right.png diff --git a/demos/declarative/webbrowser/content/pics/softshadow-top.png b/demos/declarative/webbrowser/content/pics/softshadow-top.png deleted file mode 100644 index 9a9e232..0000000 Binary files a/demos/declarative/webbrowser/content/pics/softshadow-top.png and /dev/null differ diff --git a/demos/declarative/webbrowser/content/pics/titlebar-bg.png b/demos/declarative/webbrowser/content/pics/titlebar-bg.png new file mode 100644 index 0000000..06961e8 Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/titlebar-bg.png differ diff --git a/demos/declarative/webbrowser/content/pics/view-refresh.png b/demos/declarative/webbrowser/content/pics/view-refresh.png new file mode 100644 index 0000000..afa2a9d Binary files /dev/null and b/demos/declarative/webbrowser/content/pics/view-refresh.png differ diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index f1a6034..27da814 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -3,168 +3,39 @@ import org.webkit 1.0 import "content" -Item { +Rectangle { id: webBrowser property string urlString : "http://qt.nokia.com/" - width: 640 - height: 480 + width: 800; height: 600 + color: "#343434" + + FlickableWebView { + id: webView + url: webBrowser.urlString + anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom } + + } Item { - id: webPanel - anchors.fill: parent - clip: true - Rectangle { - color: "#555555" - anchors.fill: parent - } - Image { - source: "content/pics/softshadow-bottom.png" - width: webPanel.width - height: 16 - } - Image { - source: "content/pics/softshadow-top.png" - width: webPanel.width - height: 16 - anchors.bottom: footer.top - } - RectSoftShadow { - x: -webView.contentX - y: -webView.contentY - width: webView.contentWidth - height: webView.contentHeight+headerSpace.height - } - Item { - id: headerSpace - width: parent.width - height: 60 - z: 1 + id: headerSpace + width: parent.width; height: 62 + } - RetractingWebBrowserHeader { id: header } - } - FlickableWebView { - id: webView - width: parent.width - anchors.top: headerSpace.bottom - anchors.bottom: footer.top - anchors.left: parent.left - anchors.right: parent.right - } - BorderImage { - id: footer - source: "content/pics/footer.sci" - width: parent.width - height: 43 - anchors.bottom: parent.bottom - Rectangle { - y: -1 - width: parent.width - height: 1 - color: "#555555" - } - Item { - id: backbutton - width: back_e.width - height: back_e.height - anchors.right: reload.left - anchors.rightMargin: 10 - anchors.verticalCenter: parent.verticalCenter - Image { - id: back_e - source: "content/pics/back.png" - anchors.fill: parent - } - Image { - id: back_d - source: "content/pics/back-disabled.png" - anchors.fill: parent - } - states: [ - State { - name: "Enabled" - when: webView.back.enabled==true - PropertyChanges { target: back_e; opacity: 1 } - PropertyChanges { target: back_d; opacity: 0 } - }, - State { - name: "Disabled" - when: webView.back.enabled==false - PropertyChanges { target: back_e; opacity: 0 } - PropertyChanges { target: back_d; opacity: 1 } - } - ] - transitions: [ - Transition { - NumberAnimation { - properties: "opacity" - easing.type: Easing.InOutQuad - duration: 300 - } - } - ] - MouseArea { - anchors.fill: back_e - onClicked: { if (webView.back.enabled) webView.back.trigger() } - } - } - Image { - id: reload - source: "content/pics/reload.png" - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - } - MouseArea { - anchors.fill: reload - onClicked: { webView.reload.trigger() } - } - Item { - id: forwardbutton - width: forward_e.width - height: forward_e.height - anchors.left: reload.right - anchors.leftMargin: 10 - anchors.verticalCenter: parent.verticalCenter - Image { - id: forward_e - source: "content/pics/forward.png" - anchors.fill: parent - anchors.verticalCenter: parent.verticalCenter - } - Image { - id: forward_d - source: "content/pics/forward-disabled.png" - anchors.fill: parent - } - states: [ - State { - name: "Enabled" - when: webView.forward.enabled==true - PropertyChanges { target: forward_e; opacity: 1 } - PropertyChanges { target: forward_d; opacity: 0 } - }, - State { - name: "Disabled" - when: webView.forward.enabled==false - PropertyChanges { target: forward_e; opacity: 0 } - PropertyChanges { target: forward_d; opacity: 1 } - } - ] - transitions: [ - Transition { - NumberAnimation { - properties: "opacity" - easing.type: Easing.InOutQuad - duration: 320 - } - } - ] - MouseArea { - anchors.fill: parent - onClicked: { if (webView.forward.enabled) webView.forward.trigger() } - } - } - } + Header { + id: header + editUrl: webBrowser.urlString + width: headerSpace.width; height: headerSpace.height } + + ScrollBar { + scrollArea: webView; width: 8 + anchors { right: parent.right; top: header.bottom; bottom: parent.bottom } + } + +// ScrollBar { +// scrollArea: webView; height: 8; orientation: Qt.Horizontal +// anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom } +// } } -- cgit v0.12 From a7b128ae838b006be1259ef6ba79da5440ed52dd Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 11 May 2010 09:59:56 +0200 Subject: Stabilize tst_QColumnView::parentCurrentIndex --- tests/auto/qcolumnview/tst_qcolumnview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp index 90f499d..1da8c5d 100644 --- a/tests/auto/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp @@ -596,11 +596,11 @@ void tst_QColumnView::clicked() QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, localPoint); QCOMPARE(clickedSpy.count(), 1); qApp->processEvents(); - + if (sizeof(qreal) != sizeof(double)) { QSKIP("Skipped due to rounding errors", SkipAll); } - + for (int i = 0; i < view.createdColumns.count(); ++i) { QAbstractItemView *column = view.createdColumns.at(i); if (column && column->selectionModel() && (column->rootIndex() == home)) @@ -961,9 +961,9 @@ void tst_QColumnView::parentCurrentIndex() QVERIFY(third.isValid()); view.setCurrentIndex(third); QTest::qWait(ANIMATION_DELAY); - QCOMPARE(view.createdColumns[0]->currentIndex(), first); - QCOMPARE(view.createdColumns[1]->currentIndex(), second); - QCOMPARE(view.createdColumns[2]->currentIndex(), third); + QTRY_COMPARE(view.createdColumns[0]->currentIndex(), first); + QTRY_COMPARE(view.createdColumns[1]->currentIndex(), second); + QTRY_COMPARE(view.createdColumns[2]->currentIndex(), third); first = model.index(0, 0, QModelIndex()); second = model.index(secondRow, 0, first); -- cgit v0.12 From aa04c975442aace80d95f9f70ab11fa845436c54 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Tue, 11 May 2010 11:22:59 +0300 Subject: fix webkit crash when accessing network on Symbian Fixes crash on startup and crashes on network requests Task-number: QTBUG-9820 Reviewed-by: Janne Anttila --- src/plugins/bearer/symbian/qnetworksession_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 1b9c8cc..5fc0edb 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -947,7 +947,7 @@ void QNetworkSessionPrivateImpl::RunL() #endif if (publicConfig.type() == QNetworkConfiguration::UserChoice) { serviceConfig = QNetworkConfigurationManager() - .configurationFromIdentifier(symbianConfig->serviceNetworkPtr->id); + .configurationFromIdentifier(symbianConfig->id); } symbianConfig->mutex.unlock(); -- cgit v0.12 From 70dd6652b8f649871e6801cc9190543f43daa650 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 11 May 2010 10:58:15 +0200 Subject: qdoc: Yet another revision of the top doc page. Still more to come. --- doc/src/files-and-resources/datastreamformat.qdoc | 3 +- doc/src/files-and-resources/resources.qdoc | 2 ++ doc/src/frameworks-technologies/graphicsview.qdoc | 2 +- .../model-view-programming.qdoc | 1 - doc/src/index.qdoc | 10 +++--- doc/src/network-programming/bearermanagement.qdoc | 9 +++-- doc/src/network-programming/qtnetwork.qdoc | 1 + doc/src/network-programming/ssl.qdoc | 6 ++-- doc/src/overviews.qdoc | 13 ++++++- doc/src/painting-and-printing/coordsys.qdoc | 2 +- doc/src/painting-and-printing/paintsystem.qdoc | 3 +- doc/src/painting-and-printing/printing.qdoc | 1 + tools/qdoc3/test/qt-defines.qdocconf | 28 +++++++-------- tools/qdoc3/test/qt.qdocconf | 42 +++++++++++----------- 14 files changed, 69 insertions(+), 54 deletions(-) diff --git a/doc/src/files-and-resources/datastreamformat.qdoc b/doc/src/files-and-resources/datastreamformat.qdoc index bab2c2c..c4be7bb 100644 --- a/doc/src/files-and-resources/datastreamformat.qdoc +++ b/doc/src/files-and-resources/datastreamformat.qdoc @@ -41,7 +41,8 @@ /*! \page datastreamformat.html - \title Format of the QDataStream Operators + \title Serializing Qt Data Types + \ingroup qt-network \brief Representations of data types that can be serialized by QDataStream. The \l QDataStream allows you to serialize some of the Qt data types. diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc index 00646ac..83d74a3 100644 --- a/doc/src/files-and-resources/resources.qdoc +++ b/doc/src/files-and-resources/resources.qdoc @@ -54,6 +54,8 @@ /*! \page resources.html \title The Qt Resource System + \ingroup qt-network + \brief A platform-independent mechanism for storing binary files in an application. \keyword resource system diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc index 740fcac..1dd6c7c 100644 --- a/doc/src/frameworks-technologies/graphicsview.qdoc +++ b/doc/src/frameworks-technologies/graphicsview.qdoc @@ -46,7 +46,7 @@ /*! \page graphicsview.html - \title The Graphics View Framework + \title Graphics View Framework \ingroup qt-graphics \brief An overview of the Graphics View framework for interactive 2D graphics. diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc index e02f1eb..7568981 100644 --- a/doc/src/frameworks-technologies/model-view-programming.qdoc +++ b/doc/src/frameworks-technologies/model-view-programming.qdoc @@ -50,7 +50,6 @@ \startpage index.html Qt Reference Documentation \title Model/View Programming - \ingroup qt-gui-concepts \brief A guide to the extensible model/view architecture used by Qt's item view classes. diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index e6efe4d..c9b6929 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -82,17 +82,17 @@
      diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc index 10d697a..b10481e 100644 --- a/doc/src/network-programming/bearermanagement.qdoc +++ b/doc/src/network-programming/bearermanagement.qdoc @@ -40,12 +40,11 @@ ****************************************************************************/ /*! -\page bearer-management.html + \page bearer-management.html -\title Bearer Management -\brief An API to control the system's connectivity state. - -\ingroup network + \title Bearer Management + \ingroup qt-network + \brief An API to control the system's connectivity state. Bearer Management controls the connectivity state of the system so that the user can start or stop interfaces or roam transparently between diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc index 36f48cf..9134809 100644 --- a/doc/src/network-programming/qtnetwork.qdoc +++ b/doc/src/network-programming/qtnetwork.qdoc @@ -50,6 +50,7 @@ /*! \page network-programming.html \title Network Programming + \ingroup qt-network \brief An Introduction to Network Programming with Qt The QtNetwork module offers classes that allow you to write TCP/IP clients diff --git a/doc/src/network-programming/ssl.qdoc b/doc/src/network-programming/ssl.qdoc index 2feb7b6..7f365a9 100644 --- a/doc/src/network-programming/ssl.qdoc +++ b/doc/src/network-programming/ssl.qdoc @@ -40,11 +40,11 @@ ****************************************************************************/ /*! - \group ssl + \page ssl.html \title Secure Sockets Layer (SSL) Classes - \ingroup groups - \brief Classes for secure communication over network sockets. + \ingroup qt-network + \keyword SSL The classes below provide support for secure network communication using diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc index cb6541d..cee1109 100644 --- a/doc/src/overviews.qdoc +++ b/doc/src/overviews.qdoc @@ -77,7 +77,7 @@ /*! \group qt-graphics - \title Qt Graphics + \title Qt Graphics and Painting \brief The Qt components for doing graphics. @@ -85,6 +85,17 @@ */ /*! + \group qt-network + \title Network programming with Qt + + \brief The these pages are about Qt's support for network programming. + + \generatelist {related} + */ + + + +/*! \group frameworks-technologies \title Frameworks and Technologies diff --git a/doc/src/painting-and-printing/coordsys.qdoc b/doc/src/painting-and-printing/coordsys.qdoc index b0ba093..b360d0b 100644 --- a/doc/src/painting-and-printing/coordsys.qdoc +++ b/doc/src/painting-and-printing/coordsys.qdoc @@ -41,7 +41,7 @@ /*! \page coordsys.html - \title The Coordinate System + \title Coordinate System \ingroup qt-graphics \brief Information about the coordinate system used by the paint system. diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc index b711b2f..44c84a2 100644 --- a/doc/src/painting-and-printing/paintsystem.qdoc +++ b/doc/src/painting-and-printing/paintsystem.qdoc @@ -60,7 +60,8 @@ /*! \page paintsystem.html - \title The Paint System + \title Paint System + \brief A system for painting on the screen or on print devices using the same API \ingroup qt-graphics \ingroup frameworks-technologies diff --git a/doc/src/painting-and-printing/printing.qdoc b/doc/src/painting-and-printing/printing.qdoc index 3d6ade2..6dad097 100644 --- a/doc/src/painting-and-printing/printing.qdoc +++ b/doc/src/painting-and-printing/printing.qdoc @@ -49,6 +49,7 @@ /*! \page printing.html \title Printing with Qt + \ingroup qt-graphics \previouspage Styling \contentspage The Paint System diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index dc81757..f3291df 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -20,20 +20,20 @@ codeindent = 1 # See also qhp.Qt.extraFiles extraimages.HTML = qt-logo \ trolltech-logo \ - bg_l.png \ - bg_l_blank.png \ - bg_r.png \ - box_bg.png \ - breadcrumb.png \ - bullet_gt.png \ - bullet_dn.png \ - bullet_sq.png \ - bullet_up.png \ - feedbackground.png \ - horBar.png \ - page.png \ - page_bg.png \ - sprites-combined.png \ + bg_l.png \ + bg_l_blank.png \ + bg_r.png \ + box_bg.png \ + breadcrumb.png \ + bullet_gt.png \ + bullet_dn.png \ + bullet_sq.png \ + bullet_up.png \ + feedbackground.png \ + horBar.png \ + page.png \ + page_bg.png \ + sprites-combined.png \ taskmenuextension-example.png \ coloreditorfactoryimage.png \ dynamiclayouts-example.png \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 59dd855..2f6983a 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -26,27 +26,27 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -- cgit v0.12 From ad6dafee9be288bcef6b2c4b318b234d2995abff Mon Sep 17 00:00:00 2001 From: aavit Date: Mon, 10 May 2010 16:23:44 +0200 Subject: Optimize QPixmapIconEngine's pixmap() function Replace needlessly expensive cache key generation Task-number: QTBUG-9850 Reviewed-by: Trond --- src/gui/image/qicon.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 891b1db..5ef0ff9 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -261,21 +261,28 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St if (!actualSize.isNull() && (actualSize.width() > size.width() || actualSize.height() > size.height())) actualSize.scale(size, Qt::KeepAspectRatio); - QString key = QLatin1String("$qt_icon_") - + QString::number(pm.cacheKey()) - + QString::number(pe->mode) - + QString::number(QApplication::palette().cacheKey()) - + QLatin1Char('_') - + QString::number(actualSize.width()) - + QLatin1Char('_') - + QString::number(actualSize.height()) - + QLatin1Char('_'); - + struct { + quint64 pmc; + qint32 w; + qint32 h; + quint64 pac; + qint32 m; // Make struct size a multiple of 4, for safety's sake + } dill; + + dill.pmc = pm.cacheKey(); + dill.w = actualSize.width(); + dill.h = actualSize.height(); + dill.pac = QApplication::palette().cacheKey(); + dill.m = pe->mode; + + QString keyBase = QLatin1String("$qt_icon_") + + QString::fromRawData((QChar *)&dill, sizeof(dill)/sizeof(QChar)); + QString key = keyBase + QString::number(mode, 16); if (mode == QIcon::Active) { - if (QPixmapCache::find(key + QString::number(mode), pm)) + if (QPixmapCache::find(key, pm)) return pm; // horray - if (QPixmapCache::find(key + QString::number(QIcon::Normal), pm)) { + if (QPixmapCache::find(keyBase + QString::number(QIcon::Normal, 16), pm)) { QStyleOption opt(0); opt.palette = QApplication::palette(); QPixmap active = QApplication::style()->generatedIconPixmap(QIcon::Active, pm, &opt); @@ -284,7 +291,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St } } - if (!QPixmapCache::find(key + QString::number(mode), pm)) { + if (!QPixmapCache::find(key, pm)) { if (pm.size() != actualSize) pm = pm.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); if (pe->mode != mode && mode != QIcon::Normal) { @@ -294,7 +301,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St if (!generated.isNull()) pm = generated; } - QPixmapCache::insert(key + QString::number(mode), pm); + QPixmapCache::insert(key, pm); } return pm; } -- cgit v0.12 From 3eec5af3f07fdab9084f40d6955411a667b433c4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 11 May 2010 12:26:30 +0200 Subject: Updated WebKit to b4aa5e1ddc41edab895132aba3cc66d9d7129444 Integrated changes: || || mingw-w64 and JIT support || || || [Qt] QWebPage viewMode property || || || [Qt] Fix infinite redirection loop in QNetworkReplyHandler || || || [Qt] Enable YARR_JIT for X86 Mac for QtWebKit || || || [Qt] Adapt DNS pre-fetching to Qt DNS cache code || || || [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used || || || [PATCH] [Qt] Compilation with Plugins disabled is broken || || || Crash in handleTouchEvent: using dangling node ptrs in hashmap || || || Potential crash in EventHandler::handleTouchEvent || || || Spatial Navigation: create a getter for the "fudgeFactor" || || || [Qt] QtWebKit has render bugs on Google Maps markers || || || LayoutTests/fast/canvas/pointInPath.html passed, actually it failed || || || [Qt] Expose HTMLTokenizer yielding parameters || --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 23 +++ src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 6 +- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 163 +++++++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.gypi | 2 +- src/3rdparty/webkit/WebCore/WebCore.pro | 2 +- src/3rdparty/webkit/WebCore/page/EventHandler.cpp | 13 +- .../webkit/WebCore/page/SpatialNavigation.cpp | 13 +- .../webkit/WebCore/page/SpatialNavigation.h | 5 + .../platform/graphics/qt/GraphicsContextQt.cpp | 16 +- .../webkit/WebCore/platform/graphics/qt/PathQt.cpp | 29 ++++ .../platform/network/qt/DnsPrefetchHelper.h | 11 ++ .../platform/network/qt/QNetworkReplyHandler.cpp | 13 +- .../platform/network/qt/QNetworkReplyHandler.h | 1 + .../WebCore/platform/qt/TemporaryLinkStubs.cpp | 119 --------------- .../WebCore/platform/qt/TemporaryLinkStubsQt.cpp | 119 +++++++++++++++ .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 22 ++- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 32 ++-- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 2 + src/3rdparty/webkit/WebKit/qt/ChangeLog | 58 ++++++++ .../webkit/WebKit/qt/symbian/bwins/QtWebKitu.def | 2 +- .../webkit/WebKit/qt/symbian/eabi/QtWebKitu.def | 2 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 17 +++ 24 files changed, 505 insertions(+), 169 deletions(-) delete mode 100644 src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp create mode 100644 src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 75fc5e7..65cfdda 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -b4aa5e1ddc41edab895132aba3cc66d9d7129444 +dc5821c3df2ef60456d85263160852f5335cf946 diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 1439ae0..97176ef 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,26 @@ +2010-05-10 Laszlo Gombos + + Reviewed by Darin Adler. + + [Qt] Disable JIT support for mingw-w64 + https://bugs.webkit.org/show_bug.cgi?id=38747 + + Disale JIT for mingw-w64 as it is reportedly + unstable. + + Thanks for Vanboxem Rruben for the investigation. + + * wtf/Platform.h: + +2010-05-06 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable YARR_JIT for X86 Mac for QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=38668 + + * wtf/Platform.h: + 2010-05-02 Laszlo Gombos Reviewed by Eric Seidel. diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index c582905..8d98765 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -927,8 +927,6 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100 #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 -#elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100 - #define ENABLE_JIT 1 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC) #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 @@ -1011,7 +1009,9 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \ || (CPU(ARM_TRADITIONAL) && OS(LINUX)) \ || (CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)) \ - || (CPU(MIPS) && OS(LINUX)) + || (CPU(MIPS) && OS(LINUX)) \ + || (CPU(X86) && OS(DARWIN)) \ + || (CPU(X86_64) && OS(DARWIN)) #define ENABLE_YARR 1 #define ENABLE_YARR_JIT 1 #endif diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 98debf6..24f855b 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 07b60cf799680fcfb7785ee88e14f8030a5dbfa2 + b4aa5e1ddc41edab895132aba3cc66d9d7129444 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 6617b66..ee42878 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,166 @@ +2010-05-03 Antonio Gomes + + Reviewed by Kenneth Christiansen. + + Spatial Navigation: create a getter for the "fudgeFactor" + https://bugs.webkit.org/show_bug.cgi?id=38488 + + A couple of places in the Spatial Navigation code make use of a "fudge factor" + to improve precision by working around outline focus metrics and such. Patch adds + a helper method for unify getter operations of this value, instead of having it + declared locally in the various methods it is used. + + No behaviour change. + + * page/SpatialNavigation.cpp: + (WebCore::scrollIntoView): + (WebCore::deflateIfOverlapped): + * page/SpatialNavigation.h: + (WebCore::fudgeFactor): + +2010-05-10 Markus Goetz + + Reviewed by Simon Hausmann. + + Qt after 4.6.3 has its integrated DNS cache. Therefore some + code is not necessary anymore. + + https://bugs.webkit.org/show_bug.cgi?id=38834 + + * platform/network/qt/DnsPrefetchHelper.h: + (WebCore::DnsPrefetchHelper::lookup): + (WebCore::DnsPrefetchHelper::lookedUp): + +2010-05-06 Laszlo Gombos + + Unreviewed, build fix WinCE for QtWebKit. + + [Qt] Compilation with Plugins disabled is broken + https://bugs.webkit.org/show_bug.cgi?id=31407 + + Rename platform/qt/TemporaryLinkStubs.cpp to avoid name collition on + Windows. + + Thanks for Ismail "cartman" Donmez for help. + + No new tests, as there is no new functionality. + + * WebCore.gypi: + * WebCore.pro: + * platform/qt/TemporaryLinkStubs.cpp: Removed. + * platform/qt/TemporaryLinkStubsQt.cpp: Copied from WebCore/platform/qt/TemporaryLinkStubs.cpp. + +2010-04-23 Qi Zhang + + Reviewed by Laszlo Gombos. + + [Qt] LayoutTests/fast/canvas/pointInPath.html passed, actually it failed + https://bugs.webkit.org/show_bug.cgi?id=37276 + + QPainterPath::contains doesn't count the point on the bound. + + * platform/graphics/qt/PathQt.cpp: + (WebCore::isPointOnPathBorder): + (WebCore::Path::contains): + +2010-05-07 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + [Qt] Fix rendering of -webkit-user-select: none + + -webkit-user-select: none is implemented by filling + the area with an invalid default-constructed Color. + In most ports passing an invalid color down to the + graphics backend seems to produce transparent fills. + + In Qt the behavior of painting with an invalid QColor + is undefined, and in practice it results in painting + black opaque areas. + + One way to fix this would be to use Qt::transparent + when converting an undefined Color to a QColor, but + Qt does not have short circuits for fully transparent + painting, and we actually end up in slow code paths + due to the transparency. So, we're better of doing the + short circuit in WebKit. + + https://bugs.webkit.org/show_bug.cgi?id=38523 + + * platform/graphics/qt/GraphicsContextQt.cpp: + +2010-04-05 Robert Hogan + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix infinite redirection loop in QNetworkReplyHandler + + Put a maximum on consecutive redirections so we don't have to + worry about whether it's the same url or not. + + Tolerate up to 10 consecutive redirections, anything beyond + that is considered a potentially infinite recursion in the + redirection requests. This is the same behaviour as Firefox. + + https://bugs.webkit.org/show_bug.cgi?id=37097 + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): + (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): + * platform/network/qt/QNetworkReplyHandler.h: + +2010-04-05 Robert Hogan + + Reviewed by Kenneth Rohde-Christiansen. + + [Qt] Fix infinite redirection loop in QNetworkReplyHandler + + Qt enters an infinite loop if a redirect response redirects to itself. + + Fixes http/tests/xmlhttprequest/connection-error-sync.html + + https://bugs.webkit.org/show_bug.cgi?id=37097 + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): + +2010-05-07 Ben Murdoch + + Reviewed by Darin Adler. + + Potential crash in EventHandler::handleTouchEvent + https://bugs.webkit.org/show_bug.cgi?id=38646 + + Fix a ref counting bug that can cause a crash if the m_originatingouchPointTargets + hashmap holds the last ref to an EventTarget when the user lifts their finger. + + This is very hard to reproduce in a consistent way and clearly a + simple logic error in the code, therefore no new tests. + + * page/EventHandler.cpp: + (WebCore::EventHandler::handleTouchEvent): Don't let the RefPtr we get back from + the hasmap go out of scope so soon as it could delete the wrapped ptr if the + hashmap held the last ref (and we use the raw ptr that the RefPtr + wraps later in the WebCore::Touch constructor). + +2010-05-04 Ben Murdoch + + Reviewed by Simon Hausmann. + + Crash in handleTouchEvent: using dangling node ptrs in hashmap + https://bugs.webkit.org/show_bug.cgi?id=38514 + + When navigating away from a page, if you have your finger still + pressed and then lift it on the new page we see a crash if the + node got deleted as we still have a dangling pointer in the + m_originatingTouchPointTargets hashmap and try to use it as the + receiver to dispatch a touchend event. + + Test: fast/events/touch/touch-stale-node-crash.html + + * page/EventHandler.cpp: + (WebCore::EventHandler::clear): Clear the hashmap of touch targets. + 2010-05-04 Luiz Agostini Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebCore/WebCore.gypi b/src/3rdparty/webkit/WebCore/WebCore.gypi index caa79f2..701ad90 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.gypi +++ b/src/3rdparty/webkit/WebCore/WebCore.gypi @@ -2640,7 +2640,7 @@ 'platform/qt/SharedBufferQt.cpp', 'platform/qt/SharedTimerQt.cpp', 'platform/qt/SoundQt.cpp', - 'platform/qt/TemporaryLinkStubs.cpp', + 'platform/qt/TemporaryLinkStubsQt.cpp', 'platform/qt/WheelEventQt.cpp', 'platform/qt/WidgetQt.cpp', 'platform/sql/SQLValue.cpp', diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index beeb529..e42cd8e 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2081,7 +2081,7 @@ SOURCES += \ platform/qt/SoundQt.cpp \ platform/qt/LoggingQt.cpp \ platform/text/qt/StringQt.cpp \ - platform/qt/TemporaryLinkStubs.cpp \ + platform/qt/TemporaryLinkStubsQt.cpp \ platform/text/qt/TextBoundariesQt.cpp \ platform/text/qt/TextBreakIteratorQt.cpp \ platform/text/qt/TextCodecQt.cpp \ diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp index 0a0e8c6..46dd7ae 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp @@ -230,6 +230,9 @@ void EventHandler::clear() m_capturingMouseEventsNode = 0; m_latchedWheelEventNode = 0; m_previousWheelScrolledNode = 0; +#if ENABLE(TOUCH_EVENTS) + m_originatingTouchPointTargets.clear(); +#endif } void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result) @@ -2714,21 +2717,21 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. unsigned touchPointTargetKey = point.id() + 1; - EventTarget* touchTarget = 0; + RefPtr touchTarget; if (point.state() == PlatformTouchPoint::TouchPressed) { m_originatingTouchPointTargets.set(touchPointTargetKey, target); touchTarget = target; } else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) { // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel // we also remove it from the map. - touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get(); + touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); } else - touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get(); + touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey); - if (!touchTarget) + if (!touchTarget.get()) continue; - RefPtr touch = Touch::create(doc->frame(), touchTarget, point.id(), + RefPtr touch = Touch::create(doc->frame(), touchTarget.get(), point.id(), point.screenPos().x(), point.screenPos().y(), adjustedPageX, adjustedPageY); diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp index 890eacd..d7eaf25 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp @@ -477,9 +477,8 @@ void scrollIntoView(Element* element) // it is preferable to inflate |element|'s bounding rect a bit before // scrolling it for accurate reason. // Element's scrollIntoView method does not provide this flexibility. - static const int fudgeFactor = 2; IntRect bounds = element->getRect(); - bounds.inflate(fudgeFactor); + bounds.inflate(fudgeFactor()); element->renderer()->enclosingLayer()->scrollRectToVisible(bounds); } @@ -497,14 +496,14 @@ static void deflateIfOverlapped(IntRect& a, IntRect& b) if (!a.intersects(b) || a.contains(b) || b.contains(a)) return; - static const int fudgeFactor = -2; + int deflateFactor = -fudgeFactor(); // Avoid negative width or height values. - if ((a.width() + 2 * fudgeFactor > 0) && (a.height() + 2 * fudgeFactor > 0)) - a.inflate(fudgeFactor); + if ((a.width() + 2 * deflateFactor > 0) && (a.height() + 2 * deflateFactor > 0)) + a.inflate(deflateFactor); - if ((b.width() + 2 * fudgeFactor > 0) && (b.height() + 2 * fudgeFactor > 0)) - b.inflate(fudgeFactor); + if ((b.width() + 2 * deflateFactor > 0) && (b.height() + 2 * deflateFactor > 0)) + b.inflate(deflateFactor); } static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect) diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h index 90ff1cf..309b095 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h @@ -40,6 +40,11 @@ inline long long maxDistance() return numeric_limits::max(); } +inline unsigned int fudgeFactor() +{ + return 2; +} + // Spatially speaking, two given elements in a web page can be: // 1) Fully aligned: There is a full intersection between the rects, either // vertically or horizontally. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index edac268..0100b72 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -641,12 +641,12 @@ void GraphicsContext::fillRect(const FloatRect& rect) } } -void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace colorSpace) +void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; - m_data->solidColor.setColor(c); + m_data->solidColor.setColor(color); QPainter* p = m_data->p(); if (m_common->state.shadowColor.isValid()) drawBorderlessRectShadow(this, p, rect); @@ -655,7 +655,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace) { - if (paintingDisabled() || !color.alpha()) + if (paintingDisabled() || !color.isValid() || !color.alpha()) return; Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight); @@ -717,7 +717,7 @@ void GraphicsContext::drawFocusRing(const Vector& paths, int width, int of */ void GraphicsContext::drawFocusRing(const Vector& rects, int /* width */, int /* offset */, const Color& color) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; unsigned rectCount = rects.size(); @@ -1141,8 +1141,9 @@ void GraphicsContext::setURLForRect(const KURL&, const IntRect&) void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; + QPainter* p = m_data->p(); QPen newPen(p->pen()); m_data->solidColor.setColor(color); @@ -1172,8 +1173,9 @@ void GraphicsContext::setPlatformStrokeThickness(float thickness) void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; + m_data->solidColor.setColor(color); m_data->p()->setBrush(m_data->solidColor); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp index ee4af7f..4b0c21f 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp @@ -69,12 +69,41 @@ Path& Path::operator=(const Path& other) return *this; } +// Check whether a point is on the border +bool isPointOnPathBorder(const QPolygonF& border, const QPointF& p) +{ + QPointF p1 = border.at(0); + QPointF p2; + + for (int i = 1; i < border.size(); ++i) { + p2 = border.at(i); + // (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) && (y2-y1)(x-x1) == (y-y1)(x2-x1) + // In which, (y2-y1)(x-x1) == (y-y1)(x2-x1) is from (y2-y1)/(x2-x1) == (y-y1)/(x-x1) + // it want to check the slope between p1 and p2 is same with slope between p and p1, + // if so then the three points lie on the same line. + // In which, (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) want to make sure p is + // between p1 and p2, not outside. + if (((p.x() <= p1.x() && p.x() >= p2.x()) || (p.x() >= p1.x() && p.x() <= p2.x())) + && ((p.y() <= p1.y() && p.y() >= p2.y()) || (p.y() >= p1.y() && p.y() <= p2.y())) + && (p2.y() - p1.y()) * (p.x() - p1.x()) == (p.y() - p1.y()) * (p2.x() - p1.x())) { + return true; + } + p1 = p2; + } + return false; +} + bool Path::contains(const FloatPoint& point, WindRule rule) const { Qt::FillRule savedRule = m_path.fillRule(); const_cast(&m_path)->setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill); bool contains = m_path.contains(point); + + if (!contains) { + // check whether the point is on the border + contains = isPointOnPathBorder(m_path.toFillPolygon(), point); + } const_cast(&m_path)->setFillRule(savedRule); return contains; diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h index 0d98fcb..e355025 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h @@ -42,6 +42,13 @@ namespace WebCore { if (currentLookups >= 10) return; // do not launch more than 10 lookups at the same time +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 3) + currentLookups++; + QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo))); +#else + // This code is only needed for Qt versions that do not have + // the small Qt DNS cache yet. + QTime* entryTime = lookupCache.object(hostname); if (entryTime && entryTime->elapsed() > 300*1000) { // delete knowledge about lookup if it is already 300 seconds old @@ -54,6 +61,7 @@ namespace WebCore { currentLookups++; QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo))); } +#endif } void lookedUp(const QHostInfo&) @@ -61,11 +69,14 @@ namespace WebCore { // we do not cache the result, we throw it away. // we currently rely on the OS to cache the results. If it does not do that // then at least the ISP nameserver did it. + // Since Qt 4.6.3, Qt also has a small DNS cache. currentLookups--; } protected: +#if QT_VERSION < QT_VERSION_CHECK(4, 6, 3) QCache lookupCache; // 100 entries +#endif int currentLookups; }; diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index 403718f..abeb895 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -49,6 +49,7 @@ #define SIGNAL_CONN Qt::QueuedConnection #endif +static const int gMaxRecursionLimit = 10; namespace WebCore { @@ -139,6 +140,7 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load , m_shouldFinish(false) , m_shouldSendResponse(false) , m_shouldForwardData(false) + , m_redirectionTries(gMaxRecursionLimit) { const ResourceRequest &r = m_resourceHandle->request(); @@ -336,9 +338,18 @@ void QNetworkReplyHandler::sendResponseIfNeeded() QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); if (redirection.isValid()) { + QUrl newUrl = m_reply->url().resolved(redirection); + + m_redirectionTries--; + if (m_redirectionTries == 0) { // 10 or more redirections to the same url is considered infinite recursion + ResourceError error(newUrl.host(), 400 /*bad request*/, + newUrl.toString(), + QCoreApplication::translate("QWebPage", "Redirection limit reached")); + client->didFail(m_resourceHandle, error); + return; + } m_redirected = true; - QUrl newUrl = m_reply->url().resolved(redirection); ResourceRequest newRequest = m_resourceHandle->request(); newRequest.setURL(newUrl); diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h index eb5ae3c..1abad4e 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h @@ -82,6 +82,7 @@ private: bool m_shouldFinish; bool m_shouldSendResponse; bool m_shouldForwardData; + int m_redirectionTries; }; // Self destructing QIODevice for FormData diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp deleted file mode 100644 index 814f961..0000000 --- a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com - * Copyright (C) 2006 George Staikos - * Copyright (C) 2006 Dirk Mueller - * Copyright (C) 2006 Nikolas Zimmermann - * Copyright (C) 2008 Collabora, Ltd. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "AXObjectCache.h" -#include "DNS.h" -#include "CString.h" -#include "CachedResource.h" -#include "CookieJar.h" -#include "Cursor.h" -#include "Font.h" -#include "Frame.h" -#include "FrameLoader.h" -#include "FTPDirectoryDocument.h" -#include "IntPoint.h" -#include "Widget.h" -#include "GraphicsContext.h" -#include "Cursor.h" -#include "loader.h" -#include "FileSystem.h" -#include "FrameView.h" -#include "GraphicsContext.h" -#include "IconLoader.h" -#include "IntPoint.h" -#include "KURL.h" -#include "Language.h" -#include "loader.h" -#include "LocalizedStrings.h" -#include "Node.h" -#include "NotImplemented.h" -#include "Path.h" -#include "PlatformMouseEvent.h" -#include "PluginDatabase.h" -#include "PluginPackage.h" -#include "PluginView.h" -#include "RenderTheme.h" -#include "SharedBuffer.h" -#include "SystemTime.h" -#include "TextBoundaries.h" -#include "Widget.h" -#include -#include -#include - -using namespace WebCore; - -#if defined(Q_OS_WINCE) -Vector PluginDatabase::defaultPluginDirectories() -{ - notImplemented(); - return Vector(); -} - -void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const -{ - notImplemented(); -} - -bool PluginDatabase::isPreferredPluginDirectory(const String& directory) -{ - notImplemented(); - return false; -} -#endif - -namespace WebCore { - -void getSupportedKeySizes(Vector&) -{ - notImplemented(); -} - -String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) -{ - return String(); -} - -#if !defined(Q_OS_WIN) -// defined in win/SystemTimeWin.cpp, which is compiled for the Qt/Windows port -float userIdleTime() -{ - notImplemented(); - return FLT_MAX; // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed -} -#endif - -} - -// vim: ts=4 sw=4 et diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp new file mode 100644 index 0000000..814f961 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Dirk Mueller + * Copyright (C) 2006 Nikolas Zimmermann + * Copyright (C) 2008 Collabora, Ltd. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "AXObjectCache.h" +#include "DNS.h" +#include "CString.h" +#include "CachedResource.h" +#include "CookieJar.h" +#include "Cursor.h" +#include "Font.h" +#include "Frame.h" +#include "FrameLoader.h" +#include "FTPDirectoryDocument.h" +#include "IntPoint.h" +#include "Widget.h" +#include "GraphicsContext.h" +#include "Cursor.h" +#include "loader.h" +#include "FileSystem.h" +#include "FrameView.h" +#include "GraphicsContext.h" +#include "IconLoader.h" +#include "IntPoint.h" +#include "KURL.h" +#include "Language.h" +#include "loader.h" +#include "LocalizedStrings.h" +#include "Node.h" +#include "NotImplemented.h" +#include "Path.h" +#include "PlatformMouseEvent.h" +#include "PluginDatabase.h" +#include "PluginPackage.h" +#include "PluginView.h" +#include "RenderTheme.h" +#include "SharedBuffer.h" +#include "SystemTime.h" +#include "TextBoundaries.h" +#include "Widget.h" +#include +#include +#include + +using namespace WebCore; + +#if defined(Q_OS_WINCE) +Vector PluginDatabase::defaultPluginDirectories() +{ + notImplemented(); + return Vector(); +} + +void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const +{ + notImplemented(); +} + +bool PluginDatabase::isPreferredPluginDirectory(const String& directory) +{ + notImplemented(); + return false; +} +#endif + +namespace WebCore { + +void getSupportedKeySizes(Vector&) +{ + notImplemented(); +} + +String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) +{ + return String(); +} + +#if !defined(Q_OS_WIN) +// defined in win/SystemTimeWin.cpp, which is compiled for the Qt/Windows port +float userIdleTime() +{ + notImplemented(); + return FLT_MAX; // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed +} +#endif + +} + +// vim: ts=4 sw=4 et diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 0c13e43..75a23d9 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -82,7 +82,6 @@ public: , page(0) , resizesToContents(false) #if USE(ACCELERATED_COMPOSITING) - , rootGraphicsLayer(0) , shouldSync(false) #endif { @@ -158,7 +157,7 @@ public: enum { RootGraphicsLayerZValue, OverlayZValue }; #if USE(ACCELERATED_COMPOSITING) - QGraphicsItem* rootGraphicsLayer; + QWeakPointer rootGraphicsLayer; // we need to sync the layers if we get a special call from the WebCore // compositor telling us to do so. We'll get that call from ChromeClientQt bool shouldSync; @@ -171,12 +170,11 @@ public: QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate() { #if USE(ACCELERATED_COMPOSITING) - if (rootGraphicsLayer) { - // we don't need to delete the root graphics layer - // The lifecycle is managed in GraphicsLayerQt.cpp - rootGraphicsLayer->setParentItem(0); - q->scene()->removeItem(rootGraphicsLayer); - } + if (!rootGraphicsLayer) + return; + // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp. + rootGraphicsLayer.data()->setParentItem(0); + q->scene()->removeItem(rootGraphicsLayer.data()); #endif } @@ -204,12 +202,12 @@ void QGraphicsWebViewPrivate::createOrDeleteOverlay() void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer) { if (rootGraphicsLayer) { - rootGraphicsLayer->setParentItem(0); - q->scene()->removeItem(rootGraphicsLayer); + rootGraphicsLayer.data()->setParentItem(0); + q->scene()->removeItem(rootGraphicsLayer.data()); QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive(); } - rootGraphicsLayer = layer; + rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0; if (layer) { layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); @@ -231,7 +229,7 @@ void QGraphicsWebViewPrivate::updateCompositingScrollPosition() { if (rootGraphicsLayer && q->page() && q->page()->mainFrame()) { const QPoint scrollPosition = q->page()->mainFrame()->scrollPosition(); - rootGraphicsLayer->setPos(-scrollPosition); + rootGraphicsLayer.data()->setPos(-scrollPosition); } } #endif diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index b8b50b7..e9ebce5 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -119,15 +119,6 @@ using namespace WebCore; -void QWEBKIT_EXPORT qt_wrt_setViewMode(QWebPage* page, const QString& mode) -{ - QWebPagePrivate::priv(page)->viewMode = mode; - WebCore::Frame* frame = QWebFramePrivate::core(page->mainFrame()); - WebCore::FrameView* view = frame->view(); - frame->document()->updateStyleSelector(); - view->forceLayout(); -} - void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() { PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); @@ -1361,6 +1352,26 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) ev->accept(); } +void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event) +{ + if (event->propertyName() == "_q_viewMode") { + QString mode = q->property("_q_viewMode").toString(); + if (mode != viewMode) { + viewMode = mode; + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + WebCore::FrameView* view = frame->view(); + frame->document()->updateStyleSelector(); + view->forceLayout(); + } + } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") { + int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt(); + q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize); + } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") { + double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble(); + q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay); + } +} + void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) { WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); @@ -2708,6 +2719,9 @@ bool QWebPage::event(QEvent *ev) d->touchEvent(static_cast(ev)); break; #endif + case QEvent::DynamicPropertyChange: + d->dynamicPropertyChangeEvent(static_cast(ev)); + break; default: return QObject::event(ev); } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index 0712d0c..5350cd9 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -112,6 +112,8 @@ public: void inputMethodEvent(QInputMethodEvent*); + void dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent*); + void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent*); void handleClipboard(QEvent*, Qt::MouseButton); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 555b14d..6ddaa2b 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,61 @@ +2010-05-09 Noam Rosenthal + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used + https://bugs.webkit.org/show_bug.cgi?id=38574 + + The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::setRootGraphicsLayer): + (QGraphicsWebViewPrivate::updateCompositingScrollPosition): + +2010-05-03 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Expose HTMLTokenizer yielding parameters + https://bugs.webkit.org/show_bug.cgi?id=37023 + + Enables to set TimeDelay and ChunkSize for + HTMLTokenizer. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-04 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Rename the property from wrt_viewMode to _q_viewMode. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::viewModes): + +2010-04-28 Luiz Agostini + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Replacing method qt_wrt_setViewMode by wrt_viewMode property. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::wrt_viewModes): + 2010-04-09 Tasuku Suzuki Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def index a450f9e..910ba8f 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def @@ -642,7 +642,7 @@ EXPORTS ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 641 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 642 NONAME ; void qt_drt_webinspector_show(class QWebPage *) ?qt_drt_workerThreadCount@@YAHXZ @ 643 NONAME ; int qt_drt_workerThreadCount(void) - ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) + ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ABSENT ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 645 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 646 NONAME ; bool QGraphicsWebView::resizesToContents(void) const ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 647 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def index 145fe0b..ca462d0 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -716,7 +716,7 @@ EXPORTS _ZN13QWebInspector10closeEventEP11QCloseEvent @ 715 NONAME _ZN16QGraphicsWebView26setTiledBackingStoreFrozenEb @ 716 NONAME _ZNK16QGraphicsWebView25isTiledBackingStoreFrozenEv @ 717 NONAME - _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME + _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME ABSENT _Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME _Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME _ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index f7eddd5..834a394 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -110,6 +110,8 @@ private slots: void userAgentApplicationName(); void userAgentLocaleChange(); + void viewModes(); + void crashTests_LazyInitializationOfMainFrame(); void screenshot_data(); @@ -357,6 +359,21 @@ void tst_QWebPage::userStyleSheet() QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png")); } +void tst_QWebPage::viewModes() +{ + m_view->setHtml(""); + m_page->setProperty("_q_viewMode", "minimized"); + + QVariant empty = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode)\")"); + QVERIFY(empty.type() == QVariant::Bool && empty.toBool()); + + QVariant minimized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: minimized)\")"); + QVERIFY(minimized.type() == QVariant::Bool && minimized.toBool()); + + QVariant maximized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: maximized)\")"); + QVERIFY(maximized.type() == QVariant::Bool && !maximized.toBool()); +} + void tst_QWebPage::modified() { m_page->mainFrame()->setUrl(QUrl("data:text/html,blub")); -- cgit v0.12 From 9b2038e41a9aa16df0595b812df0d414a8246f52 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 11 May 2010 13:35:32 +0300 Subject: Fix slider stepping when used with keypad navigation QElapsedTimer usage was corrected Task-number: QTBUG-9857 Reviewed-by: Alessandro Portale --- src/gui/widgets/qabstractslider.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index 6a01d68..f38bae7 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -219,8 +219,12 @@ QAbstractSliderPrivate::QAbstractSliderPrivate() #ifdef QT_KEYPAD_NAVIGATION , isAutoRepeating(false) , repeatMultiplier(1) -#endif { + firstRepeat.invalidate(); +#else +{ +#endif + } QAbstractSliderPrivate::~QAbstractSliderPrivate() @@ -787,7 +791,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev) } } - else if (!d->firstRepeat.isValid()) { + else if (d->firstRepeat.isValid()) { d->firstRepeat.invalidate(); d->repeatMultiplier = 1; } -- cgit v0.12 From 05399347ed467693d45009c6ba659746ea492231 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 11 May 2010 14:04:24 +0200 Subject: Add license header --- config.tests/symbian/simple/main.cpp | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/config.tests/symbian/simple/main.cpp b/config.tests/symbian/simple/main.cpp index 41371da..9227c42 100644 --- a/config.tests/symbian/simple/main.cpp +++ b/config.tests/symbian/simple/main.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include int main(int, char **) { -- cgit v0.12 From fffb09adfd07eef5d2f296374b507032eec06cad Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 11 May 2010 13:34:37 +0100 Subject: Symbian/trk: Fix debugging output for the N8. 1. Fix hanging behaviour when we receive a message on the wrong mux in framed mode 2. Treat messages on the trace mux (0102) as debug output 3. Separate timestamp from text in trace messages Reviewed-by: Friedemann Kleint --- tools/runonphone/symbianutils/launcher.cpp | 18 ++++++++++++++++-- tools/runonphone/symbianutils/trkutils.cpp | 22 +++++++++++++++++----- tools/runonphone/symbianutils/trkutils.h | 8 ++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/tools/runonphone/symbianutils/launcher.cpp b/tools/runonphone/symbianutils/launcher.cpp index fa509e7..ecb067e 100644 --- a/tools/runonphone/symbianutils/launcher.cpp +++ b/tools/runonphone/symbianutils/launcher.cpp @@ -365,8 +365,22 @@ void Launcher::handleResult(const TrkResult &result) QByteArray prefix = "READ BUF: "; QByteArray str = result.toString().toUtf8(); if (result.isDebugOutput) { // handle application output - logMessage("APPLICATION OUTPUT: " + result.data); - emit applicationOutputReceived(result.data); + QString msg; + if (result.multiplex == MuxTextTrace) { + if (result.data.length() > 8) { + quint64 timestamp = extractInt64(result.data) & 0x0FFFFFFFFFFFFFFFULL; + quint64 secs = timestamp / 1000000000; + quint64 ns = timestamp % 1000000000; + msg = QString("[%1.%2] %3").arg(secs).arg(ns).arg(QString(result.data.mid(8))); + logMessage("TEXT TRACE: " + msg); + } + } else { + logMessage("APPLICATION OUTPUT: " + result.data); + msg = result.data; + } + msg.replace("\r\n", "\n"); + if(!msg.endsWith('\n')) msg.append('\n'); + emit applicationOutputReceived(msg); return; } switch (result.code) { diff --git a/tools/runonphone/symbianutils/trkutils.cpp b/tools/runonphone/symbianutils/trkutils.cpp index 9b43c96..60e391e 100644 --- a/tools/runonphone/symbianutils/trkutils.cpp +++ b/tools/runonphone/symbianutils/trkutils.cpp @@ -276,14 +276,13 @@ QByteArray frameMessage(byte command, byte token, const QByteArray &data, bool s /* returns 0 if array doesn't represent a result, otherwise returns the length of the result data */ -ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame) +ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame, ushort& mux) { if (serialFrame) { // Serial protocol with length info if (buffer.length() < 4) return 0; - if (buffer.at(0) != 0x01 || byte(buffer.at(1)) != 0x90) - return 0; + mux = extractShort(buffer.data()); const ushort len = extractShort(buffer.data() + 2); return (buffer.size() >= len + 4) ? len : ushort(0); } @@ -292,6 +291,7 @@ ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame) const int firstDelimiterPos = buffer.indexOf(delimiter); // Regular message delimited by 0x7e..0x7e if (firstDelimiterPos == 0) { + mux = MuxTrk; const int endPos = buffer.indexOf(delimiter, firstDelimiterPos + 1); return endPos != -1 ? endPos + 1 - firstDelimiterPos : 0; } @@ -304,7 +304,7 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt result->clear(); if(rawData) rawData->clear(); - const ushort len = isValidTrkResult(*buffer, serialFrame); + const ushort len = isValidTrkResult(*buffer, serialFrame, result->multiplex); if (!len) return false; // handle receiving application output, which is not a regular command @@ -312,7 +312,6 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt if (buffer->at(delimiterPos) != 0x7e) { result->isDebugOutput = true; result->data = buffer->mid(delimiterPos, len); - result->data.replace("\r\n", "\n"); *buffer->remove(0, delimiterPos + len); return true; } @@ -353,6 +352,19 @@ SYMBIANUTILS_EXPORT uint extractInt(const char *data) return res; } +SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data) +{ + quint64 res = byte(data[0]); + res <<= 8; res += byte(data[1]); + res <<= 8; res += byte(data[2]); + res <<= 8; res += byte(data[3]); + res <<= 8; res += byte(data[4]); + res <<= 8; res += byte(data[5]); + res <<= 8; res += byte(data[6]); + res <<= 8; res += byte(data[7]); + return res; +} + SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba) { QString res; diff --git a/tools/runonphone/symbianutils/trkutils.h b/tools/runonphone/symbianutils/trkutils.h index 553fc7d..e571028 100644 --- a/tools/runonphone/symbianutils/trkutils.h +++ b/tools/runonphone/symbianutils/trkutils.h @@ -135,9 +135,16 @@ enum Command { TrkDSPositionFile = 0xd4 }; +enum SerialMultiplexor { + MuxRaw = 0, + MuxTextTrace = 0x0102, + MuxTrk = 0x0190 +}; + inline byte extractByte(const char *data) { return *data; } SYMBIANUTILS_EXPORT ushort extractShort(const char *data); SYMBIANUTILS_EXPORT uint extractInt(const char *data); +SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data); SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba); @@ -217,6 +224,7 @@ struct SYMBIANUTILS_EXPORT TrkResult int errorCode() const; QString errorString() const; + ushort multiplex; byte code; byte token; QByteArray data; -- cgit v0.12 From 814f7d3d607edacca091273302297b6b2674424f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 11 May 2010 12:49:32 +0200 Subject: Fix compiler warning in QT_REQUIRE_VERSION warning: format not a string literal and no format arguments Task-number: QTBUG-8967 Reviewed-by: Gabriel --- src/gui/dialogs/qmessagebox.h | 2 +- tests/auto/qmessagebox/tst_qmessagebox.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qmessagebox.h b/src/gui/dialogs/qmessagebox.h index bc6170d..f1ff6cc 100644 --- a/src/gui/dialogs/qmessagebox.h +++ b/src/gui/dialogs/qmessagebox.h @@ -354,7 +354,7 @@ if (!qApp){ \ QString s = QApplication::tr("Executable '%1' requires Qt "\ "%2, found Qt %3.").arg(qAppName()).arg(QString::fromLatin1(\ str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\ -"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal(s.toLatin1().data()); }} +"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }} #endif // QT_NO_MESSAGEBOX diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 2de1c52..d4ca064 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -140,6 +140,8 @@ private: tst_QMessageBox::tst_QMessageBox() : keyToSend(-1) { + int argc = qApp->argc(); + QT_REQUIRE_VERSION(argc, qApp->argv(), "4.6.2") } int tst_QMessageBox::exec(QMessageBox *msgBox, int key) -- cgit v0.12 From 949f49c9ea4dadfc6e7f3bf7d822830b7ef8a8e6 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 11 May 2010 15:30:12 +0200 Subject: Doc: Fixed tables and images for the new docs Added page.png to images dir. Fixed tables "generic" --- doc/src/getting-started/demos.qdoc | 7 +++--- doc/src/template/images/page.png | Bin 0 -> 3102 bytes doc/src/template/scripts/functions.js | 14 +++++++++--- doc/src/template/style/style.css | 39 +++++++++++++++++++++----------- tools/qdoc3/htmlgenerator.cpp | 41 ++++++++++++++++++---------------- 5 files changed, 62 insertions(+), 39 deletions(-) create mode 100644 doc/src/template/images/page.png diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc index 6974634..f8c70fe 100644 --- a/doc/src/getting-started/demos.qdoc +++ b/doc/src/getting-started/demos.qdoc @@ -53,15 +53,14 @@ \l{Qt Examples} and are used to highlight certain features of Qt. - \table 50% + \table \header \o {2,1} Getting an Overview \row \o \inlineimage qtdemo-small.png - \o - If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's + \o If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's widgets in action. - + The \l{Qt Widget Gallery} also provides overviews of selected Qt widgets in each of the styles used on various supported platforms. \endtable diff --git a/doc/src/template/images/page.png b/doc/src/template/images/page.png new file mode 100644 index 0000000..1db151b Binary files /dev/null and b/doc/src/template/images/page.png differ diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 2362bc4..09b7de3 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -50,7 +50,6 @@ function processNokiaData(response){ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ lookupCount++; //$('.live001').css('display','block'); - $('#ul001 .defaultLink').css('display','none'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -58,13 +57,14 @@ function processNokiaData(response){ full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; $('#ul001').append(full_li_element); + $('#ul001 .defaultLink').css('display','none'); + } } if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ articleCount++; //$('.live002').css('display','block'); - $('#ul002 .defaultLink').css('display','none'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -72,12 +72,13 @@ function processNokiaData(response){ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; $('#ul002').append(full_li_element); + $('#ul002 .defaultLink').css('display','none'); + } } if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ exampleCount++; //$('.live003').css('display','block'); - $('#ul003 .defaultLink').css('display','none'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -85,6 +86,8 @@ function processNokiaData(response){ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; $('#ul003').append(full_li_element); + $('#ul003 .defaultLink').css('display','none'); + } } } @@ -122,6 +125,11 @@ function CheckEmptyAndLoadList() $(document).ready(function () { var pageTitle = $('title').html(); $('#feedform').append(''); + var currentString = $('#pageType').val() ; + if(currentString.length < 1){ + $('.defaultLink').css('display','block'); + CheckEmptyAndLoadList(); + } $('#pageType').keyup(function () { var searchString = $('#pageType').val() ; diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 2e01af6..d87b11f 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -302,6 +302,9 @@ .sidebar .box .list { display: block; + max-height:200px; + overflow-y:auto; + overflow-x:none; } .sidebar .box .live { @@ -315,7 +318,7 @@ } .sidebar .box ul { - padding:10px 0 0 10px; + padding:10px; } .sidebar .box ul li { @@ -488,8 +491,13 @@ .wrap .content p { line-height: 20px; - padding: 5px 5px 5px 5px; + padding: 5px; } + .wrap .content table p + { + line-height: 20px; + padding: 0px; + } .wrap .content ul { padding-left: 25px; @@ -743,20 +751,21 @@ thead { margin-top: 5px; + font:600 12px/1.2 Arial; } th { padding: 5px 15px 5px 15px; background-color: #E1E1E1; - border-bottom: 1px solid #E6E6E6; + /* border-bottom: 1px solid #E6E6E6;*/ border-left: 1px solid #E6E6E6; - border-right: 1px solid #E6E6E6; + /* border-right: 1px solid #E6E6E6;*/ } td { padding: 3px 15px 3px 20px; - border-left: 1px solid #E6E6E6; - border-right: 1px solid #E6E6E6; + /* border-left: 1px solid #E6E6E6; + border-right: 1px solid #E6E6E6;*/ } tr.odd td:hover, tr.even td:hover { @@ -780,15 +789,11 @@ background-color: #ffffff; color: #66666E; } - table tr.odd:hover - { - background-color: #E6E6E6; - } - table tr.even:hover + table tr.odd td:hover, table tr.even td:hover { background-color: #E6E6E6; } - + span.comment { color: #8B0000; @@ -892,12 +897,20 @@ } .generic{ - max-width:100%; + max-width:75%; } .generic td{ padding:0; } + .generic .odd .alphaChar{ + background-color: #F6F6F6; + } + + .generic .even .alphaChar{ + background-color: #FFFFFF; + } + .alignedsummary{} .propsummary{} .memItemLeft{} diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 638ae94..5e33463 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1149,7 +1149,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << " colspan=\"" << spans.at(0) << "\""; if (spans.at(1) != "1") out() << " rowspan=\"" << spans.at(1) << "\""; + if (inTableHeader) out() << ">"; + else + out() << ">

      "; } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1159,7 +1162,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (inTableHeader) out() << ""; else - out() << ""; + out() << "

      "; if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; break; @@ -2276,22 +2279,22 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "
      "; else out() << ""; - out() << ""; + out() << "

      "; if (!(node->type() == Node::Fake)) { Text brief = node->doc().trimmedBriefText(name); if (!brief.isEmpty()) { - out() << ""; + out() << "

      "; } } else { - out() << ""; + out() << "

      "; } out() << "\n"; } @@ -2473,7 +2476,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, for (i = 0; i < NumColumns; i++) { if (currentOffset[i] >= firstOffset[i + 1]) { // this column is finished - out() << "\n"; + out() << "\n"; // check why? } else { while ((currentParagraphNo[i] < NumParagraphs) && @@ -2488,7 +2491,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, currentParagraphNo[i] = NumParagraphs - 1; } #endif - out() << "\n"; - out() << "\n"; + out() << "

      \n"; currentOffset[i]++; currentOffsetInParagraph[i]++; @@ -4438,7 +4441,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, else out() << ""; - out() << ""; + out() << "

      "; if (qpgn->isDefault()) { out() << "
      "; + //out() << "
      "; out() << ""; generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); out() << "
      , not . --- tools/qdoc3/htmlgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 6560b68..67aa6c6 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2275,9 +2275,9 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "
      "; + out() << ""; generateFullName(node, relative, marker); - out() << ""; + out() << "
      "; + out() << "

      "; generateFullName(node, relative, marker); - out() << "

      "; + out() << "

      "; generateText(brief, node, marker); - out() << "

      "; + out() << "

      "; out() << protectEnc(node->doc().briefText().toString()); - out() << "

      \n\n"; + out() << "

      "; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph if (includeAlphabet) { @@ -2499,9 +2502,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, << paragraphName[currentParagraphNo[i]] << ""; } - out() << "\n"; + out() << "

      "; + out() << "

      "; if ((currentParagraphNo[i] < NumParagraphs) && !paragraphName[currentParagraphNo[i]].isEmpty()) { NodeMap::Iterator it; @@ -2527,7 +2530,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << ")"; } } - out() << "

      "; + out() << "

      "; //out() << "

      "; // old out() << ""; if (!qpn->isWritable()) @@ -4446,14 +4449,14 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, if (qpgn->isDefault()) out() << "default"; generateQmlItem(qpn, relative, marker, false); - out() << "
      " << "
      " << "
      " << "
      " << "" - << ""; + << ""; } } ++p; @@ -4470,11 +4473,11 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; else out() << ""; - out() << ""; + out() << "

      "; out() << "
      default

      default

      "; + out() << "

      "; out() << ""; generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); //generateQmlItem(qsn,relative,marker,false); - out() << "

      "; out() << "
      "; } @@ -4487,10 +4490,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "
      "; + out() << "

      "; out() << ""; generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); - out() << "

      "; out() << "
      "; } -- cgit v0.12 From a1cda97c4002195f98c18c460d1f30682bb5a82e Mon Sep 17 00:00:00 2001 From: Jason Hollingsworth Date: Tue, 11 May 2010 16:26:42 +0200 Subject: Added QDateTime::msecsTo() This adds a QDateTime::msecsTo() function which is similar to QDateTime::secsTo(). This refers to QTBUG-8790 and task 147685. According to the task this functionality should have been added in version 4.5.0 but it never was. Task-number: 147685 Task-number: QTBUG-8790 Merge-request: 501 Reviewed-by: Benjamin Poulain Reviewed-by: Andreas Kling --- src/corelib/tools/qdatetime.cpp | 44 +++++++++++++++++++++++++++------- src/corelib/tools/qdatetime.h | 1 + tests/auto/qdatetime/tst_qdatetime.cpp | 26 ++++++++++++++++++++ 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 9afcd80..9f5d8c6 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1705,7 +1705,7 @@ int QTime::secsTo(const QTime &t) const Note that the time will wrap if it passes midnight. See addSecs() for an example. - \sa addSecs(), msecsTo() + \sa addSecs(), msecsTo(), QDateTime::addMSecs() */ QTime QTime::addMSecs(int ms) const @@ -1734,7 +1734,7 @@ QTime QTime::addMSecs(int ms) const seconds in a day, the result is always between -86400000 and 86400000 ms. - \sa secsTo(), addMSecs() + \sa secsTo(), addMSecs(), QDateTime::msecsTo() */ int QTime::msecsTo(const QTime &t) const @@ -2042,10 +2042,11 @@ int QTime::elapsed() const later. You can increment (or decrement) a datetime by a given number of - seconds using addSecs(), or days using addDays(). Similarly you can - use addMonths() and addYears(). The daysTo() function returns the - number of days between two datetimes, and secsTo() returns the - number of seconds between two datetimes. + milliseconds using addMSecs(), seconds using addSecs(), or days + using addDays(). Similarly you can use addMonths() and addYears(). + The daysTo() function returns the number of days between two datetimes, + secsTo() returns the number of seconds between two datetimes, and + msecsTo() returns the number of milliseconds between two datetimes. QDateTime can store datetimes as \l{Qt::LocalTime}{local time} or as \l{Qt::UTC}{UTC}. QDateTime::currentDateTime() returns a @@ -2719,7 +2720,7 @@ QDateTime QDateTime::addSecs(int s) const later than the datetime of this object (or earlier if \a msecs is negative). - \sa addSecs(), secsTo(), addDays(), addMonths(), addYears() + \sa addSecs(), msecsTo(), addDays(), addMonths(), addYears() */ QDateTime QDateTime::addMSecs(qint64 msecs) const { @@ -2731,7 +2732,7 @@ QDateTime QDateTime::addMSecs(qint64 msecs) const datetime. If the \a other datetime is earlier than this datetime, the value returned is negative. - \sa addDays(), secsTo() + \sa addDays(), secsTo(), msecsTo() */ int QDateTime::daysTo(const QDateTime &other) const @@ -2766,6 +2767,33 @@ int QDateTime::secsTo(const QDateTime &other) const } /*! + Returns the number of milliseconds from this datetime to the \a other + datetime. If the \a other datetime is earlier than this datetime, + the value returned is negative. + + Before performing the comparison, the two datetimes are converted + to Qt::UTC to ensure that the result is correct if one of the two + datetimes has daylight saving time (DST) and the other doesn't. + + \sa addMSecs(), daysTo(), QTime::msecsTo() +*/ + +qint64 QDateTime::msecsTo(const QDateTime &other) const +{ + QDate selfDate; + QDate otherDate; + QTime selfTime; + QTime otherTime; + + d->getUTC(selfDate, selfTime); + other.d->getUTC(otherDate, otherTime); + + return (static_cast(selfDate.daysTo(otherDate)) * static_cast(MSECS_PER_DAY)) + + static_cast(selfTime.msecsTo(otherTime)); +} + + +/*! \fn QDateTime QDateTime::toTimeSpec(Qt::TimeSpec specification) const Returns a copy of this datetime configured to use the given time diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index f445f1c..2466aeb 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -251,6 +251,7 @@ public: inline QDateTime toUTC() const { return toTimeSpec(Qt::UTC); } int daysTo(const QDateTime &) const; int secsTo(const QDateTime &) const; + qint64 msecsTo(const QDateTime &) const; bool operator==(const QDateTime &other) const; inline bool operator!=(const QDateTime &other) const { return !(*this == other); } diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 6aca996..47c54a5 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -106,6 +106,8 @@ private slots: void daysTo(); void secsTo_data(); void secsTo(); + void msecsTo_data(); + void msecsTo(); void operator_eqeq(); void currentDateTime(); void currentDateTimeUtc(); @@ -910,6 +912,30 @@ void tst_QDateTime::secsTo() QVERIFY((dt >= result) == (0 >= nsecs)); } +void tst_QDateTime::msecsTo_data() +{ + addMSecs_data(); +} + +void tst_QDateTime::msecsTo() +{ + QFETCH(QDateTime, dt); + QFETCH(int, nsecs); + QFETCH(QDateTime, result); + +#ifdef Q_OS_IRIX + QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort); +#endif + QCOMPARE(dt.msecsTo(result), qint64(nsecs) * 1000); + QCOMPARE(result.msecsTo(dt), -qint64(nsecs) * 1000); + QVERIFY((dt == result) == (0 == (qint64(nsecs) * 1000))); + QVERIFY((dt != result) == (0 != (qint64(nsecs) * 1000))); + QVERIFY((dt < result) == (0 < (qint64(nsecs) * 1000))); + QVERIFY((dt <= result) == (0 <= (qint64(nsecs) * 1000))); + QVERIFY((dt > result) == (0 > (qint64(nsecs) * 1000))); + QVERIFY((dt >= result) == (0 >= (qint64(nsecs) * 1000))); +} + void tst_QDateTime::currentDateTime() { #if defined(Q_OS_WINCE) -- cgit v0.12 From b4b4cb3248b987dd6c15908f0b46e131dc2b7cde Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 11 May 2010 16:54:41 +0100 Subject: Update DEF files for Qt 4.7 Task-Number: QTBUG-10251 Reviewed-by: Trust Me --- src/s60installs/bwins/QtCoreu.def | 2 + src/s60installs/bwins/QtDeclarativeu.def | 71 ++++++++++++++++++++------ src/s60installs/bwins/QtGuiu.def | 4 +- src/s60installs/eabi/QtCoreu.def | 2 + src/s60installs/eabi/QtDeclarativeu.def | 88 +++++++++++++++++++++++--------- src/s60installs/eabi/QtGuiu.def | 3 +- 6 files changed, 129 insertions(+), 41 deletions(-) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index e309e25..13b8157 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4463,4 +4463,6 @@ EXPORTS ?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4462 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *) ?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4463 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *) ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4464 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) + ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4465 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int) + ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4466 NONAME ; class QString & QString::setRawData(class QChar const *, int) diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def index 5f05f08..18372a4 100644 --- a/src/s60installs/bwins/QtDeclarativeu.def +++ b/src/s60installs/bwins/QtDeclarativeu.def @@ -581,7 +581,7 @@ EXPORTS ?advance@QDeclarativeParticleMotionWander@@UAEXAAVQDeclarativeParticle@@H@Z @ 580 NONAME ABSENT ; void QDeclarativeParticleMotionWander::advance(class QDeclarativeParticle &, int) ?alert@QDeclarativeWebView@@IAEXABVQString@@@Z @ 581 NONAME ABSENT ; void QDeclarativeWebView::alert(class QString const &) ?alternateBase@QDeclarativeSystemPalette@@QBE?AVQColor@@XZ @ 582 NONAME ; class QColor QDeclarativeSystemPalette::alternateBase(void) const - ?anchors@QDeclarativeItem@@QAEPAVQDeclarativeAnchors@@XZ @ 583 NONAME ; class QDeclarativeAnchors * QDeclarativeItem::anchors(void) + ?anchors@QDeclarativeItem@@QAEPAVQDeclarativeAnchors@@XZ @ 583 NONAME ABSENT ; class QDeclarativeAnchors * QDeclarativeItem::anchors(void) ?angle@QDeclarativeParticles@@QBEMXZ @ 584 NONAME ABSENT ; float QDeclarativeParticles::angle(void) const ?angleChanged@QDeclarativeParticles@@IAEXXZ @ 585 NONAME ABSENT ; void QDeclarativeParticles::angleChanged(void) ?angleDeviation@QDeclarativeParticles@@QBEMXZ @ 586 NONAME ABSENT ; float QDeclarativeParticles::angleDeviation(void) const @@ -647,7 +647,7 @@ EXPORTS ?buildObject@QDeclarativeCompiler@@AAE_NPAVObject@QDeclarativeParser@@ABUBindingContext@1@@Z @ 646 NONAME ; bool QDeclarativeCompiler::buildObject(class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) ?buildProperty@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@ABUBindingContext@1@@Z @ 647 NONAME ; bool QDeclarativeCompiler::buildProperty(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) ?buildPropertyAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@ABUBindingContext@1@@Z @ 648 NONAME ; bool QDeclarativeCompiler::buildPropertyAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) - ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAUImportedNamespace@QDeclarativeEnginePrivate@@PAVProperty@QDeclarativeParser@@PAVObject@5@ABUBindingContext@1@@Z @ 649 NONAME ; bool QDeclarativeCompiler::buildPropertyInNamespace(struct QDeclarativeEnginePrivate::ImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) + ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAUImportedNamespace@QDeclarativeEnginePrivate@@PAVProperty@QDeclarativeParser@@PAVObject@5@ABUBindingContext@1@@Z @ 649 NONAME ABSENT ; bool QDeclarativeCompiler::buildPropertyInNamespace(struct QDeclarativeEnginePrivate::ImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) ?buildPropertyLiteralAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@PAVValue@3@ABUBindingContext@1@@Z @ 650 NONAME ; bool QDeclarativeCompiler::buildPropertyLiteralAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, class QDeclarativeParser::Value *, struct QDeclarativeCompiler::BindingContext const &) ?buildPropertyObjectAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@PAVValue@3@ABUBindingContext@1@@Z @ 651 NONAME ; bool QDeclarativeCompiler::buildPropertyObjectAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, class QDeclarativeParser::Value *, struct QDeclarativeCompiler::BindingContext const &) ?buildScript@QDeclarativeCompiler@@AAE_NPAVObject@QDeclarativeParser@@0@Z @ 652 NONAME ABSENT ; bool QDeclarativeCompiler::buildScript(class QDeclarativeParser::Object *, class QDeclarativeParser::Object *) @@ -693,7 +693,7 @@ EXPORTS ?classBegin@QDeclarativeDateTimeFormatter@@UAEXXZ @ 692 NONAME ABSENT ; void QDeclarativeDateTimeFormatter::classBegin(void) ?classBegin@QDeclarativeItem@@MAEXXZ @ 693 NONAME ; void QDeclarativeItem::classBegin(void) ?classBegin@QDeclarativeNumberFormatter@@UAEXXZ @ 694 NONAME ABSENT ; void QDeclarativeNumberFormatter::classBegin(void) - ?classBegin@QDeclarativeParserStatus@@UAEXXZ @ 695 NONAME ; void QDeclarativeParserStatus::classBegin(void) + ?classBegin@QDeclarativeParserStatus@@UAEXXZ @ 695 NONAME ABSENT ; void QDeclarativeParserStatus::classBegin(void) ?classBegin@QDeclarativeStateGroup@@UAEXXZ @ 696 NONAME ; void QDeclarativeStateGroup::classBegin(void) ?classBegin@QDeclarativeTimer@@MAEXXZ @ 697 NONAME ; void QDeclarativeTimer::classBegin(void) ?classBegin@QDeclarativeXmlListModel@@UAEXXZ @ 698 NONAME ; void QDeclarativeXmlListModel::classBegin(void) @@ -754,7 +754,7 @@ EXPORTS ?componentComplete@QDeclarativeItem@@MAEXXZ @ 753 NONAME ; void QDeclarativeItem::componentComplete(void) ?componentComplete@QDeclarativeListView@@MAEXXZ @ 754 NONAME ; void QDeclarativeListView::componentComplete(void) ?componentComplete@QDeclarativeNumberFormatter@@UAEXXZ @ 755 NONAME ABSENT ; void QDeclarativeNumberFormatter::componentComplete(void) - ?componentComplete@QDeclarativeParserStatus@@UAEXXZ @ 756 NONAME ; void QDeclarativeParserStatus::componentComplete(void) + ?componentComplete@QDeclarativeParserStatus@@UAEXXZ @ 756 NONAME ABSENT ; void QDeclarativeParserStatus::componentComplete(void) ?componentComplete@QDeclarativeParticles@@MAEXXZ @ 757 NONAME ABSENT ; void QDeclarativeParticles::componentComplete(void) ?componentComplete@QDeclarativePath@@MAEXXZ @ 758 NONAME ; void QDeclarativePath::componentComplete(void) ?componentComplete@QDeclarativePathView@@MAEXXZ @ 759 NONAME ; void QDeclarativePathView::componentComplete(void) @@ -1369,7 +1369,7 @@ EXPORTS ?indexOfSignal@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 1368 NONAME ; int QMetaObjectBuilder::indexOfSignal(class QByteArray const &) ?indexOfSlot@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 1369 NONAME ; int QMetaObjectBuilder::indexOfSlot(class QByteArray const &) ?init@QDeclarativeContextPrivate@@QAEXXZ @ 1370 NONAME ABSENT ; void QDeclarativeContextPrivate::init(void) - ?init@QDeclarativePaintedItem@@AAEXXZ @ 1371 NONAME ; void QDeclarativePaintedItem::init(void) + ?init@QDeclarativePaintedItem@@AAEXXZ @ 1371 NONAME ABSENT ; void QDeclarativePaintedItem::init(void) ?init@QDeclarativeWebView@@AAEXXZ @ 1372 NONAME ABSENT ; void QDeclarativeWebView::init(void) ?initialLayout@QDeclarativeWebView@@AAEXXZ @ 1373 NONAME ABSENT ; void QDeclarativeWebView::initialLayout(void) ?initialValue@QDeclarativeOpenMetaObject@@UAE?AVQVariant@@H@Z @ 1374 NONAME ; class QVariant QDeclarativeOpenMetaObject::initialValue(int) @@ -2214,9 +2214,9 @@ EXPORTS ?resetVerticalCenter@QDeclarativeAnchors@@QAEXXZ @ 2213 NONAME ; void QDeclarativeAnchors::resetVerticalCenter(void) ?resetWidth@QDeclarativeItem@@QAEXXZ @ 2214 NONAME ; void QDeclarativeItem::resetWidth(void) ?resizeEvent@QDeclarativeView@@MAEXPAVQResizeEvent@@@Z @ 2215 NONAME ; void QDeclarativeView::resizeEvent(class QResizeEvent *) - ?resizeMode@QDeclarativeLoader@@QBE?AW4ResizeMode@1@XZ @ 2216 NONAME ; enum QDeclarativeLoader::ResizeMode QDeclarativeLoader::resizeMode(void) const + ?resizeMode@QDeclarativeLoader@@QBE?AW4ResizeMode@1@XZ @ 2216 NONAME ABSENT ; enum QDeclarativeLoader::ResizeMode QDeclarativeLoader::resizeMode(void) const ?resizeMode@QDeclarativeView@@QBE?AW4ResizeMode@1@XZ @ 2217 NONAME ; enum QDeclarativeView::ResizeMode QDeclarativeView::resizeMode(void) const - ?resizeModeChanged@QDeclarativeLoader@@IAEXXZ @ 2218 NONAME ; void QDeclarativeLoader::resizeModeChanged(void) + ?resizeModeChanged@QDeclarativeLoader@@IAEXXZ @ 2218 NONAME ABSENT ; void QDeclarativeLoader::resizeModeChanged(void) ?resolvedUrl@QDeclarativeContext@@QAE?AVQUrl@@ABV2@@Z @ 2219 NONAME ; class QUrl QDeclarativeContext::resolvedUrl(class QUrl const &) ?resources@QDeclarativeItem@@QAE?AU?$QDeclarativeListProperty@VQObject@@@@XZ @ 2220 NONAME ABSENT ; struct QDeclarativeListProperty QDeclarativeItem::resources(void) ?restart@QDeclarativeTimer@@QAEXXZ @ 2221 NONAME ; void QDeclarativeTimer::restart(void) @@ -2542,7 +2542,7 @@ EXPORTS ?setRepeating@QDeclarativeTimer@@QAEX_N@Z @ 2541 NONAME ; void QDeclarativeTimer::setRepeating(bool) ?setReset@QDeclarativeAnchorChanges@@QAEXABVQString@@@Z @ 2542 NONAME ABSENT ; void QDeclarativeAnchorChanges::setReset(class QString const &) ?setResettable@QMetaPropertyBuilder@@QAEX_N@Z @ 2543 NONAME ; void QMetaPropertyBuilder::setResettable(bool) - ?setResizeMode@QDeclarativeLoader@@QAEXW4ResizeMode@1@@Z @ 2544 NONAME ; void QDeclarativeLoader::setResizeMode(enum QDeclarativeLoader::ResizeMode) + ?setResizeMode@QDeclarativeLoader@@QAEXW4ResizeMode@1@@Z @ 2544 NONAME ABSENT ; void QDeclarativeLoader::setResizeMode(enum QDeclarativeLoader::ResizeMode) ?setResizeMode@QDeclarativeView@@QAEXW4ResizeMode@1@@Z @ 2545 NONAME ; void QDeclarativeView::setResizeMode(enum QDeclarativeView::ResizeMode) ?setRestoreEntryValues@QDeclarativePropertyChanges@@QAEX_N@Z @ 2546 NONAME ; void QDeclarativePropertyChanges::setRestoreEntryValues(bool) ?setReturnType@QMetaMethodBuilder@@QAEXABVQByteArray@@@Z @ 2547 NONAME ; void QMetaMethodBuilder::setReturnType(class QByteArray const &) @@ -2595,7 +2595,7 @@ EXPORTS ?setStartY@QDeclarativePath@@QAEXM@Z @ 2594 NONAME ; void QDeclarativePath::setStartY(float) ?setState@QDeclarativeDebugQuery@@AAEXW4State@1@@Z @ 2595 NONAME ; void QDeclarativeDebugQuery::setState(enum QDeclarativeDebugQuery::State) ?setState@QDeclarativeDebugWatch@@AAEXW4State@1@@Z @ 2596 NONAME ; void QDeclarativeDebugWatch::setState(enum QDeclarativeDebugWatch::State) - ?setState@QDeclarativeItem@@QAEXABVQString@@@Z @ 2597 NONAME ; void QDeclarativeItem::setState(class QString const &) + ?setState@QDeclarativeItem@@QAEXABVQString@@@Z @ 2597 NONAME ABSENT ; void QDeclarativeItem::setState(class QString const &) ?setState@QDeclarativeStateGroup@@QAEXABVQString@@@Z @ 2598 NONAME ; void QDeclarativeStateGroup::setState(class QString const &) ?setStateGroup@QDeclarativeState@@QAEXPAVQDeclarativeStateGroup@@@Z @ 2599 NONAME ; void QDeclarativeState::setStateGroup(class QDeclarativeStateGroup *) ?setStaticMetacallFunction@QMetaObjectBuilder@@QAEXP6AHW4Call@QMetaObject@@HPAPAX@Z@Z @ 2600 NONAME ; void QMetaObjectBuilder::setStaticMetacallFunction(int (*)(enum QMetaObject::Call, int, void * *)) @@ -2714,7 +2714,7 @@ EXPORTS ?startY@QDeclarativePath@@QBEMXZ @ 2713 NONAME ; float QDeclarativePath::startY(void) const ?state@QDeclarativeDebugQuery@@QBE?AW4State@1@XZ @ 2714 NONAME ; enum QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state(void) const ?state@QDeclarativeDebugWatch@@QBE?AW4State@1@XZ @ 2715 NONAME ; enum QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state(void) const - ?state@QDeclarativeItem@@QBE?AVQString@@XZ @ 2716 NONAME ; class QString QDeclarativeItem::state(void) const + ?state@QDeclarativeItem@@QBE?AVQString@@XZ @ 2716 NONAME ABSENT ; class QString QDeclarativeItem::state(void) const ?state@QDeclarativeStateGroup@@QBE?AVQString@@XZ @ 2717 NONAME ; class QString QDeclarativeStateGroup::state(void) const ?stateChanged@QDeclarativeDebugQuery@@IAEXW4State@1@@Z @ 2718 NONAME ; void QDeclarativeDebugQuery::stateChanged(enum QDeclarativeDebugQuery::State) ?stateChanged@QDeclarativeDebugWatch@@IAEXW4State@1@@Z @ 2719 NONAME ; void QDeclarativeDebugWatch::stateChanged(enum QDeclarativeDebugWatch::State) @@ -3576,7 +3576,7 @@ EXPORTS ?d_func@QDeclarativeSmoothedAnimation@@ABEPBVQDeclarativeSmoothedAnimationPrivate@@XZ @ 3575 NONAME ; class QDeclarativeSmoothedAnimationPrivate const * QDeclarativeSmoothedAnimation::d_func(void) const ?d_func@QDeclarativeTranslate@@AAEPAVQDeclarativeTranslatePrivate@@XZ @ 3576 NONAME ; class QDeclarativeTranslatePrivate * QDeclarativeTranslate::d_func(void) ?d_func@QDeclarativeTranslate@@ABEPBVQDeclarativeTranslatePrivate@@XZ @ 3577 NONAME ; class QDeclarativeTranslatePrivate const * QDeclarativeTranslate::d_func(void) const - ?data@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3578 NONAME ; class QDeclarativeListProperty QDeclarativeItem::data(void) + ?data@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3578 NONAME ABSENT ; class QDeclarativeListProperty QDeclarativeItem::data(void) ?dataCleared@QDeclarativeXmlListModel@@AAEXXZ @ 3579 NONAME ; void QDeclarativeXmlListModel::dataCleared(void) ?data_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 3580 NONAME ; void QDeclarativeItemPrivate::data_append(class QDeclarativeListProperty *, class QObject *) ?delegateChanged@QDeclarativeGridView@@IAEXXZ @ 3581 NONAME ; void QDeclarativeGridView::delegateChanged(void) @@ -3707,7 +3707,7 @@ EXPORTS ?request@QDeclarativePixmapCache@@SAPAVQDeclarativePixmapReply@@PAVQDeclarativeEngine@@ABVQUrl@@HH@Z @ 3706 NONAME ; class QDeclarativePixmapReply * QDeclarativePixmapCache::request(class QDeclarativeEngine *, class QUrl const &, int, int) ?resetHeight@QDeclarativeItemPrivate@@UAEXXZ @ 3707 NONAME ; void QDeclarativeItemPrivate::resetHeight(void) ?resetWidth@QDeclarativeItemPrivate@@UAEXXZ @ 3708 NONAME ; void QDeclarativeItemPrivate::resetWidth(void) - ?resources@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3709 NONAME ; class QDeclarativeListProperty QDeclarativeItem::resources(void) + ?resources@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3709 NONAME ABSENT ; class QDeclarativeListProperty QDeclarativeItem::resources(void) ?resources_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 3710 NONAME ; void QDeclarativeItemPrivate::resources_append(class QDeclarativeListProperty *, class QObject *) ?resources_at@QDeclarativeItemPrivate@@SAPAVQObject@@PAV?$QDeclarativeListProperty@VQObject@@@@H@Z @ 3711 NONAME ; class QObject * QDeclarativeItemPrivate::resources_at(class QDeclarativeListProperty *, int) ?resources_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQObject@@@@@Z @ 3712 NONAME ; int QDeclarativeItemPrivate::resources_count(class QDeclarativeListProperty *) @@ -3771,8 +3771,8 @@ EXPORTS ?start@QDeclarativeItemPrivate@@SAXAAVQTime@@@Z @ 3770 NONAME ; void QDeclarativeItemPrivate::start(class QTime &) ?startXChanged@QDeclarativePath@@IAEXXZ @ 3771 NONAME ; void QDeclarativePath::startXChanged(void) ?startYChanged@QDeclarativePath@@IAEXXZ @ 3772 NONAME ; void QDeclarativePath::startYChanged(void) - ?states@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3773 NONAME ; class QDeclarativeListProperty QDeclarativeItem::states(void) - ?states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3774 NONAME ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::states(void) + ?states@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3773 NONAME ABSENT ; class QDeclarativeListProperty QDeclarativeItem::states(void) + ?states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3774 NONAME ABSENT ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::states(void) ?statesProperty@QDeclarativeStateGroup@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3775 NONAME ; class QDeclarativeListProperty QDeclarativeStateGroup::statesProperty(void) ?stops@QDeclarativeGradient@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeGradientStop@@@@XZ @ 3776 NONAME ; class QDeclarativeListProperty QDeclarativeGradient::stops(void) ?subFocusItemChange@QDeclarativeItemPrivate@@UAEXXZ @ 3777 NONAME ; void QDeclarativeItemPrivate::subFocusItemChange(void) @@ -3799,7 +3799,7 @@ EXPORTS ?transform_clear@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsTransform@@@@@Z @ 3798 NONAME ; void QDeclarativeItemPrivate::transform_clear(class QDeclarativeListProperty *) ?transform_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQGraphicsTransform@@@@@Z @ 3799 NONAME ; int QDeclarativeItemPrivate::transform_count(class QDeclarativeListProperty *) ?transition@QDeclarativeSmoothedAnimation@@UAEXAAV?$QList@VQDeclarativeAction@@@@AAV?$QList@VQDeclarativeProperty@@@@W4TransitionDirection@QDeclarativeAbstractAnimation@@@Z @ 3800 NONAME ; void QDeclarativeSmoothedAnimation::transition(class QList &, class QList &, enum QDeclarativeAbstractAnimation::TransitionDirection) - ?transitions@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3801 NONAME ; class QDeclarativeListProperty QDeclarativeItem::transitions(void) + ?transitions@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3801 NONAME ABSENT ; class QDeclarativeListProperty QDeclarativeItem::transitions(void) ?transitionsProperty@QDeclarativeStateGroup@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3802 NONAME ; class QDeclarativeListProperty QDeclarativeStateGroup::transitionsProperty(void) ?triggeredOnStartChanged@QDeclarativeTimer@@IAEXXZ @ 3803 NONAME ; void QDeclarativeTimer::triggeredOnStartChanged(void) ?type@Variant@QDeclarativeParser@@QBE?AW4Type@12@XZ @ 3804 NONAME ; enum QDeclarativeParser::Variant::Type QDeclarativeParser::Variant::type(void) const @@ -3920,7 +3920,7 @@ EXPORTS ?execute@QDeclarativeParentChange@@UAEXW4Reason@QDeclarativeActionEvent@@@Z @ 3919 NONAME ; void QDeclarativeParentChange::execute(enum QDeclarativeActionEvent::Reason) ?resetSourceComponent@QDeclarativeLoader@@QAEXXZ @ 3920 NONAME ; void QDeclarativeLoader::resetSourceComponent(void) ?rootIndex@QDeclarativeVisualDataModel@@QBE?AVQVariant@@XZ @ 3921 NONAME ; class QVariant QDeclarativeVisualDataModel::rootIndex(void) const - ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@XZ @ 3922 NONAME ; class QScriptValue QDeclarativeComponent::createObject(void) + ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@XZ @ 3922 NONAME ABSENT ; class QScriptValue QDeclarativeComponent::createObject(void) ?execute@QDeclarativeStateChangeScript@@UAEXW4Reason@QDeclarativeActionEvent@@@Z @ 3923 NONAME ; void QDeclarativeStateChangeScript::execute(enum QDeclarativeActionEvent::Reason) ?active@QDeclarativeDrag@@QBE_NXZ @ 3924 NONAME ; bool QDeclarativeDrag::active(void) const ?retransformBack@QDeclarativeFlipable@@AAEXXZ @ 3925 NONAME ; void QDeclarativeFlipable::retransformBack(void) @@ -3955,4 +3955,43 @@ EXPORTS ?parentModelIndex@QDeclarativeVisualDataModel@@QBE?AVQVariant@@XZ @ 3954 NONAME ; class QVariant QDeclarativeVisualDataModel::parentModelIndex(void) const ?usedAnchors@QDeclarativeAnchors@@QBE?AV?$QFlags@W4Anchor@QDeclarativeAnchors@@@@XZ @ 3955 NONAME ; class QFlags QDeclarativeAnchors::usedAnchors(void) const ?eventFilter@QDeclarativeView@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 3956 NONAME ; bool QDeclarativeView::eventFilter(class QObject *, class QEvent *) + ??0QDeclarativeInfo@@AAE@PAVQDeclarativeInfoPrivate@@@Z @ 3957 NONAME ; QDeclarativeInfo::QDeclarativeInfo(class QDeclarativeInfoPrivate *) + ?_states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3958 NONAME ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::_states(void) + ?baseline@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3959 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline(void) const + ?bottom@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3960 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom(void) const + ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAVQDeclarativeImportedNamespace@@PAVProperty@QDeclarativeParser@@PAVObject@4@ABUBindingContext@1@@Z @ 3961 NONAME ; bool QDeclarativeCompiler::buildPropertyInNamespace(class QDeclarativeImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &) + ?canceled@QDeclarativeMouseArea@@IAEXXZ @ 3962 NONAME ; void QDeclarativeMouseArea::canceled(void) + ?classBegin@QDeclarativeBind@@MAEXXZ @ 3963 NONAME ; void QDeclarativeBind::classBegin(void) + ?classBegin@QDeclarativeConnections@@EAEXXZ @ 3964 NONAME ; void QDeclarativeConnections::classBegin(void) + ?classBegin@QDeclarativePath@@MAEXXZ @ 3965 NONAME ; void QDeclarativePath::classBegin(void) + ?classBegin@QDeclarativeWorkerScript@@MAEXXZ @ 3966 NONAME ; void QDeclarativeWorkerScript::classBegin(void) + ?completePending@QDeclarativeVisualDataModel@@UBE_NXZ @ 3967 NONAME ; bool QDeclarativeVisualDataModel::completePending(void) const + ?completePending@QDeclarativeVisualItemModel@@UBE_NXZ @ 3968 NONAME ; bool QDeclarativeVisualItemModel::completePending(void) const + ?componentFinalized@QDeclarativeBehavior@@AAEXXZ @ 3969 NONAME ; void QDeclarativeBehavior::componentFinalized(void) + ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@PAVQObject@@@Z @ 3970 NONAME ; class QScriptValue QDeclarativeComponent::createObject(class QObject *) + ?data@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3971 NONAME ; class QDeclarativeListProperty QDeclarativeItemPrivate::data(void) + ?engine@QDeclarativeWorkerScript@@AAEPAVQDeclarativeWorkerScriptEngine@@XZ @ 3972 NONAME ; class QDeclarativeWorkerScriptEngine * QDeclarativeWorkerScript::engine(void) + ?geometryChanged@QDeclarativePaintedItem@@MAEXABVQRectF@@0@Z @ 3973 NONAME ; void QDeclarativePaintedItem::geometryChanged(class QRectF const &, class QRectF const &) + ?get@QDeclarativeItemPrivate@@SAPAV1@PAVQDeclarativeItem@@@Z @ 3974 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItemPrivate::get(class QDeclarativeItem *) + ?horizontalCenter@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3975 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::horizontalCenter(void) const + ?hoverEnabled@QDeclarativeMouseArea@@QBE_NXZ @ 3976 NONAME ; bool QDeclarativeMouseArea::hoverEnabled(void) const + ?hoverEnabledChanged@QDeclarativeMouseArea@@IAEXXZ @ 3977 NONAME ; void QDeclarativeMouseArea::hoverEnabledChanged(void) + ?ignoreUnknownSignals@QDeclarativeConnections@@QBE_NXZ @ 3978 NONAME ; bool QDeclarativeConnections::ignoreUnknownSignals(void) const + ?itemChange@QDeclarativeMouseArea@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 3979 NONAME ; class QVariant QDeclarativeMouseArea::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &) + ?itemChange@QDeclarativePaintedItem@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 3980 NONAME ; class QVariant QDeclarativePaintedItem::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &) + ?left@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3981 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::left(void) const + ?reportConflictingAnchors@QDeclarativeColumn@@MAEXXZ @ 3982 NONAME ; void QDeclarativeColumn::reportConflictingAnchors(void) + ?reportConflictingAnchors@QDeclarativeFlow@@MAEXXZ @ 3983 NONAME ; void QDeclarativeFlow::reportConflictingAnchors(void) + ?reportConflictingAnchors@QDeclarativeGrid@@MAEXXZ @ 3984 NONAME ; void QDeclarativeGrid::reportConflictingAnchors(void) + ?reportConflictingAnchors@QDeclarativeRow@@MAEXXZ @ 3985 NONAME ; void QDeclarativeRow::reportConflictingAnchors(void) + ?resources@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3986 NONAME ; class QDeclarativeListProperty QDeclarativeItemPrivate::resources(void) + ?right@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3987 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::right(void) const + ?setHoverEnabled@QDeclarativeMouseArea@@QAEX_N@Z @ 3988 NONAME ; void QDeclarativeMouseArea::setHoverEnabled(bool) + ?setIgnoreUnknownSignals@QDeclarativeConnections@@QAEX_N@Z @ 3989 NONAME ; void QDeclarativeConnections::setIgnoreUnknownSignals(bool) + ?setState@QDeclarativeItemPrivate@@QAEXABVQString@@@Z @ 3990 NONAME ; void QDeclarativeItemPrivate::setState(class QString const &) + ?state@QDeclarativeItemPrivate@@QBE?AVQString@@XZ @ 3991 NONAME ; class QString QDeclarativeItemPrivate::state(void) const + ?states@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3992 NONAME ; class QDeclarativeListProperty QDeclarativeItemPrivate::states(void) + ?top@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3993 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::top(void) const + ?transitions@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3994 NONAME ; class QDeclarativeListProperty QDeclarativeItemPrivate::transitions(void) + ?verticalCenter@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3995 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::verticalCenter(void) const diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index c3a3a08..e574c31 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12717,7 +12717,7 @@ EXPORTS ?updateInputMethodSensitivity@QGraphicsViewPrivate@@QAEXXZ @ 12716 NONAME ; void QGraphicsViewPrivate::updateInputMethodSensitivity(void) ?updateLastCenterPoint@QGraphicsViewPrivate@@QAEXXZ @ 12717 NONAME ; void QGraphicsViewPrivate::updateLastCenterPoint(void) ?updateRect@QGraphicsViewPrivate@@QAE_NABVQRect@@@Z @ 12718 NONAME ; bool QGraphicsViewPrivate::updateRect(class QRect const &) - ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRegion@@@Z @ 12719 NONAME ; bool QGraphicsViewPrivate::updateRegion(class QRegion const &) + ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRegion@@@Z @ 12719 NONAME ABSENT ; bool QGraphicsViewPrivate::updateRegion(class QRegion const &) ?updateScroll@QGraphicsViewPrivate@@QAEXXZ @ 12720 NONAME ; void QGraphicsViewPrivate::updateScroll(void) ?verticalScroll@QGraphicsViewPrivate@@QBE_JXZ @ 12721 NONAME ; long long QGraphicsViewPrivate::verticalScroll(void) const ?viewportEvent@QAbstractScrollAreaPrivate@@QAE_NPAVQEvent@@@Z @ 12722 NONAME ; bool QAbstractScrollAreaPrivate::viewportEvent(class QEvent *) @@ -12798,4 +12798,6 @@ EXPORTS ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 12797 NONAME ; bool QWindowSurface::hasPartialUpdateSupport(void) const ?name@QIcon@@QBE?AVQString@@XZ @ 12798 NONAME ; class QString QIcon::name(void) const ?iconName@QIconEngineV2@@QAE?AVQString@@XZ @ 12799 NONAME ; class QString QIconEngineV2::iconName(void) + ?updateRectF@QGraphicsViewPrivate@@QAE_NABVQRectF@@@Z @ 12800 NONAME ; bool QGraphicsViewPrivate::updateRectF(class QRectF const &) + ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRectF@@ABVQTransform@@@Z @ 12801 NONAME ; bool QGraphicsViewPrivate::updateRegion(class QRectF const &, class QTransform const &) diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index 92a4020..dc9431b 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -3698,4 +3698,6 @@ EXPORTS _ZN24QAbstractDeclarativeData13parentChangedE @ 3697 NONAME DATA 4 _ZN24QAbstractDeclarativeData9destroyedE @ 3698 NONAME DATA 4 _ZN23QEventDispatcherSymbian12selectThreadEv @ 3699 NONAME + _ZN10QByteArray10setRawDataEPKcj @ 3700 NONAME + _ZN7QString10setRawDataEPK5QChari @ 3701 NONAME diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def index ad12166..e1d8e96 100644 --- a/src/s60installs/eabi/QtDeclarativeu.def +++ b/src/s60installs/eabi/QtDeclarativeu.def @@ -111,7 +111,7 @@ EXPORTS _ZN16QDeclarativeItem11qt_metacallEN11QMetaObject4CallEiPPv @ 110 NONAME _ZN16QDeclarativeItem11qt_metacastEPKc @ 111 NONAME _ZN16QDeclarativeItem11resetHeightEv @ 112 NONAME - _ZN16QDeclarativeItem11transitionsEv @ 113 NONAME + _ZN16QDeclarativeItem11transitionsEv @ 113 NONAME ABSENT _ZN16QDeclarativeItem12childrenRectEv @ 114 NONAME _ZN16QDeclarativeItem12focusChangedEb @ 115 NONAME _ZN16QDeclarativeItem12stateChangedERK7QString @ 116 NONAME @@ -135,17 +135,17 @@ EXPORTS _ZN16QDeclarativeItem19getStaticMetaObjectEv @ 134 NONAME _ZN16QDeclarativeItem21baselineOffsetChangedEf @ 135 NONAME _ZN16QDeclarativeItem22transformOriginChangedENS_15TransformOriginE @ 136 NONAME - _ZN16QDeclarativeItem4dataEv @ 137 NONAME + _ZN16QDeclarativeItem4dataEv @ 137 NONAME ABSENT _ZN16QDeclarativeItem5eventEP6QEvent @ 138 NONAME _ZN16QDeclarativeItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 139 NONAME - _ZN16QDeclarativeItem6statesEv @ 140 NONAME - _ZN16QDeclarativeItem7anchorsEv @ 141 NONAME + _ZN16QDeclarativeItem6statesEv @ 140 NONAME ABSENT + _ZN16QDeclarativeItem7anchorsEv @ 141 NONAME ABSENT _ZN16QDeclarativeItem7setClipEb @ 142 NONAME _ZN16QDeclarativeItem7setSizeERK6QSizeF @ 143 NONAME _ZN16QDeclarativeItem8setFocusEb @ 144 NONAME - _ZN16QDeclarativeItem8setStateERK7QString @ 145 NONAME + _ZN16QDeclarativeItem8setStateERK7QString @ 145 NONAME ABSENT _ZN16QDeclarativeItem8setWidthEf @ 146 NONAME - _ZN16QDeclarativeItem9resourcesEv @ 147 NONAME + _ZN16QDeclarativeItem9resourcesEv @ 147 NONAME ABSENT _ZN16QDeclarativeItem9setHeightEf @ 148 NONAME _ZN16QDeclarativeItem9setSmoothEb @ 149 NONAME _ZN16QDeclarativeItem9transformEv @ 150 NONAME @@ -361,13 +361,13 @@ EXPORTS _ZN18QDeclarativeLoader11itemChangedEv @ 360 NONAME _ZN18QDeclarativeLoader11qt_metacallEN11QMetaObject4CallEiPPv @ 361 NONAME _ZN18QDeclarativeLoader11qt_metacastEPKc @ 362 NONAME - _ZN18QDeclarativeLoader13setResizeModeENS_10ResizeModeE @ 363 NONAME + _ZN18QDeclarativeLoader13setResizeModeENS_10ResizeModeE @ 363 NONAME ABSENT _ZN18QDeclarativeLoader13sourceChangedEv @ 364 NONAME _ZN18QDeclarativeLoader13statusChangedEv @ 365 NONAME _ZN18QDeclarativeLoader15geometryChangedERK6QRectFS2_ @ 366 NONAME _ZN18QDeclarativeLoader15progressChangedEv @ 367 NONAME _ZN18QDeclarativeLoader16staticMetaObjectE @ 368 NONAME DATA 16 - _ZN18QDeclarativeLoader17resizeModeChangedEv @ 369 NONAME + _ZN18QDeclarativeLoader17resizeModeChangedEv @ 369 NONAME ABSENT _ZN18QDeclarativeLoader18setSourceComponentEP21QDeclarativeComponent @ 370 NONAME _ZN18QDeclarativeLoader19getStaticMetaObjectEv @ 371 NONAME _ZN18QDeclarativeLoader9setSourceERK4QUrl @ 372 NONAME @@ -586,7 +586,7 @@ EXPORTS _ZN20QDeclarativeCompiler22completeComponentBuildEv @ 585 NONAME _ZN20QDeclarativeCompiler22isAttachedPropertyNameERK10QByteArray @ 586 NONAME _ZN20QDeclarativeCompiler23buildPropertyAssignmentEPN18QDeclarativeParser8PropertyEPNS0_6ObjectERKNS_14BindingContextE @ 587 NONAME - _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEPN25QDeclarativeEnginePrivate17ImportedNamespaceEPN18QDeclarativeParser8PropertyEPNS3_6ObjectERKNS_14BindingContextE @ 588 NONAME + _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEPN25QDeclarativeEnginePrivate17ImportedNamespaceEPN18QDeclarativeParser8PropertyEPNS3_6ObjectERKNS_14BindingContextE @ 588 NONAME ABSENT _ZN20QDeclarativeCompiler25buildPropertyOnAssignmentEPN18QDeclarativeParser8PropertyEPNS0_6ObjectES4_PNS0_5ValueERKNS_14BindingContextE @ 589 NONAME _ZN20QDeclarativeCompiler25buildScriptStringPropertyEPN18QDeclarativeParser8PropertyEPNS0_6ObjectERKNS_14BindingContextE @ 590 NONAME _ZN20QDeclarativeCompiler26mergeDynamicMetaPropertiesEPN18QDeclarativeParser6ObjectE @ 591 NONAME @@ -969,7 +969,7 @@ EXPORTS _ZN21QDeclarativeComponent11beginCreateEP19QDeclarativeContext @ 968 NONAME _ZN21QDeclarativeComponent11qt_metacallEN11QMetaObject4CallEiPPv @ 969 NONAME _ZN21QDeclarativeComponent11qt_metacastEPKc @ 970 NONAME - _ZN21QDeclarativeComponent12createObjectEv @ 971 NONAME + _ZN21QDeclarativeComponent12createObjectEv @ 971 NONAME ABSENT _ZN21QDeclarativeComponent13statusChangedENS_6StatusE @ 972 NONAME _ZN21QDeclarativeComponent14completeCreateEv @ 973 NONAME _ZN21QDeclarativeComponent15progressChangedEf @ 974 NONAME @@ -1493,7 +1493,7 @@ EXPORTS _ZN23QDeclarativePaintedItem19contentsSizeChangedEv @ 1492 NONAME _ZN23QDeclarativePaintedItem19getStaticMetaObjectEv @ 1493 NONAME _ZN23QDeclarativePaintedItem20contentsScaleChangedEv @ 1494 NONAME - _ZN23QDeclarativePaintedItem4initEv @ 1495 NONAME + _ZN23QDeclarativePaintedItem4initEv @ 1495 NONAME ABSENT _ZN23QDeclarativePaintedItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 1496 NONAME _ZN23QDeclarativePaintedItemC2EP16QDeclarativeItem @ 1497 NONAME _ZN23QDeclarativePaintedItemC2ER30QDeclarativePaintedItemPrivateP16QDeclarativeItem @ 1498 NONAME @@ -1624,9 +1624,9 @@ EXPORTS _ZN24QDeclarativeParentChangeD0Ev @ 1623 NONAME _ZN24QDeclarativeParentChangeD1Ev @ 1624 NONAME _ZN24QDeclarativeParentChangeD2Ev @ 1625 NONAME - _ZN24QDeclarativeParserStatus10classBeginEv @ 1626 NONAME - _ZN24QDeclarativeParserStatus17componentCompleteEv @ 1627 NONAME - _ZN24QDeclarativeParserStatusC1Ev @ 1628 NONAME + _ZN24QDeclarativeParserStatus10classBeginEv @ 1626 NONAME ABSENT + _ZN24QDeclarativeParserStatus17componentCompleteEv @ 1627 NONAME ABSENT + _ZN24QDeclarativeParserStatusC1Ev @ 1628 NONAME ABSENT _ZN24QDeclarativeParserStatusC2Ev @ 1629 NONAME _ZN24QDeclarativeParserStatusD0Ev @ 1630 NONAME _ZN24QDeclarativeParserStatusD1Ev @ 1631 NONAME @@ -2203,21 +2203,21 @@ EXPORTS _ZNK16QDeclarativeItem13keepMouseGrabEv @ 2202 NONAME _ZNK16QDeclarativeItem14baselineOffsetEv @ 2203 NONAME _ZNK16QDeclarativeItem14implicitHeightEv @ 2204 NONAME - _ZNK16QDeclarativeItem14verticalCenterEv @ 2205 NONAME + _ZNK16QDeclarativeItem14verticalCenterEv @ 2205 NONAME ABSENT _ZNK16QDeclarativeItem15transformOriginEv @ 2206 NONAME - _ZNK16QDeclarativeItem16horizontalCenterEv @ 2207 NONAME + _ZNK16QDeclarativeItem16horizontalCenterEv @ 2207 NONAME ABSENT _ZNK16QDeclarativeItem16inputMethodQueryEN2Qt16InputMethodQueryE @ 2208 NONAME _ZNK16QDeclarativeItem19isComponentCompleteEv @ 2209 NONAME - _ZNK16QDeclarativeItem3topEv @ 2210 NONAME + _ZNK16QDeclarativeItem3topEv @ 2210 NONAME ABSENT _ZNK16QDeclarativeItem4clipEv @ 2211 NONAME - _ZNK16QDeclarativeItem4leftEv @ 2212 NONAME - _ZNK16QDeclarativeItem5rightEv @ 2213 NONAME - _ZNK16QDeclarativeItem5stateEv @ 2214 NONAME + _ZNK16QDeclarativeItem4leftEv @ 2212 NONAME ABSENT + _ZNK16QDeclarativeItem5rightEv @ 2213 NONAME ABSENT + _ZNK16QDeclarativeItem5stateEv @ 2214 NONAME ABSENT _ZNK16QDeclarativeItem5widthEv @ 2215 NONAME - _ZNK16QDeclarativeItem6bottomEv @ 2216 NONAME + _ZNK16QDeclarativeItem6bottomEv @ 2216 NONAME ABSENT _ZNK16QDeclarativeItem6heightEv @ 2217 NONAME _ZNK16QDeclarativeItem6smoothEv @ 2218 NONAME - _ZNK16QDeclarativeItem8baselineEv @ 2219 NONAME + _ZNK16QDeclarativeItem8baselineEv @ 2219 NONAME ABSENT _ZNK16QDeclarativeItem8hasFocusEv @ 2220 NONAME _ZNK16QDeclarativeItem9mapToItemERK12QScriptValueff @ 2221 NONAME _ZNK16QDeclarativePath10attributesEv @ 2222 NONAME @@ -2310,7 +2310,7 @@ EXPORTS _ZNK18QDeclarativeEngine27networkAccessManagerFactoryEv @ 2309 NONAME _ZNK18QDeclarativeEngine7baseUrlEv @ 2310 NONAME _ZNK18QDeclarativeLoader10metaObjectEv @ 2311 NONAME - _ZNK18QDeclarativeLoader10resizeModeEv @ 2312 NONAME + _ZNK18QDeclarativeLoader10resizeModeEv @ 2312 NONAME ABSENT _ZNK18QDeclarativeLoader15sourceComponentEv @ 2313 NONAME _ZNK18QDeclarativeLoader4itemEv @ 2314 NONAME _ZNK18QDeclarativeLoader6sourceEv @ 2315 NONAME @@ -3536,4 +3536,46 @@ EXPORTS _ZThn8_N25QDeclarativeAnchorChanges7executeEN23QDeclarativeActionEvent6ReasonE @ 3535 NONAME _ZThn8_N25QDeclarativeAnchorChanges7reverseEN23QDeclarativeActionEvent6ReasonE @ 3536 NONAME _ZThn8_N29QDeclarativeStateChangeScript7executeEN23QDeclarativeActionEvent6ReasonE @ 3537 NONAME + _ZN15QDeclarativeRow24reportConflictingAnchorsEv @ 3538 NONAME + _ZN16QDeclarativeBind10classBeginEv @ 3539 NONAME + _ZN16QDeclarativeFlow24reportConflictingAnchorsEv @ 3540 NONAME + _ZN16QDeclarativeGrid24reportConflictingAnchorsEv @ 3541 NONAME + _ZN16QDeclarativePath10classBeginEv @ 3542 NONAME + _ZN18QDeclarativeColumn24reportConflictingAnchorsEv @ 3543 NONAME + _ZN20QDeclarativeBehavior18componentFinalizedEv @ 3544 NONAME + _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEP29QDeclarativeImportedNamespacePN18QDeclarativeParser8PropertyEPNS2_6ObjectERKNS_14BindingContextE @ 3545 NONAME + _ZN21QDeclarativeComponent12createObjectEP7QObject @ 3546 NONAME + _ZN21QDeclarativeMouseArea10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3547 NONAME + _ZN21QDeclarativeMouseArea15setHoverEnabledEb @ 3548 NONAME + _ZN21QDeclarativeMouseArea19hoverEnabledChangedEv @ 3549 NONAME + _ZN21QDeclarativeMouseArea8canceledEv @ 3550 NONAME + _ZN23QDeclarativeConnections10classBeginEv @ 3551 NONAME + _ZN23QDeclarativeConnections23setIgnoreUnknownSignalsEb @ 3552 NONAME + _ZN23QDeclarativeItemPrivate11transitionsEv @ 3553 NONAME + _ZN23QDeclarativeItemPrivate4dataEv @ 3554 NONAME + _ZN23QDeclarativeItemPrivate7_statesEv @ 3555 NONAME + _ZN23QDeclarativeItemPrivate8setStateERK7QString @ 3556 NONAME + _ZN23QDeclarativeItemPrivate9resourcesEv @ 3557 NONAME + _ZN23QDeclarativePaintedItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3558 NONAME + _ZN23QDeclarativePaintedItem15geometryChangedERK6QRectFS2_ @ 3559 NONAME + _ZN24QDeclarativeWorkerScript10classBeginEv @ 3560 NONAME + _ZN24QDeclarativeWorkerScript6engineEv @ 3561 NONAME + _ZNK21QDeclarativeMouseArea12hoverEnabledEv @ 3562 NONAME + _ZNK23QDeclarativeConnections20ignoreUnknownSignalsEv @ 3563 NONAME + _ZNK23QDeclarativeItemPrivate14verticalCenterEv @ 3564 NONAME + _ZNK23QDeclarativeItemPrivate16horizontalCenterEv @ 3565 NONAME + _ZNK23QDeclarativeItemPrivate3topEv @ 3566 NONAME + _ZNK23QDeclarativeItemPrivate4leftEv @ 3567 NONAME + _ZNK23QDeclarativeItemPrivate5rightEv @ 3568 NONAME + _ZNK23QDeclarativeItemPrivate5stateEv @ 3569 NONAME + _ZNK23QDeclarativeItemPrivate6bottomEv @ 3570 NONAME + _ZNK23QDeclarativeItemPrivate8baselineEv @ 3571 NONAME + _ZNK27QDeclarativeVisualDataModel15completePendingEv @ 3572 NONAME + _ZNK27QDeclarativeVisualItemModel15completePendingEv @ 3573 NONAME + _ZThn8_N16QDeclarativeBind10classBeginEv @ 3574 NONAME + _ZThn8_N16QDeclarativePath10classBeginEv @ 3575 NONAME + _ZThn8_N21QDeclarativeMouseArea10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3576 NONAME + _ZThn8_N23QDeclarativeConnections10classBeginEv @ 3577 NONAME + _ZThn8_N23QDeclarativePaintedItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3578 NONAME + _ZThn8_N24QDeclarativeWorkerScript10classBeginEv @ 3579 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index b1166c5..8987470 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -11849,7 +11849,7 @@ EXPORTS _ZN19QApplicationPrivate15getPixmapCursorEN2Qt11CursorShapeE @ 11848 NONAME _ZN20QGraphicsViewPrivate10centerViewEN13QGraphicsView14ViewportAnchorE @ 11849 NONAME _ZN20QGraphicsViewPrivate10updateRectERK5QRect @ 11850 NONAME - _ZN20QGraphicsViewPrivate12updateRegionERK7QRegion @ 11851 NONAME + _ZN20QGraphicsViewPrivate12updateRegionERK7QRegion @ 11851 NONAME ABSENT _ZN20QGraphicsViewPrivate12updateScrollEv @ 11852 NONAME _ZN20QGraphicsViewPrivate15storeMouseEventEP11QMouseEvent @ 11853 NONAME _ZN20QGraphicsViewPrivate18storeDragDropEventEPK27QGraphicsSceneDragDropEvent @ 11854 NONAME @@ -11998,4 +11998,5 @@ EXPORTS _ZN14QWindowSurface23setPartialUpdateSupportEb @ 11997 NONAME _ZNK14QWindowSurface23hasPartialUpdateSupportEv @ 11998 NONAME _ZNK5QIcon4nameEv @ 11999 NONAME + _ZN20QGraphicsViewPrivate12updateRegionERK6QRectFRK10QTransform @ 12000 NONAME -- cgit v0.12 From c316e141fa511a6f0549630153e3502cca42f592 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 11 May 2010 22:57:29 +0200 Subject: Doc: Update on web template Updated Form action --- tools/qdoc3/test/qt-html-templates.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index e5d73c7..31fc414 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -31,7 +31,7 @@ HTML.postheader = "
      \n" \ "
      \n" \ " Search index:
      \n" \ "
      \n" \ - "
      \n" \ + " \n" \ "
      \n" \ " \n" \ "
      \n" \ -- cgit v0.12 From dae547d26f8c7d4c75b02045e23213c798a2fa3e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 12 May 2010 08:13:41 +1000 Subject: Clarify ListModel population via JS. Task-number: QTBUG-10457 --- doc/src/declarative/qdeclarativemodels.qdoc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index 9b706a1..788d417 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -143,6 +143,28 @@ ListView { } \endcode +It is also possible to manipulate the ListModel directly via JavaScript. +In this case, the first item inserted will determine the roles available +to any views using the model. For example, if an empty ListModel is +created and populated via JavaScript the roles provided by the first +insertion are the only roles that will be shown in the view: + +\code +Item { + ListModel { + id: fruitModel + } + MouseArea { + anchors.fill: parent + onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"}) + } +} +\endcode + +When the MouseArea is clicked fruitModel will have two roles, "cost" and "name". +Even if subsequent roles are added, only the first two will be handled by views +using the model. + \section2 XmlListModel -- cgit v0.12 From c4bb04a6154931570dee72b3a1ed34af31814d17 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 12 May 2010 08:28:55 +1000 Subject: Don't store the role-property map for each individual item. C++ models share a single metaobject type, so we don't need to create role-property mappings for each individual item. Also warn on attempt to modify a role that the model is unaware of (part of QTBUG-10457) --- .../graphicsitems/qdeclarativegridview.cpp | 2 +- .../graphicsitems/qdeclarativelistview.cpp | 3 +- .../graphicsitems/qdeclarativerepeater.cpp | 2 +- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 63 ++++++++++++++-------- .../graphicsitems/qdeclarativevisualitemmodel_p.h | 6 +-- 5 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 7b413fb..305d55c 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1027,7 +1027,7 @@ void QDeclarativeGridView::setModel(const QVariant &model) d->model = vim; } else { if (!d->ownModel) { - d->model = new QDeclarativeVisualDataModel(qmlContext(this)); + d->model = new QDeclarativeVisualDataModel(qmlContext(this), this); d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast(d->model)) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 416e0a8..65edb03 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -1461,7 +1462,7 @@ void QDeclarativeListView::setModel(const QVariant &model) d->model = vim; } else { if (!d->ownModel) { - d->model = new QDeclarativeVisualDataModel(qmlContext(this)); + d->model = new QDeclarativeVisualDataModel(qmlContext(this), this); d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast(d->model)) diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index ca0b8c6..04076f8 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -193,7 +193,7 @@ void QDeclarativeRepeater::setModel(const QVariant &model) d->model = vim; } else { if (!d->ownModel) { - d->model = new QDeclarativeVisualDataModel(qmlContext(this)); + d->model = new QDeclarativeVisualDataModel(qmlContext(this), this); d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast(d->model)) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 1038c83..0e4217e 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -138,8 +138,8 @@ public: } \endcode */ -QDeclarativeVisualItemModel::QDeclarativeVisualItemModel() - : QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate)) +QDeclarativeVisualItemModel::QDeclarativeVisualItemModel(QObject *parent) + : QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate), parent) { } @@ -269,7 +269,8 @@ public: } if (m_roles.count() == 1) m_roleNames.insert("modelData", m_roles.at(0)); - m_roleNames.insert("hasModelChildren", 0); + if (m_roles.count()) + m_roleNames.insert("hasModelChildren", 0); } else if (m_listAccessor) { m_roleNames.insert("modelData", 0); if (m_listAccessor->type() == QDeclarativeListAccessor::Instance) { @@ -285,15 +286,19 @@ public: } } + QHash roleToPropId; void createMetaData() { if (!m_metaDataCreated) { ensureRoles(); - QHash::const_iterator it = m_roleNames.begin(); - while (it != m_roleNames.end()) { - m_delegateDataType->createProperty(it.key()); - ++it; + if (m_roleNames.count()) { + QHash::const_iterator it = m_roleNames.begin(); + while (it != m_roleNames.end()) { + int propId = m_delegateDataType->createProperty(it.key()) - m_delegateDataType->propertyOffset(); + roleToPropId.insert(*it, propId); + ++it; + } + m_metaDataCreated = true; } - m_metaDataCreated = true; } } @@ -383,7 +388,6 @@ public: private: friend class QDeclarativeVisualDataModelData; - QHash roleToProp; }; class QDeclarativeVisualDataModelData : public QObject @@ -400,6 +404,8 @@ public: int propForRole(int) const; void setValue(int, const QVariant &); + void ensureProperties(); + Q_SIGNALS: void indexChanged(); @@ -412,9 +418,11 @@ private: int QDeclarativeVisualDataModelData::propForRole(int id) const { - QHash::const_iterator it = m_meta->roleToProp.find(id); - if (it != m_meta->roleToProp.end()) - return m_meta->roleToProp[id]; + QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(m_model); + QHash::const_iterator it = model->roleToPropId.find(id); + if (it != model->roleToPropId.end()) + return *it; + return -1; } @@ -470,12 +478,10 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId) model->ensureRoles(); QHash::const_iterator it = model->m_roleNames.find(propName); if (it != model->m_roleNames.end()) { - roleToProp.insert(*it, propId); QVariant value = model->m_listModelInterface->data(data->m_index, *it); return value; } else if (model->m_roles.count() == 1 && propName == "modelData") { //for compatability with other lists, assign modelData if there is only a single role - roleToProp.insert(model->m_roles.first(), propId); QVariant value = model->m_listModelInterface->data(data->m_index, model->m_roles.first()); return value; } @@ -487,7 +493,6 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId) } else { QHash::const_iterator it = model->m_roleNames.find(propName); if (it != model->m_roleNames.end()) { - roleToProp.insert(*it, propId); QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root); return model->m_abstractItemModel->data(index, *it); } @@ -502,18 +507,23 @@ QDeclarativeVisualDataModelData::QDeclarativeVisualDataModelData(int index, : m_index(index), m_model(model), m_meta(new QDeclarativeVisualDataModelDataMetaObject(this, QDeclarativeVisualDataModelPrivate::get(model)->m_delegateDataType)) { - QDeclarativeVisualDataModelPrivate *modelPriv = QDeclarativeVisualDataModelPrivate::get(model); - if (modelPriv->m_metaDataCacheable) { - if (!modelPriv->m_metaDataCreated) - modelPriv->createMetaData(); - m_meta->setCached(true); - } + ensureProperties(); } QDeclarativeVisualDataModelData::~QDeclarativeVisualDataModelData() { } +void QDeclarativeVisualDataModelData::ensureProperties() +{ + QDeclarativeVisualDataModelPrivate *modelPriv = QDeclarativeVisualDataModelPrivate::get(m_model); + if (modelPriv->m_metaDataCacheable && !modelPriv->m_metaDataCreated) { + modelPriv->createMetaData(); + if (modelPriv->m_metaDataCreated) + m_meta->setCached(true); + } +} + int QDeclarativeVisualDataModelData::index() const { return m_index; @@ -626,8 +636,8 @@ QDeclarativeVisualDataModel::QDeclarativeVisualDataModel() { } -QDeclarativeVisualDataModel::QDeclarativeVisualDataModel(QDeclarativeContext *ctxt) -: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(ctxt))) +QDeclarativeVisualDataModel::QDeclarativeVisualDataModel(QDeclarativeContext *ctxt, QObject *parent) +: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(ctxt)), parent) { } @@ -1212,6 +1222,13 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root); data->setValue(propId, d->m_abstractItemModel->data(index, role)); } + } else { + QString roleName; + if (d->m_listModelInterface) + roleName = d->m_listModelInterface->toString(role); + else if (d->m_abstractItemModel) + roleName = d->m_abstractItemModel->roleNames().value(role); + qmlInfo(this) << "Changing role not present in item: " << roleName; } } } diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h index edfd387..0bdbbcf 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h @@ -72,7 +72,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualModel : public QObject Q_PROPERTY(int count READ count NOTIFY countChanged) public: - QDeclarativeVisualModel() {} + QDeclarativeVisualModel(QObject *parent=0) : QObject(parent) {} virtual ~QDeclarativeVisualModel() {} enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 }; @@ -117,7 +117,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualItemModel : public QDeclarativeVisu Q_CLASSINFO("DefaultProperty", "children") public: - QDeclarativeVisualItemModel(); + QDeclarativeVisualItemModel(QObject *parent=0); virtual ~QDeclarativeVisualItemModel() {} virtual int count() const; @@ -156,7 +156,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisu Q_CLASSINFO("DefaultProperty", "delegate") public: QDeclarativeVisualDataModel(); - QDeclarativeVisualDataModel(QDeclarativeContext *); + QDeclarativeVisualDataModel(QDeclarativeContext *, QObject *parent=0); virtual ~QDeclarativeVisualDataModel(); QVariant model() const; -- cgit v0.12 From 1809eb091cb47c914713ecef6e514e912a4e113b Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 10 May 2010 15:38:12 +1000 Subject: Expand if available space changes. Task-number: QT-3175 --- demos/declarative/webbrowser/content/FlickableWebView.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 2862cc4..7efbaa3 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -20,6 +20,12 @@ Flickable { anchors.right: parent.right pressDelay: 200 + onWidthChanged : { + // Expand (but not above 1:1) if otherwise would be smaller that available width. + if (width > webView.width*webView.contentsScale && webView.contentsScale < 1.0) + webView.contentsScale = width / webView.width * webView.contentsScale; + } + WebView { id: webView pixelCacheSize: 4000000 -- cgit v0.12 From 797d44e7415e8f9d582dd2838957cf309cea9449 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 11 May 2010 09:01:51 +1000 Subject: Temporary work-around for QTBUG-9849. May allow better experimentation and bug fixing. --- tools/qml/main.cpp | 6 ++++++ tools/qml/qmlruntime.cpp | 11 +++++++++++ tools/qml/qmlruntime.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index fb687ac..116ca71 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -231,6 +231,7 @@ int main(int argc, char ** argv) bool stayOnTop = false; bool maximized = false; bool useNativeFileBrowser = true; + bool experimentalGestures = false; WarningsConfig warningsConfig = DefaultWarnings; bool sizeToView = true; @@ -334,6 +335,8 @@ int main(int argc, char ** argv) sizeToView = false; } else if (arg == "-sizerootobjecttoview") { sizeToView = true; + } else if (arg == "-experimentalgestures") { + experimentalGestures = true; } else if (arg[0] != '-') { fileName = arg; } else if (1 || arg == "-help") { @@ -403,6 +406,9 @@ int main(int argc, char ** argv) } #endif + if (experimentalGestures) + viewer->enableExperimentalGestures(); + foreach (QString lib, imports) viewer->addLibraryPath(lib); diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 06fa004..16b0ffb 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -501,6 +501,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) } canvas = new QDeclarativeView(this); + canvas->setAttribute(Qt::WA_OpaquePaintEvent); canvas->setAttribute(Qt::WA_NoSystemBackground); @@ -550,6 +551,16 @@ QDeclarativeViewer::~QDeclarativeViewer() delete namFactory; } +void QDeclarativeViewer::enableExperimentalGestures() +{ + canvas->viewport()->grabGesture(Qt::TapGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent); + canvas->viewport()->grabGesture(Qt::TapAndHoldGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent); + canvas->viewport()->grabGesture(Qt::PanGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent); + canvas->viewport()->grabGesture(Qt::PinchGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent); + canvas->viewport()->grabGesture(Qt::SwipeGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent); + canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents); +} + int QDeclarativeViewer::menuBarHeight() const { if (!(windowFlags() & Qt::FramelessWindowHint)) diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 9551090..b021d0d 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -112,6 +112,8 @@ public: QDeclarativeView *view() const; LoggerWidget *warningsWidget() const; + void enableExperimentalGestures(); + public slots: void sceneResized(QSize size); bool open(const QString&); -- cgit v0.12 From 355bacaa767f48014478d91e3d79f19f966c9756 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 11 May 2010 16:50:24 +1000 Subject: Ensure QPixmapCache does not flush pixmaps that are still in use. Task-number: QTBUG-10576 Reviewed-by: Alexis Menard --- src/gui/image/qpixmapcache.cpp | 43 ++++++++++++++++++++++++++-- src/gui/image/qpixmapcache.h | 10 +++++++ src/gui/image/qpixmapcache_p.h | 2 ++ tests/auto/qpixmapcache/tst_qpixmapcache.cpp | 34 +++++++++++++++------- 4 files changed, 77 insertions(+), 12 deletions(-) diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 5fc605a..7a6a73f 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#define Q_TEST_QPIXMAPCACHE #include "qpixmapcache.h" #include "qobject.h" #include "qdebug.h" @@ -194,6 +195,9 @@ public: static QPixmapCache::KeyData* getKeyData(QPixmapCache::Key *key); + QList< QPair > allPixmaps() const; + void flushDetachedPixmaps(bool nt); + private: int *keyArray; int theid; @@ -235,10 +239,9 @@ QPMCache::~QPMCache() When the last pixmap has been deleted from the cache, kill the timer so Qt won't keep the CPU from going into sleep mode. */ -void QPMCache::timerEvent(QTimerEvent *) +void QPMCache::flushDetachedPixmaps(bool nt) { int mc = maxCost(); - bool nt = totalCost() == ps; setMaxCost(nt ? totalCost() * 3 / 4 : totalCost() -1); setMaxCost(mc); ps = totalCost(); @@ -252,6 +255,12 @@ void QPMCache::timerEvent(QTimerEvent *) ++it; } } +} + +void QPMCache::timerEvent(QTimerEvent *) +{ + bool nt = totalCost() == ps; + flushDetachedPixmaps(nt); if (!size()) { killTimer(theid); @@ -263,6 +272,7 @@ void QPMCache::timerEvent(QTimerEvent *) } } + QPixmap *QPMCache::object(const QString &key) const { QPixmapCache::Key cacheKey = cacheKeys.value(key); @@ -422,6 +432,20 @@ QPixmapCache::KeyData* QPMCache::getKeyData(QPixmapCache::Key *key) return key->d; } +QList< QPair > QPMCache::allPixmaps() const +{ + QList< QPair > r; + QHash::const_iterator it = cacheKeys.begin(); + while (it != cacheKeys.end()) { + QPixmap *ptr = QCache::object(it.value()); + if (ptr) + r.append(QPair(it.key(),*ptr)); + ++it; + } + return r; +} + + Q_GLOBAL_STATIC(QPMCache, pm_cache) int Q_AUTOTEST_EXPORT q_QPixmapCache_keyHashSize() @@ -633,4 +657,19 @@ void QPixmapCache::clear() } } +void QPixmapCache::flushDetachedPixmaps() +{ + pm_cache()->flushDetachedPixmaps(true); +} + +int QPixmapCache::totalUsed() +{ + return (pm_cache()->totalCost()+1023) / 1024; +} + +QList< QPair > QPixmapCache::allPixmaps() +{ + return pm_cache()->allPixmaps(); +} + QT_END_NAMESPACE diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h index 50a9369..e9c8c15 100644 --- a/src/gui/image/qpixmapcache.h +++ b/src/gui/image/qpixmapcache.h @@ -44,6 +44,10 @@ #include +#ifdef Q_TEST_QPIXMAPCACHE +#include +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -83,6 +87,12 @@ public: static void remove(const QString &key); static void remove(const Key &key); static void clear(); + +#ifdef Q_TEST_QPIXMAPCACHE + static void flushDetachedPixmaps(); + static int totalUsed(); + static QList< QPair > allPixmaps(); +#endif }; QT_END_NAMESPACE diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h index 86a1b78..825f272 100644 --- a/src/gui/image/qpixmapcache_p.h +++ b/src/gui/image/qpixmapcache_p.h @@ -95,6 +95,8 @@ public: QPixmapCache::Key key; }; +inline bool qIsDetached(QPixmapCacheEntry &t) { return t.isDetached(); } + QT_END_NAMESPACE #endif // QPIXMAPCACHE_P_H diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp index f8951f5..70f2ac3 100644 --- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#define Q_TEST_QPIXMAPCACHE #include @@ -152,6 +153,7 @@ void tst_QPixmapCache::setCacheLimit() p1 = new QPixmap(2, 3); key = QPixmapCache::insert(*p1); QVERIFY(QPixmapCache::find(key, p1) != 0); + p1->detach(); // dectach so that the cache thinks no-one is using it. QPixmapCache::setCacheLimit(0); QVERIFY(QPixmapCache::find(key, p1) == 0); QPixmapCache::setCacheLimit(1000); @@ -169,6 +171,8 @@ void tst_QPixmapCache::setCacheLimit() key = QPixmapCache::insert(*p1); QVERIFY(QPixmapCache::find(key, &p2) != 0); //we flush the cache + p1->detach(); + p2.detach(); QPixmapCache::setCacheLimit(0); QPixmapCache::setCacheLimit(1000); QPixmapCache::Key key2 = QPixmapCache::insert(*p1); @@ -180,21 +184,25 @@ void tst_QPixmapCache::setCacheLimit() delete p1; //Here we simulate the flushing when the app is idle - /*QPixmapCache::clear(); + QPixmapCache::clear(); QPixmapCache::setCacheLimit(originalCacheLimit); p1 = new QPixmap(300, 300); key = QPixmapCache::insert(*p1); + p1->detach(); QCOMPARE(getPrivate(key)->key, 1); key2 = QPixmapCache::insert(*p1); + p1->detach(); key2 = QPixmapCache::insert(*p1); + p1->detach(); QPixmapCache::Key key3 = QPixmapCache::insert(*p1); - QTest::qWait(32000); + p1->detach(); + QPixmapCache::flushDetachedPixmaps(); key2 = QPixmapCache::insert(*p1); QCOMPARE(getPrivate(key2)->key, 1); //This old key is not valid anymore after the flush QCOMPARE(getPrivate(key)->isValid, false); QVERIFY(QPixmapCache::find(key, &p2) == 0); - delete p1;*/ + delete p1; } void tst_QPixmapCache::find() @@ -225,12 +233,14 @@ void tst_QPixmapCache::find() QPixmapCache::clear(); QPixmapCache::setCacheLimit(128); - key = QPixmapCache::insert(p1); + QPixmap p4(10,10); + key = QPixmapCache::insert(p4); + p4.detach(); - //The int part of the API + QPixmap p5(10,10); QList keys; for (int i = 0; i < 4000; ++i) - QPixmapCache::insert(p1); + QPixmapCache::insert(p5); //at that time the first key has been erase because no more place in the cache QVERIFY(QPixmapCache::find(key, &p1) == 0); @@ -257,8 +267,10 @@ void tst_QPixmapCache::insert() QPixmapCache::insert("0", p1); // ditto - for (int j = 0; j < numberOfKeys; ++j) - QPixmapCache::insert(QString::number(j), p1); + for (int j = 0; j < numberOfKeys; ++j) { + QPixmap p3(10, 10); + QPixmapCache::insert(QString::number(j), p3); + } int num = 0; for (int k = 0; k < numberOfKeys; ++k) { @@ -286,8 +298,10 @@ void tst_QPixmapCache::insert() //The int part of the API // make sure it doesn't explode QList keys; - for (int i = 0; i < numberOfKeys; ++i) - keys.append(QPixmapCache::insert(p1)); + for (int i = 0; i < numberOfKeys; ++i) { + QPixmap p3(10,10); + keys.append(QPixmapCache::insert(p3)); + } num = 0; for (int k = 0; k < numberOfKeys; ++k) { -- cgit v0.12 From 0f9f07c52310c33433dcdf5db3e9d02c695b85af Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 12 May 2010 08:45:12 +1000 Subject: Document Component::createObject() parent argument. Task-number: QTBUG-10617 --- src/declarative/QmlChanges.txt | 4 ++-- src/declarative/qml/qdeclarativecomponent.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index dfc4244..9f618d8 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -7,7 +7,7 @@ Component: isReady, isLoading, isError and isNull properties removed, use QList models no longer provide properties in model object. The properties are now updated when the object changes. An object's property "foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo" - +component.createObject has gained a mandatory "parent" argument C++ API ------- @@ -15,7 +15,7 @@ QDeclarativeExpression::value() has been renamed to QDeclarativeExpression::evaluate() ============================================================================= -The changes below are pre Qt 4.7.0 beta +The changes below are pre Qt 4.7.0 beta 1 TextEdit: wrap property is replaced by wrapMode enumeration. Text: wrap property is replaced by wrapMode enumeration. diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index afdaee8..e757675 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -545,7 +545,7 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q } /*! - \qmlmethod object Component::createObject() + \qmlmethod object Component::createObject(parent) Returns an object instance from this component, or null if object creation fails. The object will be created in the same context as the one in which the component -- cgit v0.12 From 6527735ff53a8ec593f5f85b037de46059e1207e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 12 May 2010 09:24:30 +1000 Subject: Ensure PathView "attribute" attached properties are created correctly If an item was created spontaneously (i.e. delegate is a package and some other view created the item), ensure its attached properties are correctly initialized. Task-number: QTBUG-10527 --- src/declarative/graphicsitems/qdeclarativepath.cpp | 11 +++ .../graphicsitems/qdeclarativepathview.cpp | 42 ++++++++--- .../graphicsitems/qdeclarativepathview_p.h | 1 + .../qdeclarativepathview/data/pathview_package.qml | 88 ++++++++++++++++++++++ .../tst_qdeclarativepathview.cpp | 17 +++++ 5 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index 4d8b619..3d0df87 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -322,6 +322,17 @@ QPainterPath QDeclarativePath::path() const QStringList QDeclarativePath::attributes() const { Q_D(const QDeclarativePath); + if (!d->componentComplete) { + QSet attrs; + + // First gather up all the attributes + foreach (QDeclarativePathElement *pathElement, d->_pathElements) { + if (QDeclarativePathAttribute *attribute = + qobject_cast(pathElement)) + attrs.insert(attribute->name()); + } + return attrs.toList(); + } return d->_attributes; } diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 040fc98..503d096 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -98,9 +98,8 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex) if (!attType) { // pre-create one metatype to share with all attached objects attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(q)); - foreach(const QString &attr, path->attributes()) { + foreach(const QString &attr, path->attributes()) attType->createProperty(attr.toUtf8()); - } } qPathViewAttachedType = attType; QDeclarativePathViewAttached *att = static_cast(qmlAttachedPropertiesObject(item)); @@ -418,7 +417,7 @@ void QDeclarativePathView::setModel(const QVariant &model) d->model = vim; } else { if (!d->ownModel) { - d->model = new QDeclarativeVisualDataModel(qmlContext(this)); + d->model = new QDeclarativeVisualDataModel(qmlContext(this), this); d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast(d->model)) @@ -471,12 +470,14 @@ void QDeclarativePathView::setPath(QDeclarativePath *path) disconnect(d->path, SIGNAL(changed()), this, SLOT(refill())); d->path = path; connect(d->path, SIGNAL(changed()), this, SLOT(refill())); - d->clear(); - if (d->attType) { - d->attType->release(); - d->attType = 0; + if (d->isValid() && isComponentComplete()) { + d->clear(); + if (d->attType) { + d->attType->release(); + d->attType = 0; + } + d->regenerate(); } - d->regenerate(); emit pathChanged(); } @@ -1119,7 +1120,8 @@ void QDeclarativePathView::refill() while ((pos > startPos || !d->items.count()) && d->items.count() < count) { // qDebug() << "append" << idx; QDeclarativeItem *item = d->getItem(idx); - item->setZValue(idx+1); + if (d->model->completePending()) + item->setZValue(idx+1); if (d->currentIndex == idx) { item->setFocus(true); if (QDeclarativePathViewAttached *att = d->attached(item)) @@ -1132,7 +1134,8 @@ void QDeclarativePathView::refill() d->firstIndex = idx; d->items.append(item); d->updateItem(item, pos); - d->model->completeItem(); + if (d->model->completePending()) + d->model->completeItem(); ++idx; if (idx >= d->model->count()) idx = 0; @@ -1146,7 +1149,8 @@ void QDeclarativePathView::refill() while (pos >= 0.0 && pos < startPos) { // qDebug() << "prepend" << idx; QDeclarativeItem *item = d->getItem(idx); - item->setZValue(idx+1); + if (d->model->completePending()) + item->setZValue(idx+1); if (d->currentIndex == idx) { item->setFocus(true); if (QDeclarativePathViewAttached *att = d->attached(item)) @@ -1157,7 +1161,8 @@ void QDeclarativePathView::refill() } d->items.prepend(item); d->updateItem(item, pos); - d->model->completeItem(); + if (d->model->completePending()) + d->model->completeItem(); d->firstIndex = idx; idx = d->firstIndex - 1; if (idx < 0) @@ -1269,6 +1274,19 @@ void QDeclarativePathView::createdItem(int index, QDeclarativeItem *item) { Q_D(QDeclarativePathView); if (d->requestedIndex != index) { + if (!d->attType) { + // pre-create one metatype to share with all attached objects + d->attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(this)); + foreach(const QString &attr, d->path->attributes()) + d->attType->createProperty(attr.toUtf8()); + } + qPathViewAttachedType = d->attType; + QDeclarativePathViewAttached *att = static_cast(qmlAttachedPropertiesObject(item)); + qPathViewAttachedType = 0; + if (att) { + att->m_view = this; + att->setOnPath(false); + } item->setParentItem(this); d->updateItem(item, index < d->firstIndex ? 0.0 : 1.0); } diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h index 7240578..85f47fd 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h @@ -215,6 +215,7 @@ Q_SIGNALS: private: friend class QDeclarativePathViewPrivate; + friend class QDeclarativePathView; QDeclarativePathView *m_view; QDeclarativeOpenMetaObject *m_metaobject; bool m_onPath : 1; diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml new file mode 100644 index 0000000..082da13 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml @@ -0,0 +1,88 @@ +import Qt 4.7 + +Item { + width: 800; height: 600 + Component { + id: photoDelegate + Package { + Item { id: pathItem; objectName: "pathItem"; Package.name: 'path'; width: 85; height: 85; scale: pathItem.PathView.scale } + Item { id: linearItem; Package.name: 'linear'; width: 85; height: 85 } + Rectangle { + id: wrapper + width: 85; height: 85; color: lColor + + transform: Rotation { + id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 + axis.y: 1; axis.z: 0 + } + state: 'path' + states: [ + State { + name: 'path' + ParentChange { target: wrapper; parent: pathItem; x: 0; y: 0 } + PropertyChanges { target: wrapper; opacity: pathItem.PathView.onPath ? 1.0 : 0 } + } + ] + } + } + } + ListModel { + id: rssModel + ListElement { lColor: "red" } + ListElement { lColor: "green" } + ListElement { lColor: "yellow" } + ListElement { lColor: "blue" } + ListElement { lColor: "purple" } + ListElement { lColor: "gray" } + ListElement { lColor: "brown" } + ListElement { lColor: "thistle" } + } + VisualDataModel { id: visualModel; model: rssModel; delegate: photoDelegate } + + PathView { + id: photoPathView + objectName: "photoPathView" + width: 800; height: 330; pathItemCount: 4; offset: 1 + dragMargin: 24 + preferredHighlightBegin: 0.50 + preferredHighlightEnd: 0.50 + + path: Path { + startX: -50; startY: 40; + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: -45 } + + PathCubic { + x: 400; y: 220 + control1X: 140; control1Y: 40 + control2X: 210; control2Y: 220 + } + + PathAttribute { name: "scale"; value: 1.2 } + PathAttribute { name: "angle"; value: 0 } + + PathCubic { + x: 850; y: 40 + control2X: 660; control2Y: 40 + control1X: 590; control1Y: 220 + } + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: 45 } + } + + model: visualModel.parts.path + } + + PathView { + y: 400; width: 800; height: 330; pathItemCount: 8 + + path: Path { + startX: 0; startY: 40; + PathLine { x: 800; y: 40 } + } + + model: visualModel.parts.linear + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index c32e9cc..62d0b89 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -78,6 +78,7 @@ private slots: void componentChanges(); void modelChanges(); void pathUpdateOnStartChanged(); + void package(); private: @@ -695,6 +696,22 @@ void tst_QDeclarativePathView::pathUpdateOnStartChanged() delete canvas; } +void tst_QDeclarativePathView::package() +{ + QDeclarativeView *canvas = createView(); + QVERIFY(canvas); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview_package.qml")); + + QDeclarativePathView *pathView = canvas->rootObject()->findChild("photoPathView"); + QVERIFY(pathView); + + QDeclarativeItem *item = findItem(pathView, "pathItem"); + QVERIFY(item); + QVERIFY(item->scale() != 1.0); + + delete canvas; +} + QDeclarativeView *tst_QDeclarativePathView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); -- cgit v0.12 From 6a3bbb128046942b169a3f7e6c0cf14397662d83 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 7 May 2010 15:58:10 +1000 Subject: Clean up --- doc/src/declarative/qdeclarativeintro.qdoc | 5 ++++- examples/declarative/xmldata/daringfireball.qml | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc index a98c9e1..acf4ec9 100644 --- a/doc/src/declarative/qdeclarativeintro.qdoc +++ b/doc/src/declarative/qdeclarativeintro.qdoc @@ -60,10 +60,13 @@ technologies like HTML and CSS, but it's not required. QML looks like this: \code +import Qt 4.7 + Rectangle { width: 200 height: 200 - color: "white" + color: "blue" + Image { source: "pics/logo.png" anchors.centerIn: parent diff --git a/examples/declarative/xmldata/daringfireball.qml b/examples/declarative/xmldata/daringfireball.qml index a1df809..480b13c 100644 --- a/examples/declarative/xmldata/daringfireball.qml +++ b/examples/declarative/xmldata/daringfireball.qml @@ -1,7 +1,6 @@ import Qt 4.7 Rectangle { - color: "white" width: 600; height: 600 XmlListModel { -- cgit v0.12 From ef23de2b16f3eaf6621c9407f7d921d55e380982 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 11 May 2010 11:53:25 +1000 Subject: QDeclarativeViewPrivate should subclass QGraphicsViewPrivate Task-number: QTBUG-10528 --- src/declarative/util/qdeclarativeview.cpp | 45 ++++++++++++++++++++++--------- src/declarative/util/qdeclarativeview.h | 3 +-- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 833e284..e68ef94 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -128,19 +128,18 @@ void FrameBreakAnimation::updateCurrentTime(int msecs) server->frameBreak(); } -class QDeclarativeViewPrivate : public QDeclarativeItemChangeListener +class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarativeItemChangeListener { + Q_DECLARE_PUBLIC(QDeclarativeView) public: - QDeclarativeViewPrivate(QDeclarativeView *view) - : q(view), root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {} + QDeclarativeViewPrivate() + : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {} ~QDeclarativeViewPrivate() { delete root; } void execute(); void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry); void initResize(); void updateSize(); - inline QSize rootObjectSize(); - - QDeclarativeView *q; + inline QSize rootObjectSize() const; QDeclarativeGuard root; QDeclarativeGuard declarativeItemRoot; @@ -162,6 +161,7 @@ public: void QDeclarativeViewPrivate::execute() { + Q_Q(QDeclarativeView); if (root) { delete root; root = 0; @@ -182,6 +182,7 @@ void QDeclarativeViewPrivate::execute() void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry) { + Q_Q(QDeclarativeView); if (resizeItem == root && resizeMode == QDeclarativeView::SizeViewToRootObject) { // wait for both width and height to be changed resizetimer.start(0,q); @@ -250,8 +251,9 @@ void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, Constructs a QDeclarativeView with the given \a parent. */ QDeclarativeView::QDeclarativeView(QWidget *parent) -: QGraphicsView(parent), d(new QDeclarativeViewPrivate(this)) + : QGraphicsView(*(new QDeclarativeViewPrivate), parent) { + Q_D(QDeclarativeView); setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); d->init(); } @@ -262,8 +264,9 @@ QDeclarativeView::QDeclarativeView(QWidget *parent) Constructs a QDeclarativeView with the given QML \a source and \a parent. */ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent) -: QGraphicsView(parent), d(new QDeclarativeViewPrivate(this)) + : QGraphicsView(*(new QDeclarativeViewPrivate), parent) { + Q_D(QDeclarativeView); setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); d->init(); setSource(source); @@ -271,6 +274,7 @@ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent) void QDeclarativeViewPrivate::init() { + Q_Q(QDeclarativeView); q->setScene(&scene); q->setOptimizationFlags(QGraphicsView::DontSavePainterState); @@ -288,12 +292,10 @@ void QDeclarativeViewPrivate::init() } /*! - The destructor clears the view's \l {QGraphicsObject} {items} and - deletes the internal representation. + Destroys the view. */ QDeclarativeView::~QDeclarativeView() { - delete d; } /*! \property QDeclarativeView::source @@ -316,6 +318,7 @@ QDeclarativeView::~QDeclarativeView() */ void QDeclarativeView::setSource(const QUrl& url) { + Q_D(QDeclarativeView); d->source = url; d->execute(); } @@ -327,6 +330,7 @@ void QDeclarativeView::setSource(const QUrl& url) */ QUrl QDeclarativeView::source() const { + Q_D(const QDeclarativeView); return d->source; } @@ -336,6 +340,7 @@ QUrl QDeclarativeView::source() const */ QDeclarativeEngine* QDeclarativeView::engine() { + Q_D(QDeclarativeView); return &d->engine; } @@ -348,6 +353,7 @@ QDeclarativeEngine* QDeclarativeView::engine() */ QDeclarativeContext* QDeclarativeView::rootContext() { + Q_D(QDeclarativeView); return d->engine.rootContext(); } @@ -376,6 +382,7 @@ QDeclarativeContext* QDeclarativeView::rootContext() QDeclarativeView::Status QDeclarativeView::status() const { + Q_D(const QDeclarativeView); if (!d->component) return QDeclarativeView::Null; @@ -388,6 +395,7 @@ QDeclarativeView::Status QDeclarativeView::status() const */ QList QDeclarativeView::errors() const { + Q_D(const QDeclarativeView); if (d->component) return d->component->errors(); return QList(); @@ -410,6 +418,7 @@ QList QDeclarativeView::errors() const void QDeclarativeView::setResizeMode(ResizeMode mode) { + Q_D(QDeclarativeView); if (d->resizeMode == mode) return; @@ -433,6 +442,7 @@ void QDeclarativeView::setResizeMode(ResizeMode mode) void QDeclarativeViewPrivate::initResize() { + Q_Q(QDeclarativeView); if (declarativeItemRoot) { if (resizeMode == QDeclarativeView::SizeViewToRootObject) { QDeclarativeItemPrivate *p = @@ -449,6 +459,7 @@ void QDeclarativeViewPrivate::initResize() void QDeclarativeViewPrivate::updateSize() { + Q_Q(QDeclarativeView); if (!root) return; if (declarativeItemRoot) { @@ -479,7 +490,7 @@ void QDeclarativeViewPrivate::updateSize() q->updateGeometry(); } -QSize QDeclarativeViewPrivate::rootObjectSize() +QSize QDeclarativeViewPrivate::rootObjectSize() const { QSize rootObjectSize(0,0); int widthCandidate = -1; @@ -500,6 +511,7 @@ QSize QDeclarativeViewPrivate::rootObjectSize() QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const { + Q_D(const QDeclarativeView); return d->resizeMode; } @@ -508,7 +520,7 @@ QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const */ void QDeclarativeView::continueExecute() { - + Q_D(QDeclarativeView); disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute())); if (d->component->isError()) { @@ -541,6 +553,7 @@ void QDeclarativeView::continueExecute() */ void QDeclarativeView::setRootObject(QObject *obj) { + Q_D(QDeclarativeView); if (d->root == obj) return; if (QDeclarativeItem *declarativeItem = qobject_cast(obj)) { @@ -590,6 +603,7 @@ void QDeclarativeView::setRootObject(QObject *obj) */ void QDeclarativeView::timerEvent(QTimerEvent* e) { + Q_D(QDeclarativeView); if (!e || e->timerId() == d->resizetimer.timerId()) { d->updateSize(); d->resizetimer.stop(); @@ -599,6 +613,7 @@ void QDeclarativeView::timerEvent(QTimerEvent* e) /*! \reimp */ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e) { + Q_D(QDeclarativeView); if (watched == d->root && d->resizeMode == SizeViewToRootObject) { if (d->graphicsWidgetRoot) { if (e->type() == QEvent::GraphicsSceneResize) { @@ -615,6 +630,7 @@ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e) */ QSize QDeclarativeView::sizeHint() const { + Q_D(const QDeclarativeView); QSize rootObjectSize = d->rootObjectSize(); if (rootObjectSize.isEmpty()) { return size(); @@ -628,6 +644,7 @@ QSize QDeclarativeView::sizeHint() const */ QGraphicsObject *QDeclarativeView::rootObject() const { + Q_D(const QDeclarativeView); return d->root; } @@ -638,6 +655,7 @@ QGraphicsObject *QDeclarativeView::rootObject() const */ void QDeclarativeView::resizeEvent(QResizeEvent *e) { + Q_D(QDeclarativeView); if (d->resizeMode == SizeRootObjectToView) { d->updateSize(); } @@ -657,6 +675,7 @@ void QDeclarativeView::resizeEvent(QResizeEvent *e) */ void QDeclarativeView::paintEvent(QPaintEvent *event) { + Q_D(QDeclarativeView); int time = 0; if (frameRateDebug() || QDeclarativeViewDebugServer::isDebuggingEnabled()) time = d->frameTimer.restart(); diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h index 3513c04..e9cff32 100644 --- a/src/declarative/util/qdeclarativeview.h +++ b/src/declarative/util/qdeclarativeview.h @@ -106,9 +106,8 @@ protected: virtual bool eventFilter(QObject *watched, QEvent *e); private: - friend class QDeclarativeViewPrivate; - QDeclarativeViewPrivate *d; Q_DISABLE_COPY(QDeclarativeView) + Q_DECLARE_PRIVATE(QDeclarativeView) }; QT_END_NAMESPACE -- cgit v0.12 From 0b715811609b86f9332ffd49aea08f4a4b634d21 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 11 May 2010 13:47:08 +1000 Subject: Improve XmlListModel::namespaceDeclarations() docs Task-number: QTBUG-10522 --- src/declarative/util/qdeclarativexmllistmodel.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index ae3b5d7..b9afa1f 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -479,7 +479,6 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty Date: Tue, 11 May 2010 17:23:11 +1000 Subject: Doc improvements --- doc/src/declarative/advtutorial.qdoc | 2 +- doc/src/declarative/codingconventions.qdoc | 1 - doc/src/declarative/extending-examples.qdoc | 8 +-- doc/src/declarative/qmlruntime.qdoc | 2 +- src/declarative/util/qdeclarativexmllistmodel.cpp | 68 +++++++++++++++++------ 5 files changed, 55 insertions(+), 26 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 8f95190..47504ae 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -105,7 +105,7 @@ is the \l SystemPalette item. This provides access to the Qt system palette and is used to give the button a more native look-and-feel. Notice the anchors for the \c Item, \c Button and \c Text elements are set using -\l {codingconventions.html#Grouped-properties}{group notation} for readability. +\l {qdeclarativeintroduction.html#dot-properties}{group notation} for readability. \section2 Adding \c Button and \c Block components diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc index d0f873d..4fa7d0c 100644 --- a/doc/src/declarative/codingconventions.qdoc +++ b/doc/src/declarative/codingconventions.qdoc @@ -72,7 +72,6 @@ For example, a hypothetical \e photo QML object would look like this: \snippet doc/src/snippets/declarative/codingconventions/photo.qml 0 -\target Grouped properties \section1 Grouped properties If using multiple properties from a group of properties, diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc index 307162e..611dac1 100644 --- a/doc/src/declarative/extending-examples.qdoc +++ b/doc/src/declarative/extending-examples.qdoc @@ -64,8 +64,8 @@ element, the C++ class can be named differently, or appear in a namespace. The Person class implementation is quite basic. The property accessors simply return members of the object instance. -The implementation must also be registered using the QML_REGISTER_TYPE() macro. This macro -registers the Person class with QML as a type in the People library version 1.0, +The \c main.cpp file also calls the \c qmlRegisterType() function to +register the \c Person type with QML as a type in the People library version 1.0, and defines the mapping between the C++ and QML class names. \section1 Running the example @@ -159,9 +159,7 @@ directly - an explicit Boy or Girl should be instantiated instead. While we want to disallow instantiating Person from within QML, it still needs to be registered with the QML engine, so that it can be used as a property type -and other types can be coerced to it. To register a type, without defining a -named mapping into QML, we call the QML_REGISTER_NOCREATE_TYPE() macro instead of -the QML_REGISTER_TYPE() macro used previously. +and other types can be coerced to it. \section2 Define Boy and Girl diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc index 23c5c32..10aeac0 100644 --- a/doc/src/declarative/qmlruntime.qdoc +++ b/doc/src/declarative/qmlruntime.qdoc @@ -123,7 +123,7 @@ Such files can be created using \l{Qt Linguist}. - See \l{scripting.html#internationalization} for information about how to make + See the \l{scripting.html#internationalization}{Qt Internationalization} documentation for information about how to make the JavaScript in QML files use translatable strings. Additionally, the QML runtime will load translation files specified on the diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index b9afa1f..f02ed16 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -472,39 +472,71 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty + + ... + + + Item A + Sat, 07 Sep 2010 10:00:01 GMT + + + Item B + Sat, 07 Sep 2010 15:35:01 GMT + + + + \endcode + + Then it could be used to create the following model: - Here is an example of a model containing news from a Yahoo RSS feed: \qml XmlListModel { - source: "http://rss.news.yahoo.com/rss/oceania" + source: "http://www.mysite.com/feed.xml" query: "/rss/channel/item" XmlRole { name: "title"; query: "title/string()" } XmlRole { name: "pubDate"; query: "pubDate/string()" } - XmlRole { name: "description"; query: "description/string()" } } \endqml - You can also define certain roles as "keys" so that the model only adds data - that contains new values for these keys when reload() is called. + The \l {XmlListModel::query}{query} value of "/rss/channel/item" specifies that the XmlListModel should generate + a model item for each \c in the XML document. The XmlRole objects define the + model item attributes; here, each model item will have \c title and \c pubDate + attributes that match the \c title and \c pubDate values of its corresponding \c . - For example, if the roles above were defined like this: + + \section2 Using key XML roles + + You can define certain roles as "keys" so that when reload() is called, + the model will only add and refresh data that contains new values for + these keys. + + For example, if above role for "pubDate" was defined like this instead: \qml - XmlRole { name: "title"; query: "title/string()"; isKey: true } XmlRole { name: "pubDate"; query: "pubDate/string()"; isKey: true } \endqml - Then when reload() is called, the model will only add new items with a - "title" and "pubDate" value combination that is not already present in - the model. + Then when reload() is called, the model will only add and reload + items with a "pubDate" value that is not already + present in the model. - This is useful to provide incremental updates and avoid repainting an - entire model in a view. + This is useful when displaying the contents of XML documents that + are incrementally updated (such as RSS feeds) to avoid repainting the + entire contents of a model in a view. - \sa {QtDeclarative} + If multiple key roles are specified, the model only adds and reload items + with a combined value of all key roles that is not already present in + the model. + + \sa {declarative/xmldata}{XML data example} */ QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent) @@ -625,8 +657,8 @@ void QDeclarativeXmlListModel::setXml(const QString &xml) /*! \qmlproperty string XmlListModel::query - An absolute XPath query representing the base query for the model items. The query should start with - '/' or '//'. + An absolute XPath query representing the base query for creating model items + from this model's XmlRole objects. The query should start with '/' or '//'. */ QString QDeclarativeXmlListModel::query() const { @@ -747,7 +779,7 @@ void QDeclarativeXmlListModel::componentComplete() Otherwise, items are only added if the model does not already contain items with matching key role values. - \sa XmlRole::isKey + \sa {Using key XML roles}, XmlRole::isKey */ void QDeclarativeXmlListModel::reload() { -- cgit v0.12 From 1b2b9ba6b4cea31d679aeae915e590ddbf1da945 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 11 May 2010 03:23:21 +0200 Subject: Don't use Q_UNUSED if you use parameters. That's many "use" in the sentence. Task-number:QT-1652 Reviewed-by:TrustMe --- src/gui/graphicsview/qgraphicsview.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 0bba7e9..9519ca0 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1819,8 +1819,6 @@ void QGraphicsView::centerOn(const QGraphicsItem *item) void QGraphicsView::ensureVisible(const QRectF &rect, int xmargin, int ymargin) { Q_D(QGraphicsView); - Q_UNUSED(xmargin); - Q_UNUSED(ymargin); qreal width = viewport()->width(); qreal height = viewport()->height(); QRectF viewRect = d->matrix.mapRect(rect); -- cgit v0.12 From 855368e447a1db8f72c1ad135b9edfb9c373a01d Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 12 May 2010 11:33:56 +1000 Subject: Qt.widgets was removed, point to graphics layouts example --- doc/src/declarative/integrating.qdoc | 50 ++---------------- .../declarative/graphicswidgets/bluecircle.h | 55 ------------------- .../graphicswidgets/graphicswidgets.pro | 13 ----- .../snippets/declarative/graphicswidgets/main.qml | 32 ------------ .../snippets/declarative/graphicswidgets/qmldir | 1 - .../declarative/graphicswidgets/redsquare.h | 54 ------------------- .../declarative/graphicswidgets/shapesplugin.cpp | 61 ---------------------- 7 files changed, 5 insertions(+), 261 deletions(-) delete mode 100644 doc/src/snippets/declarative/graphicswidgets/bluecircle.h delete mode 100644 doc/src/snippets/declarative/graphicswidgets/graphicswidgets.pro delete mode 100644 doc/src/snippets/declarative/graphicswidgets/main.qml delete mode 100644 doc/src/snippets/declarative/graphicswidgets/qmldir delete mode 100644 doc/src/snippets/declarative/graphicswidgets/redsquare.h delete mode 100644 doc/src/snippets/declarative/graphicswidgets/shapesplugin.cpp diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc index 1c07f8e..972976f 100644 --- a/doc/src/declarative/integrating.qdoc +++ b/doc/src/declarative/integrating.qdoc @@ -110,51 +110,11 @@ of QML UIs: \section2 Loading QGraphicsWidget objects in QML An alternative approach is to expose your existing QGraphicsWidget objects to -QML and construct your scene in QML instead. To do this, you need to register -any custom C++ types and create a plugin that registers the custom types -so that they can be used from your QML file. +QML and construct your scene in QML instead. See the \l {declarative/layouts/graphicsLayouts}{graphics layouts example} +which shows how to expose Qt's graphics layout classes to QML in order +to use QGraphicsWidget with classes like QGraphicsLinearLayout and QGraphicsGridLayout. -Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle, -that both inherit from QGraphicsWidget: - -\c [graphicswidgets/redsquare.h] -\snippet doc/src/snippets/declarative/graphicswidgets/redsquare.h 0 - -\c [graphicswidgets/bluecircle.h] -\snippet doc/src/snippets/declarative/graphicswidgets/bluecircle.h 0 - -Then, create a plugin by subclassing QDeclarativeExtensionPlugin, and register the -types by calling qmlRegisterType(). Also export the plugin with Q_EXPORT_PLUGIN2. - -\c [graphicswidgets/shapesplugin.cpp] -\snippet doc/src/snippets/declarative/graphicswidgets/shapesplugin.cpp 0 - -Now write a project file that creates the plugin: - -\c [graphicswidgets/graphicswidgets.pro] -\quotefile doc/src/snippets/declarative/graphicswidgets/graphicswidgets.pro - -And add a \c qmldir file that includes the \c graphicswidgets plugin from the \c lib -subdirectory (as defined in the project file): - -\c [graphicswidgets/qmldir] -\quotefile doc/src/snippets/declarative/graphicswidgets/qmldir - -Now, we can write a QML file that uses the \c RedSquare and \c BlueCircle widgets. -(As an example, we can also create \c QGraphicsWidget items if we import the \c Qt.widgets -module.) - -\c [main.qml] -\quotefile doc/src/snippets/declarative/graphicswidgets/main.qml - -Here is a screenshot of the result: - -\image declarative-integrating-graphicswidgets.png - - -Note this approach of creating your graphics objects from QML does not work -with QGraphicsItems that are not QGraphicsObject-based, since they are not QObjects. - -See \l{Extending QML in C++} for further information on using C++ types. +To expose your existing QGraphicsWidget classes to QML, use \l {qmlRegisterType()}. +See \l{Extending QML in C++} for further information on using C++ types in QML. */ diff --git a/doc/src/snippets/declarative/graphicswidgets/bluecircle.h b/doc/src/snippets/declarative/graphicswidgets/bluecircle.h deleted file mode 100644 index 73d66b7..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/bluecircle.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -#include -#include - -class BlueCircle : public QGraphicsWidget -{ - Q_OBJECT -public: - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) - { - painter->setPen(QColor(Qt::blue)); - painter->drawEllipse(0, 0, size().width(), size().height()); - } -}; -//![0] diff --git a/doc/src/snippets/declarative/graphicswidgets/graphicswidgets.pro b/doc/src/snippets/declarative/graphicswidgets/graphicswidgets.pro deleted file mode 100644 index 21c8a37..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/graphicswidgets.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE = lib -CONFIG += qt plugin -QT += declarative - -HEADERS += redsquare.h \ - bluecircle.h - -SOURCES += shapesplugin.cpp - -DESTDIR = lib -OBJECTS_DIR = tmp -MOC_DIR = tmp - diff --git a/doc/src/snippets/declarative/graphicswidgets/main.qml b/doc/src/snippets/declarative/graphicswidgets/main.qml deleted file mode 100644 index ffcf79d..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/main.qml +++ /dev/null @@ -1,32 +0,0 @@ -import Qt 4.7 -import Qt.widgets 4.7 - -Rectangle { - width: 200 - height: 200 - - RedSquare { - id: square - width: 80 - height: 80 - } - - BlueCircle { - anchors.left: square.right - width: 80 - height: 80 - } - - QGraphicsWidget { - anchors.top: square.bottom - size.width: 80 - size.height: 80 - layout: QGraphicsLinearLayout { - LayoutItem { - preferredSize: "100x100" - Rectangle { color: "yellow"; anchors.fill: parent } - } - } - } -} - diff --git a/doc/src/snippets/declarative/graphicswidgets/qmldir b/doc/src/snippets/declarative/graphicswidgets/qmldir deleted file mode 100644 index f94dad2..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin graphicswidgets lib diff --git a/doc/src/snippets/declarative/graphicswidgets/redsquare.h b/doc/src/snippets/declarative/graphicswidgets/redsquare.h deleted file mode 100644 index 3050662..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/redsquare.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -#include -#include - -class RedSquare : public QGraphicsWidget -{ - Q_OBJECT -public: - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) - { - painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red)); - } -}; -//![0] diff --git a/doc/src/snippets/declarative/graphicswidgets/shapesplugin.cpp b/doc/src/snippets/declarative/graphicswidgets/shapesplugin.cpp deleted file mode 100644 index 4c18ef3..0000000 --- a/doc/src/snippets/declarative/graphicswidgets/shapesplugin.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These