QTextStream, reading a file with CR+LF newlines from an stdio FILE
handle that was opened without "b", will always return false in atEnd().
Changing the open mode from "r" to "rb" works around the issue.
Task-number: QTBUG-80443
Change-Id: Ib2eafc0c4c6a6d2bcaeea3036474549d2d9e1511
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
in qt5.15 you deprecated iterator &operator--() in qhash
but QDataStream needs it. (see writeAssociativeContainer)
So when we compile without deprecated method we can see:
qdatastream.h:333:9: error: no match for ‘operator--’ (operand type is ‘QHash<QString, QImage>::const_iterator’)
333 | --it;
| ^~~~
The current code is only
QHash<QString, QImage> m_images;
QDataStream stream(&file);
stream << m_images;
Change-Id: I12e61c0c60615455ac1eeff02969f155edb12e56
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QHash::unite can silently turn a regular QHash into a multi hash,
something that is not intended here. Use a regular insert()
instead.
Change-Id: I9244a8553e84eed5367939019347b51491765ea0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
As opposed to unite(), this inserts one hash into the other
without duplicating elements.
Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QDoubleValidator would accept "1,23" as valid in a locale which has ','
as a thousand separator. However, it should have been Intermediate
instead, as there is still one digit missing.
Fixes: QTBUG-75110
Change-Id: I6de90f0b6f1eae95dc8dfc8e5f9658e482e46db3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This fixes the case where a mouse tracking item is added to the
scene while a modal panel is blocking. In order to optimize event
delivery, mouse tracking is enabled for the view only when an
item that needs it is added. This means that we cannot use
itemAcceptsHoverEvents_helper(), since that returns whether the
item _currently_ needs hover events, and we need to know whether it
will need them in the future.
[ChangeLog][QtWidgets][QGraphicsView] Fixed a bug where hover events
would not be delivered if the item was added while blocked by a modal panel.
Fixes: QTBUG-77233
Change-Id: Ifc95869f2cc9c8c048330928ef8a13cd27cfd0f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
The new version takes/returns a value that can be unpacked and passed to
other functions without knowing which backend is in use.
The old API will be removed in a later change when dependent modules have
been updated
Task-number: QTBUG-78570
Change-Id: I18d928ceef3cb617c0c509ecccb345551a7990af
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
When an application only has a trayicon and is killed by `taskkill /IM
binary.exe` the trayicon's HWND will receive a WM_CLOSE message. If we
don't handle this, the tray icon will close anyway, but the app still
runs in the task manager.
Fixes: QTBUG-43855
Change-Id: I5f82a068df9c40360bd565a2681e1b37ff114e44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since the operator does not have a total order, it is kind of pointless,
and this is going to be removed in Qt6
Change-Id: I754be059726bf30993550a2d753f8b865f2d4a5f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
...from code.
This is by design; the action is updated when the dock widget changes,
not the other way around (which would easily result in infinite loops).
Change-Id: I9e71784d239a9cbb6c8efaeaa3e3adc6dc590f65
Fixes: QTBUG-80022
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Apparently this is our preferred style for Objective C member references.
Change-Id: I8b2bbaabadbea2cfa74f209372e77cee79e3c895
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Inline systemTimeZoneId() in it to save the need for init().
We thus save the lookup by name for a time-zone object, when that
object is what we took the name from anyway.
Do some minor tidy-up in the other constructors and add an assert to
systemTimeZoneId() to match the new one in the default constructor.
Change-Id: Ib70acf31bdb4a4fa1306eebd1fd5f00ad6b89bcc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The code was assuming that if the parsing of the value worked,
then it must be a list of 4 variants. But in this case it's just
a single length.
This came from <td> using 4 values for border-width
while other elements use a single value. But the storage
is shared. So the fix is to use 4 values everywhere.
When reading 4 and there's only one, it gets duplicated,
so the caller can just use the first one in that case.
Task-number: QTBUG-80496
Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The dark edit field is now centered within the frame around it, with a
thin border on all sides, including between input field and button.
Change-Id: I27e853289e9048c21fdc81e45fadacba9665b49e
Fixes: QTBUG-63454
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is closer to what titles of documents look like in macOS apps,
even though MDI is not a well-defined concept on this platform.
To implement this, the QCommonStylePrivate::tabLayout method had to be
made virtual, as it is called by the QCommonStyle class. It was already
reimplemented in QMacStylePrivate, but didn't get called in all cases.
Now that it is called as an override, adjust the icon placement to
include the padding so that we get identical results to 5.13 for
normal tab widgets.
Change-Id: I7a63f6d76891146ca713259096a7737a86584d81
Fixes: QTBUG-63445
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The JavaScript implementation of that function has
the following code:
if (typeof JSEvents === 'object')
JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); // Release all
// JS event handlers on the DOM element that the GL context is associated with since the context
// is now deleted.
This breaks mouse/keyboard events, etc.
Disable this logic by temporarily setting the JSEvents object
to undefined, for the duration of the emscripten_webgl_destroy_context
call.
Fixes: QTBUG-74850
Change-Id: Ied3177b0ca6e63e8ea07143bf7d6a850b0bce35a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
There's no qt documentation module for 'qtrhi' - instead, it should be added
to the qtgui documentation module.
Fixes: QTBUG-80489
Change-Id: Iea61b907811cd2135c2f1258599d9868d2218679
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
CMake is case-insensitive for macro and function names. Still, it is
"strongly recommended to stay with the case chosen in the function
definition." So let's make the function and macro definition lower-case,
like we also recommend in the documentation.
Change-Id: I1f64b18716f034cb696d2e19a2b380aaadd6cd07
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Two little tool functions had come between it and the function it
actually describes.
Change-Id: Ib49d1623833275ea79c7916fece29aed9503aa40
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
These were kept around to keep Qt Quick compiling, but the
migration there has been done a long time ago. Remove these
leftovers now.
Change-Id: Ibd47381b410b11b5475a85c7ed3cb05c22f7adbb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This will blacklist this test for ci. Currently blocking enabling tests
for MSVC2019
Task-number: QTBUG-65667
Task-number: QTQAINFRA-2875
Change-Id: I7198490b1529ce2f4409bfa7399031dad7644a06
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
AppKit will initialize NSScreens nowadays, so we don't need to manually
trigger it.
Task-number: QTBUG-80193
Change-Id: Ic0251a1b978b9d4ff53f20e67902787cf529fa87
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This patch aims to implement the session management available on macOS.
Currently applicationShouldTerminate is just a go through that closes
everything and ends the application. The new implementation calls
first appCommitData and cancels the termination properly if required.
This means that if a user wishes to logout, Qt applications can now
cancel that like e.g. answering to Safari asking whether it is ok to
close because of a number of opened tab/window.
Fixes: QTBUG-33034
Change-Id: Id5d7416cb74c762c5424a77c9c7664f0749da7f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
License file (LICENSE.QT-LICENSE-AGREEMENT-4.0) was recently updated to
version 4.2 and that broke the configure.
Remove qt license file version number from file name to avoid configure
update need when license file is updated
Change-Id: I77b4a4e7c6e590bbbce79d1c86cbcfb965841eae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The warning pragmas don't work in gcc due to the fact this is a
template.
I've been told that unite() will disappear but meanwhile i think it's
better if we simply don't give a warning that people can't protect
themselves against
Change-Id: I358e629be86e0e675ef3e49a7fbc4f7f65ae97f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
QtDBus caches well known interface objects when there is a non-emtpy
interface name passed to the QDBusInterface constructor.
This commit amends the constructor documentation to explain this
behavior.
Change-Id: Ic51836be6d833411500ea05fcc895cd4f6e96407
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- start from index -1 each time when we iterate. Each time when we add a
FolderIterator to the stack we MUST reset the index (-1) otherwise it will
continue from it's last position. To fix it we are cloning the FolderIterator
to set the index to -1. The index must be -1 in order to set it to 0 when we
first call next() method.
- introduce "fileType" static method for a more reliable also much faster
file type lookup. The old version of checking if a file exists, is a folder or
a file was buggy that's why it skipped some file randomly.
Fixes: QTBUG-80178
Change-Id: I4b28e4616399b1bff35d792b55ded1bf19b62dd9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
When doing a multi ABI build in one go, if the TARGET is the same,
we'll endup with only one library which is not okay.
Task-number: QTBUG-80351
Change-Id: I0c5ff24480446d671e59dbd5a045f9889dff39e9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
It doesn't seem to be working correctly with array of literal types,
blocking the patch refactoring the webgradient support:
10171: "painting/webgradients.cpp", line 79: error #28: expression must have a constant value
Change-Id: I9ddd768d24ef79dd7a69e23c91988d891e41d4b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When connecting/disconnecting/reconfiguring screens Qt needs to know
about the changes before they are propagated by the OS in other ways,
so that we can reflect the changes in the list of QScreens as soon as
they happen.
Unfortunately the canonical notifications for this in AppKit,
NSApplicationDidChangeScreenParametersNotification, is delivered
after AppKit itself reacts to the change, which results in receiving
NSWindowDidChangeScreenNotification, NSWindowWillMoveNotification,
and others, while the list of QScreens is stale.
To work around this we adopted the lower layer Quartz Display
Services API in 3976df2805 to notify us when there are changes to
the screen configuration.
Unfortunately the window server on macOS is not consistent in how
it orders events during screen reconfiguration, and we can't rely
on the NSScreen list being up to date when we get our callbacks
from Quartz.
To work around this we still hook into Quartz, so that we get the
callbacks as early as possible, but then track the state of the
AppKit NSScreen list and update our own QScreens as soon as we
see a change.
We now also include sleeping displays in the list of QScreens,
which matches the behavior of NSScreen.screens. Similarly we
exclude displays that are mirroring another display.
Task-number: QTBUG-80193
Change-Id: I6b1958d6ee61373b2861e05a0d971d2300596f3e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QVulkanWindow support has long been removed from the Vulkan backend.
The include is a leftover from those times.
Change-Id: Ie68ac3611b24310f2b6111a72dd0679adafdc74d
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Enclose QAssociativeIterableImpl::advanceImpl within
QT_WARNING_DISABLE_DEPRECATED, fixing numerous warnings:
MSVC\14.23.28105\include\xutility(727): warning C4996: 'QHash<QString,QVariant>::const_iterator::operator --': was declared deprecated
include\QtCore\../../src/corelib/tools/qhash.h(432): note: see declaration of 'QHash<QString,QVariant>::const_iterator::operator --'
include\QtCore\../../src/corelib/kernel/qmetatype.h(1217): note: see reference to function template instantiation 'void std::advance<QHash<QString,QVariant>::const_iterator,int>(_InIt &,_Diff)' being compiled
with [ _InIt=QHash<QString,QVariant>::const_iterator, _Diff=int ]
include\QtCore\../../src/corelib/kernel/qmetatype.h(1253): note: see reference to function template instantiation 'void QtMetaTypePrivate::QAssociativeIterableImpl::advanceImpl<T>(void **,int)' being compiled
with [T=QVariantHash]
include\QtCore\../../src/corelib/kernel/qvariant.h(793): note: see reference to function template instantiation 'QtMetaTypePrivate::QAssociativeIterableImpl::QAssociativeIterableImpl<QVariantHash>(const T *)' being compiled
with[T=QVariantHash]
Amends dbb54805f6.
Change-Id: Ieb875eaa943100ce1941cb1473b35892330c3889
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The code was initially introduced in
9204b8c31e but getting the names were
conditioned on whether or not Windows identified it as a truetype font.
This excluded cases which had preferred names embedded but was not
truetype fonts. To fix that we run the code unconditionally.
[ChangeLog][Windows] Fixed a bug where some fonts would not be
accessible by referencing their typographic name.
Fixes: QTBUG-78556
Change-Id: I8823684b09cce3b1b8722b1e609a5bb49b13da13
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Otherwise combobox with editable text field won't work.
Change-Id: I135c3a63cf8fba66d724e140a5a63828853e154e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We need to reset the pressed index when the decoration was pressed on
otherwise if the mouse ends up over an already selected item that was
previously clicked on. This prevents it from thinking that the mouse
has been released on this item right after pressing on it.
Fixes: QTBUG-59067
Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Some structures needed to be cleaned for the reuse to be safe.
Reusing it cuts down on the overhead in lancebench.
Also uniqueness of block names are now enforced, and the common pattern
of "end_block blockName" could now be parsed if not always commented
out by begin_block handling.
Change-Id: I0daf6445292383aaab9392550d0842e0a654ad27
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
It was only used by conversions to indexed8 and mono, and is slower
than the generic conversion which is optimized.
Change-Id: I0480c5a1b5fa2de7e3c87fd621064dace46e5945
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>