Commit Graph

26517 Commits

Author SHA1 Message Date
Thiago Macieira
411a4cb67c QNetworkInterface/Linux: fix support for P-t-P tunnels
The kernel stores the local address in IFA_LOCAL and the peer's address
in IFA_ADDRESS. My testing with loopback, Ethernet, WiFi, OpenVPN TAP
and TUN and Openconnect shows IFA_LOCAL is always passed and always
correct, so we could have used just that, but let's leave the use of
IFA_ADDRESS because that's also what all libcs' getifaddrs() do.

[ChangeLog][QtNetwork][QNetworkInterface] Fixed a regression in
reporting the local address of a point-to-point tunnel network
interface.

Task-number: QTBUG-67226
Change-Id: I04a43ee94975482f9e32fffd151eb393d1775580
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-26 15:17:38 +00:00
Friedemann Kleint
dbc983a513 Revert "Detect C standard and try using the most recent"
The change causes a crash when compiling the xkbcommon 3rdparty
library and compile failures (qtimageformats on Android).

This reverts commit a47cb14680.

Task-number: QTBUG-67326
Task-number: QTBUG-67327
Change-Id: I5ddc4eccad699e3eaec535fd6a63d11b0026b42e
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-03-26 15:10:33 +00:00
Eric Lemanissier
edf96b984d fixup oversight in rvalue overloads of operator+=() and operator<<()
ammends 4dee5446be

Change-Id: Ia0ca27644eb71815a93d6e76681b8a9e61a4e7ab
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-26 14:29:47 +00:00
Kevin Funk
02ed1b36da Remove CMake code for CMake < 3.1
This removes the following functions from Qt5CoreMacros:
- qt5_use_modules(...)

Task-number: QTBUG-63519
Change-Id: I59769060a3a93686bf319b558c0ede55755fdb70
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-24 22:31:18 +00:00
Christian Ehrlicher
69948f4899 QSqlResult: use QVector<int> instead QList<int> for indexes value
Minor tweak: QList<int> is taking 64bit per entry, QVector<int>
only 32bit - this should reduce memory usage a little bit.

Change-Id: I3e17269feb4840343f5cecfc71f8fccd70edc80f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-23 17:03:23 +00:00
Rolf Eike Beer
25956a1e7c DBus: merge calls to set_source_files_properties() in CMake functions
This can handle multiple files at once just fine.

Change-Id: I9dcf7b0c72df432f02200ac7f3967f36a408f306
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-23 16:38:56 +00:00
Sergio Martins
54507e25d4 Fix win32-clang-msvc build due to -Werror,-Wunused-private-field
Task-number: QTBUG-63512
Change-Id: Ie1507faffc11be09d9ce5e95c3b537dd65bb6978
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-23 15:16:01 +00:00
Eirik Aavitsland
d5b9a4ebc4 Fix: avoid realloc when adding primitives to painterpath
Calling reserve() for every primitive added would defeat QVector's
over-allocation strategy to avoid reallocs.

Task-number: QTBUG-66677
Change-Id: I7bdafdfa4d3ef60b00752c11e1b803abba773658
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-23 08:18:01 +00:00
Richard Moe Gustavsen
915fa58060 QTableWidget: fix spelling error
Change-Id: Ifd6f116a214d13328ccf0d070ef4517a3b53bf25
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-03-23 08:16:59 +00:00
Mårten Nordheim
443a98e881 Document an odditity in WinRTs SSL backend
Internally we use "Tls11" and "Tls12" from Microsoft's API for TlsV1_1
and TlsV1_2 respectively. However, in their documentation these values
are defined to also include the lower TLS versions when you use them.
We should document this.

For "SslV3" TLS V1.0 support will also be enabled.

https://docs.microsoft.com/en-us/uwp/api/windows.networking.sockets.socketprotectionlevel

Change-Id: I0b20fb745eba40afc37e8430008872fc8174a72d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-03-23 07:52:18 +00:00
Oliver Wolff
f6ec2ea8a1 winrt: Fetch connection parameters when connection is successful
Change-Id: Iaf5f5d93cd07429626d5c500ac04e67daada8e6e
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-03-23 07:13:52 +00:00
Oliver Wolff
1f77332db0 winrt: Remove partially read datagrams from queue
According to the documentation, datagrams that were
not completely read are discarded.

Change-Id: Id3a038d8aeeba05e8c8f92b70877f5f5297b89ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-03-23 07:13:51 +00:00
Oliver Wolff
6696c37e00 winrt: Add initial setting of options and additional state checks
The initial settings are done for other socket engines too.

The state checks return a message when they fail. Socket engine
auto tests rely on these messages to be shown.

Change-Id: If7734b453a24ecee4c3a028395ecdbb12859c871
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-03-23 07:13:49 +00:00
Oliver Wolff
e72b583bc2 winrt: Remove unneeded function
Change-Id: I62f3abcabf1a0e5f909c603cbdcf407e36bd0402
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-03-23 07:13:49 +00:00
Oliver Wolff
f3db6971ee winrt: Rework socket handling
Buffer handling is now completely moved to the worker. Instead of
moving data around all the time, the worker is responsible for
buffer handling. When reads happen, the data that is read is used
directly from the worker and its buffer is updated.

