aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-18 16:07:54 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-18 16:07:55 +0100
commit4d99e5bb809bffbbfd3fb5e6bad34afd991beb1e (patch)
tree8d3ac63676dc90361bf561ce1eb052fd7229dc26 /src
parent4d3a64c5e65a781acb4acf4ba641456da28bd1e4 (diff)
parent7726da293c4e54aedb1ef69138f168d59692c1e8 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/src/cppintegration/interactqmlfromcpp.qdoc4
-rw-r--r--src/quick/designer/designersupport.cpp1
-rw-r--r--src/quick/doc/src/appdevguide/internationalization.qdoc2
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc42
-rw-r--r--src/quick/doc/src/concepts/positioning/anchors.qdoc9
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile.cpp4
-rw-r--r--src/quick/items/qquickrepeater.cpp5
-rw-r--r--src/quick/items/qquicktextinput.cpp2
-rw-r--r--src/quick/items/qquickwindow.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp3
10 files changed, 43 insertions, 31 deletions
diff --git a/src/qml/doc/src/cppintegration/interactqmlfromcpp.qdoc b/src/qml/doc/src/cppintegration/interactqmlfromcpp.qdoc
index 31a68d34fa..04b278106f 100644
--- a/src/qml/doc/src/cppintegration/interactqmlfromcpp.qdoc
+++ b/src/qml/doc/src/cppintegration/interactqmlfromcpp.qdoc
@@ -147,8 +147,8 @@ custom element \c PushButton with a \c buttonText property that internally
reflects the value of a \c m_buttonText member variable. Modifying the member
variable directly like this is not a good idea:
-\badcode
-// BAD!
+\code
+//bad code
QQmlComponent component(engine, "MyButton.qml");
PushButton *button = qobject_cast<PushButton*>(component.create());
button->m_buttonText = "Click me";
diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp
index 915c87e51e..7f75857fe4 100644
--- a/src/quick/designer/designersupport.cpp
+++ b/src/quick/designer/designersupport.cpp
@@ -125,6 +125,7 @@ QImage DesignerSupport::renderImageForItem(QQuickItem *referencedItem, const QRe
return QImage();
renderTexture->setRect(boundingRect);
renderTexture->setSize(imageSize);
+ renderTexture->setItem(QQuickItemPrivate::get(referencedItem)->rootNode());
renderTexture->markDirtyTexture();
renderTexture->updateTexture();
diff --git a/src/quick/doc/src/appdevguide/internationalization.qdoc b/src/quick/doc/src/appdevguide/internationalization.qdoc
index c9bec86ebd..bf6b667a01 100644
--- a/src/quick/doc/src/appdevguide/internationalization.qdoc
+++ b/src/quick/doc/src/appdevguide/internationalization.qdoc
@@ -262,7 +262,7 @@ SOURCES = main.qml \
\endcode
-You can also specify the .qml source files without with a wildcard match. The
+You can also specify the .qml source files with a wildcard match. The
search is not recursive so you need to specify each directory where there are
user interface strings in the source code:
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index e2753e47f4..8571879f78 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -56,7 +56,9 @@ to a QStringList:
\snippet quick/models/stringlistmodel/main.cpp 0
-The complete example is available in Qt's \l {quick/modelviews/stringlistmodel}{examples/quick/modelviews/stringlistmodel} directory.
+The complete source code for this example is available in
+\l {quick/modelviews/stringlistmodel}{examples/quick/modelviews/stringlistmodel}
+within the Qt install directory.
\b{Note:} There is no way for the view to know that the contents of a QStringList
have changed. If the QStringList changes, it will be necessary to reset
@@ -68,7 +70,7 @@ the model by calling QQmlContext::setContextProperty() again.
A list of QObject* values can also be used as a model. A QList<QObject*> provides
the properties of the objects in the list as roles.
-The following application creates a \c DataObject class that with
+The following application creates a \c DataObject class with
Q_PROPERTY values that will be accessible as named roles when a
QList<DataObject*> is exposed to QML:
@@ -86,15 +88,17 @@ the ListView delegate:
\snippet quick/models/objectlistmodel/view.qml 0
-Note the use of the fully qualified access to the \c color property.
+Note the use of \c color property with qualifier.
The properties of the object are not replicated in the \c model
-object, since they are easily available via the \c modelData
+object, as they are easily available via the \c modelData
object.
-The complete example is available in Qt's \l {quick/modelviews/objectlistmodel}{examples/quick/modelviews/objectlistmodel} directory.
+The complete source code for this example is available in
+\l {quick/modelviews/objectlistmodel}{examples/quick/modelviews/objectlistmodel}
+within the Qt install directory.
Note: There is no way for the view to know that the contents of a QList
-have changed. If the QList changes, it will be necessary to reset
+has changed. If the QList changes, it is necessary to reset
the model by calling QQmlContext::setContextProperty() again.
@@ -103,10 +107,11 @@ the model by calling QQmlContext::setContextProperty() again.
A model can be defined by subclassing QAbstractItemModel. This is the
best approach if you have a more complex model that cannot be supported
by the other approaches. A QAbstractItemModel can also automatically
-notify a QML view when the model data has changed.
+notify a QML view when the model data changes.
-The roles of a QAbstractItemModel subclass can be exposed to QML by calling
-QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
+The roles of a QAbstractItemModel subclass can be exposed to QML by
+reimplementing QAbstractItemModel::roleNames(). The default role names
+set by Qt are:
\table
\header
@@ -120,9 +125,10 @@ QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
\li decoration
\endtable
-Here is an application with a QAbstractListModel subclass named \c AnimalModel
-that has \e type and \e size roles. It reimplements QAbstractItemModel::roleNames() to set the
-role names for accessing the properties via QML:
+Here is an application with a QAbstractListModel subclass named \c AnimalModel,
+which exposes the \e type and \e sizes roles. It reimplements
+QAbstractItemModel::roleNames() to expose the role names, so that they can be
+accessed via QML:
\snippet quick/models/abstractitemmodel/model.h 0
\dots
@@ -143,16 +149,18 @@ roles:
QML views are automatically updated when the model changes. Remember the model
must follow the standard rules for model changes and notify the view when
the model has changed by using QAbstractItemModel::dataChanged(),
-QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for
+QAbstractItemModel::beginInsertRows(), and so on. See the \l {Model subclassing reference} for
more information.
-The complete example is available in Qt's \l {quick/modelviews/abstractitemmodel}{examples/quick/modelviews/abstractitemmodel} directory.
+The complete source code for this example is available in
+\l {quick/modelviews/abstractitemmodel}{examples/quick/modelviews/abstractitemmodel}
+within the Qt install directory.
QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
can only display list data.
-In order to display child lists of a hierarchical model
-the VisualDataModel element provides several properties and functions for use
-with models of type QAbstractItemModel:
+In order to display the child lists of a hierarchical model,
+use the VisualDataModel type, which provides the following properties and functions to be used
+with list models of QAbstractItemModel type:
\list
\li \e hasModelChildren role property to determine whether a node has child nodes.
diff --git a/src/quick/doc/src/concepts/positioning/anchors.qdoc b/src/quick/doc/src/concepts/positioning/anchors.qdoc
index 871cd526d0..d0a14f7392 100644
--- a/src/quick/doc/src/concepts/positioning/anchors.qdoc
+++ b/src/quick/doc/src/concepts/positioning/anchors.qdoc
@@ -140,7 +140,8 @@ carefully ordered, or they may produce unexpected outcomes. The following exampl
\table
\row
\li
- \badcode
+ \code
+ //bad code
Rectangle {
width: 50
anchors.left: parent.left
@@ -185,7 +186,8 @@ conditional bindings, as this can lead to the ordering issue described above. In
the Rectangle will eventually grow to the full width of its parent, because both left and right anchors
will be simultaneously set during binding update.
-\badcode
+\code
+//bad code
Rectangle {
width: 50; height: 50
anchors.left: state == "right" ? undefined : parent.left;
@@ -201,7 +203,8 @@ ordering issues internally.
For performance reasons, you can only anchor an item to its siblings and direct parent. For example,
the following anchor is invalid and would produce a warning:
-\badcode
+\code
+//bad code
Item {
id: group1
Rectangle { id: rect1; ... }
diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp
index f6d7b4efac..aaf613098b 100644
--- a/src/quick/items/context2d/qquickcontext2dtile.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtile.cpp
@@ -80,9 +80,9 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth, bool antialiasing)
#endif
if (antialiasing)
- m_painter.setRenderHints(QPainter::Antialiasing | QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing, true);
+ m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true);
else
- m_painter.setRenderHints(QPainter::Antialiasing | QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing, false);
+ m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, false);
if (smooth)
m_painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index c986e469cf..35e37d1246 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -118,9 +118,10 @@ QQuickRepeaterPrivate::~QQuickRepeaterPrivate()
Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects.
For example, it cannot be used to repeat QtObjects:
- \badcode
+ \code
+ //bad code
Item {
- //XXX does not work! Can't repeat QtObject as it doesn't derive from Item.
+ Can't repeat QtObject as it doesn't derive from Item.
Repeater {
model: 10
QtObject {}
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index b305ad116a..f9de3d25e7 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -2099,7 +2099,7 @@ void QQuickTextInput::insert(int position, const QString &text)
}
/*!
- \qmlmethod string QtQuick2::TextInput::getText(int start, int end)
+ \qmlmethod QtQuick2::TextInput::remove(int start, int end)
Removes the section of text that is between the \a start and \a end positions from the TextInput.
*/
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index ea454367a9..9acd24cae3 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1250,7 +1250,7 @@ bool QQuickWindowPrivate::deliverInitialMousePressEvent(QQuickItem *item, QMouse
event->setAccepted(me->isAccepted());
if (me->isAccepted())
return true;
- if (mouseGrabberItem && !event->buttons())
+ if (mouseGrabberItem)
mouseGrabberItem->ungrabMouse();
}
}
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index a6b0c328e6..e5cf6b8295 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -179,8 +179,7 @@ void QSGPainterNode::paint()
}
if (m_smoothPainting) {
- painter.setRenderHints(QPainter::Antialiasing | QPainter::HighQualityAntialiasing
- | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
+ painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
}
painter.scale(m_contentsScale, m_contentsScale);