aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-26 14:03:55 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-06-26 14:03:56 +0200
commit1c1bb3bc4ae3907d9d6d2417b56d90da3c70e4b7 (patch)
treeea7c3a0dbf98786edf0a2be0f82381e0f25bac61
parent7ccfa59664b8bdb24c06025d3ffc5c4da7f0bb1e (diff)
parentb1ccb1f8c30d601c55145b65add3846fe5f9bb32 (diff)
Merge remote-tracking branch 'origin/5.5.0' into 5.5
-rw-r--r--dist/changes-5.5.0105
-rw-r--r--src/qml/compiler/qv4ssa.cpp240
-rw-r--r--src/qml/debugger/qqmldebug.h7
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc3
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp5
-rw-r--r--src/qml/qml/qqmlengine.cpp25
-rw-r--r--src/qml/qml/qqmlvaluetype.cpp39
-rw-r--r--src/qml/qml/qqmlvaluetype_p.h18
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp10
-rw-r--r--src/quick/items/qquickitemsmodule.cpp1
-rw-r--r--src/quick/items/qquickmousearea.cpp1
-rw-r--r--src/quick/items/qquickmousearea_p.h4
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp5
-rw-r--r--src/quickwidgets/qquickwidget.cpp9
-rw-r--r--tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/rect_read.qml4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp8
20 files changed, 395 insertions, 105 deletions
diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0
new file mode 100644
index 0000000000..fc1607dc25
--- /dev/null
+++ b/dist/changes-5.5.0
@@ -0,0 +1,105 @@
+Qt 5.5 introduces many new features and improvements as well as bugfixes
+over the 5.4.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5
+
+The Qt version 5.5 series is binary compatible with the 5.4.x series.
+Applications compiled for 5.4 will continue to run with 5.5.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+QtQml
+-----
+
+ * [QTBUG-44934] Assigning a char to a string will now create a string
+ with the actual character instead of a string representation of the
+ character's code-point. A side effect of this change is that a
+ one-character string also can be assigned to a character type.
+
+QtQuick
+-------
+
+ * Flickable.DragAndOvershootBounds value changed from 2 to 3. This will
+ only affect you if you've worked around enum type checking and have
+ the integer value explicitly in your code.
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+
+Android
+-------
+
+ - [QTBUG-43515] Fixed a vertex shader compilation issue on certain OpenGL
+ drivers.
+
+QtQml
+-----
+
+ - [QTBUG-29769] Custom C++ value types annotated with Q_GADGET are now
+ fully accessible in the QML and QJSEngine JavaScript environment.
+
+ - Added qjsEngine(QObject*) getter similar to qmlEngine(object) that
+ allows retrieving the engine for an exposed object.
+
+ - Added Qt.hsva() function
+
+ - XMLHttpRequest:
+ * [QTBUG-35892] XMLHttpRequest now supports the OPTION method in
+ HTTP requests.
+ * QQmlXMLHttpRequest now supports "arraybuffer" binary response type.
+ * Support for synchronous requests
+
+QtQuick
+-------
+
+ - BorderImage: Add support for @2x HiDPI border images. This means, no more need to
+ multiply the border sizes by the device pixel ratio.
+
+ - [QTBUG-37946] Image: An autoTransform property has been added to control
+ whether metadata image transforms such as EXIF orientation are
+ automatically applied. By default it enabled for TIFF images and
+ disabled for JPEG.
+
+ - Changed to use the threaded render loop by default on Windows when
+ running with desktop OpenGL (opengl32.dll).
+ - [QTBUG-42813] QQuickRenderControl can now be used to render the Qt Quick
+ scene on a dedicated render thread, similarly to how the built-in
+ threaded render loop operates.
+ - Added Window.width and Window.height attached properties
+ - Added a Shortcut utility type for catching keyboard shortcuts
+
+ - Flickable:
+ * Introduced Flickable.OvershootBounds behavior that allows content
+ overshooting the boundary when flicked, but does not allow dragging
+ content beyond the boundary of Flickable.
+ * [QTBUG-22407] Flickable handles pixel deltas from trackpad gestures as
+ drags, for a more native feel
+
+ - PinchArea:
+ * Pinch gestures are recognized by the operating system on OSX
+ * Fix infinite recursion when TouchCancel events are received.
+
+ - TextInput:
+ * SetFocusOnTouchRelease is honored
+
+ - [QTBUG-44743] Text: Fixed assert when setting an invalid width or height on an
+ <img> tag in a text element.
+
+ - TextEdit:
+ * [QTBUG-44492] Fixed positioning of text decoration with some fonts.
+ * [QTBUG-45032] Fixed issues with using other vertical alignments than
+ AlignTop.
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index a0ed77ffc1..e61a602e64 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -81,16 +81,129 @@ static void showMeTheCode(IR::Function *function, const char *marker)
}
}
-class ProcessedBlocks
+#if !defined(BROKEN_STD_VECTOR_BOOL_OR_BROKEN_STD_FIND)
+// Sanity:
+class BitVector
{
- QBitArray processed;
+ std::vector<bool> bits;
public:
- ProcessedBlocks(IR::Function *function)
+ BitVector(int size = 0, bool value = false)
+ : bits(size, value)
+ {}
+
+ void reserve(int size)
+ { bits.reserve(size); }
+
+ int size() const
{
- processed = QBitArray(function->basicBlockCount(), false);
+ Q_ASSERT(bits.size() < INT_MAX);
+ return static_cast<int>(bits.size());
}
+ void resize(int newSize)
+ { bits.resize(newSize); }
+
+ void assign(int newSize, bool value)
+ { bits.assign(newSize, value); }
+
+ int findNext(int start, bool value, bool wrapAround) const
+ {
+ // The ++operator of std::vector<bool>::iterator in libc++ has a bug when using it on an
+ // iterator pointing to the last element. It will not be set to ::end(), but beyond
+ // that. (It will be set to the first multiple of the native word size that is bigger
+ // than size().)
+ //
+ // See http://llvm.org/bugs/show_bug.cgi?id=19663
+ //
+ // The work-around is to calculate the distance, and compare it to the size() to see if it's
+ // beyond the end, or take the minimum of the distance and the size.
+
+ size_t pos = std::distance(bits.begin(),
+ std::find(bits.begin() + start, bits.end(), value));
+ if (wrapAround && pos >= static_cast<size_t>(size()))
+ pos = std::distance(bits.begin(),
+ std::find(bits.begin(), bits.begin() + start, value));
+
+ pos = qMin(pos, static_cast<size_t>(size()));
+
+ Q_ASSERT(pos <= static_cast<size_t>(size()));
+ Q_ASSERT(pos < INT_MAX);
+
+ return static_cast<int>(pos);
+ }
+
+ bool at(int idx) const
+ { return bits.at(idx); }
+
+ void setBit(int idx)
+ { bits[idx] = true; }
+
+ void clearBit(int idx)
+ { bits[idx] = false; }
+};
+#else // Insanity:
+class BitVector
+{
+ QBitArray bits;
+
+public:
+ BitVector(int size = 0, bool value = false)
+ : bits(size, value)
+ {}
+
+ void reserve(int size)
+ { Q_UNUSED(size); }
+
+ int size() const
+ { return bits.size(); }
+
+ void resize(int newSize)
+ { bits.resize(newSize); }
+
+ void assign(int newSize, bool value)
+ {
+ bits.resize(newSize);
+ bits.fill(value);
+ }
+
+ int findNext(int start, bool value, bool wrapAround) const
+ {
+ for (int i = start, ei = size(); i < ei; ++i) {
+ if (at(i) == value)
+ return i;
+ }
+
+ if (wrapAround) {
+ for (int i = 0, ei = start; i < ei; ++i) {
+ if (at(i) == value)
+ return i;
+ }
+ }
+
+ return size();
+ }
+
+ bool at(int idx) const
+ { return bits.at(idx); }
+
+ void setBit(int idx)
+ { bits[idx] = true; }
+
+ void clearBit(int idx)
+ { bits[idx] = false; }
+};
+#endif
+
+class ProcessedBlocks
+{
+ BitVector processed;
+
+public:
+ ProcessedBlocks(IR::Function *function)
+ : processed(function->basicBlockCount(), false)
+ {}
+
bool alreadyProcessed(BasicBlock *bb) const
{
Q_ASSERT(bb);
@@ -106,7 +219,7 @@ public:
class BasicBlockSet
{
- typedef std::vector<bool> Flags;
+ typedef BitVector Flags;
QVarLengthArray<int, 8> blockNumbers;
Flags *blockFlags;
@@ -119,7 +232,7 @@ public:
const BasicBlockSet &set;
// ### These two members could go into a union, but clang won't compile (https://codereview.qt-project.org/#change,74259)
QVarLengthArray<int, 8>::const_iterator numberIt;
- size_t flagIt;
+ int flagIt;
friend class BasicBlockSet;
const_iterator(const BasicBlockSet &set, bool end)
@@ -138,24 +251,9 @@ public:
}
}
- void findNextWithFlags(size_t start)
+ void findNextWithFlags(int start)
{
- flagIt = std::distance(set.blockFlags->begin(),
- std::find(set.blockFlags->begin() + start,
- set.blockFlags->end(),
- true));
-
- // The ++operator of std::vector<bool>::iterator in libc++ has a bug when using it on an
- // iterator pointing to the last element. It will not be set to ::end(), but beyond
- // that. (It will be set to the first multiple of the native word size that is bigger
- // than size().)
- //
- // See http://llvm.org/bugs/show_bug.cgi?id=19663
- //
- // As we use the size to for our end() iterator, take the minimum of the size and the
- // distance for the flagIt:
- flagIt = qMin(flagIt, set.blockFlags->size());
-
+ flagIt = set.blockFlags->findNext(start, true, /*wrapAround = */false);
Q_ASSERT(flagIt <= set.blockFlags->size());
}
@@ -165,8 +263,8 @@ public:
if (!set.blockFlags) {
return set.function->basicBlock(*numberIt);
} else {
- Q_ASSERT(flagIt <= static_cast<size_t>(set.function->basicBlockCount()));
- return set.function->basicBlock(static_cast<int>(flagIt));
+ Q_ASSERT(flagIt <= set.function->basicBlockCount());
+ return set.function->basicBlock(flagIt);
}
}
@@ -256,7 +354,7 @@ public:
Q_ASSERT(function);
if (blockFlags) {
- (*blockFlags)[bb->index()] = true;
+ blockFlags->setBit(bb->index());
return;
}
@@ -268,10 +366,10 @@ public:
if (blockNumbers.size() == MaxVectorCapacity) {
blockFlags = new Flags(function->basicBlockCount(), false);
for (int i = 0; i < blockNumbers.size(); ++i) {
- blockFlags->operator[](blockNumbers[i]) = true;
+ blockFlags->setBit(blockNumbers[i]);
}
blockNumbers.clear();
- blockFlags->operator[](bb->index()) = true;
+ blockFlags->setBit(bb->index());
} else {
blockNumbers.append(bb->index());
}
@@ -282,7 +380,7 @@ public:
Q_ASSERT(function);
if (blockFlags) {
- (*blockFlags)[bb->index()] = false;
+ blockFlags->clearBit(bb->index());
return;
}
@@ -310,7 +408,7 @@ public:
Q_ASSERT(function);
if (blockFlags)
- return (*blockFlags)[bb->index()];
+ return blockFlags->at(bb->index());
for (int i = 0; i < blockNumbers.size(); ++i) {
if (blockNumbers[i] == bb->index())
@@ -539,12 +637,12 @@ public:
np.todo = children[nodeIndex];
}
- std::vector<bool> DF_done(function->basicBlockCount(), false);
+ BitVector DF_done(function->basicBlockCount(), false);
while (!worklist.empty()) {
BasicBlockIndex node = worklist.back();
- if (DF_done[node]) {
+ if (DF_done.at(node)) {
worklist.pop_back();
continue;
}
@@ -552,7 +650,7 @@ public:
NodeProgress &np = nodeStatus[node];
std::vector<BasicBlockIndex>::iterator it = np.todo.begin();
while (it != np.todo.end()) {
- if (DF_done[*it]) {
+ if (DF_done.at(*it)) {
it = np.todo.erase(it);
} else {
worklist.push_back(*it);
@@ -575,7 +673,7 @@ public:
S.insert(w);
}
}
- DF_done[node] = true;
+ DF_done.setBit(node);
worklist.pop_back();
}
}
@@ -914,8 +1012,8 @@ class VariableCollector: public StmtVisitor, ExprVisitor {
std::vector<Temp> _allTemps;
std::vector<BasicBlockSet> _defsites;
std::vector<std::vector<int> > A_orig;
- std::vector<bool> nonLocals;
- std::vector<bool> killed;
+ BitVector nonLocals;
+ BitVector killed;
BasicBlock *currentBB;
bool isCollectable(Temp *t) const
@@ -979,8 +1077,8 @@ public:
bool isNonLocal(const Temp &var) const
{
Q_ASSERT(!var.isInvalid());
- Q_ASSERT(var.index < nonLocals.size());
- return nonLocals[var.index];
+ Q_ASSERT(static_cast<int>(var.index) < nonLocals.size());
+ return nonLocals.at(var.index);
}
protected:
@@ -1025,7 +1123,7 @@ protected:
addDefInCurrentBlock(t);
// For semi-pruned SSA:
- killed[t->index] = true;
+ killed.setBit(t->index);
}
} else {
s->target->accept(this);
@@ -1037,8 +1135,8 @@ protected:
addTemp(t);
if (isCollectable(t))
- if (!killed[t->index])
- nonLocals[t->index] = true;
+ if (!killed.at(t->index))
+ nonLocals.setBit(t->index);
}
};
@@ -1619,7 +1717,7 @@ void convertToSSA(IR::Function *function, const DominatorTree &df, DefUses &defU
VariableCollector variables(function);
// Prepare for phi node insertion:
- std::vector<std::vector<bool> > A_phi;
+ std::vector<BitVector > A_phi;
const size_t ei = function->basicBlockCount();
A_phi.resize(ei);
for (size_t i = 0; i != ei; ++i)
@@ -1646,7 +1744,7 @@ void convertToSSA(IR::Function *function, const DominatorTree &df, DefUses &defU
BasicBlock *y = *it;
if (!A_phi.at(y->index()).at(a.index)) {
insertPhiNode(a, y, function);
- A_phi[y->index()].at(a.index) = true;
+ A_phi[y->index()].setBit(a.index);
const std::vector<int> &varsInBlockY = variables.inBlock(y);
if (std::find(varsInBlockY.begin(), varsInBlockY.end(), a.index) == varsInBlockY.end())
W.push_back(y);
@@ -1723,10 +1821,10 @@ class StatementWorklist
{
IR::Function *theFunction;
std::vector<Stmt *> stmts;
- std::vector<bool> worklist;
+ BitVector worklist;
unsigned worklistSize;
std::vector<int> replaced;
- std::vector<bool> removed;
+ BitVector removed;
Q_DISABLE_COPY(StatementWorklist)
@@ -1750,7 +1848,7 @@ public:
continue;
stmts[s->id()] = s;
- worklist[s->id()] = true;
+ worklist.setBit(s->id());
++worklistSize;
}
}
@@ -1765,7 +1863,7 @@ public:
if (!s)
continue;
- worklist[s->id()] = true;
+ worklist.setBit(s->id());
++worklistSize;
}
@@ -1776,10 +1874,9 @@ public:
void remove(Stmt *stmt)
{
replaced[stmt->id()] = Stmt::InvalidId;
- removed[stmt->id()] = true;
- std::vector<bool>::reference inWorklist = worklist[stmt->id()];
- if (inWorklist) {
- inWorklist = false;
+ removed.setBit(stmt->id());
+ if (worklist.at(stmt->id())) {
+ worklist.clearBit(stmt->id());
Q_ASSERT(worklistSize > 0);
--worklistSize;
}
@@ -1789,15 +1886,15 @@ public:
{
Q_ASSERT(oldStmt);
Q_ASSERT(replaced[oldStmt->id()] == Stmt::InvalidId);
- Q_ASSERT(removed[oldStmt->id()] == false);
+ Q_ASSERT(removed.at(oldStmt->id()) == false);
Q_ASSERT(newStmt);
registerNewStatement(newStmt);
Q_ASSERT(replaced[newStmt->id()] == Stmt::InvalidId);
- Q_ASSERT(removed[newStmt->id()] == false);
+ Q_ASSERT(removed.at(newStmt->id()) == false);
replaced[oldStmt->id()] = newStmt->id();
- worklist[oldStmt->id()] = false;
+ worklist.clearBit(oldStmt->id());
}
void applyToFunction()
@@ -1818,7 +1915,7 @@ public:
Q_ASSERT(id != Stmt::InvalidId);
Q_ASSERT(static_cast<unsigned>(stmt->id()) < stmts.size());
- if (removed[id]) {
+ if (removed.at(id)) {
bb->removeStatement(i);
} else {
if (id != stmt->id())
@@ -1847,10 +1944,10 @@ public:
return *this;
Q_ASSERT(s->id() >= 0);
- Q_ASSERT(static_cast<unsigned>(s->id()) < worklist.size());
+ Q_ASSERT(s->id() < worklist.size());
- if (!worklist[s->id()]) {
- worklist[s->id()] = true;
+ if (!worklist.at(s->id())) {
+ worklist.setBit(s->id());
++worklistSize;
}
@@ -1860,11 +1957,10 @@ public:
StatementWorklist &operator-=(Stmt *s)
{
Q_ASSERT(s->id() >= 0);
- Q_ASSERT(static_cast<unsigned>(s->id()) < worklist.size());
+ Q_ASSERT(s->id() < worklist.size());
- std::vector<bool>::reference inWorklist = worklist[s->id()];
- if (inWorklist) {
- inWorklist = false;
+ if (worklist.at(s->id())) {
+ worklist.clearBit(s->id());
Q_ASSERT(worklistSize > 0);
--worklistSize;
}
@@ -1884,18 +1980,13 @@ public:
const int startAt = last ? last->id() + 1 : 0;
Q_ASSERT(startAt >= 0);
- Q_ASSERT(static_cast<unsigned>(startAt) <= worklist.size());
+ Q_ASSERT(startAt <= worklist.size());
- Q_ASSERT(worklist.size() == stmts.size());
+ Q_ASSERT(static_cast<size_t>(worklist.size()) == stmts.size());
- // Do not compare the result of find with the end iterator, because some libc++ versions
- // have a bug where the result of the ++operator is past-the-end of the vector, but unequal
- // to end().
- size_t pos = std::find(worklist.begin() + startAt, worklist.end(), true) - worklist.begin();
- if (pos >= worklist.size())
- pos = std::find(worklist.begin(), worklist.begin() + startAt, true) - worklist.begin();
+ int pos = worklist.findNext(startAt, true, /*wrapAround = */true);
- worklist[pos] = false;
+ worklist.clearBit(pos);
Q_ASSERT(worklistSize > 0);
--worklistSize;
Stmt *s = stmts.at(pos);
@@ -1917,9 +2008,9 @@ public:
int newSize = s->id() + 1;
stmts.resize(newSize, 0);
- worklist.resize(newSize, false);
+ worklist.resize(newSize);
replaced.resize(newSize, Stmt::InvalidId);
- removed.resize(newSize, false);
+ removed.resize(newSize);
}
stmts[s->id()] = s;
@@ -1928,7 +2019,8 @@ public:
private:
void grow()
{
- size_t newCapacity = ((stmts.capacity() + 1) * 3) / 2;
+ Q_ASSERT(stmts.capacity() < INT_MAX / 2);
+ int newCapacity = ((static_cast<int>(stmts.capacity()) + 1) * 3) / 2;
stmts.reserve(newCapacity);
worklist.reserve(newCapacity);
replaced.reserve(newCapacity);
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index bb90c4f1b8..559c492dfd 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -42,8 +42,13 @@ QT_BEGIN_NAMESPACE
struct Q_QML_EXPORT QQmlDebuggingEnabler
{
+ enum StartMode {
+ DoNotWaitForClient,
+ WaitForClient
+ };
+
QQmlDebuggingEnabler(bool printWarning = true);
- static bool startTcpDebugServer(int port, bool block = false,
+ static bool startTcpDebugServer(int port, StartMode mode = DoNotWaitForClient,
const QString &hostName = QString());
};
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 48f7ba1bae..31133c862f 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -208,6 +208,9 @@ Or use the \l{QtQml::Qt::rect()}{Qt.rect()} function:
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
\endqml
+The \c rect type also exposes read-only \c left, \c right, \c top and \c bottom
+attributes. These are the same as their \l {QRectF}{C++ counterparts}.
+
When integrating with C++, note that any QRect or QRectF value
\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
converted into a \c rect value, and vice-versa. When a \c rect value is passed to C++, it
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp
index 49b284b979..a90e8e3689 100644
--- a/src/qml/jsruntime/qv4internalclass.cpp
+++ b/src/qml/jsruntime/qv4internalclass.cpp
@@ -199,10 +199,7 @@ InternalClass *InternalClass::nonExtensible()
if (!extensible)
return this;
- Transition temp;
- temp.lookup = 0;
- temp.flags = Transition::NotExtensible;
-
+ Transition temp = { Q_NULLPTR, Q_NULLPTR, Transition::NotExtensible};
Transition &t = lookupOrInsertTransition(temp);
if (t.lookup)
return t.lookup;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 8a7e4b84e7..8cf3d2064d 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1491,18 +1491,29 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
}
/*!
+ * \enum QQmlDebuggingEnabler::StartMode
+ *
+ * Defines the debug server's start behavior. You can interrupt QML engines starting while a debug
+ * client is connecting, in order to set breakpoints in or profile startup code.
+ *
+ * \value DoNotWaitForClient Run any QML engines as usual while the debug services are connecting.
+ * \value WaitForClient If a QML engine starts while the debug services are connecting,
+ * interrupt it until they are done.
+ */
+
+/*!
* Enables debugging for QML engines created after calling this function. The debug server will
* listen on \a port at \a hostName and block the QML engine until it receives a connection if
- * \a block is true. If \a block is not specified it won't block and if \a hostName isn't specified
- * it will listen on all available interfaces. You can only start one debug server at a time. A
- * debug server may have already been started if the -qmljsdebugger= command line argument was
- * given. This method returns \c true if a new debug server was successfully started, or \c false
- * otherwise.
+ * \a mode is \c WaitForClient. If \a mode is not specified it won't block and if \a hostName is not
+ * specified it will listen on all available interfaces. You can only start one debug server at a
+ * time. A debug server may have already been started if the -qmljsdebugger= command line argument
+ * was given. This method returns \c true if a new debug server was successfully started, or
+ * \c false otherwise.
*/
-bool QQmlDebuggingEnabler::startTcpDebugServer(int port, bool block, const QString &hostName)
+bool QQmlDebuggingEnabler::startTcpDebugServer(int port, StartMode mode, const QString &hostName)
{
#ifndef QQML_NO_DEBUG_PROTOCOL
- return QQmlDebugServer::enable(port, port, block, hostName);
+ return QQmlDebugServer::enable(port, port, mode == WaitForClient, hostName);
#else
Q_UNUSED(port);
Q_UNUSED(block);
diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp
index 341ddf802d..b147266080 100644
--- a/src/qml/qml/qqmlvaluetype.cpp
+++ b/src/qml/qml/qqmlvaluetype.cpp
@@ -388,6 +388,26 @@ void QQmlRectFValueType::setHeight(qreal h)
v.setHeight(h);
}
+qreal QQmlRectFValueType::left() const
+{
+ return v.left();
+}
+
+qreal QQmlRectFValueType::right() const
+{
+ return v.right();
+}
+
+qreal QQmlRectFValueType::top() const
+{
+ return v.top();
+}
+
+qreal QQmlRectFValueType::bottom() const
+{
+ return v.bottom();
+}
+
int QQmlRectValueType::x() const
{
return v.x();
@@ -428,6 +448,25 @@ void QQmlRectValueType::setHeight(int h)
v.setHeight(h);
}
+int QQmlRectValueType::left() const
+{
+ return v.left();
+}
+
+int QQmlRectValueType::right() const
+{
+ return v.right();
+}
+
+int QQmlRectValueType::top() const
+{
+ return v.top();
+}
+
+int QQmlRectValueType::bottom() const
+{
+ return v.bottom();
+}
QQmlEasingValueType::Type QQmlEasingValueType::type() const
{
diff --git a/src/qml/qml/qqmlvaluetype_p.h b/src/qml/qml/qqmlvaluetype_p.h
index be453ae35a..2c02cc0aa1 100644
--- a/src/qml/qml/qqmlvaluetype_p.h
+++ b/src/qml/qml/qqmlvaluetype_p.h
@@ -153,6 +153,10 @@ struct QQmlRectFValueType
Q_PROPERTY(qreal y READ y WRITE setY FINAL)
Q_PROPERTY(qreal width READ width WRITE setWidth FINAL)
Q_PROPERTY(qreal height READ height WRITE setHeight FINAL)
+ Q_PROPERTY(qreal left READ left DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal right READ right DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal top READ top DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal bottom READ bottom DESIGNABLE false FINAL)
Q_GADGET
public:
Q_INVOKABLE QString toString() const;
@@ -165,6 +169,11 @@ public:
qreal height() const;
void setWidth(qreal);
void setHeight(qreal);
+
+ qreal left() const;
+ qreal right() const;
+ qreal top() const;
+ qreal bottom() const;
};
struct QQmlRectValueType
@@ -174,6 +183,10 @@ struct QQmlRectValueType
Q_PROPERTY(int y READ y WRITE setY FINAL)
Q_PROPERTY(int width READ width WRITE setWidth FINAL)
Q_PROPERTY(int height READ height WRITE setHeight FINAL)
+ Q_PROPERTY(int left READ left DESIGNABLE false FINAL)
+ Q_PROPERTY(int right READ right DESIGNABLE false FINAL)
+ Q_PROPERTY(int top READ top DESIGNABLE false FINAL)
+ Q_PROPERTY(int bottom READ bottom DESIGNABLE false FINAL)
Q_GADGET
public:
int x() const;
@@ -185,6 +198,11 @@ public:
int height() const;
void setWidth(int);
void setHeight(int);
+
+ int left() const;
+ int right() const;
+ int top() const;
+ int bottom() const;
};
struct QQmlEasingValueType
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index 67092438a7..e87d9ede77 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -315,10 +315,12 @@ ReturnedValue QQmlValueTypeWrapper::method_toString(CallContext *ctx)
const QMetaObject *mo = w->d()->propertyCache->metaObject();
const int propCount = mo->propertyCount();
for (int i = 0; i < propCount; ++i) {
- QVariant value = mo->property(i).readOnGadget(w->d()->gadgetPtr);
- result += value.toString();
- if (i < propCount - 1)
- result += QStringLiteral(", ");
+ if (mo->property(i).isDesignable()) {
+ QVariant value = mo->property(i).readOnGadget(w->d()->gadgetPtr);
+ if (i > 0)
+ result += QLatin1String(", ");
+ result += value.toString();
+ }
}
result += QLatin1Char(')');
}
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index 8b4723f340..5fbae66b6c 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -268,6 +268,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickPinchArea, 1>(uri, 2, 5,"PinchArea");
qmlRegisterType<QQuickImage, 2>(uri, 2, 5,"Image");
+ qmlRegisterType<QQuickMouseArea, 2>(uri, 2, 5, "MouseArea");
}
static void initResources()
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 9b1d54173a..4a44760035 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -498,6 +498,7 @@ void QQuickMouseArea::setEnabled(bool a)
/*!
\qmlproperty bool QtQuick::MouseArea::scrollGestureEnabled
+ \since 5.5
This property controls whether this MouseArea responds to scroll gestures
from non-mouse devices, such as the 2-finger flick gesture on a trackpad.
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index 9fa213c254..4ad14e6bdd 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -54,7 +54,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMouseArea : public QQuickItem
Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged)
Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
- Q_PROPERTY(bool scrollGestureEnabled READ isScrollGestureEnabled WRITE setScrollGestureEnabled NOTIFY scrollGestureEnabledChanged)
+ Q_PROPERTY(bool scrollGestureEnabled READ isScrollGestureEnabled WRITE setScrollGestureEnabled NOTIFY scrollGestureEnabledChanged REVISION 2)
Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedButtonsChanged)
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
@@ -112,7 +112,7 @@ Q_SIGNALS:
void hoveredChanged();
void pressedChanged();
void enabledChanged();
- void scrollGestureEnabledChanged();
+ Q_REVISION(2) void scrollGestureEnabledChanged();
void pressedButtonsChanged();
void acceptedButtonsChanged();
void hoverEnabledChanged();
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 136f23f339..dcc485ce17 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -38,6 +38,7 @@
#include <QtQml/private/qqmlglobal_p.h>
#include <QtQuick/private/qsgdistancefieldutil_p.h>
#include <qopenglfunctions.h>
+#include <qopenglframebufferobject.h>
#include <qmath.h>
#if !defined(QT_OPENGL_ES_2)
@@ -324,7 +325,7 @@ void QSGDefaultDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int
GL_COLOR_BUFFER_BIT, GL_NEAREST);
// Reset the default framebuffer
- m_coreFuncs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ QOpenGLFramebufferObject::bindDefault();
return;
} else if (useTextureResizeWorkaround()) {
@@ -449,7 +450,7 @@ void QSGDefaultDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int
m_funcs->glDeleteTextures(1, &tmp_texture);
m_funcs->glDeleteTextures(1, &oldTexture);
- m_funcs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ QOpenGLFramebufferObject::bindDefault();
// restore render states
if (stencilTestEnabled)
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 608c5f93f5..a848774ae9 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -202,7 +202,12 @@ void QQuickWidgetPrivate::itemGeometryChanged(QQuickItem *resizeItem, const QRec
void QQuickWidgetPrivate::render(bool needsSync)
{
- context->makeCurrent(offscreenSurface);
+ if (!context->makeCurrent(offscreenSurface)) {
+ qWarning("QQuickWidget: Cannot render due to failing makeCurrent()");
+ return;
+ }
+
+ QOpenGLContextPrivate::get(context)->defaultFboRedirect = fbo->handle();
if (needsSync) {
renderControl->polishItems();
@@ -217,6 +222,8 @@ void QQuickWidgetPrivate::render(bool needsSync)
}
static_cast<QOpenGLExtensions *>(context->functions())->flushShared();
+
+ QOpenGLContextPrivate::get(context)->defaultFboRedirect = 0;
}
void QQuickWidgetPrivate::renderSceneGraph()
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp
index 68279413e0..bddece6452 100644
--- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp
@@ -36,7 +36,7 @@
int main(int argc, char *argv[])
{
- bool block = false;
+ QQmlDebuggingEnabler::StartMode block = QQmlDebuggingEnabler::DoNotWaitForClient;
int portFrom = 0;
int portTo = 0;
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
arguments.removeFirst();
if (arguments.size() && arguments.first() == QLatin1String("-block")) {
- block = true;
+ block = QQmlDebuggingEnabler::WaitForClient;
arguments.removeFirst();
}
diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml
index c511c2dfc4..104e7ba1e9 100644
--- a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml
+++ b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml
@@ -1,10 +1,6 @@
import Test 1.0
MyTypeObject {
- property int r_x: rect.x
- property int r_y: rect.y
- property int r_width: rect.width
- property int r_height: rect.height
property variant copy: rect
property string tostring: rect.toString()
diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml
index c3b37a7099..da6deddd75 100644
--- a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml
+++ b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml
@@ -5,6 +5,10 @@ MyTypeObject {
property int r_y: rect.y
property int r_width: rect.width
property int r_height: rect.height
+ property int r_left: rect.left
+ property int r_right: rect.right
+ property int r_top: rect.top
+ property int r_bottom: rect.bottom
property variant copy: rect
}
diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml
index 6ac4049558..eb61755bcf 100644
--- a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml
+++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml
@@ -1,10 +1,6 @@
import Test 1.0
MyTypeObject {
- property real r_x: rectf.x
- property real r_y: rectf.y
- property real r_width: rectf.width
- property real r_height: rectf.height
property variant copy: rectf
property string tostring: rectf.toString()
diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml
index 6ff3ce30bf..878868254d 100644
--- a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml
+++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml
@@ -5,6 +5,10 @@ MyTypeObject {
property real r_y: rectf.y
property real r_width: rectf.width
property real r_height: rectf.height
+ property real r_left: rectf.left
+ property real r_right: rectf.right
+ property real r_top: rectf.top
+ property real r_bottom: rectf.bottom
property variant copy: rectf
}
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 2892e746da..578004b0a1 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -371,6 +371,10 @@ void tst_qqmlvaluetypes::rect()
QCOMPARE(object->property("r_y").toInt(), 3);
QCOMPARE(object->property("r_width").toInt(), 109);
QCOMPARE(object->property("r_height").toInt(), 102);
+ QCOMPARE(object->property("r_left").toInt(), 2);
+ QCOMPARE(object->property("r_right").toInt(), 110);
+ QCOMPARE(object->property("r_top").toInt(), 3);
+ QCOMPARE(object->property("r_bottom").toInt(), 104);
QCOMPARE(object->property("copy"), QVariant(QRect(2, 3, 109, 102)));
delete object;
@@ -418,6 +422,10 @@ void tst_qqmlvaluetypes::rectf()
QCOMPARE(float(object->property("r_y").toDouble()), float(99.2));
QCOMPARE(float(object->property("r_width").toDouble()), float(88.1));
QCOMPARE(float(object->property("r_height").toDouble()), float(77.6));
+ QCOMPARE(float(object->property("r_left").toDouble()), float(103.8));
+ QCOMPARE(float(object->property("r_right").toDouble()), float(191.9));
+ QCOMPARE(float(object->property("r_top").toDouble()), float(99.2));
+ QCOMPARE(float(object->property("r_bottom").toDouble()), float(176.8));
QCOMPARE(object->property("copy"), QVariant(QRectF(103.8, 99.2, 88.1, 77.6)));
delete object;