From 98e0cb0a28845fd6b808c25d2e049f8da1f9867c Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Thu, 19 Jan 2017 11:36:59 +0100 Subject: Doc: updated QSyntaxHighlighter documentation and use QRegularExpression The documentation of QSyntaxHighlighter still uses the deprecated QRegExp class. This patch updates the code samples as well as cleanup some typos. Change-Id: I87b525fddb560b7c5bb38f96d9aaceadb594f76c Reviewed-by: Sze Howe Koh --- src/gui/text/qsyntaxhighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index 8834afc80e..fcda17605f 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -292,7 +292,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block) /*! Constructs a QSyntaxHighlighter with the given \a parent. - If the parent is a QTextEdit, it installs the syntaxhighlighter on the + If the parent is a QTextEdit, it installs the syntax highlighter on the parents document. The specified QTextEdit also becomes the owner of the QSyntaxHighlighter. */ -- cgit v1.2.3 From 5662234afaf23d88e1f3fa4bee2a59b61bd0c267 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 14 Apr 2017 12:39:20 +0200 Subject: QMatrix4x4: fix aliasing problem in operator*= When multiplying a QMatrix4x4 by itself, we were clobbering the very matrix we read from. Employ read-caching to avoid this aliasing problem. [ChangeLog][QtGui][QMatrix4x4] operator*=() now calculates the correct result even if the RHS and LHS are the same object. Change-Id: I8534d56cfdd62c336577125127f05173fcec2873 Reviewed-by: Sean Harmer --- src/gui/math3d/qmatrix4x4.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index aca685920e..4db96d07c0 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -423,8 +423,9 @@ inline QMatrix4x4& QMatrix4x4::operator-=(const QMatrix4x4& other) return *this; } -inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& other) +inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& o) { + const QMatrix4x4 other = o; // prevent aliasing when &o == this ### Qt 6: take o by value flagBits |= other.flagBits; if (flagBits < Rotation2D) { -- cgit v1.2.3