With the previous approach it was possible, that transfers never
completed. It was possible, that new data was read between calls
of bytesAvailable and read and the availability of that data was
never communicated to the user. If a read that does not read all
the data happens, we signal, that there is still data available,
so that the user is notified about that fact. At the same time
we avoid unnecessary readyRead calls by blocking them until a read
happens.

To make future debugging sessions easier, categorized logging
(including verbose) was added to the socket engine.

Task-number: QTBUG-65556
Change-Id: I12020ffcccf8eb3efec9c36dc5b0e6c0ebef7eb5
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-03-23 07:13:47 +00:00
Allan Sandfeld Jensen
1d616e764d Avoid of bounds memory reads when scaling and mirroring images
The bounds check we had wasn't complete for mirroring cases.

Task-number: QTBUG-65387
Change-Id: I5333912621c1223f83b4f1b95f2b16d12b520bd2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-22 23:47:25 +00:00
Gabriel de Dietrich
fae42e1e73 QMacStyle: Don't highlight square buttons text when pressed
Native square buttons keep their text black when pressed or on.

Plus using the QStyleOptionButton variable over the QStyleOption
one where appropriate.

Change-Id: Idba8197e64d408e8a0987f1ef9243fde08e3e839
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:25:24 +00:00
Gabriel de Dietrich
b8dc00ea4b QMacStyle: Refactor button sizing
We prepare for a better world without HITheme.

Sadly, we can't guarantee Cocoa will be good enough as a
replacement. So, expect more hardcoded values and margins.

Change-Id: I915906b5dbfbfbfc8c7f5c3224fc0ed98562bb9f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:24:56 +00:00
Gabriel de Dietrich
3e665c8df8 QMacStyle: Make CE_PushButtonBevel square if large enough
Meaning, if larger than the size of a regular NSButton.

No intermediate size square buttons anymore. We'll try to get
the closest one later, once the sizing problem is solved.

We also refactor the button creation code a bit.

Change-Id: I965520469546aea596cd1abec2309b40d70399ce
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:24:35 +00:00
Gabriel de Dietrich
bec1e609ec QMacStyle: No more HITheme for CC_ToolButton
As for CE_PushButtonBevel, sizing is still pending. These
two seem to go together anyway.

Change-Id: I631c3f32ba201b16adbfa264a2920bfb636fb86f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:24:12 +00:00
Gabriel de Dietrich
e3561dbda0 QMacStyle: No more HITheme for CE_PushButtonBevel
For rendering only. Sizing is still pending and, consequently,
square buttons since these depend on the button's intrinsic size.

Change-Id: Iacadc02a1a75970b221543b32ca724c92e118ce1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:24:05 +00:00
Gabriel de Dietrich
3691c41115 QMacStyle: Make CocoaControl a full type
And one small code clean-up.

Change-Id: I57c71ce2e18c95529ee45ba4fdfc68e21209e384
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-22 21:23:59 +00:00
Pasi Petäjäjärvi
14157a1a3e Add env variable to set QNX screen debugging information
Enables different QNX Screen graphics system information
as overlay.
Following are valid options for the env variable:
* fps, posts, blits, updates, cpu_time, gpu_time, statistics

More info:
http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.screen/topic/group__screen__debugging_1Screen_Debug_Graph_Types.html

Change-Id: I8cbee44de31bb2aaf3892a063769f4740027242b
Reviewed-by: Adam Treat <adam.treat@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2018-03-22 13:37:10 +00:00
David Edmundson
ee54df0311 Support GLX_NV_robustness_video_memory_purge in XCB-GLX
Nvidia doesn't handle suspend very well in Linux and textures get
corrupted. To handle this Nvidia has a bespoke extension to query when
this has happened.

This patch checks if graphics have been reset and invalidates the
surface.

Task-number: QTBUG-56610
Change-Id: I0b97d539ce6cc2b9cfe41c71bf6efd4f68496cd6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-22 08:23:18 +00:00
Andy Shaw
f4435d2d5c offscreen: Check that native interface is valid before using it
If the offscreen platform plugin is used on Windows then it can end up
crashing since there is no native interface. This prevents a crash from
occurring when these functions are called.

Change-Id: I526fc0703771fa5f85b26d182ad3b15ef1a3ada5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-21 18:11:49 +00:00
Thiago Macieira
d3b6ef6ccf QFile::rename: fix the error message if renaming a file by copy fails
The QFile out variable cannot be open because if out.open() succeeded,
we could never reach this line. Instead, we want to capture *why* either
the source or the destination failed to open.

Task-number: QTBUG-66445
Change-Id: I940917d6763842499b18fffd15142f231bf34a47
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-03-21 14:23:53 +00:00
Thiago Macieira
79493a3ee1 Make QCOMPARE(-inf, -inf) and QCOMPARE(NaN, NaN) succeed
This will make two floating points containing NaN compare as equal,
instead of the regular nan != nan IEEE behavior (which isn't very useful
in a unit-test framework).

Note that this does not apply to indirect comparisons, for example via
QVariant.

Change-Id: I39332e0a867442d58082fffd150851acfdd18c23
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-21 14:23:13 +00:00
Ulf Hermann
6e8e9979d0 Make sure we can build with -no-feature-itemmodel
Various pieces of code have to be disabled in this case.

