It's better to save icons in $XDG_RUNTIME_DIR or
$XDG_CACHE_HOME paths than in $TMPDIR as these
places are readable from the desktop environment
when an app is ran confined in a sandbox (as in
snap packages)
Change-Id: I1a3e4c5714f8ea51034d18fb87cead87ed21d6be
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
As explained in
https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0
creating dialogs on the stack is a bad idea if the
application or the dialog's parent window can be closed
by means other than user interaction (such as a timer or
an IPC call). Since we cannot know whether Qt is used to
build such an application, we must assume it is, create
the dialog on the heap, and monitor its lifetime with a
QPointer.
Instead of using manual resource management, add a
minimal implementation of QAutoPointer, and use that in
all static get*() functions.
Task-number: QTBUG-54693
Change-Id: I6157dca18608e02be1ea2c2defbc31641defc9d1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Clang complained about a missing override:
qgtk3menu.h:58:14: error: 'tag' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
Change-Id: I681cdeb93d35848ae39c1af289973b436e8ea60e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When a QFile object is reused, the atEnd() method may return incorrect
values. The reason for this is that QFileDevicePrivate::cachedSize is
not cleared. Setting cachedSize = 0 in the close() method fixes this issue.
Task-number: QTBUG-57698
Change-Id: I828a2cf844e98d581098f2c781fa47d2cd3275ce
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QDateTimeEdit (QtWidgets) inherits its Private class from
QDateTimeParser.
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.
Since the class is already exported, users of these classes are
unaffected by the change, and since it's private API, we don't need
to avoid adding code to the out-of-line destructor until Qt 6.
Task-number: QTBUG-45582
Change-Id: Id57289a7eff13564dddeca0af1c45a6180c36c48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
At 200 ms, the error on first firing could be 10 ms.
Task-number: QTBUG-58519
Change-Id: Ifaee7464122d402991b6fffd14a02a4ce782f11f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Update the QtConcurrent code snippets to use the new QRegularExpression
class in place of the deprecated QRegExp.
Change-Id: I1366f902fc46bbeccc4013dd8adcf5fbfda13aed
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
... to make user code buildable with gcc [-Werror=zero-as-null-pointer-constant].
Change-Id: Ifef52e406c1f7d5a260612ec27922d1805aea6e2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
On macOS, the code that read the plist is using
QByteArray::fromRawCFData. When we return the data directly
we need to detach the QByteArray so that it does not point
CFData's data that will get deallocated just after the call.
Task-number: QTBUG-58531
Change-Id: If829a304b986c99c8fc2aeeb992f2d539a4eef3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When a black font is used, such as Arial Black, it would cause
the font to appear to be rendered twice, particularly at large
point sizes. This is down to the synthesizing of the bold
aspect, however since the font is actually weighted as black
this is not required.
Change-Id: Ie32e0da8bc67c94123631253854312ed5c25ad9f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
in a framework build, the headers are inside the "library", so it's
obviously not very wise to suppress its installation on the basis of
it not being there.
Task-number: QTBUG-57656
Change-Id: I026a3e486a2aad6ee0b8e0d264af4385af945e42
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Harald Fernengel <harryf@gmx.com>
"/usr/include/mysql/.." would slip by the removal of default include
directories. so clean up the returned paths first.
Task-number: QTBUG-58532
Change-Id: I445bb15619f6401494e8fffd149ea41a50ef188e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As used in recent qtdeclarative commits, so better make sure it keeps working.
Change-Id: I6d0ceda76201e3e7f75661cb6449e1ff32329126
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The interface name is used inside the bearer plugin to obtain
additional information about the interface. Calling CreateFile with the
more friendly name fails (file not found) so we use the Luid and gather
information from its type.
Task-number: QTBUG-51543
Change-Id: I09b7f124657a0bbccf36da6f43b36a3c50b5fde0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
qcore_foundation.mm:
- Can't link to 'fromCGPoint()'
- Undocumented parameter 'point' in QPointF::fromCGPoint()
- Can't link to 'fromCGRect()'
- Undocumented parameter 'rect' in QRectF::fromCGRect()
- Can't link to 'fromCGSize()'
- Undocumented parameter 'size' in QSizeF::fromCGSize()
Change-Id: Ie48f04c7b990634f8c5a836100b1be7854848bb4
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Previously, the flags were replaced rather than appended to, losing -I
flags and causing `#include` directives to fail.
Change-Id: I74609e891ea327a8136c8075ab13176fc85ab111
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
with homebrew, etc., this would find the opengl packaged with x11, which
is not suitable for use with cocoa.
Change-Id: I8390e1ac32c58f6644d6ef3978bdc6da9d111e79
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Building qt with msvc would fail with the -developer-build configure
option turned on under simplified chinese locale.
This is because msvc will emit warnings for source files with utf-8
characters which are not representable in CP936, and -developer-build
implies treating warnings as errors.
This patch turn on -utf-8 compiler option for msvc2015 update 2
and up only for building qt.
Task-number: QTBUG-58161
Change-Id: If38ea11eb1f39f8e08efa1cccb92e0eea50daf92
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
There is no need in additional polling, because readyRead() signal of
the inner socket is directly connected to the slot which extracts the
datagrams. Moreover, calling _q_udpSocketReadNotification() from the
engine code might cause the spurious notifications both in the outer
and inner sockets.
Change-Id: Ibe75f5990e27b7460d628fa4a1ca4e64657e302c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The rubberband is shown depending if there's a current hovered dock widget,
but there were a few places that were not calling updateGapIndicator().
Additionally, the rubberband will also disappear if the currentHoveredFloat
is destroyed externally (would leave a ghost rubber band behind).
Task-number: QTBUG-58049
Change-Id: Iafdf234aa04b0ee280e51f8fa2fd212c86610cd1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Match the logic that is used for building.
Change-Id: I9ce6db2357b9b3e19a1e932fae57d376aae406f7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Chinese locale means Code Page 936 here. It's also related with
removing C4819 warnings.
And it's also following Conventions in Qt source code: All code
is ascii only (7-bit characters only, run man ascii if unsure)
See also http://wiki.qt.io/Coding_Conventions
Task-number: QTBUG-56155
Task-number: QTBUG-58161
Change-Id: I37fa7a0e6a82a16eaf80e1cc99be801099ab87de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Nothing uses this and there's no incremental_off.prf since the MSVC6 purge
in 99f390f9 (dec 2009).
Change-Id: I2bc52f3c7a574209b213fffd149b4bf378805969
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
MSVC < 1800 (older than 2013) is no longer supported, so we can simplify
the code. And the implementation for C never worked -- "if it's not C++,
let's use a namespace!"
Change-Id: Iaeecaffe26af4535b416fffd148c2c6788c43881
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
There's no reason to have that. Let the compiler decide whether it wants
to align or not. Current versions seem not to want to align beyond
multiple of 2.
Change-Id: Iab7c358838e1487387a2fffd149d73e0a218d3c2
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The last use of qWinMain was removed in commit
390598cb43, "Winmain: Remove Windows CE."
It used to be used on non-WinCE, but that was dropped in commit
9b121e5579.
Change-Id: Idc347fbb462f4122b044fffd1490a210358a61b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There was a test that tested this, but was wrong.
[ChangeLog][QtCore][QVariant] Fixed a bug that caused wrong results for
comparisons of QVariants containing either NaN or infinite numbers.
Task-number: QTBUG-56073
Change-Id: I33dc971f005a4848bb8ffffd1475d29d00dd1b7f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Merged in the upstream version.
The remaining diff to clean 1.6.28 is archived in the qtpatches.diff file.
This fixes CVE-2016-10087 but Qt was never vulnerable to that issue!
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.28.
Change-Id: I46712103fb160f31702eb7496fdd5c492a59ba5b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
For certain slightly miscoded png images, newer versions of libpng
will trigger the mentioned zlib error and fail to read the image. This
miscoding has until now been safely ignored by all png
implementations, so such images exist in the wild, and users expect
them to work. Since the cost of the workaround is only a missed
opportunity of a tiny saving in memory usage during decoding, enable
it.
Task-number: QTBUG-58171
Change-Id: I820a9faef6d5b7af79c04404ebdceb48a096f29a
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
There was a false assumption that the bidi level of text is only
used for visualizing the text, not for calculating its bounding
box. But the bidi level is required for shaping (indeed many
OpenType rules check for reading direction) and the glyphs used
to represent a given text may be different based on its
directionality. The effect would be that the bounding rect we
calculated for text would sometimes be too small for RTL text, and
we would end up clipping pixels.
[ChangeLog][QtGui][Text] Fixed clipping errors and too small
bounding rects for some right-to-left text.
Task-number: QTBUG-48005
Change-Id: Idd12ae1b0033d518034b582204ba47ae41795293
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Although it's permitted to specify the project name together with
a version number for \since, it's unnecessary for Qt classes and
functions.
This change also normalizes the version formatting: '<major>.<minor>'
Change-Id: Ie5a43662077d13c31e241bcde8a7a2849d27d330
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
benchmarktests.h:323:18: warning: field 'm_as_pixmap' is uninitialized when used here [-Wuninitialized]
benchmarktests.h:371:18: warning: field 'm_as_pixmap' is uninitialized when used here [-Wuninitialized]
benchmarktests.h:417:18: warning: field 'm_as_pixmap' is uninitialized when used here [-Wuninitialized]
Change-Id: Ica496e3baa19e0701c64222ce8ab92ec94178db7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Because on Windows, the .ini files are saved with CRLF, but the files in
the Qt resource are just LF (.gitattributes makes them so).
Task-number: QTBUG-25446
Change-Id: I5eab0d9620bd1ba675b0a87c554f62cef0f98fcc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of using the actual compiler version to determine which C++11
features to enable, let's just use the Mirosoft compiler version that
the actual compiler is claiming compatibility with. That is because the
limiting factor is often the standard library, not the compiler itself.
This will cause some features that do not depend on the library to also
be disabled, but oh well. Better upgrade your Visual Studio version
instead.
Task-number: QTBUG-57696
Change-Id: I3e4e5051937c40319d6efffd14912cd4fdab25fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Commit 52d64fca66 made qlibraryinfo.obj be
compiled with an extra -D argument, but that doesn't take effect since a
precompiled header is in effect.
Warning #673: the initial sequence of preprocessing directives is not compatible with those of precompiled header file "qmake_pch.pchi"
qlibraryinfo.cpp(61): catastrophic error: cannot open source file "qconfig.cpp"
Change-Id: Iab7c358838e1487387a2fffd149d74a9aa2be338
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The __popcnt family of intrinsics with MSVC generates directly the
POPCNT instruction and are documented to do so:
https://msdn.microsoft.com/en-us/library/bb385231.aspx
So we can't use __popcnt unless the target processor supports it.
[ChangeLog][Windows] Fixed a bug that caused applications to crash with
"Illegal instruction" faults when compiled with Visual Studio and run on
some older processors.
Task-number: QTBUG-58446
Change-Id: I445bb15619f6401494e8fffd149d83bd2a7e3376
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The patch fixes a number of bugs in code, and removes dead logic
clarifying that MIPS DSP, like ARM NEON, has no runtime detecton.
Change-Id: If2f4eea68da5b2eaa80b8e9c8258206d8c1b7173
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On some keyboard layouts it is possible that pressing SHIFT+letter does
not give the upper case version of the character. So we depend on QKeyMapper
here to give us the right keysequence as then it will compare against
a shortcut created with this combination then.
Task-number: QTBUG-57928
Task-number: QTBUG-57931
Change-Id: I9421f3ab4d3f8d1ee42f9680200d4b017d551057
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
We have an invalid pointer dereference in our callback.
Apple's docs are quite ambiguous, whatever we receive in our callback's
'client' parameter is our PACInfo, not clientContext's address.
That's what we pass to CFNetworkExecuteProxyAutoConfigurationURL:
"clientContext - A stream context containing a client info object and optionally
retain and release callbacks for that object."
This 'client info' is our PACInfo struct with 2 pointers.
Now in a callback, 'client':
"The client reference originally passed in the clientContext
parameter of the ..."
So apparently we should read this as "client info originally passed in ...."
Otherwise incorrect cast results in invalid pointer (apparently
the value of retain/release/copy pointers we carefully set to 0)
and a crash on dereference.
Task-number: QTBUG-56747
Change-Id: I89378f1582679638cd29a36c563e506d8f5af518
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
The compiler command line used to populate QMAKE_DEFAULT_INCDIRS must
include the sysroot in order to generate the correct paths list.
This fixes a regression introduced in afd8263 which in turn attempted to
fix an earlier regression making it impossible to override the
deployment target in user project files.
Task-number: QTBUG-58325
Change-Id: I93e6b7ef90b2744dd2f03c77da31c692cb194976
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>