A style may have been set before the application was created, which
would have resulted in setting the system palette based on the style's
palette. Once the application is initialized and we have a platform theme
we need to reset the system palette.
Change-Id: Ia48f57d3983535c8633741d8027f75bc0c214018
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We let initSystemPalette() do all the work, instead of leaving the first
time initialization of the system palette to the caller, which makes the
logic harder to follow.
This also means first time initialization of the system palette will
pick up a platform theme if available and resolve the palette using
that, which was missing from the original logic.
Change-Id: I84da557caf8ecedf6d96d87ebee93168ea9d73ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The call was added in c49c96fbb1, "Reinitialize system palette
when setting a new style", but adding it along with the palette code
seems like a mistake. The potentially dirty widget font hash needs
to be reset for all style changes.
Change-Id: I411f56bb833819213c5485d7585fc5e3e9bd8983
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Setting the CONFIGURATION_BUILD_DIR variable to tell Xcode where to
place the final application bundle confuses Xcode when archiving
a project, and the archive ends up without the dSYM files.
Unfortunately we can't leave it up to Xcode to place the build
artifacts wherever it wants, as Qt Creator's iOS support expects
to find the artifacts in a well-defined place. Until we've taught
Qt Creator to find the artifacts for deployment where Xcode placed
them we need to keep this logic.
We now avoid setting the CONFIGURATION_BUILD_DIR variable unless we
really need to due to in-source builds. As long as we're dealing with
a shadow-build it's okey to set SYMROOT.
Change-Id: I9661c1c57725dc8ba5a21f8467b8b61834f2e64d
Fixes: QTBUG-74841
Task-number: QTBUG-52474
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When passing the resources used to the android deployment setting json
file it needs to check the variable generated by the qtquickcompiler
feature so that it can still find the qrc files originally populated in
the resources. This ensures that qmlimportscanner can still scan the
original qrc files when determining which QML import plugins are
needed.
Fixes: QTBUG-80713
Change-Id: I695b289eaaa78cc6c355fa8abd22a8a1031a9f6c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This warning is not in -Wall or -Wextra, but it happens in a single
place, so we can reasonably suppress it.
Fixes: QTBUG-79138
Change-Id: Ib5d667bf77a740c28d2efffd15ccb3f62cf8f431
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Some projects can be configured to have both qrcFiles and qml-root-path
included in the deployment settings file. The addition to qrc scanning
prevented the qml root directory from being scanned.
Change-Id: Idadb62f5572be45d0083294440bdb29740c2c47e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This flag is used in QSequentialIterable and QAssociativeIterable to indicate
that the data pointer in VariantData should be deleted after the variant has
been constructed.
The use case for this is
https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have
a proxy iterator and cannot easily return a pointer to already owned data, as
it is hard to manage its lifetime in the iterator. In contrast, it is clear
that we can release the memory in the QSequentialIterable functions, as it has
already been copied into the QVariant there.
Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Update the instructions on how to build and distribute the mysql and
postgresql drivers on windows.
Change-Id: Ie4d50c1c34820680d7496b9544eb00fcee17f8e7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This ties our hands on what we can do in our implementations. I don't
care if you've depended on this in your code. It was wrong.
Fixes: QTBUG-80600
Change-Id: I568dea4813b448fe9ba6fffd15de8865a27f0a35
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Minor performance optimalizations:
- No need to check if the date and time are correct because the QDate,
QTime and QDateTime parsing functions already perform these checks
- No need to add minute part to the UTC offset before parsing the date,
because the QDateTime class can parse time zone offset both in form
±hh:mm and ±hh
Change-Id: Id74b7ae075135c5c8cf420247c49b5f12fe88899
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The callback should be named the same as the function expects
Change-Id: I4ca73958313c93c0d68e7205d8641c4104247e0c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This creates a define in the binary, as well as writing emscripten
version for qmake.
It also enforces app builder to use a certain known version.
Task-number: QTBUG-77745
Change-Id: I37691512171635cec66aa3ffa16258081f3f1e1b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
ISO date format doesn't allow spaces within a date, although 3339 does
allow a space to replace the T between date and time. Sixteen tests
added to check this all failed. So clean up the handling of spaces in
the parsing of ISO date-time strings.
[ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires
a punctuator as separator (it previously allowed any non-digit;
officially only a dash should be allowed) and parsing of date-times no
longer tolerates spaces in the numeric fields: an internal space is
only allowed in an ISO 8601 date-time as replacement for the T between
date and time.
Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The xml_escape function must be part of resources_functions.prf, and the
qmake_immediate resource must not be created multiple times. Instead,
create another qmake_immediate resource with a number suffix.
This commit amends 577b6554.
Task-number: QTBUG-79672
Change-Id: Ibbe20c0fd1940f1fe7733cd1e5b0891f65689782
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
rcc currently always writes the namespace mangling macros in both the
initializer constructor and destructor. This patch add the missing
handling of the --namespace option for that part of the generated code.
[ChangeLog][Tools][rcc] rcc now generates correct code when using the
--namespace option.
Change-Id: I7e5e608eb0ad267d11d601fc69c1a87d3f655a6e
Fixes: QTBUG-80649
Reviewed-by: hjk <hjk@qt.io>
Fix some tests in tst_QSqlQuery:
- make sure to use QSql::HighPrecision in tst_QSqlQuery::precision()
(needed for psql)
- remove outdated stuff for mysql 3.x
- psql_bindWithDoubleColonCastOperator: the placeholder are stored as
named placeholders in psql
- avoid some useless old-style casts
Change-Id: I54d29a7e24f17d853cce6baa09a67d9278098810
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
In order to allow screen readers to say checked/unchecked for checkable
menu items, this information has to be provided through UI Automation.
Checkable menu items should implement the "Toggle" UI Automation pattern.
The "checkable" state must also be supported by QAccessibleMenuItem, which
is being added by a separated change.
Task-number: QTBUG-80551
Change-Id: I661668310d1b6b4701d0c0efdb1dcfd15d0db729
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The information about whether a menu item may be checked is necessary
to allow the platform code (in particular, Windows UI Automation layer)
to make this information available to screen readers.
Task-number: QTBUG-80551
Change-Id: Ibfcc4f2da1ebc68e7dc5df2cd46bbfc0a177da12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Clamp mode was being obliterated by not appending to EMCC_COMMON_LFLAGS
This fixes crashes of integer overflow
Change-Id: Icae757a7189de25db5ed41df6d41d86304c39830
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Relying on the hard clipping of QRegion widget masks to create
non-rectangular windows is a solution from a bygone era. The result
looks horrible with today's eyes, particularly on a high-dpi
screen. Update the example to create smooth anti-aliased edges using
translucent window bacground.
Task-number: QTBUG-64229
Change-Id: I8859d61177d2a2dc446632c23f27f42050e0d7c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Unlike comparable widgets like QLabel or QFrame, QPushButton would not
render a content image specified in the stylesheet, unless a border
style was also specified. Fix by explicitly rendering the content
image, if set, in the native-border codepath also.
Although the doc warns about the QPushButton border style having to be
set in order for the background styling to take effect (since the
native border painting otherwise hides it), the previous behavior does
seem unexpected.
Fixes: QTBUG-72029
Change-Id: I8b979b010515dab4dcf2f00344a187c87eeec096
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
There remain QStringRef uses where QString::splitRef() is used.
Requires converting some .count()s to .size()s, as QStringView lacks count();
and some .toInt()s need to be handled by QLocale::c().
Change-Id: If9a49e063d217671ea9335a82e4bf977b7b48be0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The latter can be invalid if midnight is skipped by a spring-forward.
Change-Id: Ibf98d165557229f19622774ebf9a27bb0911c7a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt::ToolTipRole is not honored by dataChanged() which may be a little
bit surprising. Therefore add a small note about this behavior.
Fixes: QTBUG-78726
Change-Id: Ic4361f55e55ab59d5bae2fdb98907a62055604c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The fusion style did not properly handle the text layouting for a
QPushButton in RTL mode. Also the menu indicator was not adjusted in
this case.
Fix it by calling the base class implementation as QCommonStyle does it
mostly right. Since Fusion does not handle State_On or State_Sunken but
QCommonStyle does, explicitly mask them out.
Fixes: QTBUG-80083
Change-Id: Ide7bf997b4f4a5b61fcb8ea4a1a152122daef1e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use $$QMAKE_STREAM_EDITOR, instead, which will on Windows expand
to "qmake -install sed" (triggering qmake's own sed implementation)
and otherwise expand to "sed".
Change-Id: I57da5fb3a4f6e5a09ae25c947caa0a10d279b480
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Users that have large mouse pointers configured in their settings
can not see tooltips, as they are obscured by the pointer.
Native applications on Windows and macOS have the same problem,
which includes the tooltips for the minimize/maximize/close controls
in the window frame of e.g. Explorer.
Introduce QPlatformCursor::size that returns a value that is based
on the user's settings, or a default value. We can then use that
value to move the tooltip out of the way.
On Windows, the calculation of the cursor size is based on
experimenting with the settings, which are in logical independent
pixels. The placement of the tooltip attempts to keep existing
behavior, and to not end up with a tooltip that's very far away
from the tip of the arrow even for very large mouse cursors.
[ChangeLog][QtWidgets][QToolTip] Make sure that the tooltip
is not obscured by very large mouse pointers on Windows and macOS.
Change-Id: I8e13b7a166bfe8b59cef4765c950f90fefeaef9d
Fixes: QTBUG-79627
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Change-Id: Iaafba9557ece36607c86d5be4fbb5e4ac2e459d3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reset sloppyState for the previous submenu, so that if it
will be shown as a menu, it will not use an incorrect pointer.
Fixes: QTBUG-80528
Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The platform window may create or destroy its surface from other entry
points than the QWidget API, in which case QWidget needs to sync up
its own state to match. In particular WA_WState_Created and the winId
needs to be recomputed.
Fixes: QTBUG-69289
Fixes: QTBUG-77350
Change-Id: I769e58ead3c2efcf8c451c363108848feade9388
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Future versions of QNX will, by default, require the use of registered
events. Currently, event registration is supported but optional.
Change-Id: Ie45484d5ca9fa832a28ccf08cb1764cf24262dcc
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Since the QSqlField used to retrieve the data is reused in the loop, the
default empty value of the QSqlField is not set for all except the first
field since it was implicitly set by QSqlField::setType() only when the
value is invalid. Therefore we have to call QSqlField::setValue()
directly.
Change-Id: I1d3abe4e3c46f6378f9ff25529a79bbe33bb7b74
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Windows apparently has special code to deal with those addresses. If all
your network interfaces are up and have acquired addresses, then the
link-local network at 169.254.0.0/16 is unreachable. I had never caught
this because both my Windows VM and my bare metal Windows have inactive
interfaces (like the Bluetooth PAN one) and, when inactive, Windows
assigns a link-local address. But in the CI, the interface(s) were all
up and running, causing this issue.
Unix systems don't treat IPv4 link-local any differently, so they always
worked, so long as any interface was up and there had to be one to reach
the network test server.
This commit reworks the test to add test addresses based on the
addresses found on up & running interfaces (see tst_qudpsocket.cpp). For
IPv4, we flip the bits in the local portion of the address. For IPv6, we
add a node with an address I generated randomly (non-universal), with
the same scope.
Fixes: QTBUG-65667
Change-Id: I568dea4813b448fe9ba6fffd15dd9f482db34991
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As we assert on the size of the vector before accessing it, there is no
point in using the checked at() method over operator[]. Besides, if at()
throws, what are we going to do with the exception anyway.
Incidentally, this also works around a compiler bug causing binary
incompatibility in QtQml.
Change-Id: I460e7514429daecabc304eb2c5f96ed715008b0a
Fixes: QTBUG-80535
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In some cases when editing the text (for example when removing the
selected text, or pasting a text block) the text cursor position is
updated, but its visual x position is not updated. This causes the next
cursor movements to start from a wrong position.
Force the update for those cases.
Fixes: QTBUG-78479
Change-Id: Ia496be62beec58660f5e1695e5aafae09c79684e
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
There were factual errors.
Important details were omitted.
The \sa blocks were haphazard and cluttered.
Change-Id: I76ceb00830c36699c48529b64808844faf09391e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Cite RFC 3339 as basis for allowing a space in place of the T, too.
The RFC mentions that ISO 8601 accepts t and z for T and Z, so test
for them case-insensitively. Add a test for this.
Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If milliseconds were followed by a space, the space was included in
the count of "digits" read as the fractional part; since we read (up
to) four digits (so that we round correctly if extras are given), a
harmless apce could cause scaling down by too large a power of ten.
Since QString::toInt() ignores leading space, we were also allowing
interior space at the start of the milliseconds, which we should not,
so catch that at the same time. Added tests, including one for the
rounding that's the reason for reading the extra digit, when present.
Fixes: QTBUG-80445
Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Although the relevant conditions are indeed likely, we don't want to
push the less likely branch into hard-to-load pages; they're not
anomalous conditions, merely ones with lower probability.
Change-Id: Icc12a921d38d8c398cd832964e9d57d7648698b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDateTime is a friend of QTimeZone, so can access its internals; but
it must check the zone is valid before doing so.
Expanded tst_QDateTime::invalid() and made it data-driven to catch the
failure cases.
Commented on a test-case that caught a mistake in my first attempt at
this, and on QDateTimeParser's surprising reliance on a quirk of
QDateTime::toMSecsSinceEpoch()'s behavior.
Fixes: QTBUG-80146
Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Some styles, notably QMacStyle, use different margins for widgets and
for windows. For these margins to be returned correctly, we have to
tell the style that we want them for a toplevel widget. This was
done correctly when laying out the dialog, but not when calculating the
sizeHint, leading to a default size of the dialog that was too small
to fit the text.
As a drive-by, change variable names in the sizeHint method to be a
bit more readable.
Change-Id: Ib4168c7be176fa816241ebcc5f9235db4a7f982f
Fixes: QTBUG-80272
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 13bbb1d9b9411e6eb65848efa8c0d481109b8868)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The dragging icon is created from the visible items in the
selection. It would be clipped to the parts visible in the
viewport. That meant that items on the edge could be rendered
illegible, even though they were part of what was being dragged.
Fix by dropping the horizontal clipping to the viewport. Items fully
outside the viewport are already filtered away, so this should at most
make a difference to the bottom and/or top items in the set.
Keep the vertical clipping, since items may easily be very wide, so an
unclipped icon would be unwieldy.
Done-With: Sona Kurazyan <sona.kurazyan@qt.io>
Fixes: QTBUG-77336
Change-Id: I2d29cb0ca69c1058635106aa0c67e9f7e140d1cd
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>