Change-Id: I83b133f17e9f024016a79c9103293627185449d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-21 14:00:29 +00:00
Allan Sandfeld Jensen
a47cb14680 Detect C standard and try using the most recent
Fixes the default C version used with gcc < 5

Change-Id: I948dece961caed8e6b181e1c6e6b9dc43c46583f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-21 13:52:10 +00:00
Marcel Krems
5f66486cc2 Fix crash when deleting a QSqlQueryModel after closing the database
Task-number: QTBUG-66553
Change-Id: Ib5c04ebe5ac2b7581613e0044804072eb0980b2e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-21 13:50:43 +00:00
Nathan Collins
992f673782 macOS: Handle NaN mouse event positions
When performing gestures such as Exposé or Mission Control with the
mouse button down, the position of the mouse release event is
returned with NaN values. This causes
QGuiApplicationPrivate::processMouseEvent to be called recursively
and ultimately crash.

Task-number: QTBUG-67194
Change-Id: If1536bc4dc2075c498cdd6c5afe57c86bdaac13b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-21 10:45:47 +00:00
Ulf Hermann
955cf40b18 Testlib: Add a feature for the item model tester
It depends on QAbstractItemModel, so we need to switch it off if
itemmodel is unavailable.

Change-Id: I97246767a5e387b7a2cee90c34125a8411ef1c4e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-21 10:31:08 +00:00
Ulf Hermann
4db38197c2 Testlib: Rename qtest_global.h to qttestglobal.h
This follows the naming convention for global headers and causes
qttestglobal.h to be added to the top of the generated QtTest header. It
is necessary to have it there when other headers depend on features
defined in configure.json.

[ChangeLog][QtTest] The qtest_global.h header is now deprecated. Include
qttestglobal.h instead.

Change-Id: Iaed639d4e13dd99cee6387fce9d15d6e55b0b1e8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-21 10:31:01 +00:00
Mårten Nordheim
4a56d86ee4 Make QSsl::SecureProtocols also enable use of TLS1.{1,2}
Previously it was only enabling use of TLS1.0, unlike our openssl
backend, which understandably caused some confusion among some of our
users.

Seeing as this is also the default value in QSslConfiguration it is nice
to have it negotatiate more secure ciphers.

Task-number: QTBUG-67112
Change-Id: Ie216703da1ec4e6b973a881040e14816ad4c0a32
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-03-21 10:30:48 +00:00
Morten Johan Sørvig
45c62aae4b Cocoa: Restore resizable window mask setting to 5.9 behavior
This should be tied to the CustomizeWindowHint flag:
if that flag is set we start out without NSResizableWindowMask
and possibly add it later on if WindowMaximizeButtonHint
is set.

Change-Id: I7e826d4bd357a8a17c60cfef948af25d61b66ebf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-21 10:25:55 +00:00
Friedemann Kleint
f1bf7eb34a qtestlib/Unix: Output function time and total time in case of a crash
This helps to distinguish timeouts from real crashes in COIN.
This is already done for Windows.

Change-Id: I4daeafa36f50482d20cea4bd1106647081ff7abe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-03-21 10:22:00 +00:00
Sergio Martins
fc8fd50816 Fix subpixel rendering on Windows/FreeType
FT_LCD_FILTER_H wasn't defined because we weren't including the header.
To fix it just remove the checks, as was done for Linux and assume
sub-pixel is there. If it's not then no harm done, it won't use any.

Change-Id: I76f50cb17e41621c45c03cb7d5c75c110557ea68
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-20 21:16:22 +00:00
Ulf Hermann
5a4787dca0 Modernize the "regularexpression" feature
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED,
switch it off in the bootstrap build, remove the #ifdefs from
qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression)
to the header.

qregularexpression.{h|cpp} are already correctly excluded in tools.pri
if !qtConfig(regularexpression).

Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-20 08:19:25 +00:00
Ulf Hermann
dd74f5d347 Gui: Properly use the standarditemmodel feature
Require it in the headers and exclude the implementation from the build
if disabled.

Change-Id: Ida3303f8595f47b469e92d68e8bccc3957d943b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-20 08:19:03 +00:00
Lars Knoll
f4b6ea2ae2 Fix infinite recursion on stack trying load empty glyhs
Loading empty glyphs in some fonts would cause the application
to crash with an infinite recusion on the stack between qfontengine
and qfontengine_ft:

12 0x00007ffff6954395 in QFontEngine::alphaMapForGlyph (this=0x7fb0c0, glyph=50, subPixelPosition=..., t=...) at text/qfontengine.cpp:877
13 0x00007fffee7d104e in QFontEngineFT::alphaMapForGlyph (this=0x7fb0c0, g=50, subPixelPosition=..., t=...) at freetype/qfontengine_ft.cpp:2096
14 0x00007fffee7d0ea8 in QFontEngineFT::alphaMapForGlyph (this=0x7fb0c0, g=50, subPixelPosition=...) at freetype/qfontengine_ft.cpp:2078
15 0x00007ffff6954395 in QFontEngine::alphaMapForGlyph (this=0x7fb0c0, glyph=50, subPixelPosition=..., t=...) at text/qfontengine.cpp:877
16 0x00007fffee7d104e in QFontEngineFT::alphaMapForGlyph (this=0x7fb0c0, g=50, subPixelPosition=..., t=...) at freetype/qfontengine_ft.cpp:2096
17 0x00007fffee7d0ea8 in QFontEngineFT::alphaMapForGlyph (this=0x7fb0c0, g=50, subPixelPosition=...) at freetype/qfontengine_ft.cpp:2078
18 0x00007ffff6954395 in QFontEngine::alphaMapForGlyph (this=0x7fb0c0, glyph=50, subPixelPosition=..., t=...) at text/qfontengine.cpp:877
...

