summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-06 17:00:40 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-06 17:00:40 (GMT)
commit4f5017995bd493c30c5e0321711f2e1759b4189c (patch)
treee156adab0021995413d0be016768d00629a808e7 /src
parent6af078b2a13f4855a35d48376e58154ee2d57ec1 (diff)
parentad512e135ec6407323516526f09f03070d373d2e (diff)
downloadQt-4f5017995bd493c30c5e0321711f2e1759b4189c.zip
Qt-4f5017995bd493c30c5e0321711f2e1759b4189c.tar.gz
Qt-4f5017995bd493c30c5e0321711f2e1759b4189c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Document support for QVariantList and QVariantMap type conversion Some doc clarification for components and javascript integration Cursor shouldn't blink while dragging cursor position Qt.include() docs weren't being picked up by qdoc Doc: make it clear that "z" affects sibling stacking order.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp1
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp28
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp27
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp24
-rw-r--r--src/gui/widgets/qlinecontrol.cpp9
-rw-r--r--src/gui/widgets/qlinecontrol_p.h1
7 files changed, 58 insertions, 36 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9d6fe12..932e68f 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1809,9 +1809,9 @@ void QDeclarativeItem::setClip(bool c)
/*!
\qmlproperty real Item::z
- Sets the stacking order of the item. By default the stacking order is 0.
+ Sets the stacking order of sibling items. By default the stacking order is 0.
- Items with a higher stacking value are drawn on top of items with a
+ Items with a higher stacking value are drawn on top of siblings with a
lower stacking order. Items with the same stacking value are drawn
bottom up in the order they appear. Items with a negative stacking
value are drawn under their parent's content.
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index f8421a3..df103de 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -1479,6 +1479,7 @@ void QDeclarativeTextInput::cursorPosChanged()
updateRect();//TODO: Only update rect between pos's
updateMicroFocus();
emit cursorPositionChanged();
+ d->control->resetCursorBlinkTimer();
if(!d->control->hasSelectedText()){
if(d->lastSelectionStart != d->control->cursor()){
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 63bde0f..77fc925 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -147,32 +147,36 @@ class QByteArray;
Components are reusable, encapsulated QML elements with well-defined interfaces.
Components are often defined by \l {qdeclarativedocuments.html}{component files} -
- that is, \c .qml files. The \e Component element allows components to be defined
- within QML items rather than in a separate file. This may be useful for reusing
- a small component within a QML file, or for defining a component that logically
- belongs with other QML components within a file.
+ that is, \c .qml files. The \e Component element essentially allows QML components
+ to be defined inline, within a \l {QML Document}{QML document}, rather than as a separate QML file.
+ This may be useful for reusing a small component within a QML file, or for defining
+ a component that logically belongs with other QML components within a file.
For example, here is a component that is used by multiple \l Loader objects.
- It contains a top level \l Rectangle item:
+ It contains a single item, a \l Rectangle:
\snippet doc/src/snippets/declarative/component.qml 0
Notice that while a \l Rectangle by itself would be automatically
rendered and displayed, this is not the case for the above rectangle
because it is defined inside a \c Component. The component encapsulates the
- QML elements within, as if they were defined in a separate \c .qml
+ QML elements within, as if they were defined in a separate QML
file, and is not loaded until requested (in this case, by the
two \l Loader objects).
- A Component cannot contain anything other
- than an \c id and a single top level item. While the \c id is optional,
- the top level item is not; you cannot define an empty component.
+ Defining a \c Component is similar to defining a \l {QML Document}{QML document}.
+ A QML document has a single top-level item that defines the behaviors and
+ properties of that component, and cannot define properties or behaviors outside
+ of that top-level item. In the same way, a \c Component definition contains a single
+ top level item (which in the above example is a \l Rectangle) and cannot define any
+ data outside of this item, with the exception of an \e id (which in the above example
+ is \e redSquare).
- The Component element is commonly used to provide graphical components
- for views. For example, the ListView::delegate property requires a Component
+ The \c Component element is commonly used to provide graphical components
+ for views. For example, the ListView::delegate property requires a \c Component
to specify how each list item is to be displayed.
- Component objects can also be dynamically created using
+ \c Component objects can also be created dynamically using
\l{QML:Qt::createComponent()}{Qt.createComponent()}.
*/
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index a8404f0..201e675 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -261,6 +261,33 @@ of their use.
\endlist
*/
+/*!
+\qmlmethod object Qt::include(string url, jsobject callback)
+
+Includes another JavaScript file. This method can only be used from within JavaScript files,
+and not regular QML files.
+
+This imports all functions from \a url into the current script's namespace.
+
+Qt.include() returns an object that describes the status of the operation. The object has
+a single property, \c {status}, that is set to one of the following values:
+
+\table
+\header \o Symbol \o Value \o Description
+\row \o result.OK \o 0 \o The include completed successfully.
+\row \o result.LOADING \o 1 \o Data is being loaded from the network.
+\row \o result.NETWORK_ERROR \o 2 \o A network error occurred while fetching the url.
+\row \o result.EXCEPTION \o 3 \o A JavaScript exception occurred while executing the included code.
+An additional \c exception property will be set in this case.
+\endtable
+
+The \c status property will be updated as the operation progresses.
+
+If provided, \a callback is invoked when the operation completes. The callback is passed
+the same object as is returned from the Qt.include() call.
+*/
+// Qt.include() is implemented in qdeclarativeinclude.cpp
+
QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
: captureProperties(false), rootContext(0), isDebugging(false),
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
index 1e240d7..a9ecdda 100644
--- a/src/declarative/qml/qdeclarativeinclude.cpp
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -172,28 +172,8 @@ void QDeclarativeInclude::callback(QScriptEngine *engine, QScriptValue &callback
}
}
-/*!
-\qmlmethod object Qt::include(string url, jsobject callback)
-
-Include another JavaScript file. This method can only be used from within JavaScript files,
-and not regular QML files.
-
-Qt.include() returns an object that describes the status of the operation. The object has
-a single property, \c {status} that is set to one of the following values:
-
-\table
-\header \o Symbol \o Value \o Description
-\row \o result.OK \o 0 \o The include completed successfully.
-\row \o result.LOADING \o 1 \o Data is being loaded from the network.
-\row \o result.NETWORK_ERROR \o 2 \o A network error occurred while fetching the url.
-\row \o result.EXCEPTION \o 3 \o A JavaScript exception occurred while executing the included code.
-An additional \c exception property will be set in this case.
-\endtable
-
-The return object's properties will be updated as the operation progresses.
-
-If provided, \a callback is invoked when the operation completes. The callback is passed
-the same object as is returned from the Qt.include() call.
+/*
+ Documented in qdeclarativeengine.cpp
*/
QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *engine)
{
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index f338f40..5ea9dc4 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1308,6 +1308,15 @@ void QLineControl::setCursorBlinkPeriod(int msec)
m_blinkPeriod = msec;
}
+void QLineControl::resetCursorBlinkTimer()
+{
+ if (m_blinkPeriod == 0 || m_blinkTimer == 0)
+ return;
+ killTimer(m_blinkTimer);
+ m_blinkTimer = startTimer(m_blinkPeriod / 2);
+ m_blinkStatus = 1;
+}
+
void QLineControl::timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_blinkTimer) {
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index 7068f62..d881acf 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -296,6 +296,7 @@ public:
int cursorBlinkPeriod() const { return m_blinkPeriod; }
void setCursorBlinkPeriod(int msec);
+ void resetCursorBlinkTimer();
QString cancelText() const { return m_cancelText; }
void setCancelText(const QString &text) { m_cancelText = text; }