Haiku supports the realpath implementation, but failed the
original #if check because of the wrong _POSIX_VERSION.
Change-Id: Ibad12de3bf7c1031b2dff3026b5c61e5afd3f3e6
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use an existing, non-symlinked directory for the unit test.
Change-Id: Ice9976a4fd10c42c3cb014614ccd699bcea1065f
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The _POSIX_VERSION declared in Haiku is 199009L, so we have
to enable support for setenv/unsetenv explicitly until
Haiku POSIX version is updated.
Change-Id: Ic22374253b0512a6a816257db83b0c649be0585d
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
TabAllWidgets in QPlatformTheme is replaced by TabFocusBehavior.
[ChangeLog][QtGui] Expose TabFocusBehavior in QStyleHints
Change-Id: Iafaad7c6a5c6bc888d1e124e6ddcdbdc46f37b1c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Followup to 2203d9d93e: clearRegion takes
a little time, so doing grabWindow() too soon afterwards can result in
grabbing a pixmap with undesired leftovers. And doing it every time
we render the icon causes flicker. So, do clearRegion() ASAP when showing
the icon, wait for it to happen, then grabWindow() only the first time we
render, and reuse the resulting pixmap for all future calls to paintEvent().
(The downside is, if there is any corruption during the first grabWindow(),
it's going to stay there as long as the app is running.)
Task-number: QTBUG-35658
Change-Id: If881ab192dba43758dcbb0d080663ff42057fa4f
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Until now, only the Gnome and KDE themes have done this. But
the gtk2 theme is not the same as the gnome theme. Further, Ubuntu sets
the environment variable QT_QPA_PLATFORMTHEME=appmenu-qt5 if that
plugin is installed on the system; and then with a custom build of Qt
which cannot load the module (e.g. a static build), it will again
fall back to QGenericUnixTheme instead of the gnome theme. In both
cases we want to still try to use D-Bus StatusNotifier protocol
instead of XEmbed. In general it should always be safe to check
whether or not that is possible, before falling back to the XEmbed
tray icon implementation.
Change-Id: I86d6c6f6ad410ea31770d39166d0a7e3330365a0
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
QSharedDataPointer is declared in qshareddata.h, not qsharedpointer.h
Change-Id: I4702f346ae01a8de07a6a9b50f951d2d4a89e1fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Short version: fix build on QNX 6.5.0.
C++11 has been included on QNX 6.6.0's libcpp (Dinkum C++11 libs), while
continuing to be unsupported by the older QNX 6.5.0 toolchain.
This patch updates the mechanism for detecting the QNX's libcpp that is being
used during compile time, and also updates the list of C++11 features to be
disabled when QNX C++11 support is not present by adding
Q_COMPILER_UNICODE_STRINGS and Q_COMPILER_NOEXCEPT to it.
Change-Id: Iddb3626206a0d97d7103c1ff17ba0ae953e9a4b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The phase changes to ScrollEnd as soon as the user's fingers
are lifted from the trackpad; then the OS can optionally continue
sending scroll events to simulate deceleration, which are translated
into more QWheelEvents with phase ScrollUpdate. With this patch,
the phase of the final event after the momentum phase will be
ScrollEnd to indicate that the scrolling is completely finished.
[ChangeLog][QtGui][QWheelEvent] on OSX, trackpad wheel event phase
transitions occur in the order ScrollBegin, ScrollUpdate, ...,
ScrollEnd, ScrollUpdate, ..., ScrollEnd, where the second batch of
updates represent momentum events (inertial scrolling).
Change-Id: I7404ed6fbbeaff6b1fa63e226fe1800494986b7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Use the
QDebugStateSaver saver(debug);
debug.resetFormat().nospace();
idiom to unify the formatting and whitespace handling.
Change-Id: Id346d63b3f589b60ca19e4459271d587f1a0c003
Reviewed-by: Richard J. Moore <rich@kde.org>
In case CreateFontIndirect() call fails, always fallback to a better
stock font provided by Windows (apparently, it is DEFAULT_GUI_FONT).
Change-Id: Ib78fe0d21ba4fccbba1152b81ed87c010e1220e0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
No significant changes, just stick to a released version.
Change-Id: Ib9c4ce6f7da07727e890a4ac3265fc4574e89821
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Instead of using QString::sprintf() (and converting the result back to QByteArray),
simply do the conversion from uchar to octal digits ourselves, using QtMiscTools.
Change-Id: I452c085b717c71609cd1a9465e31d90e6a0ba54b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QTimeZonePrivate::Data type is larger than void*,
so holding them in QLists is horribly inefficient.
In addition, this type is held elsewhere in QVector,
so do that here, too.
As well as being faster, also saves 1.3K of text size on
optimized AMD64 builds.
Change-Id: I1ecf3ee0d955f6b19d2269204e2febc2ba2a9d9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation-private QTzType type is larger than void*,
so holding them in QLists is horribly inefficient.
Fix by holding it in QVector instead (it was already marked
as a primitive type before).
Text size grows by ca. 0.5K, but of course we got rid of all
those pesky heap allocations.
Change-Id: I3b70ed36fa9947b695ffc87c6f6199daa13cb7cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation-private QTzTransition type is larger than void*,
so holding them in QLists is horribly inefficient.
Fix by declaring it as a primitive types (it just contains
various integers) and holding it in QVector instead.
Also optimize parseTzTransitions() by preallocating the expected
number of transitions and streaming directly into the container,
resizing to the number of successful read items on error.
Saves roughly 0.5K in text size, too.
Change-Id: Iadec7a7b0721893e477e1778c9fb54afd6e49544
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both QTzTransitionTime and QTzTransitionRule are larger than void*,
so holding them in QLists is horribly inefficient.
Fix by declaring them as primitive types (they just contains
various integers) and holding them in QVector instead.
While we're at it, make the equality operator for QTzTransitionRule
a constexpr, noexcept non-member, and provide the inequality operator,
too.
As well as being faster, this also saves 1.5K of text size on optimized
AMD64 builds.
Change-Id: I37100522f19556101c334625818dcf8c9a712dd9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Though only present in QT_BUILD_INTERNAL builds, accessing an unprotected
global bool is still a data race.
While the intended use of reset flag/start test/check flag is kosher
when it comes to the happens-before relation, this is no longer true when
users use two instances of QFileSystemModel at the same time.
To fix, make the bool an atomic int instead. Relaxed memory ordering
suffices, since the atomic int represents all the data. The races over
which model sets the variable is the job of the test case to resolve,
and doesn't affect other users.
Change-Id: I4d245b93a741e3457c42df6edd5b836a9bdacd83
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously, number() was implemented in terms of setNum().
That makes no sense whatsoever. It creates a temporary
value which requires the function to have an exception
table and an unwinding trampoline. It also introduces
a default constructor (in number()) and a copy assignment
(in setNum()), which breaks the chain of RVOs originating
in the QLocaleData functions.
Instead, implement setNum() in terms of number().
This makes setNum() such a premature pessimisation that
it's probably best to deprecate it in the near future.
There are not many users of it in qtbase left, and it
just pollutes the QString interface.
Effects on Linux GCC 4.9 stripped release builds:
text -708B
data +-0B
relocs +-0
Change-Id: I015c9ddb1ba9c98c2c55e38e54ef7894954ac4ca
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Effects on Linux GCC 4.9 stripped release builds:
text -2024B
data +-0B
relocs +-0
Change-Id: I1a315eb0f94ade2b40be62770c6ddcfc56da9ec0
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QString::vasprintf() deals just fine with a nullptr format string,
so don't check manually.
The main advantage of dropping the check is that in two of three
cases, we can replace assignment with initialization, thus saving
one default ctor and one (move) assignment.
Change-Id: I08dd24111cd0b92f21ef9f1c3e352ede0f66afe0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
asprintf() is a GNU extension that prints into a string it
allocates internally. Arguably, that's a better name for
QString::sprintf() since it also allocates memory internally.
The main problem with QString::sprintf() isn't that it's
dangerous to use (it is), but that it's not static. It also
returns a reference instead of by-value, breaking RVO.
There is a comment about removing this function completely
in Qt 6.0, but it remains the only printf-style function
in Qt that can allocate the target string, so it's vital
for logging, e.g., and the recommended replacement code
(http://linux.die.net/man/3/vsnprintf) is a nightmare.
So this patch adds static (v)asprintf() methods to replace it.
Further patches will fix up all in-tree callers and finally
deprecate the old (v)sprintf().
Test coverage is provided through the existing tests of
sprintf(), which is implemented in terms of asprintf().
Arguably, the in-tree callers show that QByteArray would
benefit from having an asprintf(), too, as most of the
in-tree code works around its lack with calls
to to{Latin1,Local8Bit}() after using the QString version.
[ChangeLog][QtCore][QString] Added asprintf(), vasprintf().
Change-Id: I8510f8d67c22230653ec0f1c252c01bc95f3c386
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of using sprintf (and #ifdef'ing our way around Windows warnings),
simply do the conversion from uchar to hex digits ourselves, using
QtMiscUtils.
Also used the Qt::Uninitialized QString ctor, as the result length is
exactly known ahead of time.
Change-Id: Ie42e5f11c608e7719f7dc33d72739c1e41901b3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Hand-tuned in an attempt to get something that matches the normal arrow
cursor.
Task-number: QTBUG-44385
Change-Id: Iea2ee309fccb78706f47003fb11b14156fa01a50
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Making a build with an older NDK having only gl2.h results in crashing
QOpenGLTexture on devices that provide ES 3.0 or 3.1. This is because
immutable storage is supported (based on runtime checks) but the function
pointers are not there (due to ifdef checks).
Fix this like we did in other places: get rid of the ifdef and dlsym the
ES3-only symbols.
Task-number: QTBUG-44397
Change-Id: Ief518ec8c7d532aeea0075ba166baf8d22e66ec5
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Change-Id: If43dcc2b77fea5ae3ec40cc847467fc21fbd2c83
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
QAbstractSocket::close() always calls QIODevice::close(), which resets
QIODevice's internal read buffer. So it makes no sense to make same calls
from disconnectFromHost(). This made the closeCalled private member
superfluous.
Change-Id: I4ec64e9711490e44e737763e4ed7fb41bffe2556
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since the algorithm can only be one the underlying structure can
share the same memory.
Change-Id: Ifeaa1a2d5c4ad3566cbbf847445b805876275260
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Optional parameter DESTINATION to set target rcc file
Example:
qt5_add_binary_resources(GenerateFixture "fixture.qrc")
Task-number: QTBUG-41728
Change-Id: I9dc2fe8e7d5e9ad3873b89f75ab84a2a1b9d1d29
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
Since argc/argv is modified by QCoreApplication-derived classes,
a copy of the original arguments is needed for comparison.
This fixes a crash in Qt Quick 2 tests (which use
the -qmljsdebugger=<port> argument) introduced
by dff18b8e80 .
Task-number: QTBUG-30330
Change-Id: Ic145ac923e0a7c504ab16602c8686268e4fd9700
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
When Qt runs in process with low integrity level,
and place child QWindow to HWND from less restricted process,
ChildWindowFromPointEx could fail with ERROR_ACCESS_DENIED
and QWindowsScreen::windowAt will return 0 despite mouse is on window.
Task-number: QTBUG-44332
Change-Id: I07e1594b90cbde8a9496f8d53ef247a7c69d8715
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This enables us to do more intelligent distribution than simply doing the
rounding on each individual items geometry (which often leads to larger
spacings than specified).
Instead of doing the rounding on the output geometries, we now do the
snapping inside the layout engine. This allows us to do more intelligent
distribution of items, and spacings should always be respected.
There are some cases where items with fractional size hints might overlap
with less than a pixel. This was also the case before this patch. Those
cases are impossible to fix properly, since fractional size hints
conflicts with the snapping in some cases.
(Fractional size hints is normal for Text items.)
Task-number: QTBUG-41216
Change-Id: I01a8bc3529f0b8b028d6eb0a530c751b67ac6f4e
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Previous errors in versioned function classes for OpenGL versions
prior to 4.4 have also been fixed to comply with the new OpenGL
xml specification. Such mistakes were due to either bugs in the
old plain text specification files or problems due to the
difficulty in parsing the old spec files.
In some cases this has meant adding in missing functions that were
absent previously.
The other class of problem was when functions were erroneously
included in the versioned function classes when they should not
have been present. That is, some core profile classes incorrectly
had member functions for deprecated functions that should only
be present in the compatibility profile classes. In these cases
these incorrect functions will now trigger a qFatal if
called. This is fine as any applications that called these by mistake
in the past would have been dereferencing a null pointer as the
function pointer resolution would have failed for these functions.
[ChangeLog][QtGui] Add version function classes for OpenGL 4.4 and 4.5
and deprecate some erroneously classified functions.
Task-Id: QTBUG-33671
Task-Id: QTBUG-44364
Change-Id: I224108dcaf4f8b4933bc121827511841e2a41590
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Adds an SSE4.1 optimized version of qUnpremultiply and uses it in the
most drawing conversions methods. This gives a speed-up of little over
2x.
Change-Id: Ieb858a94ada1eb86d7af715ac1a100f1587f360d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Unify the behavior of the different operator<< by always using
QDebugStateSaver (appending an optional space at exit), and making
sure that the space(), nospace() setting isn't 'leaked'.
Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Gnome Classic on Ubuntu shows this icon but fails to scale it down.
So if we do not pre-scale the icon, it will be too wide, and cropped.
Change-Id: If8cf98de3672deff77b99b17da5491bd6c45cfdb
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
It is unimplemented and probably unnecessary. Unintentionally included
in commit 74443d7bbb.
Change-Id: I3a1afb20e673fa0611b602a11ceca1953231ac14
Reviewed-by: Andrew Knight <qt@panimo.net>
The cipher is always valid here, so this check was never needed anyway.
Change-Id: I22be273d166702926b98f0c9443657a1dde65f6e
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
There were still ifdefs for openssl 0.9.7 and openssl 0.9.8f.
[ChangeLog][QtNetwork] Some legacy ifdefs for openssl 0.9.7 and openssl 0.9.8f
were removed, Qt will no longer build with these versions. In addition there
is no support for openssl built with NO_TLSEXT.
Change-Id: I9268515c0a125a2f6d79add8ee1cb40768e7e898
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Having overloads for GLuint that call glUniformNi was a mistake to begin with,
and it has only been made worse when later OpenGL versions introduced unsigned
int support and glUniformNui. Note this in the docs.
Task-number: QTBUG-37012
Change-Id: Icc867221d0fbced8c4ff769deee66effa022f1b5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The postfix increment(decrement) creates a temp copy of *this before the
modification and then returns that copy. It's needed only when using the
old iterator and then incrementing it.
Change-Id: I7f6702de78f5f987cec3556047e76049b4ee063a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>