Fix this by trusting the freetype fontengine that it could load the glyph,
as the base class anyway can't do better.

Task-number: QTBUG-62331
Task-number: QTBUG-66617
Change-Id: I6c7c24d24ec0f71a66fa519c04a336f276e418f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-20 07:53:09 +00:00
Lars Knoll
83c01a5909 Fix display recognition for IBUS
The parsing of the DISPLAY environment variable was wrong,
and only worked by accident for DISPLAY=':[0-9]'.

Task-number: QTBUG-62068
Change-Id: I6860e3907c9b1ad6e538d1b5d08628cd306b4aa1
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-20 07:52:52 +00:00
Mikhail Svetkin
91a52fc6a0 widgets: Add a QT_CONFIG(style_stylesheet) guard
for isWindowsStyle in QDockWidget

Change-Id: Id471b91a415f1a677ced6022bdd05b7e1b72aad2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-20 07:51:36 +00:00
Friedemann Kleint
1cb439dc94 Windows QPA: Fix potential crash in leave event handling
Add a check for window != nullptr.
Amends af5c8d04fb.

Task-number: QTBUG-67101
Task-number: QTBUG-57864
Change-Id: I2bbbbe514fc494fd569d0932d508c53c0544f665
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-03-20 00:36:20 +00:00
Thiago Macieira
323b00e38c QSharedDataPointer: use swap-and-move in the move constructor
This makes the pointer that was in the moved-into object be destroyed
before the return of this function (if the reference count was 1),
instead of letting it live in the moved-from object.

Task-number: QTBUG-66322
Change-Id: I3debfc11127e4516b505fffd151209292bd3adaa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:59 +00:00
Thiago Macieira
dabc76de80 QSemaphore: add minor optimization for 64-bit Linux systems
Since we won't use the high bit of the low 32-bit word at all, we don't
need the AND with 0x7fffffff either. Just cast.

Change-Id: I72f5230ad59948f784eafffd151aa5a7dee995db
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-19 20:36:55 +00:00
Thiago Macieira
081c001deb QSemaphore: fix deadlock when the woken up thread wakes up another
When the thread that got woken up by release() is supposed to release()
to wake up another thread, we were deadlocking. This happened because we
cleared the bit indicating that there was contention when the first
release(). Instead of storing a single bit, we now store the number of
threads waiting.

Task-number: QTBUG-66875
Change-Id: I72f5230ad59948f784eafffd15193873502ecba4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:51 +00:00
Thiago Macieira
9fa2626ef8 Remove src/corelib/arch, merging with src/corelib/thread
There is no more architecture-specific code.

Change-Id: Ie9d9215342d449c48a11fffd151d11411cd73fc7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:45 +00:00
Thiago Macieira
90493e16b8 Atomics: remove qatomic_msvc.h
No longer needed. The comment about missing constexpr support is
incorrect: MSVC 2015 does have constexpr issues, but they don't affect
our use of std::atomic.

Change-Id: Ie9d9215342d449c48a11fffd151d11208137f00d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:41 +00:00
Thiago Macieira
38597dd080 Atomic: silence MSVC warning in the generic fetchAndSub
MSVC atomics still use the generic version, instead of qatomic_cxx11.h.
The implementation of fetchAndSub is implemented on top of fetchAndAdd,
but produced a warning with unsigned types.

Change-Id: I72f5230ad59948f784eafffd151aa53435b75298
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:36 +00:00
Johan Klokkhammer Helsing
efa6e98912 QPixmap don't assume QPlatformScreen::format is opaque
QRasterPlatformPixmap::systemOpaqueFormat returned QPlatformScreen::format
without checking that the format was actually opaque.

This caused several QPixmap tests to fail on Wayland because Wayland
compositors don't communicate the native format of the screen, just a list of
supported pixel formats, so we just return ARGB32_premultiplied in
QWaylandScreen::format().

Rename the method systemOpaqueFormat to systemNativeFormat since that's how
it's used most of the time. And do a conversion when we actually care whether
the format is opaque or not.

Task-number: QTBUG-51748
Change-Id: I47dc1c3f185fb802016ca361206d47d02e8d3cf1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-19 08:23:54 +00:00
Albert Astals Cid
d3121e3888 Fix QPageLayout() not initializing units
by using the other QPageLayout constructor

Task-number: QTBUG-47551
Change-Id: I9c3635d4a460437febefdfb9d259d508b61c1f29
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-19 08:20:20 +00:00
Thiago Macieira
daa7f5375c q{,Utf8}Printable: avoid creating a copy of a QString
We have this QString() constructor call to permit things that convert to
QString but aren't QString to be used in qPrintable, like a
QStringBuilder-powered fast operator+ expression, like:

    qPrintable(string1 + ": " + string2)

