It's deprecated. Port some unnamed enumerations (used only to
declare constants) to constexpr integers instead. Apply qToUnderlying
as needed.
Task-number: QTBUG-94059
Change-Id: Ifaa64ece966ce08df40dc71ffcfa7ac038110e0b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both code paths (write() for the main thread and waitCallback() for
the worker thread) use the same logic when processing write results.
To avoid code duplication, consolidate the common part for both threads
in the startAsyncWriteLocked() function.
Change-Id: Ie2663b2ed221e2797a1ecbdb3fcee0ee8f030cc0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
One link was wrong. Also, the %VERSION%/%SHORTVERSION%
syntax seem to be some leftover from pre-git times?
All in all, I doubt the need for this file.
Pick-to: 6.1 6.2
Change-Id: I52e93b056d17e05831f97d6c34232b3265accba7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This reverts commit c686e885c0
and commit d64abf8166.
We don't feature .qmake.cache/.qmake.super files anymore in the
source directory, so there's no problem anymore.
Change-Id: Ib820a109fbfbad70d85b0f14ef72915882217ca3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Some of the data members related to progress reporting (min, max and
text) aren't used when user doesn't want manual progress reporting, so
the data for them can be allocated on demand, when the user explicitly
sets them. Note, that we still need to always create other related data
(current value and progress timer), since in the non-manual mode
progress is still reported by incrementing the current value each time
a new result is reported.
Task-number: QTBUG-92045
Change-Id: I1e5bd17de2613a6ea72ccff0029812f67686708b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
QFuture doesn't need both at the same time, calling QFuture::result(s)
either returns a result or throws an exception. Store result and
exception stores in a union, to reduce the memory.
Also added a note for making the ResultStoreBase destructor non-virtual
in Qt 7.
Task-number: QTBUG-92045
Change-Id: I7f0ac03804d19cc67c1a1466c7a1365219768a14
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
A follow-up to 6ec3321875 where the
function was optimized using a hand-rolled lazy-split on a QBAView.
Now that QLatin1String::indexOf(QLatin1String) has been optimized we can
use QStringTokenizer instead.
Change-Id: I30b15d309e7c364c0a4dafe31651b39ea14db7e5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Removing flags based on REGEX may include spaces, so flags might be
glued. Replace flags with spaces to keep at least one space for
the described case.
Pick-to: 6.2 6.1
Fixes: QTBUG-94400
Change-Id: Ice268da36174ef5cf4398d2aee8fcd4731336316
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Rather than when the data is received. Source compatibility is
achieved through double-decompressing the data. This lets us know
how many bytes are available just as before but without having the
uncompressed data left in memory.
Fixes: QTBUG-83269
Change-Id: I352bd09581614c582e4628243e2a0e895ba4946b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Small change needed to make QString_char16 and QString_QChar return -1
in this case, but other combinations already returns -1.
[ChangeLog][QtCore][Behavior Change] QString::indexOf(QChar) and
QString::indexOf(char16_t) now treat a negative start-position, from,
bigger than the string's size as invalid. It previously
clipped such start-positions to the start of the string, inconsistently
with other QString indexOf overloads.
Change-Id: Ic56c8a558bf40a94845c649647db569892d4df02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
tst_QStringList::sort() wants to use the C locale; but, if it failed,
it left that in force, since it only restored the prior locale on
success. It should also use C.UTF-8, since Qt now wants UTF-8.
Change-Id: If62e3d8da682081bf969075a719d03caebf09233
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We need those events to trigger palette color group changes in QQuickItem
without having to connect every item to yet another QWindow signal.
Task-number: QTBUG-93752
Pick-to: 6.2
Change-Id: I8534808cdaab828e5876f8fda31567aeb1b4272a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We use UTF-8 locales by default since Qt 6; and relatively few systems
have the encoding-unspecified locales we were trying to use, with the
result that the setlocale() calls all failed.
Task-number: COIN-689
Change-Id: Id791ba269bf4abac29da3daa4fd01684ca9caa7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Because they were followed by a QVERIFY(false), no-one noticed until
now. Dates from 2011, when ICU support was first added. I guess
someone fixed the problem in the intervening decade.
Change-Id: I847816c297156e65397c652767f286bc4de193a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The case where a parsed date-time fell in a transition, but only
because the default value for some field lead it there, only dealt
with the case of parsing a date-time, which is the only time it should
be relevant. However, since the date and time do get combined as a
date-time (even when only one of them is relevant) the same problem
could arise when parsing a date (on which the current time-zone
happened to make a transition at the start of the day) or a time (if
the default date happens to be one on which the current zone had a
transition).
So handle both of those cases, as well as the date-time case.
Fixes: QTBUG-91120
Pick-to: 5.15 6.1 6.2
Change-Id: I565d115eb85cd2ee69fa500fcd40b05bcf8f6fff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The Open Group's documentation of the meanings of the
locale-determining environment variables.
Change-Id: I5e3ae7de033b569b1c691b85ed65e441832359c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some time ago I wanted to use QStringTokenizer with a QL1S haystack and
needle to optimize a particular bottleneck. Only to realize the new
bottleneck was more expensive (continuously converting both the strings
to QString).
Change-Id: Ica86db0043c839c2336a3c3886ffbe3875659b5b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The decoding of PNG_INFO_gAMA to QColorSpace was incorrect, the PNG
gamma is the inverse of the gamma value we use. We revert it
everywhere else, just not here.
Pick-to: 6.2 5.15
Change-Id: Ic0ae1963b2dde3004cac8a6430ddaf99e7096915
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Without the overloads using QLatin1Char in QL1S member functions results
in the QL1Char being converted to QChar and QL1String being converted to
QString.
Change-Id: Ic19545539a207f025a6293f0b2d929de475dc166
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's a latin-1 string so embedded nulls are weird, but it makes it
easier for the follow-up patch adding overloads for QLatin1Char.
A test case in tst_qstringapisymmetry.cpp, which checks handling of
"empty" values, end up with a '\0' latin-1 char. Which makes the code
assert.
Change-Id: I0ff6628087cfac4d875b19f572c59ef7b5406293
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
queued_activate adds a reference to the slot object. It also attempts to
deref it again, but that did not work correctly so far. We could end up
with
T1 | T2
queued_activate |
checks isSlotObject |
adds ref |
locker.unlock() |
| QObject::~QObject
| //In disconnect all senders loop
| sets isSlotObject to false
| derefs slotObj, but not deleted
checks isSlotObject |
(no deref because it's null) |
To solve this issue and others caused by early returns, we now use a
RAII helper, which always takes care of calling destroyIfLastRef if the
ref count has been incremented.
Change-Id: I9c011cdb8faa5f344d7e70f024fc13f407e39ccf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The code already checked for QT_BUILDING_QT to decide whether the
'apk' target should be part of the default 'all' target, but it only
worked properly for qtbase.
The 'apk' target was created before the value of QT_BUILDING_QT is set
when building other repos like qttools.
Postpone the decision on whether 'apk' should be part of 'all' to the
first call of qt_add_executable -> qt_android_add_apk_target.
At this point QT_BUILDING_QT will be defined.
Achieve that by relying on an additional 'apk_all' target as an
implementation detail.
Amends 8b8679f73d
Pick-to: 6.2 6.1
Fixes: QTBUG-94442
Task-number: QTBUG-94264
Change-Id: I92ff0a7eef2caad244340ab7835e77c9fb3377c0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
To better match other plugins in Qt
Pick-to: 6.2
Change-Id: I6ab19603f13c80a8afe4fe69f64669559a0eea15
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
The relevant test is conducted by tst_Moc::warnOnVirtualSignal(),
added in 2009, <quote>
Fix Warning saying that signal cannot be made virtual
The test for virtual signal did not work.
But we cannot make an error right now or it might break existing code
(exemple in task 210879)
</quote> but without removing the #include, so we do still get a
warning about that when building tst_moc.
Pick-to: 6.2 6.1 5.15
Change-Id: I5ea18058f22bbd483d1ff18b0ca7b360f6674ed9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In my prior attempt to handle the last second of 1969, I forgot that
the QTime we're describing is a local time, so whether *it* thinks
we're at the last second of the day is beside the point. Fortunately,
preceding second should get -2 as return if mktime()'s initial -1
actually meant the last second of 1969, so we can test via that, after
a cheap pre-test to save doing this too often (albeit we only even
attempt the check if mktime() returned -1 in any case).
Restructured qt_mktime() in the process to deal with the error case's
early return promptly instead of doing it in an else clause. Also
repackage the calls to mktime to isolate various quirks and simplify
the logic in qt_mktime(). This also prepares for setting tm_isdst as a
hint when we know when we came from, in massageAdjustedDateTime().
Refined one test, added two more test cases. These didn't fail before
this fix, but a judiciously-placed qDebug() in testing revealed that
localMSecsToEpochMSecs() resorted to its fall-back handling - as if
the date-time were outside the time_t range - due to qt_mktime()
failing, for these test-cases (and several others). This fix evades
that fall-back behavior; a judiciously-placed qDebug() shows none of
our test-cases now fail callMkTime().
Change-Id: I11aa5015191dc4a565c28482307f7bc341c207e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In setMSecsSinceEpoch(), the CET end-of-time is invalid anyway, so a
whole block (rather than just one sub-test of it) was irrelevant for
the max-qint64 test case (aside from verifying cet *is* invalid).
Split out to a separate test the part of a data-driven test that was
the same for all data rows. Reworked several ill-advised ways to use
QSKIP().
Change-Id: If757d3e722c81fc42a87256125ceef605b6bfb64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The function takes a UTC time, which it converts to local time when
needed, but its (two) calls to refresh a local time instance were
doing the (more expensive) reverse conversion, which we don't need
(because we knew UTC to start with) and, in this case, it can't land
on an invalid time, so we don't need to cope with that.
Change-Id: I49b42bfa9f6a5fde12810f5a0da9ff4466ca86a4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Add 'Private' suffix to the internal module names in the mappings of
the qmake files for modules of the qtdeclarative repo.
Change-Id: I1592ebad0f0db553322ea766561b1b8c3fd38aea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before Unicode 4.1.0 there was an error in the example code for Hangul
normalization that used <= on the ends of some ranges of values, where
they should have used < tests. This was faithfully copied but the need
for correction has only lately come to light.
Thanks to Ma Lin for pointing this out and providing the fix and
test-cases.
Fixes: QTBUG-71894
Pick-to: 6.2 6.1 5.15
Change-Id: I5c7fec1f9fac1f7a25b2d5e9c3109a90a7ff49e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Handle the case were a format was applied that does not align with
the fragments.
Pick-to: 6.2 6.1 5.15
Change-Id: I27593a50c587a5ec0290ff9d0a7a9767a3981cac
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Dock widgets enable the QTabBar::drawBase property, but the clip region
left a gap of 3 pixels on each side between the base line and the tabs.
Correct the size of the hole cut into the clip region accordingly.
Visually tested on macOS 10.15.7 and macOS 11.2.1 using the dockwidgets
and tabdialog example.
As a drive-by, fix a spelling mistake in related documentation.
Fixes: QTBUG-86362
Pick-to: 6.2 6.1
Change-Id: Iada027999467741d0590576ee4508e6f41fb056d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QToolButton can show an arrow instead of an icon, and that arrow can, as
per the documentation, styled via the ::down/up/left/right-arrow pseudo
element. This was not working at all, as the implementation confused the
down-arrow with the menu arrow. Implement this correctly for all arrow
types.
A QToolButton can also have different ways to show a menu, either by
using a separate section of the button that can be clicked; this section
can be styled via ::menu-button and ::menu-arrow.
Or by instant or delayed menu popup when clicking the button itself, in
which case the button shows an indicator in the button itelf; that
indicator can be styled via the ::menu-indicator pseudo element.
The old implementation confused the various options, and the name of the
PseudeoElement_ToolButonDownArrow didn't help with that. So rename that
element to PseudoElement_ToolButtonMenuIndicator, and render it when
there is no separate drop down.
Fixes: QTBUG-27640
Pick-to: 6.1 6.2
Change-Id: Ia142a5d7498fa717e70f4e5382305e305b29effa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
A style sheet that styles only the header arrow, but not the header
section or label, resulted in an overlapped text and header if the text
was also right aligned.
To prevent this, add the space required by the arrow to the size
calculation, and shorten the space accordingly before rendering the
right-aligned label.
Make corresponding adjustments to vertical headers with bottom-aligned
labels.
Fixes: QTBUG-84117
Pick-to: 6.2
Change-Id: I782d9538b695ad55d2d70b6d230f66059598768f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We currently only support full gamma corrected painting by using linear
color space images, the text logic however did its own gamma correction
on top of that.
Change-Id: I4ef41745f4bc1c3a5815426abbcee6968987e70d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The lack of an unsigned pack 32bit->16bit without SSE4, meant
the premultiplied path would saturate color values over 32735.
Pick-to: 6.2
Change-Id: Ia76e0369fd11a6767e8db78bf9a10eea30d91d2c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS has been removed
Change-Id: Ic77cdae4e5151e3b0fe05cc6dd5b43bffc24768c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add 'Private' suffix to the internal module names in the mappings of
the qmake files.
Change-Id: Iacc487aa5e463a522341e526bf8580be2868cf37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When the listview setWordWrap is true and ScrollBarPolicy is
ScrollBarAsNeeded, if QStyle::PM_ScrollView_ScrollBarOverlap
returns true, the text displayed an empty line.
Fix this by not reserving the width of the vertical scrollbar
if the flow is TopToBottom and the vertical scrollbar, and QStyle
returns true for PM_ScrollView_ScrollBarOverlap. Amends
aeef92c3c3
Pick-to: 6.1 6.2
Fixes: QTBUG-94248
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I4d47c7e86bbb86474cb1a99bb26d8b67f0e8a7e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
'ld' only capable to resolve circular dependencies by wrapping the
suspected static libraries and objects using --start/end-group
arguments. We want to detect if linker is 'ld' at configure time to
decide how to link the resource objects if finalizers are not enabled.
The qt_config_compile_test function is extended with an extra argument
since it's required to pass custom cmake flags to the ld-related test.
Pick-to: 6.2
Change-Id: I484fcc99e2886952d8b0232f37e4e6a35d072931
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fix docs to state that findClass() returns a global ref from the
cached classes list.
Pick-to: 6.2
Change-Id: I7c45cc4c9e1c6e109db7cf7d926a250592798972
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>