This fixes an issue where a build error may be introduced by a simulator
being selected whose OS version is lower than the application's
minimum deployment target.
Task-number: QTBUG-64456
Change-Id: Ic7c834a1473c183ebb910bc01a416fe1e23a5a14
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Prevent it from crashing when naively using it for example
on Windows, which defaults to the Windows Vista style operating
on native window handles.
Change-Id: I7b1dfb00a6b6860d0f0a134653ce1142b45959ec
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Commit 02dc39fa8e added the constructor
for the bootstrapped mode. For the regular mode, we hadn't needed, since
the {} syntax guaranteed initialization for us.
Turns out there's at least one compiler that doesn't think it was enough
(GCC for QNX 7).
Task-number: QTBUG-64451
Change-Id: Ic632b4163d784b83951cfffd14f6766b4cb4eb64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
on Ubuntu_16_04 and openSUSE_42_3.
Task-number: QTBUG-64446
Change-Id: If8fff2823f041428852822470a2f00157795558b
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
We store both in a single memory structure, instead of two local
statics. By construction, we also ensure that the global PRNG mutex is
in a different cacheline from the global PRNG state itself.
Finally, we don't store the full system QRandomGenerator, since we only
need the type member from it.
Change-Id: Icaa86fc7b54d4b368c0efffd14eecc48ff05ec27
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This brings us to almost parity with the C++11 Random Engine API
requirements (see chapter 26.5.1.4 [rand.req.eng]). We don't implement
the templated Sseq requirements because it would require moving the
implementation details to the public API. And we don't implement the
<iostreams> code because we don't want to.
Change-Id: Icaa86fc7b54d4b368c0efffd14f05ff813ebd759
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Since we don't document how many bytes one needs (it's 2496), it's
difficult for the caller to provide just enough data in the seed
sequence. Moreover, since std::mt19937 doesn't make it easy to provide
the ideal size either, we can't actually write code that operates
optimally given a quint32 range either -- we only provide it via
std::seed_seq, which is inefficient.
However, we can do it internally by passing QRandomGenerator to the
std::mersenne_twister_engine constructor, as it's designed to work.
Change-Id: Icaa86fc7b54d4b368c0efffd14f0613c10998321
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Now only QRandomGenerator::system() will access the system-wide RNG,
which we document to be cryptographically-safe and possibly backed by a
true HWRNG. Everything else just wraps a Mersenne Twister.
Change-Id: I0a103569c81b4711a649fffd14ec8cd3469425df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Since we're adding a deterministic generator that inherently does not
use syscalls, and people should really use that one by default, there is
no point in optimizing the secure generator wrt syscalls. Besides,
keeping the random data in memory for longer than needed is likely
inadviseable.
Change-Id: Ib17dde1a1dbb49a7bba8fffd14ed0871117fe930
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
To obtain "proper" directory behavior, we have to check against the
extracted "resources" directory instead of its qrc counterpart.
Change-Id: I4996ba74419945f78d356ad953a5b826ff663687
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
To obtain the file's handle, we need to obtain it from the extracted
test data instead of qrc.
Change-Id: I89c5c3f3a7da7e36205a439581a6d83efffdc07c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Resource files are extracted to m_dataDir in tst_QFile::initTestCase.
Instead of trying to access the file from the resource on systems that
use qrc for bundling the test data, we have to use the files that were
extracted at the beginning of the test.
Change-Id: I35453fbdeb27e317d1342ff1cb7bbea9cebea14d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
On some platforms (like UWP) files that are copied during
qfile auto tests are not writable by default. The cleanup will fail for
these files if the permissions are not set accordingly.
Change-Id: Id925dcadfc6b505c87f1f55d5ea05e286b60a5a5
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Ceiling width/height fails to take into account rects that do no have
their top left position on an exact point boundary.
Example: QRect(0,0 20x20) and QRect(1,1 20x20) with scale 2.0 would give
the same result of QRect(0,0 10x10). The correct rects are QRect(0,0 10x10)
and QRect(0,0 11x11), so that we are sure to repaint all pixels within the
exposed region.
Before 5138fada0b, rects were also rounded incorrectly. The old method
would give the result of QRect(0,0 11x11) in both cases, causing the
exposed region to be larger than a window.
Amends 5138fada0b
Task-number: QTBUG-63943
Change-Id: I9f3dddf649bdc506c23bce1b6704860d61481459
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
So far we just write ... '.'. , which looks weird.
Change-Id: Iac6fc781c80976994ea0a182b55958baa39a7e52
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This patch works around Windows X86 on QEMU antics.
It appears on this platform the test behaves in some unpredictable manner:
- WSAConnect with 255.255.255.255 does not always immediately fail with
some error, so socket engine waits for a connection timeout (30 s.),
but the test itself
- only waits for 5 seconds and then tests that a request has finished with
error, which is not true (we are still connecting).
To make it work - whenever we have bearermanager feature enabled, set
a connection timeout to something reasonable, not 30 s.
Since we try to connect to each address twice, make timeout 1.5 s
(so it's 3 s. in total and still is < 5 s.).
Task-number: QTBUG-64264
Change-Id: I1d40c140667fca8402ec9344e66d313b6df54256
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)
This commit also found a couple of calls to rand() instead of qrand().
This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
src/network/ssl/qsslkey_qt.cpp
src/network/ssl/qsslsocket_mac.cpp
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
- Blacklist ioHttpRedirectPostPut for Windows
- Amend 84396a3f93:
Keys need to be on subsequent lines
Task-number: QTBUG-62583
Change-Id: I6360ec7bd87de65a3294a0d22148f13579fcd292
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Clang compiler defines fallthrough, but wrongly detects QT_HAS_CPP_ATTRIBUTE(fallthrough).
This makes compiler breaks compilation due clang be expecting
clang::fallthrough.
Change the order makes the exceptions. clang/gnu, been tested before
the generic, setting then proper defines at end.
LLVM-bug: https://bugs.llvm.org/show_bug.cgi?id=33518
Change-Id: Ic287e9028936af3bdade5c1ee319ca8914b36ea7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Contrarily to what the comment stated, we actually rely on automatic
menu validation, even for submenu items. This is visible in the menu
delegate's validateMenuItem: and itemFired: methods.
This solves the last visible issue in BigMenuCreator where, under
ASP/ASP, ASP/SAP, SAP/ASP and SAP/SAP, all A*S submenus would be
disabled. The cause was an incorrect target/action setup.
Menurama still behaves as expected.
Change-Id: I2599d6fb0d51f56f5d36f03b69647e35ff6c550a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
In QMainWindow::setMenuBar(), we hide and schedule the current
menubar, if any, to be deleted later. However, it remains installed
as its whole ancestry's event filter, which could conflict with the
newly assigned menubar until the old menubar is destroyed. In our
case, we have noticed issues with the Cocoa QPA plugin.
We force uninstalling the old menubar as event filter by setting its
parent to null, pending its deletion shortly after.
This fixes BigMenuCreator's empty menubar when calling it with only
the "--new-menubar" option. It also fixes QTBUG-34160 example which
was not behaving as well as it should.
Task-number: QTBUG-34160
Change-Id: Ifefb72affad01e7b7371005442074afd6a39a5b8
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When one of the menubar actions changed, we would omit to
update several properties on the platform menu, most notably
its title.
Manual tested with BigMenuCreator, where the sequence
menu->addAction(action); // A-operation
action->setMenu(submenu); // S-operation
would result in an "Untitled" menubar item on macOS, and this
regardless of when the submenu is populated.
Change-Id: I43989f36f6bf3f0b7056310ac986c06f8e02f128
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This saves 32 bytes per instance on 64-bit macOS, from 888
down to 856 bytes.
Change-Id: I2592631aa3566d2eab72bad338aacfe76bee8ef3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Xcode 9 introduced the main thread checker, which detects invalid
use of AppKit, UIKit, and other APIs from background threads.
https://developer.apple.com/documentation/code_diagnostics/main_thread_checker
In our case these are accesses to e.g. [UIView layer] and
[UIScreen scaleFactor] from the render thread of QtQuick,
things we should look at, but that might not be easily solvable.
In any case, these are not warnings the user can do anything about,
so in lack of a per-library disable of the checker, we have to
globally disable it for the whole Xcode project.
Task-number: QTBUG-63822
Change-Id: Ibfcdf23891cf6bfbbc9b9b3349e4c256c273c7de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There are three ways to set the application (Dock/task switcher) icon:
1. By setting an ICON in the project file
2. By calling QGuiApplication::setWindowIcon
3. By calling QWindow::setIcon
The third one was not working on macOS, despite being documented as
such: "The window icon might be used by the windowing system for example
to decorate the window, and/or in the task switcher."
We now update the application icon based on the active window,
unless a global application icon has been set using ICON, or
via QGuiApplication::setWindowIcon. The reason for not allowing
the window's icon to override a global application icon is that
the developer may have intended to set the document icon for a
window (to represent QWindow::filePath), and we don't want that
to affect the Dock icon of the application.
The role of QGuiApplication::setWindowIcon is a bit dubious in this,
as it's documented as "This property holds the default window icon",
which would indicate it should follow the same logic as above by not
letting it override the global ICON set in the project file, but this
would not allow runtime switching of the application icon, so the
QGuiApplication property is left as is. The property should probably
have been named QGuiApplication::applicationIcon initially.
Task-number: QTBUG-63340
Change-Id: I94d3710a8586bb729af42f59a915b8f49dded101
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The glyph cache resize is clearly doing something that is not actually
legal with OpenGL ES. Until this gets investigated properly, add the
Vivante GC2000 (found in the commonly used i.MX6 quad) to the list since
reports show that the issue occurs there as well.
Task-number: QTBUG-49490
Change-Id: Ia890346d8dbb1691bc113e2ef522713ba6709393
Reviewed-by: Louis Kröger <louis.kroeger@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
All code should be using the license header in header.BSD or header.FDL
now. If modules still use outdated headers, they should be fixed or
as a stop-gap measure add header.BSD-OLD, header.FDL-OLD files locally.
Change-Id: If462f1646ab413c18d2d3c61197773dca2a036ec
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
I updated signals and slots and for each loops to the new syntax and
replaced most free functions with std::function.
Task-number: QTBUG-60641
Change-Id: I7693f81f71c7f53fcbe83189a0de2fb76ddf99a8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Similar to the problem found in QTcpSocket auto-test recently.
While the failure on CI looks differently (apparently, server process
starts but does not print anything), fixing the dependency does not
hurt and at least fixes the 'make check' scenario.
Change-Id: I8f29f3e492d22410533407a527f5fc8f664e7f5c
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This fixes an upstream bug in the existing version 1.6.32 which would
cause certain valid png files to be rejected.
The remaining diff to clean 1.6.34 is archived in the qtpatches.diff file.
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.34
Task-number: QTBUG-63950
Change-Id: Ie6f2a09c78a93b6e5623848776b75650bb5bca66
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Make sure the wait handle is unregistered even though
there is no event dispatcher in QWinEventNotifier::setEnabled().
Task-number: QTBUG-64152
Task-number: QTCREATORBUG-19175
Change-Id: I608b95adc7cb874bc52dc5bf0e9f51b443b54ebc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This test was failing recently on Windows 7, mingw, x86. It's not
failing now and attempts to reproduce the failure on CI's VM were
unsuccessful. Anyway, just reading the code is enough to spot
race-conditions: two threads are accessing two shared boolean
variables without any protection.
It's unclear if these races were the reason why the test was failing,
but we fix them for good anyway. Also, a failure to start a thread
or to start listening on a TCP socket is not treated as XML-related
failure anymore and QSKIPped instead.
Change-Id: I5115ce6c33cafc91485f8cf6e7e268d954976556
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When a section is hidden, QHeaderViewPrivate::cascadingResize() does
resize a section even it is hidden. This leads to space between the
neighbor sections and also some unneeded calculations.
Task-number: QTBUG-54601
Change-Id: Ie139417ae2c77ef25e66cf628bfe400185f88ee8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Resizing a QTreeeView section with double click or
resizeColumnToContents() does not respect the maximumSectionSize when
the resize mode is Interactive or Fixed. Since the documentation of
maximumSectionSize states that it should honor this property for those
cases either the documentation or implementation is incorrect.
This patch fixes the latter.
Task-number: QTBUG-64036
Change-Id: Ic14c8e444d50b9c50a117efed19d0bca7ec1cf82
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This test contains Oracle specific queries and will fail for other DBMS.
Currently it doesn't fail, because it is skipped for drivers that doesn't
support BatchOperations and only QOCI supports batch operations.
Change-Id: I8f1e7c7244726fa11c841023dec186553747a6b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The test showed flakyness on Linux. It has been observed that its
windows overlap. Position the windows beside each other.
Change-Id: I4ff1b9cafaf753a6844b3dfabb576a07f74b396a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Qt draws the backing store to the window using CoreGrahics,
which will trigger a slow RGB32 -> RGB64 conversion
when the output display is a deep color display.
Disable NSWindow dynamicDepthLimit and force the depthLimit
to WindowDepthTwentyforBitRGB for the common case of
8-bit-per-component raster surfaces.
This was benchmarked by resizing a simple QRasterWindow
test case which fills the window area using QPainter::fillRect().
Before:
67.1% rgba64_image_mark_rgb32
10.8% __vImageCopyBuffer_block_invoke
6.0% madvise
5.0% _kernelrpc_mach_vm_deallocate_trap
4.1% qt_memfill32(unsigned int*, unsigned int, int)
After:
30.7% __vImageCopyBuffer_block_invoke
20.3% madvise
12.3% __vOverwriteChannelsWithScalar_ARGB8888_block_invoke
12.2% qt_memfill32(unsigned int*, unsigned int, int)
4.6% _kernelrpc_mach_vm_deallocate_trap
The test program now spends significantly more of its
time allocating/deallocating the backing store (madvise),
and running the Qt paint event (qt_memfill32).
Task-number: QTBUG-47660
Change-Id: I878be7a0e6eee4ad798f7a53f7f9f79b7950af26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Bitmap glyphs are returned prescaled, which means we should include
the transform in their bounding box.
Additionally painting them should stick the smallest rect to avoid
writing outside the allocated area, and assert in debug builds.
Task-number: QTBUG-64239
Change-Id: I5f877d36566891323f528018f910798344ba4ce2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>