Unfortunately, it meant that we unnecessarily created a QString copy if
the input was already QString.

Change-Id: Iecab8770aa5840aba8edfffd1516bc94cec791a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-18 17:28:42 +00:00
Andy Shaw
e4e87a2ece sqlite: Prevent a crash when sqlite does not detect any parameters
When using a virtual table inside a SQLite database it is possible that
it does not report the right number of parameters. Therefore we need
to account for this case to prevent it from crashing when trying to
bind parameters it thinks does not exist.

Task-number: QTBUG-66816
Change-Id: I3ff70bb1fe73091f43c3df53616f75858e451cfd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-17 23:14:14 +00:00
Thiago Macieira
63c7a8e725 qglobal.h: compile Q_UINT64_C in C mode
This is used by qfloat_f16c.c → qsimd_p.h → qsimd_x86_p.h.

Change-Id: I359898686ce545f69847fffd151c785237a54b94
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-17 16:03:38 +00:00
Friedemann Kleint
8aeed99d77 Windows QPA: Improve tablet mode detection
Change the code to detect mouse mode only the first packet after
receiving the enter proximity event, using the current tablet
position. This should prevent mis-detecting mouse mode due to lags, etc.

There is a theoretical chance of failing to detect mouse mode should the
positions match resulting in differing speeds of mouse/tablet positions, but
this seems to be a negligible risk.

Task-number: QTBUG-36937
Task-number: QTBUG-64781
Change-Id: I27ca4a17786164dc8b25c4614a88672e150d5fe3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-17 12:10:23 +00:00
David Faure
8b6838347d QNetworkReply: fix isFinished() for disabled replies
When network access is disabled, every QNAM request returns a
QDisabledNetworkReply instance, which emits error and finished
immediately. However isFinished() was still false, which could confuse
application code.

Change-Id: Ifd43c86364b11a9583a38fde536e6c09c109b55f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-17 08:38:29 +00:00
J-P Nurmi
23fd4f7171 QGtk3Menu::showPopup(): fix target item selection
If a target item was passed, QGtk3Menu tried using gtk_menu_set_active()
to select the target item. However, the function does not do what you'd
imagine. Even the documentation states:

    This is used by the GtkComboBox and should not be used by anyone else.

The correct function, gtk_menu_shell_select_item(), is in the GtkMenuShell
"base class".

Change-Id: Ia2c03f87bb97f618c041c03011af8c676108aea5
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-03-16 09:14:55 +00:00
Andre Hartmann
f371b1cc8d QDomNode::replaceChild(): Fix documentation typo
Change-Id: Ib530ebc926aa2c6779b0e02878f92664022b6bcf
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-03-16 06:34:13 +00:00
Gabriel de Dietrich
0c059db57d QMenu: Realign submenu first action with its parent menu action
There was an offset equivalent to all the margins we add to
the action rectangles. We need to subtract it in order for
both menu items, parent and sub-menu, to be aligned. This
amount is given by the sub-menu's first action position
relative to its popup.

Change-Id: I141bbe3cfb81825a25b12e4059b93e61c29df518
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-16 00:13:28 +00:00
Thiago Macieira
2fb706f9a8 QIpAddress: reject IPv6 addresses with more than 4 hex digits
Matches glibc commit 9a0cc8c1bd7645bf3c988890ffb59639c07a5812.

[ChangeLog][QtCore][QUrl] Fixed a bug in parsing IPv6 addresses with
more than 4 hex digits in a component.

[ChangeLog][QtNetwork][QHostAddress] Fixed a bug in parsing IPv6
addresses with more than 4 hex digits in a component.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9a0cc8c1bd7645bf3c988890ffb59639c07a5812

Change-Id: I2701038131d91eb108aebb3bec16278e4efe3de2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-16 00:01:53 +00:00
Alexander Akulich
53f82185e9 QFusionStyle: Fix compilation when qreal is float
Change-Id: I575d348915a7239a40b589012b4e9707bd15d1dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-15 23:51:49 +00:00
Thiago Macieira
8eb3944dac Disable statx(2) and renameat2(2) system calls on Android
Many Android systems come with a locked down system call list, causing
the statx(2) system call to fail with an unexpected error code or by
delivering a signal to the application. Because of the signal, we can't
do runtime detection...

This is not our bug: it's obviously a mistake in the SECCOMP rules in
Android. But we work around the issue.

Unfortunately, because of a few manufacturers who can't configure their
rules properly, everyone will suffer.

Task-number: QTBUG-64490
Change-Id: I39332e0a867442d58082fffd1507a49415917384
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-03-14 19:26:02 +00:00
Alexander Akulich
96ba39b1ee QFlatpakTheme: Cleanup the code
There is no codepath that can result in d->baseTheme being nullptr.
Remove the checks and get rid unneeded and sometimes dangerous fallbacks
(createPlatformMenuBar(), showPlatformMenuBar() and three more methods
could overflow the stack because of infinity recursion).

Change-Id: Ib03adadf56c169286de42671e2da506502df7aea
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-14 19:25:22 +00:00
Oswald Buddenhagen
1718efe8fa QByteArray::setRawData(): don't null-terminate initialization from nullptr
it's antithetical to do that, as raw data is documented to be not null-
terminated. QString doesn't, either.

