summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/qnamespace.qdoc11
-rw-r--r--src/corelib/codecs/qtextcodec.cpp57
-rw-r--r--src/corelib/kernel/qmetatype.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp122
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp35
-rw-r--r--src/gui/kernel/qshortcut.cpp1
-rw-r--r--src/gui/kernel/qtooltip.cpp21
-rw-r--r--src/gui/painting/qdrawutil.cpp56
-rw-r--r--src/gui/painting/qpaintengineex.cpp8
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/painting/qtransform.cpp15
-rw-r--r--src/gui/widgets/qdockwidget.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp4
-rw-r--r--src/gui/widgets/qmenu_p.h2
-rw-r--r--src/gui/widgets/qmenubar.cpp18
-rw-r--r--src/gui/widgets/qsizegrip.cpp2
-rw-r--r--src/gui/widgets/qtoolbutton.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp37
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h2
-rw-r--r--src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h5
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty.cpp17
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp34
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp31
-rw-r--r--tests/auto/qtransform/tst_qtransform.cpp7
26 files changed, 327 insertions, 181 deletions
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index b66ebee..7772958 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -2674,11 +2674,14 @@
\enum Qt::TileRule
\since 4.6
- This enum describes how to repeat or stretch the parts of an image when drawing.
+ This enum describes how to repeat or stretch the parts of an image
+ when drawing.
\value Stretch Scale the image to fit to the available area.
- \value Repeat Tile the image until there is no more space. May crop the last image.
- \value Round Like Repeat, but scales the images down to ensure that the last image is not cropped.
- \sa qDrawBorderPixmap()
+ \value Repeat Tile the image until there is no more space. May crop
+ the last image.
+
+ \value Round Like Repeat, but scales the images down to ensure that
+ the last image is not cropped.
*/
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index e6fdc08..2aec40f 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -448,10 +448,10 @@ static const char * const tis_620locales[] = {
// static const char * const tcvnlocales[] = {
// "vi", "vi_VN", 0 };
-static bool try_locale_list(const char * const locale[], const char * lang)
+static bool try_locale_list(const char * const locale[], const QByteArray &lang)
{
int i;
- for(i=0; locale[i] && *locale[i] && strcmp(locale[i], lang); i++)
+ for(i=0; locale[i] && lang != locale[i]; i++)
;
return locale[i] != 0;
}
@@ -503,13 +503,12 @@ static QTextCodec * ru_RU_hack(const char * i) {
#endif
#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)
-static QTextCodec *checkForCodec(const char *name) {
+static QTextCodec *checkForCodec(const QByteArray &name) {
QTextCodec *c = QTextCodec::codecForName(name);
if (!c) {
- const char *at = strchr(name, '@');
- if (at) {
- QByteArray n(name, at - name);
- c = QTextCodec::codecForName(n.data());
+ const int index = name.indexOf('@');
+ if (index != -1) {
+ c = QTextCodec::codecForName(name.left(index));
}
}
return c;
@@ -550,21 +549,19 @@ static void setupLocaleMapper()
// definitely knows it, but since we cannot fully trust it, get ready
// to fall back to environment variables.
#if !defined(QT_NO_SETLOCALE)
- char * ctype = qstrdup(setlocale(LC_CTYPE, 0));
+ const QByteArray ctype = setlocale(LC_CTYPE, 0);
#else
- char * ctype = qstrdup("");
+ const QByteArray ctype;
#endif
// Get the first nonempty value from $LC_ALL, $LC_CTYPE, and $LANG
// environment variables.
- char * lang = qstrdup(qgetenv("LC_ALL").constData());
- if (!lang || lang[0] == 0 || strcmp(lang, "C") == 0) {
- if (lang) delete [] lang;
- lang = qstrdup(qgetenv("LC_CTYPE").constData());
+ QByteArray lang = qgetenv("LC_ALL");
+ if (lang.isEmpty() || lang == "C") {
+ lang = qgetenv("LC_CTYPE");
}
- if (!lang || lang[0] == 0 || strcmp(lang, "C") == 0) {
- if (lang) delete [] lang;
- lang = qstrdup(qgetenv("LANG").constData());
+ if (lang.isEmpty() || lang == "C") {
+ lang = qgetenv("LANG");
}
// Now try these in order:
@@ -577,35 +574,35 @@ static void setupLocaleMapper()
// 7. guess locale from lang
// 1. CODESET from ctype if it contains a .CODESET part (e.g. en_US.ISO8859-15)
- char * codeset = ctype ? strchr(ctype, '.') : 0;
- if (codeset && *codeset == '.')
- localeMapper = checkForCodec(codeset + 1);
+ int indexOfDot = ctype.indexOf('.');
+ if (indexOfDot != -1)
+ localeMapper = checkForCodec( ctype.mid(indexOfDot + 1) );
// 2. CODESET from lang if it contains a .CODESET part
- codeset = lang ? strchr(lang, '.') : 0;
- if (!localeMapper && codeset && *codeset == '.')
- localeMapper = checkForCodec(codeset + 1);
+ if (!localeMapper) {
+ indexOfDot = lang.indexOf('.');
+ if (indexOfDot != -1)
+ localeMapper = checkForCodec( lang.mid(indexOfDot + 1) );
+ }
// 3. ctype (maybe the locale is named "ISO-8859-1" or something)
- if (!localeMapper && ctype && *ctype != 0 && strcmp (ctype, "C") != 0)
+ if (!localeMapper && !ctype.isEmpty() && ctype != "C")
localeMapper = checkForCodec(ctype);
// 4. locale (ditto)
- if (!localeMapper && lang && *lang != 0)
+ if (!localeMapper && !lang.isEmpty())
localeMapper = checkForCodec(lang);
// 5. "@euro"
- if ((!localeMapper && ctype && strstr(ctype, "@euro")) || (lang && strstr(lang, "@euro")))
+ if ((!localeMapper && ctype.contains("@euro")) || lang.contains("@euro"))
localeMapper = checkForCodec("ISO 8859-15");
// 6. guess locale from ctype unless ctype is "C"
// 7. guess locale from lang
- char * try_by_name = ctype;
- if (ctype && *ctype != 0 && strcmp (ctype, "C") != 0)
- try_by_name = lang;
+ const QByteArray &try_by_name = (!ctype.isEmpty() && ctype != "C") ? lang : ctype;
// Now do the guessing.
- if (lang && *lang && !localeMapper && try_by_name && *try_by_name) {
+ if (!lang.isEmpty() && !localeMapper && !try_by_name.isEmpty()) {
if (try_locale_list(iso8859_15locales, lang))
localeMapper = QTextCodec::codecForName("ISO 8859-15");
else if (try_locale_list(iso8859_2locales, lang))
@@ -638,8 +635,6 @@ static void setupLocaleMapper()
localeMapper = ru_RU_hack(lang);
}
- delete [] ctype;
- delete [] lang;
}
// If everything failed, we default to 8859-1
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 22214a4..687a070 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -89,7 +89,7 @@ public:
// This logic must match the one in qglobal.h
#if defined(QT_COORD_TYPE)
QReal = 0,
-#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE)
+#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
QReal = Float,
#else
QReal = Double,
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 43cbca1..e4f2a75 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -91,30 +91,33 @@
\snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 0
- The boundingRect() function has many different purposes. QGraphicsScene
- bases its item index on boundingRect(), and QGraphicsView uses it both for
- culling invisible items, and for determining the area that needs to be
- recomposed when drawing overlapping items. In addition, QGraphicsItem's
- collision detection mechanisms use boundingRect() to provide an efficient
- cut-off. The fine grained collision algorithm in collidesWithItem() is based
- on calling shape(), which returns an accurate outline of the item's shape
- as a QPainterPath.
-
- QGraphicsScene expects all items boundingRect() and shape() to remain
- unchanged unless it is notified. If you want to change an item's geometry
- in any way, you must first call prepareGeometryChange() to allow
- QGraphicsScene to update its bookkeeping.
+ The boundingRect() function has many different purposes.
+ QGraphicsScene bases its item index on boundingRect(), and
+ QGraphicsView uses it both for culling invisible items, and for
+ determining the area that needs to be recomposed when drawing
+ overlapping items. In addition, QGraphicsItem's collision
+ detection mechanisms use boundingRect() to provide an efficient
+ cut-off. The fine grained collision algorithm in
+ collidesWithItem() is based on calling shape(), which returns an
+ accurate outline of the item's shape as a QPainterPath.
+
+ QGraphicsScene expects all items boundingRect() and shape() to
+ remain unchanged unless it is notified. If you want to change an
+ item's geometry in any way, you must first call
+ prepareGeometryChange() to allow QGraphicsScene to update its
+ bookkeeping.
Collision detection can be done in two ways:
\list 1
- \o Reimplement shape() to return an accurate shape for your item, and rely
- on the default implementation of collidesWithItem() to do shape-shape
- intersection. This can be rather expensive if the shapes are complex.
+ \o Reimplement shape() to return an accurate shape for your item,
+ and rely on the default implementation of collidesWithItem() to do
+ shape-shape intersection. This can be rather expensive if the
+ shapes are complex.
- \o Reimplement collidesWithItem() to provide your own custom item and shape
- collision algorithm.
+ \o Reimplement collidesWithItem() to provide your own custom item
+ and shape collision algorithm.
\endlist
@@ -136,24 +139,28 @@
position, pos(). To change the item's transformation, you can pass
a transformation matrix to setTransform()
- Item transformations accumulate from parent to child, so if both a parent and child
- item are rotated 90 degrees, the child's total transformation will be 180 degrees.
- Similarly, if the item's parent is scaled to 2x its original size, its
- children will also be twice as large. An item's transformation does not
- affect its own local geometry; all geometry functions (e.g., contains(),
+ Item transformations accumulate from parent to child, so if both a
+ parent and child item are rotated 90 degrees, the child's total
+ transformation will be 180 degrees. Similarly, if the item's
+ parent is scaled to 2x its original size, its children will also
+ be twice as large. An item's transformation does not affect its
+ own local geometry; all geometry functions (e.g., contains(),
update(), and all the mapping functions) still operate in local
coordinates. For convenience, QGraphicsItem provides the functions
- sceneTransform(), which returns the item's total transformation matrix
- (including its position and all parents' positions and transformations),
- and scenePos(), which returns its position in scene coordinates. To reset
- an item's matrix, call resetTransform().
+ sceneTransform(), which returns the item's total transformation
+ matrix (including its position and all parents' positions and
+ transformations), and scenePos(), which returns its position in
+ scene coordinates. To reset an item's matrix, call
+ resetTransform().
- Another way to apply transformation to an item is to use the , or set the
- different transformation properties (transformOrigin, x/y/zRotation, x/yScale,
- horizontal/verticalShear). Those properties come in addition to the base transformation
+ Another way to apply transformation to an item is to use the , or
+ set the different transformation properties (transformOrigin,
+ x/y/zRotation, x/yScale, horizontal/verticalShear). Those
+ properties come in addition to the base transformation
- The order you set the transformation properties does not affect the resulting transformation
- The resulting transformation is always computed in the following order
+ The order you set the transformation properties does not affect
+ the resulting transformation The resulting transformation is
+ always computed in the following order
\code
[Origin] [Base] [RotateX] [RotateY] [RotateZ] [Shear] [Scale] [-Origin]
@@ -2538,8 +2545,8 @@ QPointF QGraphicsItem::pos() const
\sa y()
*/
-/*
- Set's the x coordinate of the item's position. Equivalent to
+/*!
+ Set's the \a x coordinate of the item's position. Equivalent to
calling setPos(x, y()).
\sa x(), setPos()
@@ -2557,8 +2564,8 @@ void QGraphicsItem::setX(qreal x)
\sa x()
*/
-/*
- Set's the y coordinate of the item's position. Equivalent to
+/*!
+ Set's the \a y coordinate of the item's position. Equivalent to
calling setPos(x(), y).
\sa x(), setPos()
@@ -2743,7 +2750,8 @@ QTransform QGraphicsItem::transform() const
The default is 0
- \warning The value doesn't take in account any rotation set with the setTransform() method.
+ \warning The value doesn't take in account any rotation set with
+ the setTransform() method.
\sa setXRotation(), {Transformations}
*/
@@ -3048,7 +3056,7 @@ void QGraphicsItem::setShear(qreal sh, qreal sv)
/*!
\since 4.6
- Returns the origin point using for transformation in item coordinate.
+ Returns the origin point used for transformation in item coordinate.
The default is QPointF(0,0).
@@ -6440,15 +6448,21 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
\property QGraphicsObject::parent
\brief the parent of the item
- \sa QGraphicsItem::setParentItem, QGraphicsItem::parentObject
+ \sa QGraphicsItem::setParentItem(), QGraphicsItem::parentObject()
*/
+/*!
+ \property QGraphicsObject::id
+ \brief the id of of the item
+
+ \sa QGraphicsItem::opacity(), QGraphicsItem::setOpacity()
+*/
/*!
\property QGraphicsObject::opacity
\brief the opacity of the item
- \sa QGraphicsItem::setOpacity, QGraphicsItem::opacity
+ \sa QGraphicsItem::setOpacity(), QGraphicsItem::opacity()
*/
/*!
@@ -6456,7 +6470,13 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
This signal gets emitted whenever the opacity of the item changes
- \sa opacity
+ \sa QGraphicsItem::opacity()
+*/
+
+/*!
+ \fn QGraphicsObject::parentChanged()
+
+ This signal gets emitted whenever the parent of the item changes
*/
/*!
@@ -6465,7 +6485,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
Describes the items position.
- \sa QGraphicsItem::setPos, QGraphicsItem::pos, positionChanged
+ \sa QGraphicsItem::setPos(), QGraphicsItem::pos()
*/
/*!
@@ -6474,7 +6494,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
Describes the items x position.
- \sa QGraphicsItem::setX, setPos, xChanged
+ \sa QGraphicsItem::setX(), setPos(), xChanged()
*/
/*!
@@ -6482,7 +6502,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
This signal gets emitted whenever the x position of the item changes
- \sa pos
+ \sa pos()
*/
/*!
@@ -6491,15 +6511,15 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
Describes the items y position.
- \sa QGraphicsItem::setY, setPos, yChanged
+ \sa QGraphicsItem::setY(), setPos(), yChanged()
*/
/*!
\fn QGraphicsObject::yChanged()
- This signal gets emitted whenever the y position of the item changes
+ This signal gets emitted whenever the y position of the item changes.
- \sa pos
+ \sa pos()
*/
/*!
@@ -6508,15 +6528,15 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
Describes the items z value.
- \sa QGraphicsItem::setZValue, zValue, zChanged
+ \sa QGraphicsItem::setZValue(), zValue(), zChanged()
*/
/*!
\fn QGraphicsObject::zChanged()
- This signal gets emitted whenever the z value of the item changes
+ This signal gets emitted whenever the z value of the item changes.
- \sa pos
+ \sa pos()
*/
@@ -6536,7 +6556,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
This signal gets emitted whenever the item get's enabled or disabled.
- \sa enabled
+ \sa isEnabled()
*/
/*!
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 55d8a1d..673fd23 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5074,8 +5074,8 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
}
// Calculate the full transform for this item.
- QRect viewBoundingRect;
bool wasDirtyParentSceneTransform = false;
+ bool dontDrawItem = true;
QTransform transform;
if (item) {
if (item->d_ptr->itemIsUntransformable()) {
@@ -5091,15 +5091,17 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
transform = item->d_ptr->sceneTransform;
transform *= viewTransform;
}
-
+
QRectF brect = item->boundingRect();
// ### This does not take the clip into account.
_q_adjustRect(&brect);
- viewBoundingRect = transform.mapRect(brect).toRect();
+ QRect viewBoundingRect = transform.mapRect(brect).toRect();
item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect);
viewBoundingRect.adjust(-1, -1, 1, 1);
if (exposedRegion)
- viewBoundingRect &= exposedRegion->boundingRect();
+ dontDrawItem = !exposedRegion->intersects(viewBoundingRect);
+ else
+ dontDrawItem = viewBoundingRect.isEmpty();
}
// Find and sort children.
@@ -5154,7 +5156,6 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
}
bool childClip = (item && (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape));
- bool dontDrawItem = !item || viewBoundingRect.isEmpty();
bool dontDrawChildren = item && dontDrawItem && childClip;
childClip &= !dontDrawChildren && !children->isEmpty();
if (item && ((item->d_ptr->flags & QGraphicsItem::ItemHasNoContents) || invisibleButChildIgnoresParentOpacity))
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index a72aa5a..c94c1d7 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -217,6 +217,8 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
minimizing the areas that require redrawing, which improves performance. A
common side effect is that items that do draw with antialiasing can leave
painting traces behind on the scene as they are moved.
+
+ \omitvalue IndirectPainting
*/
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 12baa56..06ea333 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -1660,7 +1660,8 @@ bool QGraphicsWidget::isActiveWindow() const
This property is only used for windows.
- By default, if no title has been set, this property contains an empty string.
+ By default, if no title has been set, this property contains an
+ empty string.
*/
void QGraphicsWidget::setWindowTitle(const QString &title)
{
@@ -1723,6 +1724,38 @@ QGraphicsWidget *QGraphicsWidget::focusWidget() const
return d->focusChild;
}
+/*! \property QGraphicsWidget::horizontalShear
+ \brief This property holds the horizontal shear value for the item.
+ */
+
+/*! \property QGraphicsWidget::transformOrigin
+ \brief This property holds the origin point used for transformations
+ in item coordinates.
+ */
+
+/*! \property QGraphicsWidget::verticalShear
+ \brief This property holds the vertical shear value for the item.
+ */
+
+/*! \property QGraphicsWidget::xRotation
+ \brief This property holds the value for rotation around the x axis.
+ */
+
+/*! \property QGraphicsWidget::xScale
+ \brief This property holds the scale factor for the x axis.
+ */
+
+/*! \property QGraphicsWidget::yRotation
+ \brief This property holds the value for rotation around the y axis.
+ */
+
+/*! \property QGraphicsWidget::yScale
+ \brief This property holds the scale factor for the y axis.
+ */
+
+/*! \property QGraphicsWidget::zRotation
+ \brief This property holds the value for rotation around the z axis.
+ */
#ifndef QT_NO_SHORTCUT
/*!
diff --git a/src/gui/kernel/qshortcut.cpp b/src/gui/kernel/qshortcut.cpp
index 50b6e59..bced833 100644
--- a/src/gui/kernel/qshortcut.cpp
+++ b/src/gui/kernel/qshortcut.cpp
@@ -163,7 +163,6 @@ public:
void QShortcutPrivate::redoGrab(QShortcutMap &map)
{
Q_Q(QShortcut);
- QWidget *parent = q->parentWidget();
if (!parent) {
qWarning("QShortcut: No widget parent defined");
return;
diff --git a/src/gui/kernel/qtooltip.cpp b/src/gui/kernel/qtooltip.cpp
index 15a3dd2..2f97e7b 100644
--- a/src/gui/kernel/qtooltip.cpp
+++ b/src/gui/kernel/qtooltip.cpp
@@ -126,14 +126,15 @@ public:
bool eventFilter(QObject *, QEvent *);
- QBasicTimer hideTimer;
+ QBasicTimer hideTimer, expireTimer;
+
bool fadingOut;
void reuseTip(const QString &text);
void hideTip();
void hideTipImmediately();
void setTipRect(QWidget *w, const QRect &r);
- void restartHideTimer();
+ void restartExpireTimer();
bool tipChanged(const QPoint &pos, const QString &text, QObject *o);
void placeTip(const QPoint &pos, QWidget *w);
@@ -190,16 +191,17 @@ QTipLabel::QTipLabel(const QString &text, QWidget *w)
reuseTip(text);
}
-void QTipLabel::restartHideTimer()
+void QTipLabel::restartExpireTimer()
{
int time = 10000 + 40 * qMax(0, text().length()-100);
- hideTimer.start(time, this);
+ expireTimer.start(time, this);
+ hideTimer.stop();
}
void QTipLabel::reuseTip(const QString &text)
{
#ifndef QT_NO_STYLE_STYLESHEET
- if (styleSheetParent) {
+ if (styleSheetParent){
disconnect(styleSheetParent, SIGNAL(destroyed()),
QTipLabel::instance, SLOT(styleSheetParentDestroyed()));
styleSheetParent = 0;
@@ -213,7 +215,7 @@ void QTipLabel::reuseTip(const QString &text)
if (fm.descent() == 2 && fm.ascent() >= 11)
++extra.rheight();
resize(sizeHint() + extra);
- restartHideTimer();
+ restartExpireTimer();
}
void QTipLabel::paintEvent(QPaintEvent *ev)
@@ -257,7 +259,8 @@ QTipLabel::~QTipLabel()
void QTipLabel::hideTip()
{
- hideTimer.start(300, this);
+ if (!hideTimer.isActive())
+ hideTimer.start(300, this);
}
void QTipLabel::hideTipImmediately()
@@ -278,8 +281,10 @@ void QTipLabel::setTipRect(QWidget *w, const QRect &r)
void QTipLabel::timerEvent(QTimerEvent *e)
{
- if (e->timerId() == hideTimer.timerId()){
+ if (e->timerId() == hideTimer.timerId()
+ || e->timerId() == expireTimer.timerId()){
hideTimer.stop();
+ expireTimer.stop();
#if defined(Q_WS_MAC) && !defined(QT_NO_EFFECTS)
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){
// Fade out tip on mac (makes it invisible).
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index c2509ad..7d98190 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -1046,23 +1046,18 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
draw it, similar to \l{http://www.w3.org/TR/css3-background/}
{CSS3 border-images}.
- \sa qDrawBorderPixmap(), Qt::TileRule, QTileRules
+ \sa Qt::TileRule, QTileRules
*/
-/*!
- \fn QMargins::QMargins(int margin)
-
- Constructs an instance of QMargins setting all four
- margins to \a margin.
+/*! \fn QMargins::QMargins(int margin)
+ Constructs a QMargins with the top, left, bottom, and
+ right margins set to \a margin.
*/
-/*!
- \fn QMargins::QMargins(int topMargin, int leftMargin, int bottomMargin, int rightMargin)
-
- Constructs an instance of QMargins setting the four
- margins to \a topMargin, \a leftMargin, \a bottomMargin,
- and \a rightMargin.
-*/
+/*! \fn QMargins::QMargins(int topMargin, int leftMargin, int bottomMargin, int rightMargin)
+ Constructs a QMargins with the given \a topMargin, \a leftMargin,
+ \a bottomMargin, and \a rightMargin.
+ */
/*!
\class QTileRules
@@ -1071,35 +1066,36 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
Holds the rules used to draw a pixmap or image split into nine segments,
similar to \l{http://www.w3.org/TR/css3-background/}{CSS3 border-images}.
- \sa qDrawBorderPixmap(), Qt::TileRule, QMargins
+ \sa Qt::TileRule, QMargins
*/
-/*!
- \fn QTileRules::QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
+/*! \fn QTileRules::QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
+ Constructs a QTileRules with the given \a horizontalRule and
+ \a verticalRule.
+ */
- Constructs an instance of QTileRules from the \a horizontalRule
- and the \a verticalRule.
-*/
+/*! \fn QTileRules::QTileRules(Qt::TileRule rule)
+ Constructs a QTileRules with the given \a rule used for both
+ the horizontal rule and the vertical rule.
+ */
/*!
- \fn QTileRules::QTileRules(Qt::TileRule rule)
-
- Constructs an instance of QTileRules setting both the
- horizontal and vertical rules to \a rule.
-*/
-
-/*!
- \fn qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap)
- \relates QMargins
\since 4.6
+ \relates QMargins
Draws the given \a pixmap into the given \a target rectangle, using the
given \a painter. The pixmap will be split into nine segments and drawn
according to the \a margins structure.
*/
-static inline void qVerticalRepeat(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source,
- void (*drawPixmap)(QPainter*, const QRect&, const QPixmap&, const QRect&))
+static inline void qVerticalRepeat(QPainter *painter,
+ const QRect &target,
+ const QPixmap &pixmap,
+ const QRect &source,
+ void (*drawPixmap)(QPainter*,
+ const QRect&,
+ const QPixmap&,
+ const QRect&))
{
const int x = target.x();
const int width = target.width();
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 67a3fa9..222e29f 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -149,15 +149,11 @@ void QPaintEngineExPrivate::replayClipOperations()
QTransform transform = q->state()->matrix;
- const QTransform &redirection = q->state()->redirectionMatrix;
-
for (int i = 0; i < clipInfo.size(); ++i) {
const QPainterClipInfo &info = clipInfo.at(i);
- QTransform combined = info.matrix * redirection;
-
- if (combined != q->state()->matrix) {
- q->state()->matrix = combined;
+ if (info.matrix != q->state()->matrix) {
+ q->state()->matrix = info.matrix;
q->transformChanged();
}
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 528c575..1094206 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -414,7 +414,7 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio
bool old_txinv = txinv;
QTransform old_invMatrix = invMatrix;
txinv = true;
- invMatrix = state->redirectionMatrix.inverted();
+ invMatrix = QTransform();
QPainterPath clipPath = q->clipPath();
QRectF r = clipPath.boundingRect().intersected(absPathRect);
absPathRect = r.toAlignedRect();
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index c00012a..16d60f8 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -420,7 +420,8 @@ QTransform &QTransform::translate(qreal dx, qreal dy)
affine._dy += dy*affine._m22 + dx*affine._m12;
break;
}
- m_dirty |= TxTranslate;
+ if (m_dirty < TxTranslate)
+ m_dirty = TxTranslate;
return *this;
}
@@ -472,7 +473,8 @@ QTransform & QTransform::scale(qreal sx, qreal sy)
affine._m22 *= sy;
break;
}
- m_dirty |= TxScale;
+ if (m_dirty < TxScale)
+ m_dirty = TxScale;
return *this;
}
@@ -529,7 +531,8 @@ QTransform & QTransform::shear(qreal sh, qreal sv)
break;
}
}
- m_dirty |= TxShear;
+ if (m_dirty < TxShear)
+ m_dirty = TxShear;
return *this;
}
@@ -605,7 +608,8 @@ QTransform & QTransform::rotate(qreal a, Qt::Axis axis)
break;
}
}
- m_dirty |= TxRotate;
+ if (m_dirty < TxRotate)
+ m_dirty = TxRotate;
} else {
QTransform result;
if (axis == Qt::YAxis) {
@@ -677,7 +681,8 @@ QTransform & QTransform::rotateRadians(qreal a, Qt::Axis axis)
break;
}
}
- m_dirty |= TxRotate;
+ if (m_dirty < TxRotate)
+ m_dirty = TxRotate;
} else {
QTransform result;
if (axis == Qt::YAxis) {
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index 30f9a87..e20fedd 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -1053,7 +1053,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
if (floating != wasFloating) {
emit q->topLevelChanged(floating);
- if (!floating && q->parentWidget()) {
+ if (!floating && parent) {
QMainWindowLayout *mwlayout = qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout());
if (mwlayout)
emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 7baea94..aa601cb 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -205,7 +205,6 @@ void QMenuPrivate::calcActionRects(QMap<QAction*, QRect> &actionRects, QList<QAc
actionRects.clear();
actionList.clear();
- QList<QAction*> items = filterActions(q->actions());
int max_column_width = 0,
dh = popupGeometry(QApplication::desktop()->screenNumber(q)).height(),
ncols = 1,
@@ -218,6 +217,7 @@ void QMenuPrivate::calcActionRects(QMap<QAction*, QRect> &actionRects, QList<QAc
tabWidth = 0;
maxIconWidth = 0;
hasCheckableItems = false;
+ QList<QAction*> items = filteredActions();
for(int i = 0; i < items.count(); i++) {
QAction *action = items.at(i);
if (widgetItems.value(action))
@@ -348,7 +348,7 @@ void QMenuPrivate::updateActions()
itemsDirty = 0;
}
-QList<QAction *> QMenuPrivate::filterActions(const QList<QAction *> &actions) const
+QList<QAction *> QMenuPrivate::filteredActions() const
{
QList<QAction *> visibleActions;
int i = 0;
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index f08283d..1dfe701 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -161,7 +161,7 @@ public:
void calcActionRects(QMap<QAction*, QRect> &actionRects, QList<QAction*> &actionList) const;
void updateActions();
QRect popupGeometry(int screen=-1) const;
- QList<QAction *> filterActions(const QList<QAction *> &actions) const;
+ QList<QAction *> filteredActions() const;
uint ncols : 4; //4 bits is probably plenty
uint collapsibleSeparators : 1;
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 51e38e6..68a0233 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -116,11 +116,9 @@ QSize QMenuBarExtension::sizeHint() const
*/
QAction *QMenuBarPrivate::actionAt(QPoint p) const
{
- Q_Q(const QMenuBar);
- QList<QAction*> items = q->actions();
- for(int i = 0; i < items.size(); ++i) {
- if(actionRect(items.at(i)).contains(p))
- return items.at(i);
+ for(int i = 0; i < actions.size(); ++i) {
+ if(actionRect(actions.at(i)).contains(p))
+ return actions.at(i);
}
return 0;
}
@@ -259,9 +257,9 @@ void QMenuBarPrivate::updateGeometries()
}
q->updateGeometry();
#ifdef QT3_SUPPORT
- if (q->parentWidget() != 0) {
+ if (parent) {
QMenubarUpdatedEvent menubarUpdated(q);
- QApplication::sendEvent(q->parentWidget(), &menubarUpdated);
+ QApplication::sendEvent(parent, &menubarUpdated);
}
#endif
}
@@ -413,15 +411,14 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start, QMap<QAction*, Q
actionList.clear();
const int itemSpacing = q->style()->pixelMetric(QStyle::PM_MenuBarItemSpacing, 0, q);
int max_item_height = 0, separator = -1, separator_start = 0, separator_len = 0;
- QList<QAction*> items = q->actions();
//calculate size
const QFontMetrics fm = q->fontMetrics();
const int hmargin = q->style()->pixelMetric(QStyle::PM_MenuBarHMargin, 0, q),
vmargin = q->style()->pixelMetric(QStyle::PM_MenuBarVMargin, 0, q),
icone = q->style()->pixelMetric(QStyle::PM_SmallIconSize, 0, q);
- for(int i = 0; i < items.count(); i++) {
- QAction *action = items.at(i);
+ for(int i = 0; i < actions.count(); i++) {
+ QAction *action = actions.at(i);
if(!action->isVisible())
continue;
@@ -534,7 +531,6 @@ void QMenuBarPrivate::_q_actionHovered()
emit q->hovered(action);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
- QList<QAction*> actions = q->actions();
int actionIndex = actions.indexOf(action);
++actionIndex;
QAccessible::updateAccessibility(q, actionIndex, QAccessible::Focus);
diff --git a/src/gui/widgets/qsizegrip.cpp b/src/gui/widgets/qsizegrip.cpp
index 6458b15..244d34a 100644
--- a/src/gui/widgets/qsizegrip.cpp
+++ b/src/gui/widgets/qsizegrip.cpp
@@ -139,7 +139,7 @@ public:
void QSizeGripPrivate::updateMacSizer(bool hide) const
{
Q_Q(const QSizeGrip);
- if (QApplication::closingDown() || !q->parentWidget())
+ if (QApplication::closingDown() || !parent)
return;
QWidget *topLevelWindow = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q));
if(topLevelWindow && topLevelWindow->isWindow())
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp
index 0eb6364..d26cf5b 100644
--- a/src/gui/widgets/qtoolbutton.cpp
+++ b/src/gui/widgets/qtoolbutton.cpp
@@ -104,10 +104,9 @@ public:
#ifndef QT_NO_MENU
bool QToolButtonPrivate::hasMenu() const
{
- Q_Q(const QToolButton);
return ((defaultAction && defaultAction->menu())
|| (menuAction && menuAction->menu())
- || q->actions().size() > (defaultAction ? 1 : 0));
+ || actions.size() > (defaultAction ? 1 : 0));
}
#endif
@@ -882,7 +881,6 @@ void QToolButtonPrivate::popupTimerDone()
} else {
actualMenu = new QMenu(q);
mustDeleteActualMenu = true;
- QList<QAction*> actions = q->actions();
for(int i = 0; i < actions.size(); i++)
actualMenu->addAction(actions.at(i));
}
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index abaa7fb..b40b4c8 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -64,7 +64,7 @@
QT_BEGIN_NAMESPACE
-const int QHttpNetworkConnectionPrivate::channelCount = 2;
+const int QHttpNetworkConnectionPrivate::channelCount = 6;
QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &hostName, quint16 port, bool encrypt)
: hostName(hostName), port(port), encrypt(encrypt),
@@ -74,6 +74,7 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host
#endif
{
+ channels = new Channel[channelCount];
}
QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()
@@ -82,6 +83,7 @@ QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()
channels[i].socket->close();
delete channels[i].socket;
}
+ delete []channels;
}
void QHttpNetworkConnectionPrivate::connectSignals(QAbstractSocket *socket)
@@ -1090,25 +1092,26 @@ void QHttpNetworkConnectionPrivate::_q_disconnected()
void QHttpNetworkConnectionPrivate::_q_startNextRequest()
{
- // send the current request again
- if (channels[0].resendCurrent || channels[1].resendCurrent) {
- int i = channels[0].resendCurrent ? 0:1;
- QAbstractSocket *socket = channels[i].socket;
- channels[i].resendCurrent = false;
- channels[i].state = IdleState;
- if (channels[i].reply)
- sendRequest(socket);
- return;
+ //resend the necessary ones.
+ for (int i = 0; i < channelCount; ++i) {
+ if (channels[i].resendCurrent) {
+ channels[i].resendCurrent = false;
+ channels[i].state = IdleState;
+ if (channels[i].reply)
+ sendRequest(channels[i].socket);
+ }
}
- // send the request using the idle socket
- QAbstractSocket *socket = channels[0].socket;
- if (isSocketBusy(socket)) {
- socket = (isSocketBusy(channels[1].socket) ? 0 :channels[1].socket);
+ QAbstractSocket *socket = 0;
+ for (int i = 0; i < channelCount; ++i) {
+ QAbstractSocket *chSocket = channels[i].socket;
+ // send the request using the idle socket
+ if (!isSocketBusy(chSocket)) {
+ socket = chSocket;
+ break;
+ }
}
-
- if (!socket) {
+ if (!socket)
return; // this will be called after finishing current request.
- }
unqueueAndSendRequest(socket);
}
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 4603a55..b5f3593 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -250,7 +250,7 @@ public:
{}
};
static const int channelCount;
- Channel channels[2]; // maximum of 2 socket connections to the server
+ Channel *channels; // parallel connections to the server
bool pendingAuthSignal; // there is an incomplete authentication signal
bool pendingProxyAuthSignal; // there is an incomplete proxy authentication signal
diff --git a/src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h b/src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h
index e3ec541..546ed7f 100644
--- a/src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h
@@ -60,6 +60,8 @@
QT_BEGIN_NAMESPACE
+class QDataStream;
+
class Q_AUTOTEST_EXPORT QScriptDebuggerObjectSnapshotDelta
{
public:
@@ -68,6 +70,9 @@ public:
QScriptDebuggerValuePropertyList addedProperties;
};
+Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerObjectSnapshotDelta &);
+Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerObjectSnapshotDelta &);
+
QT_END_NAMESPACE
#endif
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
index 723e304..51133bc 100644
--- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
+++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
@@ -41,6 +41,7 @@
#include "qscriptdebuggervalueproperty_p.h"
#include "qscriptdebuggervalue_p.h"
+#include "qscriptdebuggerobjectsnapshotdelta_p.h"
#include <QtCore/qatomic.h>
#include <QtCore/qdatastream.h>
@@ -225,4 +226,20 @@ QDataStream &operator>>(QDataStream &in, QScriptDebuggerValueProperty &property)
return in;
}
+QDataStream &operator<<(QDataStream &out, const QScriptDebuggerObjectSnapshotDelta &delta)
+{
+ out << delta.removedProperties;
+ out << delta.changedProperties;
+ out << delta.addedProperties;
+ return out;
+}
+
+QDataStream &operator>>(QDataStream &in, QScriptDebuggerObjectSnapshotDelta &delta)
+{
+ in >> delta.removedProperties;
+ in >> delta.changedProperties;
+ in >> delta.addedProperties;
+ return in;
+}
+
QT_END_NAMESPACE
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 06b4a78..78d09ba 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -194,6 +194,7 @@ private slots:
void mouseTracking();
void mouseTracking2();
void render();
+ void exposeRegion();
// task specific tests below me
void task172231_untransformableItems();
@@ -3323,6 +3324,39 @@ void tst_QGraphicsView::render()
QCOMPARE(r4->paints, 2);
}
+void tst_QGraphicsView::exposeRegion()
+{
+ RenderTester *item = new RenderTester(QRectF(0, 0, 20, 20));
+ QGraphicsScene scene;
+ scene.addItem(item);
+
+ CustomView view;
+ view.setScene(&scene);
+ view.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&view);
+#endif
+ QTest::qWait(125);
+
+ item->paints = 0;
+ view.lastUpdateRegions.clear();
+
+ // Update a small area in the viewport's topLeft() and bottomRight().
+ // (the boundingRect() of this area covers the entire viewport).
+ QWidget *viewport = view.viewport();
+ QRegion expectedExposeRegion = QRect(0, 0, 5, 5);
+ expectedExposeRegion += QRect(viewport->rect().bottomRight() - QPoint(5, 5), QSize(5, 5));
+ viewport->update(expectedExposeRegion);
+ qApp->processEvents();
+
+ // Make sure it triggers correct repaint on the view.
+ QCOMPARE(view.lastUpdateRegions.size(), 1);
+ QCOMPARE(view.lastUpdateRegions.at(0), expectedExposeRegion);
+
+ // Make sure the item didn't get any repaints.
+ QCOMPARE(item->paints, 0);
+}
+
void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged()
{
QGraphicsView view;
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 43b4ea9..a93d0b6 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -243,6 +243,8 @@ private Q_SLOTS:
void proxyChange();
void authorizationError_data();
void authorizationError();
+
+ void httpConnectionCount();
};
QT_BEGIN_NAMESPACE
@@ -3665,5 +3667,34 @@ void tst_QNetworkReply::authorizationError()
QCOMPARE(QString(reply->readAll()), httpBody);
}
+void tst_QNetworkReply::httpConnectionCount()
+{
+ QTcpServer server;
+ QVERIFY(server.listen());
+ QCoreApplication::instance()->processEvents();
+
+ for (int i = 0; i < 10; i++) {
+ QNetworkRequest request (QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/" + QString::number(i)));
+ QNetworkReply* reply = manager.get(request);
+ reply->setParent(this);
+ }
+
+ int pendingConnectionCount = 0;
+ QTime time;
+ time.start();
+
+ while(pendingConnectionCount != 6) {
+ QCoreApplication::instance()->processEvents();
+ while (server.nextPendingConnection())
+ pendingConnectionCount++;
+
+ // at max. wait 10 sec
+ if (time.elapsed() > 10000)
+ break;
+ }
+
+ QCOMPARE(pendingConnectionCount, 6);
+}
+
QTEST_MAIN(tst_QNetworkReply)
#include "tst_qnetworkreply.moc"
diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp
index 74c405e..3b13a41 100644
--- a/tests/auto/qtransform/tst_qtransform.cpp
+++ b/tests/auto/qtransform/tst_qtransform.cpp
@@ -603,6 +603,13 @@ void tst_QTransform::types()
1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 2.0f);
QCOMPARE(m3.type(), QTransform::TxProject);
+
+ QTransform m4;
+ m4.scale(5, 5);
+ m4.translate(4, 2);
+ m4.rotate(45);
+
+ QCOMPARE(m4.type(), QTransform::TxRotate);
}