summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-14 18:44:22 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-14 18:44:22 (GMT)
commit1d0ddf8037c068ff584dda60cffeb6b2b506d4b2 (patch)
treefe330dc2dc3290b58d3d7de1aab6a7dd03b0a6a4 /src/declarative
parent372136f7d6e321d42a134cb6d8aac7723dd572e7 (diff)
parent29e3302213cd5b33c01ee0ba7c5fe3d036faf902 (diff)
downloadQt-1d0ddf8037c068ff584dda60cffeb6b2b506d4b2.zip
Qt-1d0ddf8037c068ff584dda60cffeb6b2b506d4b2.tar.gz
Qt-1d0ddf8037c068ff584dda60cffeb6b2b506d4b2.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: Docs: implications of creating network access managers in other threads Clarify that XmlListModel is read only Revert a fix made for bug QTBUG-15341
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h1
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp53
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp4
4 files changed, 35 insertions, 37 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 1042cf1..e05f4e4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -994,20 +994,6 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
QDeclarativeItemPrivate::focusChanged(hasFocus);
}
-void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event)
-{
- Q_D(QDeclarativeTextEdit);
- if (event->reason() != Qt::ActiveWindowFocusReason
- && event->reason() != Qt::PopupFocusReason) {
- QTextCursor cursor = d->control->textCursor();
- if (cursor.hasSelection()) {
- cursor.clearSelection();
- d->control->setTextCursor(cursor);
- }
- }
- QDeclarativePaintedItem::focusOutEvent(event);
-}
-
/*!
\qmlmethod void TextEdit::selectAll()
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 6826cb5..68fde3d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -249,7 +249,6 @@ protected:
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
void focusInEvent(QFocusEvent *event);
- void focusOutEvent(QFocusEvent *event);
// mouse filter?
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
index d22798d..36e9721 100644
--- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
@@ -46,27 +46,44 @@ QT_BEGIN_NAMESPACE
/*!
\class QDeclarativeNetworkAccessManagerFactory
\since 4.7
- \brief The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager for use by a Qt Declarative engine.
+ \brief The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML engine.
- QNetworkAccessManager is used for all network access by QML.
- By implementing a factory it is possible to create custom
- QNetworkAccessManager with specialized caching, proxy and
- cookie support.
+ A QML engine uses QNetworkAccessManager for all network access.
+ By implementing a factory, it is possible to provide the QML engine
+ with custom QNetworkAccessManager instances with specialized caching,
+ proxy and cookies support.
- To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and implement
- the create() method.
+ To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and
+ implement the virtual create() method, then assign it to the relevant QML
+ engine using QDeclarativeEngine::setNetworkAccessManagerFactory().
- To use a factory, assign it to the relevant QDeclarativeEngine using
- QDeclarativeEngine::setNetworkAccessManagerFactory().
+ Note the QML engine may create QNetworkAccessManager instances
+ from multiple threads. Because of this, the implementation of the create()
+ method must be \l{Reentrancy and Thread-Safety}{reentrant}. In addition,
+ the developer should be careful if the signals of the object to be
+ returned from create() are connected to the slots of an object that may
+ be created in a different thread:
- Note: the create() method may be called by multiple threads, so ensure the
- implementation of this method is reentrant.
+ \list
+ \o The QML engine internally handles all requests, and cleans up any
+ QNetworkReply objects it creates. Receiving the
+ QNetworkAccessManager::finished() signal in another thread may not
+ provide the receiver with a valid reply object if it has already
+ been deleted.
+ \o Authentication details provided to QNetworkAccessManager::authenticationRequired()
+ must be provided immediately, so this signal cannot be connected as a
+ Qt::QueuedConnection (or as the default Qt::AutoConnection from another
+ thread).
+ \endlist
+
+ For more information about signals and threads, see
+ \l {Threads and QObjects} and \l {Signals and Slots Across Threads}.
- \sa QDeclarativeEngine::setNetworkAccessManagerFactory(), {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
+ \sa {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
*/
/*!
- The destructor is empty.
+ Destroys the factory. The default implementation does nothing.
*/
QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory()
{
@@ -75,13 +92,9 @@ QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactor
/*!
\fn QNetworkAccessManager *QDeclarativeNetworkAccessManagerFactory::create(QObject *parent)
- Implement this method to create a QNetworkAccessManager with \a parent.
- This allows proxies, caching and cookie support to be setup appropriately.
-
- This method must return a new QNetworkAccessManager each time it is called.
- The parent of the QNetworkAccessManager must be the \a parent provided.
- The QNetworkAccessManager(s) created by this
- function will be destroyed automatically when their parent is destroyed.
+ Creates and returns a network access manager with the specified \a parent.
+ This method must return a new QNetworkAccessManager instance each time
+ it is called.
Note: this method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index ce5b483..49a12b1 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -503,9 +503,9 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
\qmlclass XmlListModel QDeclarativeXmlListModel
\ingroup qml-working-with-data
\since 4.7
- \brief The XmlListModel element is used to specify a model using XPath expressions.
+ \brief The XmlListModel element is used to specify a read-only model using XPath expressions.
- XmlListModel is used to create a model from XML data. It can be used as a data source
+ XmlListModel is used to create a read-only model from XML data. It can be used as a data source
for view elements (such as ListView, PathView, GridView) and other elements that interact with model
data (such as \l Repeater).