Change-Id: I7ded83a09f64e747a248f9bdac2a364032aae4c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-14 15:37:00 +00:00
Allan Sandfeld Jensen
a93096a770 Fix performance regression in simple a8 non-gamma corrected
Avoid doing the conversion over QRgba64 when we don't need it.

Change-Id: Ic2f82bef0a80b17ef7803eedcdb0600eeac96489
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-14 15:11:14 +00:00
BogDan Vatra
b30b957552 Android: Fix possible crash
Change-Id: I3362dffe0f30196a2a1eabcffe6cb3b2d52a7785
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-14 13:32:20 +00:00
Martin Smith
91b35011f5 doc: Make fromStdVariant() appear in the QVariant docs
This function was not appearing in the QVariant docs because the \fn command
was wrong and because clang was not seeing the declaration in qvariant.h in
the first place. With this update, the function does appear in the docs, but
it's signature is not correct because clang can't find a definition for
std::variant<Types...>, which probably means it doesn't have the most recent
declarations in the std namespace.

Change-Id: I7912ff333e5d4a8619461dd3ab7ee34bcd8f2289
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-14 12:59:35 +00:00
Błażej Szczygieł
a62f1d0356 xcb: Prevent shared memory allocation on every window resize
Allocate new shared memory only when window size grows or when window
size is 2 times smaller than allocated memory size. This improves
window resizing performance and also allows to free some memory if
window becames much smaller.

Change-Id: I3454cd3c6023eede8242d6b29038f4dd6638f9f1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
2018-03-14 12:47:27 +00:00
Laszlo Agocs
00304eac7b Revert "Set sharedPainter correctly for QGraphicsEffect"
This reverts commit 7257862fb2.

It has been reported that this patch causes widgets with certain effects
become invisible.

Task-number: QTBUG-60231
Task-number: QTBUG-66803
Task-number: QTBUG-66387
Change-Id: I9c3c4cf2f17ac639d1aee5489b665aa1e165af16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-14 12:37:53 +00:00
Friedemann Kleint
39d2a11a86 Item views: Fix 5.11 API review findings
Rename getter QHeaderView::firstSectionMovable()
to QHeaderView::isFirstSectionMovable(), turn into a property
and fix \since.

Change-Id: Ica2ca43d22f3fd78ff63178ba75014807fc9b823
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-14 12:23:27 +00:00
Edward Welbourne
c0272f98df Expand Config to Configuration in method names
Commit f55c73ede2 added various backendConfig methods;
API review for 5.11 pointed out that Config should not be abbreviated.

Change-Id: I3b294b44a030b2a6e4cdd034fa27583c228dfe42
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-13 14:10:50 +00:00
Timur Pocheptsov
f9131b0e17 Fix Darwin OS (but not macOS) build - mark unusued parameter
... with Q_UNUSED.

Change-Id: I3736c179381deb08cec9c2c399aaf8a24d8d7f0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-13 13:20:54 +00:00
Edward Welbourne
4d4c63acba Remove needless #include <sys/random.h> from qrandom.cpp
Tripped over by Alexei Fedotov and brought to light on the developer
list; Thiago says it's a left-over from before reworking to actually
use getentropy() instead of getrandom(); it should no longer be
needed.

Change-Id: Id09b0628e58fa62170a0f0da35b2b121f3fb0172
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-13 12:54:18 +00:00
Laszlo Agocs
a060ee2802 QWindowWindow: Avoid resize events from the ctor
When calling showFullScreen(), the setwindowStates call in the
QWindowsWindow constructor led to generating a resize event. This is
pretty bad for example when QOpenGLWindow is involved since the QWindow's
platformWindow member is not even set yet (handle() == nullptr) so
everything related to OpenGL contexts starts failing (as there is no
underlying platform window yet as far as the QWindow is concerned).

In short, generating geometry changes from the platformwindow ctor is a
bad idea. Use initialize() instead for that.

Task-number: QTBUG-67027
Change-Id: I35d11949213eb21f81b2ff2d4f2282cb36510210
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-13 12:49:54 +00:00
Mikhail Svetkin
aaace8fbdb widgets: Add a QT_CONFIG(messagebox) guard
for initResources in QApplication

Change-Id: Id083edbcba4b348ef78e55c788ea94f85b6f572b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-13 12:33:13 +00:00
Nico Vertriest
e9dc2f1783 Doc: Add doc to Graphics View Flow Layout example
Change-Id: Id3965d099222607cee4252bbb33c6a1e9c17765a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-13 12:07:55 +00:00
Friedemann Kleint
43918feb4a Windows QPA: Fix QWindowsWindowFunctions::SetHasBorderInFullScreen() to work in all cases
- Directly apply the flag in case the platform window exists and
  is in full screen.
- Store as a dynamic property in case the platform window is not
  created yet.

Amends 69839e55c1.

Task-number: QTBUG-41309
Task-number: QTBUG-66557
Change-Id: I162baecfae4d07a5d5b59c5401bdb605faa7ab68
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-13 12:04:11 +00:00
Friedemann Kleint
910cc08f6b Windows QPA: Improve the event logging
Add more message codes and fix the whitespaces in the output:

 EVENT: hwd= 0x280484 WM_WINDOWPOSCHANGED msg=0x 47 et=0x 21e wp= 0 at -2208 -31887 handled= false
