Use a QTemporaryFile in readFromFileAfterJunk() instead writing
to the current directory which might not have write permission.
Enclose each call to QFile::open() in QVERIFY2() with error message.
Change-Id: I3c5da31c6681a2396cee473cafe7d92c5c220de3
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
This reverts commit 5b62a5e7aa.
This commit is reverted due to two reasons:
1) It was written incorrectly and does not work as is. The
ifdefs should be ifndefs. In its current state, it does
the exact opposite of what it is supposed to be doing.
2) There is another environment access inside qsimd.cpp
(which checks QT_NO_CPU_FEATURE). This access causes the
app to hang.
All in all that approach is not sustainable as we might get
bitten by environment access again and again. Instead we should
use another environment container or use a recursive mutex for
WinRT and Windows CE.
Task-number: QTBUG-49529
Change-Id: Iaca76404dc1023551a7c25489a609681135765fd
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Create a temporary directory instead of writing to the
test data directory or home path (Android).
Change-Id: I6af583e5da91eefb603eaae179e7d789487dc626
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We assumed that creating a window would always result in a configure
notify event, so we delayed sending the initial expose event until
receiving the configure notify.
That strategy fails in cases where the window does not need a reconfigure
after being created, such as when not running a window manager, or when
creating child windows. In those cases the window is just mapped, and
we ended up never sending an expose event.
The problem was masked by sometimes receiving an explicit expose event
from X, just after the mapped notification, which we then sent without
waiting for configure. Unfortunately we can't rely on this behavior
and need to remove the deferred expose event logic, so that we always
ensure that at least one expose event is sent to Qt.
Change-Id: I702be7f24de2a1e89c085fb6bd95bb8ff7792a27
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
We need to remember where the included file's name starts anyway; if
we move this to before the search for the end, we don't need a
separate variable to keep track of its length.
Change-Id: Ia8d72839ac3fa32f2e748a21ee70dcab614562f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is a partial revert of aecf3006bd.
The DPI needs to be set inside the constructor to have the text
rendering initialize properly. Landscape orientation fix is still valid
and the dpi change was unrelated to resolve QTBUG-49470.
Task-number: QTBUG-49610
Task-number: QTBUG-49470
Change-Id: I928b8d291b65cd744731c009917804b96253c276
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
We're never interested in trailing zeroes, unless the number is exactly
0. qdtoa would return an empty string if the result was exactly '0',
which is also fixed by this change.
Change-Id: I3ba2f7e835b92d54d9008ad03fdf6ce5fb3af8a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
When bootstrapping we might rely on sscanf(3) for parsing doubles from
strings. We don't want this to be localized.
Task-number: QTBUG-49616
Change-Id: I1607bb750b479fd7007dd0d875d600be59caa859
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
VS2010 is not supported in Qt5.7+
Task-number: QTBUG-31611
Change-Id: I4b2bd703f6462e6f0a4de9e75bca8316b8707680
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Ubuntu 10.04 is not supported anyways in Qt 5.7+
Task-number: QTBUG-25293
Change-Id: I6420f76b12835aca268455341b46be61e9a2b143
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Shifting a signed integer that overflows is undefined behavior. All
masks were changed to unsigned in qRgb and qRgba. While the alpha value
is enough to fix the undefined behavior, Visual C++ generates slow
code if not all of those constants are unsigned.
Change-Id: Ia0ec3e9464088495173b4ad9c2e37a49e6f8e987
Task-number: QTBUG-49595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Before:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
After:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch("/home/dfaure/.local/share/user-places.xbel") failed: No such file or directory
(assuming "%{function}:" in $QT_MESSAGE_PATTERN)
Change-Id: I6cc68529516b33683bd69fbb61e04df8a8aa880d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt uses QHash as the container for faking environment variables on
Windows Runtime and CE. Environment variable manipulation functions are
protected by mutex. Accessing the QT_HASH_SEED environment variable
inside QHash can lead to situation where qputenv() call leads to
qgetenv() call and that leads to a deadlock. Since the application
environment is faked anyway, drop support for QT_HASH_SEED and ifdef
that functionality out on those platforms. Documentation is updated
to reflect changes.
Task-number: QTBUG-49529
Change-Id: I1b1c28cb0b041fe2a63ca3dce57068fcb46505a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Since the item positions are guaranteed to grow, we could safely re-use
the obtained first item while looking for the last item in the chain.
Change-Id: I5e42f5de820c62a51a109a4b227b031c697aa898
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The documentation already states we're doing this, so stop lying
and implement it properly :)
Change-Id: Ic78980d76f61e8aa64e59ea058a8105d9c507774
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
In fact, this is an extra info no one ever cares about.
We already have properly configured INCLUDEPATH to look for png.h.
Change-Id: I27fec4d474570683c6c371dff34472a7c650fe65
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This method is virtual probably to avoid having to use the specific
driver type in cases like this.
Change-Id: Ifd9d5e2d320b744e098a0b24ae6f3a89cfc15c9a
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
These are signed values. Notice the initialization to -1, which
apparently never worked. The unsigned types previously used may
be due to confusion with other arguments of OCIAttrSet():
sword OCIAttrSet ( dvoid *trgthndlp,
ub4 trghndltyp,
dvoid *attributep,
ub4 size,
ub4 attrtype,
OCIError *errhp );
Examples found in web searches also use signed int.
Change-Id: I8db273a554fa0ef454a8dfce5d83983f79cf6cb9
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Casting between Qt::Handle (void*) and db2's SQLHANDLE (int) is
not tolerated by gcc 5. Neither is the missing enum value in the
switch.
Change-Id: Ibce0adc68376e6c411cae238b26abc6682d0392c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
A table in enum doc may have long literal strings defined
as enum values - they take up space from the Description column,
and often force a scrollbar to appear, making the entire
table difficult to read.
Alleviate this by reducing the font size for the text in Value
column.
Change-Id: I18495a4f506851f9eff2cd94f5cdfcb03096c698
Task-number: QTWEBSITE-658
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
The EcmaScript format for printing doubles in exponent form differs
from Qt's format only in this aspect. EcmaScript explicitly prohibits
leading zeroes in exponents. It is thus worthwhile to add those flags
in order to be able to generate and parse doubles in compliance with
EcmaScript.
[ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption
allow generating and parsing doubles in EcmaScript compliant format.
Change-Id: Ia7b82c2e67bb8b80bd890014ff5cd4563faf2a03
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Also use this for converting doubles with QVariant. We generally want
exact results there, rather than adding rounding errors whenever we
convert.
[ChangeLog][QtCore][QLocale] Added special value for double conversion
precision to get shortest accurate representation.
Change-Id: I905b8a103f39adf31d24b6ce2c8a283cf271b597
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The part of qmodule.pri that is supposed to set QT_CPU_FEATURES ends up
missing in the output.
Change-Id: I30f3dbad5ac22d32e25d63037980dac370adc4ea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
removeFromSuperview could be called from outside the Qt domain (e.g from
a native cocoa gui). we need to guard it by an autorelease pool to make
sure that potential release/dealloc methods are not postponed to a point
when we do not have a qapplication anymore
Change-Id: If65cce4c524a16ffee125694c534f900c7d08fa8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Move QWindowsDrag::defaultCursor() to the per-screen instance
of QWindowsCursor so that the cached default drag cursor pixmaps
are created with the correct size per screen.
Task-number: QTBUG-49511
Change-Id: I02f75ac3b1e5e064325b066ee03e1d5c8a7c7ee8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
QWindowsCursor::customCursor() uses a best match algorithm to
find the most suitable pixmap for the cursor size obtained
from GetSystemMetrics(). This size is correct for the primary
screen only; in High DPI + normal monitor multiscreen-environments,
the cursors will be too large on the secondary monitor.
Pass the platform screen to apply a correction factor based on
logical DPI to obtain the correct size.
Task-number: QTBUG-49511
Change-Id: I8a64a969e3ade7ab5029e3ae904a0bcbb4704f90
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Apply a per screen scale factor, also taking the device pixel
ratios of the pixmaps into account.
Task-number: QTBUG-49511
Change-Id: If46b6eeb37635c2c4046992c1ba06711ccf54eae
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
The pixmap-based cursors and some of the standard cursors we
create from resource pixmaps need to be separated per screen.
Use a QScopedPointer containing the per-screen cursor instead
of the previously used QSharedPointer containing the cursor
shared by all screens.
Task-number: QTBUG-49511
Change-Id: I5203fcc4ecf5a7ff3fea833a4eaeb5300a6e6d54
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Windows opened from keyboard (e.g. keyboard shortcut) are not active on
Marco or Xfwm4. These windows are under the window which received the
key event. This patch fixes the problem by updating XCB timestamp on
every key press like Qt4 does.
Task-number: QTBUG-49567
Change-Id: I9ea483784ac361d0b645d0f11f643868b367ac2c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Due to recreating the underlying framebuffer we absolutely need a
re-render. However, going directly through paintGL() is wrong since
application code may override paintEvent() instead. Such code would
then miss these repaint requests.
To overcome this, simply rely on paint events, like the normal code
path does.
Task-number: QTBUG-49466
Change-Id: I6ddb9eb53bedb1655a9714b9b77faa1c439766a2
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
The recent changes added a widgetTexturesFor() helper function. There
has to be a dummy version of this for -no-opengl builds because
QPlatformTextureList is not available in such builds at all, meaning
the real function is not suitable outside !QT_NO_OPENGL.
Change-Id: Ib108b1804f539796631b1927de89937236781d2a
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
When built in by the debian scripts, a symbol PLATFORM_API_TOUCH would
be defined for relevant target platforms. Here in Qt, this does not apply.
On a correctly installed system, the UBUNTU_PLATFORM_API_BACKEND
variable is not required at runtime, since the system's value will be
read from a settings file under /etc.
Also, the previous hardcoding would mean that it could not be
overridden at runtime.
Change-Id: I24ddfaa254005b4113f3328b66edb1c6bbc509e2
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
The files are automatically generated, so that's where they
belong. This makes a small cosmetic difference when generating
Xcode projects, since then the files will be grouped under
a different folder in the project explorer, separate from user
sources.
Change-Id: Ic2599ccb3008635e76ae467eec80f2b9e5ca838e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This is the simplest step we take on the way to supporting color bitmap
glyphs with FreeType "out-of-the-box".
Change-Id: Iebdb7acf937734f66a7944d153026d0735cb53d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Check that we can use std::forward, and that the compiler
synthesizes move special member functions when it should.
MSVC only supports the latter since the Nov 2013 CTP,
which, for our intents and purposes, means VC2015.
Change-Id: I8d8e4ae064abce90076a05b3b637950ab7d21dac
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The platform is no longer supported or actively maintained, and is
in the way for improvements to the Unix event dispatcher and QProcess
implementations.
Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
If, after checking a condition, we issue a qWarning(),
by definition that check is unlikely to be true.
Tell the compiler so it can move the error handling
code out of the normal code path to increase the
effective icache size.
This change contains the changes to the util/,
dialogs/ and widgets/ subdirs.
Moved conditional code around where possible so that
we could always use Q_UNLIKELY, instead of having to
revert to Q_LIKELY here and there.
In QSystemTrayIcon::setVisible(), as a drive-by, I
swapped the evaluation order of an &&-expression
(newly wrapped in Q_UNLIKELY) to be more readable
and more efficient (cheaper check first) at the same
time.
Change-Id: I3564c5a5deacba49d67d3989fb0b53e680c57fcb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is more efficient and works even with non-US-ASCII
QStrings.
Change-Id: I4ca19de60347ded03022ef8540a6708c563bc9d7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QString::asprintf() has the ability to take a ushort* array as
obtained from QString::utf16() and insert that into the output
with an %ls conversion.
But no-one ever used this, because just passing QString::utf16()
to QString::asprintf() creates a warning about wchar_t* expected,
but ushort* provided.
The new qUtf16Printable() macro adds the necessary casts (via void*
to prevent any "type-punned pointer" warnings) to make
passing QString::utf16() to QString::asprintf() work silently.
This should greatly reduce the need to do a round-trip via utf-8
just to print the contents of a QString.
[ChangeLog][QtCore] Added qUtf16Printable().
Change-Id: I7ddd8d2b2a2191c9faa26aca95d49850d94b287c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move the QT_USE_NAMESPACE up, so any use of Q* classes won't result in
compilation errors when Qt is configured to be in a namespace.
Change-Id: Id559c86798529f6cad43a75fce303c108ce820bc
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Check that it works on C arrays, with auto type deduction
and with types that only provide free begin()/end()
functions that can only be found through ADL.
Change-Id: I760722a0f56c9ebe967070ff68af90b96ed77e66
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This should solve problems with our use of the noexcept
operator, because that's how std::pair is defined, too.
Mid-term, we should kill QPair and use std::pair instead.
It really has gotten way too complicated to implement a
C++11 pair correctly.
Task-number: QTBUG-48780
Change-Id: Ied0acd220e5131000a957dc356d6efcdd8f83828
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Obtain the system setting via SystemParametersInfo(),
amending fac71528cc.
Task-number: QTBUG-49561
Change-Id: Ie7a956fdc6b175ad09356949645c1e8937053abd
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Pass 0 window to High DPI scaling function to prevent it from
trying to find a screen and applying a screen offset.
Task-number: QTBUG-49516
Change-Id: Ib3e1919985f2c6df1dd8369f6e28b3ee1fdb7afe
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>