Guard the FILE * obtained by fopen() by a RAI class ensuring
the file is closed on destruction.
Change-Id: I9297f91ca2120238f3a44bad92bca5f920e01aa8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
tst_noqteventloop.cpp 'event' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'canFetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'fetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'hasChildren' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'rowCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'columnCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'index' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'parent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'data' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'begin' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'end' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'updateState' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'drawPixmap' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'type' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
Change-Id: I2a0c5da15994619383c1f90fee311927e58d7af0
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
It's perfectly benign, but I spent a lot of time debugging this and
trying to figure out how to solve something that didn't need solving. So
document for posterity.
For an adopted thread, the TLS destructors or the adopted thread watcher
on Windows will call QThreadData::deref():
- QThreadData::deref(), count drops to zero
-> delete this;
- ~QThreadData() deletes the QAdoptedThread
-> delete t;
- ~QThreadPrivate() calls deref() again
-> data->deref();
- QThreadData::deref(), count drops to -1, no action taken
- ~QObjectPrivate() calls deref() yet again
-> threadData->deref()
- QThreadData::deref(), count drops to -2, no action taken
Change-Id: Icaa86fc7b54d4b368c0efffd14ee448e0796e8d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise, the plain socket might be blocked indefinitely on waiting for
socket activity.
This issue is tested by tst_QSslSocket::disconnectFromHostWhenConnected()
which was unstable in CI.
Task-number: QTBUG-64016
Change-Id: I6a1a111dea4d1d1adaf55e6a90c0c5f995a270af
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
... the same way other tests do in this file.
Change-Id: Ifcaee084bd20c55d6b9f7ddcf35daebce2a02e07
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This file could not be included by user code in an installed Qt.
Change-Id: Id222d56dda9ef47d010ab947efa01bf63ecac050
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The manager and managerPrivate member variables are set in the
constructor and never changed after that.
Change-Id: I7cc2fd2eb3f50bdc529ed29485e74bf9c016b0c0
Coverity-Id: 185272
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.20.1
Change-Id: I538a4de9b915fd1655479e44aa7ca8bae7b9a0b3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
These are third party licenses that are part of
freetype.
Change-Id: I8c54feb6b5537ccfb0d0a4ffc24bc830c3c530e4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The LICENSE.txt we showed so far only mentioned the two mutual
licenses (FTL and GPLv2), whithout actually spelling them out.
This is required though.
[ChangeLog][Third-Party Code] Improve documentation about
Freetype 2 licenses.
Change-Id: I3af84b732aff58b12218cb7e8bb8e8de00c86307
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There were a couple of corner cases where doing setPort() would result
in QUrl thinking that an authority was not present. Since the full URL
parsing implies that a host is always present if the authority is
present, then we also imply that setting the port number makes the host
be present too.
Change-Id: I69f37f9304f24709a823fffd14e67c12da18d69f
Reviewed-by: David Faure <david.faure@kdab.com>
1. Recently we have updated our receive window size to a larger value.
Unfortunately, this also results in auto-test pumping through
more data, which probably takes more time on CI.
At the moment we do not have any public API on QNAM's level to
customize HTTP/2 parameters (aka 5.10/FF and so on). So we use the fact
that QNAM is QObject and we can set a property on it. This property
is our Http2::ProtocolParameters object that allows us to configure:
- HPACK parameters (in 5.10 - noop)
- session receive window size
- different SETTINGS as described by RFC 7540, 6.5.2.
2. Undocumented environment variable to set ENABLE_PUSH is not needed
anymore.
3. In 5.11 Http2::ProtocolParameter will become a public API
and we'll introduce a new setter in QNAM.
Change-Id: If08fd5e09e7c0b61cf9700b426b60b5837b6b2e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Make an explicit mention of the fact that modifying a device while it
is being held by a QImageReader is undefined.
Task-number: QTBUG-61121
Change-Id: Ie0a016255c2614c5b8b415c8cd9602169153c8f8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
When embedding foreign windows, we won't be able to return a valid child
accessible interface, so do not report it at all.
Supporting foreign windows properly is platform specific and something
to consider, but at least we shouldn't crash.
Task-number: QTBUG-63451
Change-Id: I19350cf97dc8d0c3f3052411eba0eee5f750dbab
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
It has several problems:
1. It could potentially create an intArray with uninitialized elements.
This could happen because the index for getting interfaces were the
same as the storage index. This was not correct, because they could
diverge if iface->child() returned an invalid interface.
2. The count of accessible child elements could change while iterating.
This could cause out-of-bounds condition when calling
SetIntArrayRegion as described in QTBUG-45855. Instead now, we call
SetIntArrayRegion only once, after we have gathered all the child
interface ids.
Task-number: QTBUG-45855
Change-Id: I77e813158df5f563d04931ac4e296e3fc2a16e67
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Ensure windows are cleaned up. Add scaling where native coordinates
are used.
Task-number: QTQAINFRA-1440
Change-Id: Ie080ff780c687418f4dc5d71fd49112486b217e6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Currently on Windows, the Next button's shortcut doesn't work, because
QWizard overrides it with an empty key sequence.
The key sequence should be changed only if isVistaThemeEnabled() returns
true.
Task-number: QTBUG-46894
Change-Id: I54f26388b167973cc8065a867d9e771c1e6a2a72
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In Qt 5.7, it was possible to call moc "-bfoo.h" or "-b foo.h" and it had the
same effect. With the port to QCommandLineOption, we broke the -b option as it
was not annotated as a short option.
(Regression in a7e3c17e75)
Task-number: QTBUG-63706
Change-Id: I161d0f1a4e65d129063b5e8431802257677da19d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
c4cf90b1f7 made POST requests be
redirected properly, but this wasn't enough and should have included
every method/verb.
Change-Id: I37b12dc9fdffcbf2aadbd2360d4fc2584c024939
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QAction::setData() always emits changed() even without actual data change.
Original code lacks a guard to check if the data changes.
According to http://doc.qt.io/qt-4.8/signalsandslots.html,
adding guard also benefits to prevent infinite looping in case
of cyclic connections.
Task-number: QTBUG-62006
Change-Id: I776369b668082f9f02e4502a36b1ae234ee7e079
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We have found that there are three important operations
when it comes to menu creation and putting it up in the
native menubar:
* Adding the action to its parent menu
* Setting the submenu as the action's menu
* Populating the actual submenu
This application tests all possible permutations for these
three operations, starting from the menubar and down two
more menu levels.
Two command-line options allow, first, to create a late
menubar that will replace the original menubar from the main
window form (--new-menubar) with, second, the option of
creating it parentless (--no-parent) before setting it as
the new main window menubar.
While mostly interesting for platforms supporting QPA menus
and menubars, this could be useful as a trivial check for
QMenu and QMenuBar in a pure QWidget environment.
As of today, the application shows at least three issues on
macOS which will be fixed in upcoming patches.
Change-Id: Id3c1e0f346c6fe27ab4656ff045b88a0a8623740
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
They are not updated after switching tabs. Thus they can be enabled even
when no entry is selected: select an entry on the current tab and then
switch to an empty tab.
Emit AddressWidget::selectionChanged() signal after changing the current tab
to update these actions.
Change-Id: I00da15ed6c3d3839210ae3ffbe1436e234695522
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
"global/qrandom.cpp", line 155: error #2000-D: attribute "destructor" is not implemented and will be ignored
Task-number: QTBUG-63948
Change-Id: Icaa86fc7b54d4b368c0efffd14efa35381d4e797
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The QTextCharFormat documentation said that the used style is based on
QStyle::SH_SpellCheckUnderlineStyle style hint, however in fact the
implementation (drawTextItemDecoration in qpainter.cpp) uses
themeHint(QPlatformTheme::SpellCheckUnderlineStyle) instead since Qt 5
(see commit 1f9ae50457).
Make the documentation match that behavior, and update QPlatformTheme
to use the correct default value.
Also, switch Cocoa theme to use DotLine, as that is what native macOS
applications use.
Change-Id: I2a6bb3da6c7b0686dca87ed2c251b6abc006123c
Task-number: QTBUG-50499
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
The previous version was good, just not optimal. Because the input was
an unsigned 64-bit number, compilers needed to generate extra code to
deal with HW instructions that only convert 64-bit signed input. And
that was useless because a double uniformly distributed from 0 to 1 can
only have 53 bits of randomness.
The previous implementation did exactly what the Microsoft libstdc++ and
libc++ implementations do. In my opinion, those implementations have an
imperfect distribution, which is corrected in this commit. In those, all
random input bigger than 0x20000000000000 has a different frequency
compared to input below that mark. For example, both 0x20000000000000
and 0x20000000000001 produce the same result (4.8828125e-4).
What's more, for the libc++ and MSVC implementations, input between
0xfffffffffffff001 and 0xffffffffffffffff results in 1.0 (probability 1
in 2⁵³), even though the Standard is very clear that the result should
be strictly less than 1. GCC 7's libstdc++ doesn't have this issue,
whereas the versions before would enter an infinite loop.
Change-Id: Ib17dde1a1dbb49a7bba8fffd14eced3c375dd2ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Let's make it happen even later: at the time of QtCore's unloading from
memory. This prevents issues with something using QRandomGenerator after
the global static destructor would have run.
Change-Id: Icaa86fc7b54d4b368c0efffd14eed56bbbb51cb6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Mouse position is converted from native pixels later, so we must
provide native pixels for "QWindowSystemInterface::handleEnterEvent".
Amends 7091be1b79
Task-number: QTBUG-63865
Change-Id: I813c171f2fc1d321af702ac30eb5f2e4232e97c4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Not properly initializing all members of the extended parameter struct
will cause an "invalid handle specified" exception on use.
Task-number: QTBUG-63883
Change-Id: Ic3a58df864c9e29ccbadc04bd71c18c8ef34374c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Both QNSMenu and QSystemTrayIconQMenu aren't referenced anywhere
else, including within qcocoasystemtrayicon.mm, since the QPA
backend was added.
Change-Id: I632c1b230226b2d08afce7f0f0019e9f7c030ba5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QBasicMutex and QMutex are the same in bootstrap mode.
Change-Id: Icaa86fc7b54d4b368c0efffd14eed63343ddb51b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
A QVariant can only be converted to a QByteArray if it has user type
QMetaType::QByteArray or QMetaType::QString. The way it stood, we
always tried to convert the mime data to a QByteArray, and
then put the result into a QVariant. This would fail if the mime
data contained e.g a QPixmap.
This patch will inspect what kind of data the QMimeData contains, and
convert it to a QVariant using the expected API.
Backport of 6d3c483
Task-number: QTBUG-57428
Task-number: QTBUG-63660
Change-Id: I09b4a94aef7b52773e1a79c468ead71b36dfbfc5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The path wouldn't match if the cookie's path was root ('/') and the
URLs path was empty.
Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>