->
 EVENT: hwd=0x2204d6 WM_WINDOWPOSCHANGED msg=0x47 et=0x21e wp=0 at -3280,-19633 handled=false

Change-Id: I89a7b3bd328748ef39fe2dcd789497f43e9d4a2a
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-13 12:03:50 +00:00
Johan Klokkhammer Helsing
c6ea77f59d Use QWindow::windowStates() for WindowStateChangedEvent::oldState
WindowStateChangedEvent::oldState is of type Qt::WindowStates and should
therefore be set to QWindow::windowStates() instead of QWindow::windowState()

Change-Id: I6710624dd303642a31bfbb25bc07bf05b921d84c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-13 07:47:45 +00:00
Edward Welbourne
54190595ef Make sure QDir::absoluteFilePath("/dir") includes a drive on MS
QDir::isAbsolutePath(name) thinks any path starting with a slash is
absolute; however, to return a valid absolute path, we need to put a
drive prefix onto such a name. So use QFileSystemEntry::isAbsolute()
for that check (it believes in the need for a drive, or UNC prefix)
and handle the absolute-but-for-drive case when it arises.

Add a regression test and make related changes to existing tests.

Task-number: QTBUG-50839
Change-Id: Id5d2b2586bb1423fa2d9375a298a4bb5241cffe0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-12 18:11:33 +00:00
Allan Sandfeld Jensen
5473535344 Fix scaling precision with large zooms
Avoid using the two fast-scaling paths, while they might not overflow
in this case, they do not have enough precision in their fixed point
math to render accurately.

Task-number: QTBUG-53582
Change-Id: I2e063ee90defbecd79a12a6ce02a74c60d1805df
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-12 11:16:09 +00:00
Sergio Martins
f1d2c20a27 Fix ambiguous shortcut warning message
This is done in QAction::event(), not eventFilter().

Change-Id: Idc5d7864d259dcf035543c40c8e7b6acd86bde9b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-11 19:45:37 +00:00
Sergio Martins
99f93cca27 document that QueryWhatsThis is a QHelpEvent
Change-Id: I4240c32287530df6162c07a27b865fb4176103db
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-03-11 19:45:35 +00:00
Christian Ehrlicher
41db3140a9 QRasterPaintEngine: properly initialize flags
QRasterPaintEngineState::flags.non_complex_pen was not initialized in
the ctor which leads to valgrind warnings. Initialize it to false - the
correct value is set within update/ensurePen() before it is really used.

Task-number: QTBUG-66615
Change-Id: If154873ad89903c243662ab1f140f74434a6f88c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-11 18:43:53 +00:00
Friedemann Kleint
52fede55b8 Windows QPA: Output more information when initializing tablets
Add a debug operator for the LOGCONTEXT.

Change-Id: I93d567692f35c69687709800d80bc93487c8f906
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-10 20:36:09 +00:00
Friedemann Kleint
ac6590e0fc Windows QPA: GL: Fix setting the color depths for the GDI fallback
Set the color buffer depths on the PIXELFORMATDESCRIPTOR for
the fallback code path (-platform windows:gl=gdi).

Task-number: QTBUG-66797
Change-Id: Idccd94fdf121803af1c19e34cc86b6f06ca88d90
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-10 20:35:46 +00:00
Friedemann Kleint
88a48192aa Fix 5.11 API review findings in QtNetwork
Rename
QNetworkInterface::maxTransmissionUnit()
to
QNetworkInterface::maximumTransmissionUnit()

Change-Id: I24a80b1317363e8d5da5f251ec908da9a51a6b0a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-10 20:35:16 +00:00
Nils Jeisecke
fee8944cbe Allow use of template class instances inheriting from a Q_GADGET in Qml
The Q_GADGET macro cannot be used in templates. It can however be useful
to derive a template class from a Q_GADGET enabled base class to benefit
from type safety features in C++ (e.g. the class could represent an id
or handle for some C++ type).

For proper wrapping of a QVariant with a gadget value in a QJSValue, the
QMetaType::IsGadget flag must be set for the registered template
instance type - which does not happen prior to the fix because
IsGadgetHelper requires qt_check_for_QGADGET_macro to be defined in the
registered class but not in an ancestor class - in other words: The
class must declare Q_GADGET.

To overcome this, IsGadgetHelper/IsPointerToGadgetHelper can now
differentiate between a Q_GADGET flagged class (allowing
automatic registration) and a derived class, e.g. a template class
(forcing Q_DECLARE_METATYPE to be used explicitly).

[ChangeLog][QtCore][QMetaObject] It is now possible to use template
class instances inheriting from a Q_GADGET in Qml

Task-number: QTBUG-66744
Change-Id: I7632ad45cff79fa422b3f852ca0b963f35fab155
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-10 06:12:24 +00:00
David Faure
b767c7363f qxcbconnection_xi2.cpp: fix debug check to avoid confusing debug output
The check on line 972 says lcQpaXInputEvents().isDebugEnabled() so
that debug output was always showing "from 0,0" due to
lastScrollPosition not being set.

