summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/images/javaiterators1.svg60
-rw-r--r--src/corelib/doc/images/javaiterators2.svg57
-rw-r--r--src/corelib/doc/images/stliterators1.svg90
-rw-r--r--src/corelib/doc/src/containers.qdoc2
-rw-r--r--src/corelib/doc/src/java-style-iterators.qdoc2
-rw-r--r--src/corelib/thread/qfuture.qdoc2
-rw-r--r--src/gui/painting/qcolor.cpp30
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp13
-rw-r--r--src/tools/macdeployqt/shared/shared.cpp27
9 files changed, 227 insertions, 56 deletions
diff --git a/src/corelib/doc/images/javaiterators1.svg b/src/corelib/doc/images/javaiterators1.svg
index 468dbe5371c..c10329ab480 100644
--- a/src/corelib/doc/images/javaiterators1.svg
+++ b/src/corelib/doc/images/javaiterators1.svg
@@ -12,6 +12,11 @@
svg .text-style { font: 20px arial; fill: black }
svg .fill-style { stroke: none; fill: red }
+ svg.dark .box-style { stroke: #f2f2f2; fill: black }
+ svg.dark .line-style { stroke: red; fill: none }
+ svg.dark .text-style { font: 20px arial; fill: #f2f2f2 }
+ svg.dark .fill-style { stroke: none; fill: red }
+
[data-theme="dark"] svg .box-style { stroke: #f2f2f2; fill: black }
[data-theme="dark"] svg .line-style { stroke: red; fill: none }
[data-theme="dark"] svg .text-style { font: 20px arial; fill: #f2f2f2 }
@@ -24,36 +29,53 @@
</style>
<g transform="translate(10.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">A</text>
-<path d="M 0,60 v 30" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">A</text>
+<path d="M 0,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="red" fill="red"
+ class="fill-style" />
</g>
<g transform="translate(90.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">B</text>
-<path d="M 0,60 v 30" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">B</text>
+<path d="M 0,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="red" fill="red"
+ class="fill-style" />
</g>
<g transform="translate(170.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">C</text>
-<path d="M 0,60 v 30" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">C</text>
+<path d="M 0,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="red" fill="red"
+ class="fill-style" />
</g>
<g transform="translate(250.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">D</text>
-<path d="M 0,60 v 30" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">D</text>
+<path d="M 0,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="red" fill="red"
+ class="fill-style" />
</g>
<g transform="translate(330.5, 10.5)">
-<path d="M 0,60 v 30" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
+<path d="M 0,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="red" fill="red"
+ class="fill-style" />
</g>
-
</svg>
diff --git a/src/corelib/doc/images/javaiterators2.svg b/src/corelib/doc/images/javaiterators2.svg
index df4c6b352a6..3b41b3f8730 100644
--- a/src/corelib/doc/images/javaiterators2.svg
+++ b/src/corelib/doc/images/javaiterators2.svg
@@ -15,6 +15,14 @@
svg .text-style { font: 20px arial; fill: black }
svg .small-text-style { font: 12px monospace; fill: black }
+ svg.dark .box-style { stroke: #f2f2f2; fill: black }
+ svg.dark .line-style { stroke: red; fill: none }
+ svg.dark .fill-style { stroke: none; fill: red }
+ svg.dark .np-line-style { stroke: #4080ff; fill: none; stroke-width: 1.5 }
+ svg.dark .np-fill-style { stroke: none; fill: #4080ff }
+ svg.dark .text-style { font: 20px arial; fill: #f2f2f2 }
+ svg.dark .small-text-style { font: 12px monospace; fill: #f2f2f2 }
+
[data-theme="dark"] svg .box-style { stroke: #f2f2f2; fill: black }
[data-theme="dark"] svg .line-style { stroke: red; fill: none }
[data-theme="dark"] svg .fill-style { stroke: none; fill: red }
@@ -33,31 +41,46 @@
</style>
<g transform="translate(10.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">A</text>
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">A</text>
</g>
<g transform="translate(90.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">B</text>
-<path d="M 0,60 c 0,30 50,40 80,30" class="np-line-style" />
-<path d="M 0,60 l -2,14 l 11,-4 z" class="np-fill-style" />
-<text x="-15" y="110" class="small-text-style">previous()</text>
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">B</text>
+<path d="M 0,60 c 0,30 50,40 80,30" stroke="blue" fill="none"
+ class="np-line-style" />
+<path d="M 0,60 l -2,14 l 11,-4 z" stroke="none" fill="blue"
+ class="np-fill-style" />
+<text x="-15" y="110"
+ class="small-text-style">previous()</text>
</g>
<g transform="translate(170.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">C</text>
-<path d="M 0,60 v 50" class="line-style" />
-<path d="M 0,60 l -5,10 l 10,0 z" class="fill-style" />
-<text x="30" y="110" class="small-text-style">next()</text>
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">C</text>
+<path d="M 0,60 v 50" stroke="red"
+ class="line-style" />
+<path d="M 0,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+<text x="30" y="110"
+ class="small-text-style">next()</text>
</g>
<g transform="translate(250.5, 10.5)">
-<path d="m 0,0 h 80 v 60 h -80 z" class="box-style" />
-<text x="35" y="36" class="text-style">D</text>
-<path d="M 0,60 c 0,30 -50,40 -80,30" class="np-line-style" />
-<path d="M 0,60 l 2,14 l -11,-4 z" class="np-fill-style" />
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">D</text>
+<path d="M 0,60 c 0,30 -50,40 -80,30" stroke="blue" fill="none"
+ class="np-line-style" />
+<path d="M 0,60 l 2,14 l -11,-4 z" stroke="none" fill="blue"
+ class="np-fill-style" />
</g>
-
</svg>
diff --git a/src/corelib/doc/images/stliterators1.svg b/src/corelib/doc/images/stliterators1.svg
new file mode 100644
index 00000000000..478211c78d7
--- /dev/null
+++ b/src/corelib/doc/images/stliterators1.svg
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ version="1.1"
+ width="420"
+ height="110"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+
+<style>
+ svg .box-style { stroke: black; fill: white }
+ svg .line-style { stroke: red; fill: none }
+ svg .text-style { font: 20px arial; fill: black }
+ svg .fill-style { stroke: none; fill: red }
+ svg .fn-text-style { font: 14px monospace; fill: black }
+
+ svg.dark .box-style { stroke: #f2f2f2; fill: black }
+ svg.dark .line-style { stroke: red; fill: none }
+ svg.dark .text-style { font: 20px arial; fill: #f2f2f2 }
+ svg.dark .fill-style { stroke: none; fill: red }
+ svg.dark .fn-text-style { font: 14px monospace; fill: #f2f2f2 }
+
+ [data-theme="dark"] svg .box-style { stroke: #f2f2f2; fill: black }
+ [data-theme="dark"] svg .line-style { stroke: red; fill: none }
+ [data-theme="dark"] svg .text-style { font: 20px arial; fill: #f2f2f2 }
+ [data-theme="dark"] svg .fill-style { stroke: none; fill: red }
+ [data-theme="dark"] svg .fn-text-style { font: 14px monospace; fill: #f2f2f2 }
+
+ [data-theme="light"] svg .box-style { stroke: black; fill: white }
+ [data-theme="light"] svg .line-style { stroke: red; fill: none }
+ [data-theme="light"] svg .text-style { font: 20px arial; fill: black }
+ [data-theme="light"] svg .fill-style { stroke: none; fill: red }
+ [data-theme="light"] svg .fn-text-style { font: 14px monospace; fill: black }
+</style>
+
+<g transform="translate(10.5, 10.5)">
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">A</text>
+<path d="M 40,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 40,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+</g>
+
+<g transform="translate(90.5, 10.5)">
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">B</text>
+<path d="M 40,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 40,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+</g>
+
+<g transform="translate(170.5, 10.5)">
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">C</text>
+<path d="M 40,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 40,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+</g>
+
+<g transform="translate(250.5, 10.5)">
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ class="box-style" />
+<text x="35" y="36" font-family="arial" font-size="20px"
+ class="text-style">D</text>
+<path d="M 40,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 40,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+</g>
+
+<g transform="translate(330.5, 10.5)">
+<path d="m 0,0 h 80 v 60 h -80 z" stroke="black" fill="white"
+ stroke-dasharray="3,3"
+ class="box-style" />
+<text x="20" y="36" font-family="monospace" font-size="14px"
+ class="fn-text-style">end()</text>
+<path d="M 40,60 v 30" stroke="red"
+ class="line-style" />
+<path d="M 40,60 l -5,10 l 10,0 z" stroke="none" fill="red"
+ class="fill-style" />
+</g>
+</svg>
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index 874ab807609..38ce2188e13 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -275,7 +275,7 @@
The diagram below shows the valid iterator positions as red
arrows for a list containing four items:
- \image stliterators1.png
+ \image stliterators1.svg STL-style iterators point to items
Iterating backward with an STL-style iterator is done with reverse iterators:
diff --git a/src/corelib/doc/src/java-style-iterators.qdoc b/src/corelib/doc/src/java-style-iterators.qdoc
index a0e5c53d633..fc1378bb718 100644
--- a/src/corelib/doc/src/java-style-iterators.qdoc
+++ b/src/corelib/doc/src/java-style-iterators.qdoc
@@ -70,7 +70,7 @@
\l{QListIterator::next()}{next()} and
\l{QListIterator::previous()}{previous()} on an iterator:
- \image javaiterators2.png Iterating to the next and previous items
+ \image javaiterators2.svg Iterating to the next and previous items
The following table summarizes the QListIterator API:
diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc
index f3f32e20adc..5e97086694b 100644
--- a/src/corelib/thread/qfuture.qdoc
+++ b/src/corelib/thread/qfuture.qdoc
@@ -786,7 +786,7 @@
between the second and third result, and returns the second result; and
so on.
- \image javaiterators1.png
+ \image javaiterators1.svg
Here's how to iterate over the elements in reverse order:
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index fe79490f54b..d63da38b747 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -2196,29 +2196,27 @@ QColor QColor::toHsv() const noexcept
color.ct.ahsv.alpha = ct.argb.alpha;
color.ct.ahsv.pad = 0;
- const float r = ct.argb.red / float(USHRT_MAX);
- const float g = ct.argb.green / float(USHRT_MAX);
- const float b = ct.argb.blue / float(USHRT_MAX);
- const float max = Q_MAX_3(r, g, b);
- const float min = Q_MIN_3(r, g, b);
- const float delta = max - min;
- color.ct.ahsv.value = qRound(max * USHRT_MAX);
- if (qFuzzyIsNull(delta)) {
+ const ushort r = ct.argb.red;
+ const ushort g = ct.argb.green;
+ const ushort b = ct.argb.blue;
+ const auto [min, max] = std::minmax({r, g, b});
+ color.ct.ahsv.value = max;
+ if (max == min) {
// achromatic case, hue is undefined
color.ct.ahsv.hue = USHRT_MAX;
color.ct.ahsv.saturation = 0;
} else {
// chromatic case
- float hue = 0;
+ const float delta = max - min; // cannot overflow
+ float hue;
color.ct.ahsv.saturation = qRound((delta / max) * USHRT_MAX);
- if (qFuzzyCompare(r, max)) {
- hue = ((g - b) /delta);
- } else if (qFuzzyCompare(g, max)) {
- hue = (2.0f + (b - r) / delta);
- } else if (qFuzzyCompare(b, max)) {
- hue = (4.0f + (r - g) / delta);
+ if (max == r) {
+ hue = 0 + (g - b) / delta;
+ } else if (max == g) {
+ hue = 2 + (b - r) / delta;
} else {
- Q_ASSERT_X(false, "QColor::toHsv", "internal error");
+ Q_ASSERT(max == b); // max({r,g,b}) must be one of r, g, and b!
+ hue = 4 + (r - g) / delta;
}
hue *= 60.0f;
if (hue < 0.0f)
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 6428653de26..66bb65685fa 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -216,6 +216,19 @@ static void ensureInitialized()
can be:
\snippet code/src_network_access_qnetworkaccessmanager.cpp 1
+ Since Qt 6.11 the defaults of the TCP Keepalive parameters used by
+ QNetworkAccessManager have been changed. With the current settings
+ the connection will be terminated after 2 minutes of inactivity.
+
+ These settings can be changed the individual requests, to make
+ them more lenient, or even more aggressive via the QNetworkRequest API.
+ \snippet http/httpwindow.cpp qnam-tcpkeepalive
+
+ In the above snippet we are picking a more aggressive strategy, to
+ terminate the connection after thirty seconds of inactivity. This can
+ be useful, for example, in early detection of network hangs caused
+ by network changes on Linux.
+
\sa QNetworkRequest, QNetworkReply, QNetworkProxy
*/
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index 0731fb616ed..7f8590ae894 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1008,6 +1008,31 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks,
rpathsUsed.append(framework.rpathUsed);
}
+ // To properly find all dependencies of the current framework / library further down in
+ // getQtFrameworks, we need to get its rpaths, resolve them in the context of its original
+ // location before it is copied, and add them as candidate rpaths.
+ //
+ // This is necessary to handle cases like
+ // (1) QtNetwork.framework -> (2) libbrotlidec.dylib -> (3) libbrotlicommon.1.dylib
+ // to correctly resolve the path to (3) when it is referenced as
+ // '@rpath/libbrotlicommon.1.dylib' and (2) has an LC_RPATH of '@loader_path/../lib', and
+ // no other absolute rpaths. So the '@loader_path/../lib' will be resolved relative
+ // to (2)'s original location and its LC_RPATH.
+ //
+ // Otherwise we'd only have the Qt prefix and the current bundle app dir as rpath
+ // candidates, and once (2) is copied into the app bundle, there's no way
+ // '@rpath/libbrotlicommon.1.dylib' could resolve to the real path on disk from the two
+ // candidates above.
+ if (!framework.sourceFilePath.isEmpty()) {
+ const QList<QString> sourceRPaths = getBinaryRPaths(framework.sourceFilePath, true);
+ for (const QString &sourceRPath : sourceRPaths) {
+ const QDir sourceRPathDir(sourceRPath);
+ if (sourceRPathDir.exists() && !rpathsUsed.contains(sourceRPath)) {
+ rpathsUsed.append(sourceRPath);
+ }
+ }
+ }
+
// Copy the framework/dylib to the app bundle.
const QString deployedBinaryPath = framework.isDylib ? copyDylib(framework, bundlePath)
: copyFramework(framework, bundlePath);
@@ -1032,7 +1057,7 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks,
for (const FrameworkInfo &dependency : dependencies) {
if (dependency.rpathUsed.isEmpty()) {
changeInstallName(bundlePath, dependency, QStringList() << deployedBinaryPath, useLoaderPath);
- } else {
+ } else if (!rpathsUsed.contains(dependency.rpathUsed)) {
rpathsUsed.append(dependency.rpathUsed);
}