Add refreshQuery() and refreshQuery(const QSqlDatabase &db) to refresh the model data.
[ChangeLog][QtSql][QSqlQueryModel] Added refreshQuery() and
refreshQuery(const QSqlDatabase &db) to refresh the model data.
Fixes: QTBUG-123603
Change-Id: I6738006dd8ca2fc82f3b4ad88b663c7b353a09f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Only UintData::metaTypeCount() is used and it calls directly
MetaTypeList::count(). These two did not compile if one attempted to
instantiate them.
Change-Id: I5815d042d9019b29fff3fffd8a17841704d2e1c2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Push buttons' optics can be optimized by adding vertical margin.
Implement it in QFusionStyle.
Change-Id: Iaa66738e5f854de11ef317ffba4df2b2bbee5da2
Found-by: Alessandro Portale@qt.io <alessandro.portale@qt.io>
Task-number: QTBUG-94860
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
As a drive-by replace calls to QList::append with emplace_back,
to avoid repeating value_type.
Pick-to: 6.8
Task-number: QTBUG-115841
Change-Id: I027d82706f3545dd63c6b8ba89ba66ae938e07f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Looks like this was an oversight from Qt4 times where there was no
QCoreApplication. But nowadays the plugin loader only needs a
QCoreApplication instead a QApplication.
Pick-to: 6.8
Change-Id: I878ee157968ca0cd45314f955fc732d0f00b11ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A lookup to QHash<QString,...> works perfectly fine for a
QLatin1StringView so no need to create a QString first.
Pick-to: 6.8
Change-Id: I4cd5f3c0bab8f9af696e8ae2d3eefad77f2e8722
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We need to enable users to abort the connection to a website if, after
performing the TLS handshake, they decide not to continue. Without
sending any data.
The problem with QHttp2Connection was that it would always send
the preface as soon as the object was created, along with the
SETTINGS frame, which may in turn be seen as leaking info from
the user (disregarding that ALPN negotiations already succeeded).
This change requires us to create the first stream before the SETTINGS
gets sent, so this also rearranges all of the QHttp2Connection tests
to create a stream before waiting for the SETTINGS ACK.
Not cherry-picking because this was never considered a problem for
gRPC, but was something we worked to make happen for QNAM.
Change-Id: I84063adf3401a143046514499c2443506c60192c
Reviewed-by: Mate Barany <mate.barany@qt.io>
9122d826d25b9afab230771dc86e1ff6158e6cbc introduced support in the Cocoa
backend to provide a hint to applications to not trigger new frames on
the render thread without the main thread being the driver which can
cause painting to be out of sync with the expected size and appear
glitchy.
This problem exists on other platforms, moving the current mechanism to
QPlatformWindow allows other backends to opt-into it.
Change-Id: I03ea1354c3768f2b5feb82596ce5f0d0138c5976
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We'd like to compile-test doc_snippets on some configurations. So far,
we enable this by checking the private_tests feature, that is in turn
enabled by default by developer_build.
Let's rather have a separate doc_snippets feature, as we might turn
this on and off independently from private tests. In fact, private API
shouldn't be used by any of the snippets.
Change-Id: Icba8f6af610d7951e65783d8b1700be57584cc4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Commit e2ff9e3b9957 was adding Q_OBJECT as a qdoc macro to allow to mask
Q_OBJECT calls that are part of the documentation. Anyhow, while qdoc
does allow the underscore in the _definition_ of macros, it doesn't
allow it for the _invocation_. The questionable places should rather
use snippet files.
Fixes: QTBUG-130799
Pick-to: 6.8
Change-Id: I13bac0334b67ba7072946ab7d3f34c7a304c3f84
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Colorful emojis in Unicode are not isolated to specific ranges
of code points like other writing systems. Instead, there are
a set of rules defining whether a sequence of characters should
be displayed in color or black/white.
http://www.unicode.org/reports/tr51/
For instance, appending a variation selector to a character can
turn it into a color emoji, even if it is a code point that
predates the invention of emojis.
In addition, sequences of joined characters that are determined
to be a color emoji sequence should be parsed by a single emoji
font, so that it can apply things like skin color, etc.
In general, users expect emojis and emoji sequences to be shown
in the preferred color font of the system, even if a selected
font has black/white characters for the symbols.
This patch applies the emoji segmenter to strings to isolate
sequences that should be in color. As an implementation hack,
we mark this in the QScriptItems as a special "emoji" script.
Note that this is not a real Unicode script and only exists
internally for this reason, because the "emojiness" of the
resulting glyph overrides the original script of the
individual characters when selecting fonts. This way, we can
use a lot of the same logic for itemizing the strings and
looking up fonts, and we don't need to increase the size of
the QScriptItem. (It is just an implementation detail and
is not exposed to the user, so it can be replaced by other
approaches later if we need to.)
When matching an emoji sequence, we always try to apply a
color font and ignore all others. The exception is if there
is no color font at all on the system, then we will find a
black and white font which supports the characters instead
as a final failsafe.
In addition, each platform will put its default emoji font
at the top of the fallbacks list in order to make this the
preference in case there are more than one. This patch also
adds API to override this with an application-defined emoji
font, since this is a common use case.
Note: The font includes an environment variable to disable
the feature as a fail safe. A flag to disable it per QFont
will be added in a follow-up.
Fixes: QTBUG-111801
Change-Id: I9431ec34d56772ab8688814963073b83b23002ae
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: <carl@carlschwan.eu>
Says GCC (e.g.):
qabstracteventdispatcher.h:122:9:
warning: ‘virtual int QAbstractEventDispatcherV2::remainingTime(int)’ was
hidden [-Woverloaded-virtual]
122 | int remainingTime(int timerId) final;
| ^~~~~~~~~~~~~
qeventdispatcher_glib_p.h:47:14:
warning: by ‘virtual QAbstractEventDispatcher::Duration
QEventDispatcherGlib::remainingTime(Qt::TimerId) const’
[-Woverloaded-virtual]
47 | Duration remainingTime(Qt::TimerId timerId) const override final;
| ^~~~~~~~~~~~~
The usual way to fix this warning, adding `using base::func;`, doesn't
work here, because (the int overloads of) the functions in question
are made private in QAbstractEventDispatcherV2, so the `using` fails
with "is private in this context" errors.
Since this situation is temporary (until Qt 7, when the overloading
stops), simply suppress the warnings manually.
Found that the Windows dispatcher doesn't inherit from V2, yet, and
created QTBUG-129170 to track the issue.
Amends f8da484d5741d1191504eefddf5134fd7009e16a.
Pick-to: 6.8
Task-number: QTBUG-126219
Change-Id: I0da821f08364f97fb7a17c9019586064ae58b0b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QCupsPrintEnginePrivate::closePrintDevice() function expects the
cupsOptions string-list to have an even number of elements, because it
iterates in steps of two and doesn't check the size of the container
while in-between steps.
Print a qWarning() in setProperty() when the option value string-list
has an odd number of elements in it, and append an empty entry to
maintain the expected format for closePrintDevice(). This is the
least-intrusive way to fix the problem, hopefully defining previously
undefined behavior without other user-visible effects.
Amends f70924e9ccc016b979bc74bba156600639184be7, which, however, may
have merely moved the code around.
[ChangeLog][QtPrintSupport][QCupsPrintEngine] Fixed a bug where setting
a value string-list with an odd number of elements as the
PPK_CupsOptions value would read uninitialized data.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I38ed8de6da00f17fa8fe9138d54db3699943f3b1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This can be useful for QRhiWidget subclasses with PIMPL.
Also add Q_WIDGETS_EXPORT for QRhiWidgetPrivate.
Change-Id: Idec480454dca59313f8baaa8d6369cb4a85ea567
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
As requested in qtbase/5d174877234477a59eb29818d3cfb99fedc3e704.
Change-Id: I5f6568921a25918a5ae3fffdff7c136d3eb455a9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The stream insertion operator for QDebug is not overloaded
to handle std::unordered_map
Overload the stream insertion operator for QDebug
to handle std::unordered_map
[ChangeLog][QtCore][QDebug] Added support for std::unordered_map.
Fixes: QTBUG-130290
Change-Id: I96e82f90c310dcac4a6e4d35651fb1adb6d6293a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QZipReader::extractAll handles zip files without dir entries in a way that
it creates the dirs automatically.
Fixed this logic for files in the root of the zip file by skipping those.
Fixes: QTBUG-131008
Change-Id: Ia7cde0f2762f4566564e8524b71f43834158f09c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is a potential race condition on Mac that can lead to crashes
when destroying `QNetworkConnectionMonitor`. This issue arises when
`QNetworkConnectionMonitorPrivate` has already been destroyed, but is
still being accessed through `QNCMP::probeCallback()` from another
thread.
To fix the issue, a reference counter is used.
This counter indicates whether the callback is being used in monitoring.
It increases when information is retained (when we set the callback,
the info retains to 1) and decreases when information is released
(the info releases to 0, when QNCMP object is not used in monitoring).
A waitCondition is used to notify all threads when the reference counter
reaches zero. The QNCMP::reset function waits until
the probeCallback is disconnected and the reference counter is zero.
This indicates that the info resource is free,
allowing us to safely destroy the QNCMP object.
The conditional variable protects
the QNetworkConnectionMonitorPrivate object and ensures
that the callback is disconnected properly.
Fixes: QTBUG-130552
Pick-to: 6.8 6.5
Change-Id: I1259c429e92bc20c382604192243d6d8fadb5c25
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
It hasn't seemingly made a difference in the time since then but we were
using 2.0, apparently an internal draft version.
Fixes: QTBUG-130590
Change-Id: I78e25eba76dc9a3150932981f6c703eb0b7f3874
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Same limitation as setting priority; it only applies to threads that
start after the call.
Change-Id: I0f77467a76ce2f4e7743d04fde344ef08cd8dbb8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Various pieces of QTZP and QTZ rely (by using std::set_union or
std::set_intersection) on the backends supplying the list of available
IDs in sorted order. As this isn't documented as part of public API
behavior, document it internally and assert it.
Add the missing sorting and uniquification for Android; although the
Java API used does appear to return a sorted list, its specification
[0] says nothing about its ordering, so make sure. In the process,
rename a wantonly long variable so the uniquifying doesn't need a
line-split.
[0] https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html#getAvailableIDs--
Document, in the ICU backend, that the relevant API doesn't say what
order it returns; but also make clear where the backend *does* take
care of sorting it and rendering entries unique.
Change-Id: I61b4ecf342044e2303b18889c600da5922aec278
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
On some platforms and setups, the multi-threaded implementation of this functionality is not desirable. Allow disabling it at runtime by setting the environment variable QT_NO_GUI_THREADPOOL.
Pick-to: 6.8
Task-number: QTBUG-129650
Change-Id: If089ecb3b335defc06f14749841bf9f6041e6f5e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
In the line break algorithm, we try filling characters and
objects onto a text line until we see an overflow. We then
keep the state *before* the overflow as the current line and
move to the next.
However, for inline images we would store its height to the
current state before checking if it overflowed. So if the
inline image did cause an overflow it would be counted
towards the height of the preceding line in addition to the
line where it actually ended up.
[ChangeLog][Text] Fixed an issue which could cause the
height of a word-wrapped text line to grow if the immediate
line after it began with an inline image.
Pick-to: 5.15 6.5 6.8
Fixes: QTBUG-130980
Change-Id: I68494b49059e5e35349cbde77aefc64abeb69697
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
When a corner widget in a QTabWidget is hidden then the space is not
reclaimed for the tabs. Check whether the corner widget is visible before
laying out the corner contents.
Fixes: QTBUG-18068
Pick-to: 6.8
Change-Id: Ib07ad15a7317e37101dde87c6f80c91c6c4ac6d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Uses __weak if possible, and otherwise falls back to associated objects.
Replaces manual tracking of QNSView lifetime for QCocoaDrag.
Task-number: QTBUG-116554
Pick-to: 6.8
Change-Id: I56f2707bbf5aa14a9efd0ec29e37b157e97cfc3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is a parser for emoji sequences developed by Google
which is used in multiple other projects for parsing
sequences of characters to see if they should be represented
as color emojis or as monochrome text.
[ChangeLog][Third-Party Code] Added the emoji-segmenter to
third party code, for supporting complex emoji sequences.
This can be configured using the -emojisegmenter option.
Task-number: QTBUG-111801
Change-Id: I7f87b0751415024d29f074d133850027f0003e29
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends e5f9738385d8fc49492bc759472a571e241a5501, which removed the
turning on of anti-aliasing, under the assumption that QCachedPainter
always turns on anti-aliasing (which was initially the case, but then
reverted in 1ad9330a9c56a59d407f5644fe547ba69c1a205b). On the other
hand, the later QCachedPainter instances still turned on anti-aliasing
explicitly.
Now we do so again consistently, but setting it on the painter we get;
QCachedPainter will then use the same render hints.
As a drive-by, constify the variables with the old painter states
consistently.
Change-Id: I2ed31ae42c77f07d8496dcb16b767def29203973
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The getters were used to convert types in an undefined manner.
No usage of the methods outside of qtbase (Qt and KDE searched)
has been found, and qtbase is already fixed.
Change-Id: I9fe77de842a2e0023b011e6eee257d6c6a28a3f5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Auto test tst_QWidget::setParentChangesFocus is flaky where
QVERIFY(QTest::qWaitForWindowActive(secondary.get())) sometimes return
false.
Modify QVERIFY for QTRY_VERIFY to give the necessary time to the XCB
thread to proceed.
Remove the flakiness when testing on Opensuse 15.5
Change-Id: I5ff5b7a1d9071482d9a955f8309abec0f70f97f2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When a label is displaying a QPixmap after it showed text, the pixmap
was not shown as the label still was in 'text-mode'. Add the missing
clearContents() before setting a new QPixmap. This was removed by
accident with 81e74cfa2610fb2aa90b2352d498762d46d0ddd5.
This amends 81e74cfa2610fb2aa90b2352d498762d46d0ddd5.
Task-number: QTBUG-122403
Change-Id: I024df6a17458f98f715eba13caaffb3213d0e9fa
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The tst_QFont::italicOblique() test is testing whether
a request for an "Oblique" font in the presence of an italic
one (or vice versa) may return the other as a second-best match.
However, it did not consider the fact that some fonts may not
be marked as italic even if the style name contains the word
"italic". One instance of this are variable fonts with oblique
instances. In this case we currently do not correctly recognize
the fonts as oblique.
But there is nothing preventing someone from creating a normal
font that has "italic" in the style name and not setting it as
italic in the OS/2 table (maybe the style name is "non-italic"),
so we can't really depend on this.
This makes the test a bit more robust by checking if the actual
font stored in the database is italic and verifying a match with
the requested oblique font. There are still cases that might
fail here, but we don't need to address those unless they
actually appear.
Pick-to: 6.5 6.8
Fixes: QTBUG-131108
Task-number: QTBUG-131262
Change-Id: I9ae0d37d378e8fec2be524db203dcea9a881f15a
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
These files use errno constants such as EACCES, while relying on
this header to be included implicitly.
If building with the latest libc++ versions, configured with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1 (which removes unnecessary
transitive includes from the public headers), one runs into this
error, where errno.h no longer is implicitly included through
other headers.
Prior to 762017f03ca530937dfe24cc822065e08111f985, these functions
were in separate files that explicitly did include errno.h.
Pick-to: 6.8
Change-Id: I7b02f2ffa35b86606f6c173bf6a6d2917dbdc151
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Opening existing directory with write mode always passes on VxWorks, the
reason is to be found. This causes the failure of
tst_QFile::openDirectory test function.
We need to run tests on COIN for VxWorks as significant, and fail in
QFile::openDirectory test functions prevents it, to reduce growing
number of regressions and allow iterative introduction of VxWorks as a
supported platform.
Add QEXPECT_FAIL macro to tst_QFile::openDirectory() test function for
VxWorks before verifying if opening of directory with ReadWrite
permissions works.
Task-number: QTBUG-115777
Task-number: QTBUG-130074
Change-Id: Iba8bd5ed143d43ddd665b213cc850af503e476e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The logging category now silences QtWarningMsg and below by
default, so we can be more granular in our logging.
Use info logging category for registering/unregistering, to allow
filtering out the detailed debug logging while still seeing when
devices are registered/unregistered.
Log the number of buttons for pointing devices, if there are any.
Log the device for wheel events.
Pick-to: 6.8
Change-Id: Ie046fee1659fc3967caf7eafbaf46f3ed22be5bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This reverts commit 6bb3feffd56424d0990b1345f343012a60e3351e, which
resulted in cyclic dependencies when running _check targets several
times:
ninja: error: dependency cycle: qtbase/src/android/templates/build.gradle
-> qtbase/src/android/templates/build.gradle
Pick-to: 6.8
Change-Id: I5ae178d137044afe7b627d2637bc43913f00812a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There is one minor difference: we now use operator== instead of
operator!= now, so some defective types may start working (but may break
some other, defective types).
Simplifies the emitted code, from
case 6:
if (_t->sMember != *reinterpret_cast< QString*>(_v)) {
_t->sMember = *reinterpret_cast< QString*>(_v);
Q_EMIT _t->member5Changed(_t->sMember);
}
break;
case 8:
if (_t->sub.m_string != *reinterpret_cast< QString*>(_v)) {
_t->sub.m_string = *reinterpret_cast< QString*>(_v);
}
break;
to:
case 6:
if (QtMocHelpers::setProperty(_t->sMember, *reinterpret_cast<QString*>(_v)))
Q_EMIT _t->member5Changed(_t->sMember);
break;
case 8: QtMocHelpers::setProperty(_t->sub.m_string, *reinterpret_cast<QString*>(_v)); break;
The second parameter to setProperty() helper is passed as an rvalue
reference and forwarded to the assignment, making this ready for move
semantics when moc generates code for it.
Change-Id: I45ad4a236d38f6c8f994fffd701d4193504d985a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Amends e70cc743bc89afa7f36cd6afa520af2dab763c3a by fixing a
copy/paste from CC_SpinBox handling.
Task-number: QTBUG-129680
Change-Id: Ib122feedeed7cb502d4d1f789e3c83573cacb402
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Clang warning:
.../qproperty_p.h:666:58: warning: declaration shadows a local variable [-Wshadow]
666 | if (QPropertyObserverPointer observer = d.firstObserver())
| ^
.../qproperty_p.h:660:46: note: previous declaration is here
660 | if (QPropertyObserverPointer observer = d.firstObserver()) {
|
Fix by abbreviating the variable name in if statement.
Pick-to: 6.8
Change-Id: I7905de08f15124466f8aa587691b2880c889199f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Per render target blending is required for WeightedBlended order
independent transparency method.
Also add an autotest for the feature.
Task-number: QTBUG-130334
Change-Id: Iae1bd75c917f0f1f8314e57091d3f71dc4ffd92a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The change adds CPE and PURL keys to all qt_attribution.json files in
the repo.
In case if no sensible CPE or PURL exists, a "Comment" field is added
with the text "no relevant CPE or PURL found". If only one of them
does not exist, it is written as such in the Comment field.
This allows filtering for files that haven't had the information added
yet vs those that were looked up but no relevant information was
found.
For sources that are not hosted on github, a generic PURL is used with
a download_url fragment pointing either to the exact location where
the sources can be downloaded, or to the homepage of the project.
The generic package name was chosen based on the 'Id' key of the
attribution entry where it was present, and is not authoritative.
For PURL github packages, the 'git tag' name was specified into the
'version' part of the PURL, rather than the 'version number', because
SBOM processing tooling handle that better than the version number.
For example for the freetype package, we specify the string
'VER-2-13-3' rather than the tag name '2.13.3'.
We might revisit this in the future.
[ChangeLog][Third-Party Code] Added PURL and CPE information to the
attribution files of 3rd party sources.
Pick-to: 6.5 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129602
Change-Id: Iad126242cafc3ea0b678c5c36b26f857039b1dbd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
If building within Yocto with lttng enabled syncqt's generated headers
will contain full paths, so the check for `startWith('Q')` must check
the basename only
Change-Id: I0c3621b2b5062c085ffa0b70c7f16ff9c16c26b7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This change prepares Qt for upgrading to Emscripten 3.1.70.
There is some weird behavior on emscripten which requires these flags:
https://github.com/emscripten-core/emscripten/issues/21844
Task-number: QTBUG-131279
Change-Id: I1b2a95241d6055fbcc4c6c451b62da1d3d3b3e7e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>