Change-Id: I345732e36db05108f70474261c47e78333b57d30
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-09 10:55:38 +00:00
Alexander Volkov
9b7809a43e xcb: Fix FP1616 to int conversion
Divide the whole FP1616 value by 0x10000 instead of dividing
the integer part by 0x10000 and the fractional part by 0xFFFF.
It also makes fixed1616ToInt() consistent with fixed1616ToReal(),
see 7d3f353a5b.

Change-Id: Id76025028c926872b002ef0a1ca8a8bdc2de3e1e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-09 10:45:26 +00:00
Sergio Martins
c082d84d5d Fix QLabel crash if buddy's lifetime is too short
If buddy is deleted then QLabel will still try to deliver the
shortcut event to it, in QLabel::event(), and cras.

Besides connecting to destroyed() which alone fixes the crash,
also hardened it and guarded against dereferencing null buddy,
in the unlikely event of someone adding features to QLabel.

The second part is suitable for backporting to the LTS branches.

Task-Id: QTBUG-66841
Change-Id: Ib6a36a9f99cee31afe1f88eb77f5b6cafb8b1086
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-08 22:36:49 +00:00
Mitch Curtis
e5a6e9bb80 Doc: improve QScopedPointer::reset() documentation
- Fix grammar
- Mention take()

Change-Id: I3bde229755549230ad3d0962da6eeb164a060fb1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-08 07:40:26 +00:00
Gabriel de Dietrich
e16c6dfb72 QCocoaMenuItem: Make QCocoaNSMenu the item target
Since we made the NSMenu delegate a singleton we could not rely
on it to have enough information to implement worksWhenModal.
At the same time as the delegate change, we derived NSMenu into
QCocoaNSMenu. This allows us to extend the menu functionality
and, in this case, serve as target for the Cocoa menu items.

We also refactor setting the item's target/action.

Manually tested against menurama and bigmenucreator tests, the
test-case for QTBUG-17291, and the richtext/textedit example.

Change-Id: I222241f71db82611711b23d4a8c6122a741370ae
Task-number: QTBUG-66676
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-07 19:14:07 +00:00
Christian Ehrlicher
4dee5446be Add missing rvalue overloads of operator+=() and operator<<()
They were forgotten when the overloads for append()/push_back() were
added in Qt 5.6

[ChangeLog][QtCore][QVarLengthArray] Added missing rvalue overload of
operator+=() and operator<<()

[ChangeLog][QtCore][QVector] Added missing rvalue overload of
operator+=() and operator<<()

Change-Id: I20fedfba2bf282773bd1f9cf2c8ec06f05896a7d
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-03-07 18:36:40 +00:00
Christian Ehrlicher
808adeb7bc QSqlField: rearrange QSqlFieldPrivate members
Rearrange QSqlFieldPrivate members to only need 64Byte instead 72 in
an 64bit environment.

Change-Id: I620c18aca06a11b7ab4bd8e99b377b9d823da7f4
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:36:33 +00:00
Christian Ehrlicher
80693f171c QStandardItem: add more sanity checks on insertRow(s)/Column(s)
When QStandardItem::insertRows/Columns is called with an empty list
or an insert count of 0, do not assert but return false.

Task-number: QTBUG-66491
Change-Id: I328598e08584fb9b0a35075458bfeb31c57ebfee
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:15 +00:00
Christian Ehrlicher
b64f3f6ca9 QTabWidget: Do not add tabbar size during sizeHint() when it is hidden
Since Qt 5.4 the QTabBar can be automatically hidden when it has less
then 2 tabs. Therefore the sizeHint should not consider the tabbars
size when the tabbar is hidden.

Task-number: QTBUG-64715
Change-Id: I2f248f88d9070de5354f7344c7628a78442ab499
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:06 +00:00
Christian Ehrlicher
3185b40d5d SQL/Postgres: Fix support for nan, inf and -inf
Postgresql needs a special value for nan and +/- inf. This was
considered during insert but not during select.
Also remove some pre-c++11 inf/nan - handling and replace it with
Qt equivalents.

Change-Id: I044ca58e9cf673f4b100b05a0d8e25c8a9c29ec5
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:35:57 +00:00
Tor Arne Vestbø
67d5f79fe6 logging: Clarify and document how we look for the presence of a console
The privately exported qt_logging_to_console() function has been renamed
to shouldLogToStderr, and exported in the QtPrivate namespace for QtTestLib.

[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] The QT_LOGGING_TO_CONSOLE environment variable has been
deprecated. Use the more specific QT_ASSUME_STDERR_HAS_CONSOLE or
QT_FORCE_STDERR_LOGGING, depending on your usecase.

Change-Id: Ie29228eeac3b700c3de94fee022d5d66d9b5c210
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-07 18:12:09 +00:00
Ville Voutilainen
f49c55a505 Revert "Make qWaitForWindowActive more robust"
This reverts commit 2eec3272c7.
The change to qWaitForWindowActive causes regressions
in qtdeclarative, so we need a better fix for the problems
we have with window waiting.

Task-number: QTBUG-66866
Change-Id: I8300dabc870d6aeaa9ba6bfcf3d64146b13c1955
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-03-07 07:13:19 +00:00