Commit Graph

35847 Commits

Author SHA1 Message Date
Tor Arne Vestbø
286c153583 iOS: Handle application state for application extensions
Change-Id: I97df0f8ecf93e28bfbe9c719922f1ee5ec12b563
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:46:39 +00:00
Tor Arne Vestbø
0587941f6e Add function to safely access the shared application on Apple platforms
Change-Id: I52910309ba94d84d69f049b5c1990f1f866e1698
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:16:23 +00:00
Tor Arne Vestbø
6ada504475 Add function to check whether or not we're part of an extension on Apple OSes
Change-Id: I308147c752ec9c869db87aa94ccf6c88e0999524
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:16:07 +00:00
Allan Sandfeld Jensen
ffc377a529 Reduce recent performance regression
The change to fix 16-bit integer overflow used two floor operations
when only one is necessary. With floor being rather expensive on x86
without SSE4.1 this caused a performance regression in ARGB32
smooth perspective transforms.

This eliminates one of the floor operations which is unnecessary as the
number is always positive in this case and thus truncation will yield
the same result faster.

Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-30 08:28:41 +00:00
Allan Sandfeld Jensen
d517d5428c Use qFuzzyCompare instead of qFuzzyIsNull in QPointF ==
qFuzzyIsNull has a fixed range, where qFuzzyCompare can tell if numbers
are different in a more relative range. Without it QPointFs that are
heavily scaled will be interpreted as identical, when they are quite
different at their own scale.

Task-number: QTBUG-60359
Task-number: QTBUG-62161
Change-Id: Ic4ba90e9e994aedff5548d690f053eb309b0a60b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 08:28:11 +00:00
Laszlo Agocs
6a14608742 QOpenGLTexture: Enable multisample 2D textures on GLES 3.1+
Task-number: QTBUG-68510
Change-Id: Ib224189906b595bbae5aab95c888dd13e94171aa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-05-30 07:53:15 +00:00
Thiago Macieira
28ab81158f forkfd: Restore errno on exit from the SIGCHLD handler
I'd never thought about it, but it is a requirement: a signal handler
must leave the global state as it found it (except for those bits that
it intended to change, and those must be done in an async-signal-safe
way). Otherwise, errno could change from one line to the next in the
middle of some code.

[ChangeLog][QtCore][QProcess] On Unix, the QProcess SIGCHLD handler now
restores errno on exit.

Task-number: QTBUG-68472
Change-Id: If025d476890745368955fffd1531e7126f1436d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-30 03:57:36 +00:00
Thiago Macieira
b9dc4f7a96 Suppress warnings about deprecated QString constructor
They were introduced in commit c416a7f257.

 warning: ‘QString::QString(const QByteArray&)’ is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations]

Change-Id: I6a540578e810472bb455fffd1532e31736e1edc9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-05-30 03:57:32 +00:00
Gabriel de Dietrich
9ffb001306 QAbstractSpinBox: Fix missing frame condition
Wrong check for SH_SpinBox_ButtonsInsideFrame in initStyleOption().

Change-Id: I35c6ff4d007f171fe44d7f3e5734c6f4586d871b
Task-number: QTBUG-68238
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-30 02:13:49 +00:00
Joerg Bornemann
9f27bfb31a Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.

Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-29 18:31:35 +00:00
Tor Arne Vestbø
dd8e73504e macOS: Respect maximum window size when computing zoomed state geometry
AppKit will normally compute this automatically based on the
contentMaxSize property of the NSWindow, which we set correctly
based on the window's maximum size, but since we ignore the
frame proposed by AppKit (due to not working for borderless
windows), we need to take the maximum size into account ourselves.

We follow the lead of QCocoaWindow::propagateSizeHints(), and
interpret the window's maximum size as referring to the client
area size, not including the frame geometry, but AppKit expects
the NSWindow's frame, so we need to manually add the frame.

In addition, AppKit expects the frame in the native coordinate
system, so we need to map to it. This was an existing bug, that
never manifested before taking the maximum size into account.

Task-number: QTBUG-67376
Change-Id: Id4cf6ff5640610f809472e5b1d591b4ec17df602
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-05-29 10:54:21 +00:00
Tor Arne Vestbø
0b1342f374 iOS: Send window-system event also when embedded in native iOS app
The iOS event dispatcher has been split into two; one dealing with the
QPA event processing, which we should always do, and one dealing with
the longjumping that we do when running the user's main on a separate
stack.

Change-Id: I1f819db33c608aad130ff23cbbadcf84363a32d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 5414d372d4)
2018-05-29 10:53:11 +00:00
Tor Arne Vestbø
dc55000140 iOS: Don't assume our UIWindow is a QUIWindow
Change-Id: I6494e4a476273b131aedcf409abdb1ffffa5b62e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit ab9b026d27)
2018-05-29 10:53:10 +00:00
Mikhail Svetkin
6b98d97670 macOS: Fix QFileSystemWatcher to watch paths with the same prefix
It happens because our filesystemwatcher thinks it is subdirectory and not
two different paths

Task-number: QTBUG-60676
Change-Id: Ic753e9481cb26303a030044e0a5ab4d703bc529f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-05-29 06:32:46 +00:00
Nico Vertriest
42e4a6531d Doc: Update Echoplugin Example
- screenshot
- connect syntax

Task-number: QTBUG-60635
Change-Id: I18c3e1fef5c623565bbf6cf33bf88e9d8135d8be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 12:38:07 +00:00
Nico Vertriest
35e31149c2 Doc: Update Fetchmore example
- minor edit
- updated screenshot

Task-number: QTBUG-60635
Change-Id: I988ad28723131127eee0a93671b0562d8f446139
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 10:19:06 +00:00
Christian Ehrlicher
e15fc26e9f QSortFilterProxyModel: don't assert when old model gets destroyed
When a new model was set with setSourceModel() and the mapping was
built up, the destruction of the old model caused a reset in the
QSortFilterProxyModel which lead to an empty view or an assertion.
Now we properly disconnect the old model again and also clean up the old
mapping/persistent indexes when a new source model is set.

Task-number: QTBUG-44962
Task-number: QTBUG-67948
Task-number: QTBUG-68427
Change-Id: I2e0612899c210bde3ac0cfa59aefd78269deee5b
Reviewed-by: David Faure <david.faure@kdab.com>
2018-05-26 11:24:53 +00:00
Liang Qi
8050f1c287 Fix build for Android with android-clang
kernel/qnetworkinterface_linux.cpp:204:17: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare]
            if (NLMSG_OK(hdr, len))
                ^~~~~~~~~~~~~~~~~~

This amends 09cb23f342.

Change-Id: Ib966a60b7a7117d63ed758cba7b556abd90eca0c
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-25 14:52:47 +00:00
Samuel Gaist
56b04fe42f Add translation for unsupported_android_version for fr and de
More recent versions of Android lint triggers an error when a
translation is missing. The solution is to either provide translations
for all languages supported or add translatable="false" as property to
the strings that are not yet fully translated.

Task-number: QTBUG-63952
Change-Id: I5afa8a23d3e2285b5c93ee493d9b02397c328f2d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-25 06:50:40 +00:00
André Klitzing
747de3e067 Fix build if openssl is configured with no-des or no-rc2
A custom build of openssl can disable DES or RC2. This
allows to build Qt against those builds.

Change-Id: I9b91c943fab4d217a791381e81a7d87a9ff5031a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-24 14:58:00 +00:00
Timur Pocheptsov
ee47999333 Http/2 - remove unused 'compressedData'
and thus reduce memory consumption, allocations etc.

Task-number: QTBUG-68394
Change-Id: Ibad9b01a1e709e6abafcd9531fbcfc1eafa9cff3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-05-24 04:38:01 +00:00
Allan Sandfeld Jensen
b9bc6c31a0 Fix potential 16-bit integer overflow
When multiplying a float in [0;1[ with (1<<16), with rounding, it might
end up being rounded to 65536 even if the input was under 1. This patch
uses a floor operation to make sure the value can be in a ushort, and
cleans up the surrounding code so it is clearer what it does.

Task-number: QTBUG-68360
Change-Id: I2d566586765db3d68e8e7e5fb2fd1df20dabd922
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-23 13:26:57 +00:00
Edward Welbourne
c416a7f257 QLocale: only use LANGUAGE if it contradicts LC_ALL/LC_MESSAGES/LANG
If LANGUAGE specified only the language, without any script or
country, and matched the value we'd got from other environment
variables, we were throwing away their knowledge of script and
country, leading to falling back on the default script and country for
that language, which might be at odds with what other environment
variables had told us.

Changed to only use LANGUAGE if it contradicts (or extends) what we
would otherwise have used.  Clarified some comments in the process.

[ChangeLog][QLocale][Unix] When using LANGUAGE would lose information
about script or country, without changing language, use the locale
implied by LC_ALL, LC_MESSAGES or LANG.

Prompted-by: Safa AlFulaij <safa1996alfulaij@gmail.com>
Change-Id: Ie433e57ae6b995abafd05c931136cc9796494895
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-23 12:12:24 +00:00
Friedemann Kleint
7aaa7debc4 QWin32PrintEngine: Fix crash in drawPixmap(), drawImage()
Use the printer's HDC instead of the screen HDC for StretchBlt().

Patch as contributed via bug report.

Task-number: QTBUG-59689
Task-number: QTBUG-66325
Change-Id: I9b5d6ddd3f0e9e68f2a003ca9ed20ece20dccef8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-23 08:26:57 +00:00
Andy Shaw
4deea4b905 doc: Explicitly mention that QSqlRecord fields are generated by default
Task-number: QTBUG-38460
Change-Id: I5982d018ebf239eb95dba59e2c5559bf5b5ce6ca
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-23 07:01:39 +00:00
Venugopal Shivashankar
57868b6081 Doc: Document the WA_ContentsMarginsRespectsSafeArea widget attribute
Task-number: QTBUG-68153
Change-Id: Ie4fa1a4e06ff5ee506e1d7788c245b7add776bd6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-23 05:54:06 +00:00
Thiago Macieira
f86fbc4566 QTemporaryFile: Disable O_TMPFILE on Android
We require linkat(2) to materialize the file and that is (stupidly)
filtered. See 138d34b9c8 and QTBUG-64103.

Task-number: QTBUG-68344
Change-Id: I052407b777ec43f78378fffd152fd8822761b452
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-22 19:26:26 +00:00
Thiago Macieira
fb0447bc05 Mark Clang 6 as warning-free
Change-Id: I7f8a97595d874145b160fffd152973700c61a0cb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-22 14:06:53 +00:00
Janne Koskinen
adad959aef egl: Add ES3.2 direct function pointers
Task-number: QT3DS-1738
Change-Id: Ib582d37717618104e10535bae8dea87e2e98b2ce
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-05-22 13:24:17 +00:00
Paul Wicking
0e666d1875 Doc: Update image, icon and screenshot for SQL example application
Replace image and icon in the SQL Master Detail example application,
as well as the screenshot of the application on the landing page.

Task-number: QTBUG-60633
Change-Id: Ic739908b569ea7f974b9dac48f673e14f6557550
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-22 12:06:22 +00:00
Olivier Goffart
97fc2800ed Fix documentation of Q_NAMESPACE
We need to add the \relates command otherwise it won't appear in the documentation

Change-Id: I134776c1528445761a7539cf687e4855d39eb7a7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-22 07:30:17 +00:00
Thiago Macieira
c780434ba2 qt_is_ascii: improve isAscii a little further (QUrl, QLatin1String)
Turns out that the non-AVX2 code was beating the performance of the AVX2
because the simdTestMask function did a little too much. So just use the
same VPMOVMSKB technique for it.

Change-Id: I0825ff5b5f6f4c85939ffffd152f3b636ab998db
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-20 00:14:40 +00:00
Andy Shaw
8d19afcc81 ibase: Don't use deprecated QSqlError constructor
Task-number: QTBUG-68330
Change-Id: Ie6ece8574462699fca401139ea00f1925b0a440b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-18 12:46:59 +00:00
Qt Forward Merge Bot
1af15a5659 Merge "Merge remote-tracking branch 'origin/5.11.0' into 5.11" into refs/staging/5.11 2018-05-18 11:17:10 +00:00
Qt Forward Merge Bot
294f036a11 Merge remote-tracking branch 'origin/5.11.0' into 5.11
Change-Id: Idfb5542f76cfd5ccda7521e529505e5a4a54c797
2018-05-18 11:22:37 +02:00
Friedemann Kleint
24d7a2229d Documentation: Fix URLs to GL(ES) functions
Replace the XML pages which are typically displayed as broken
by the XTHML pages. Strip some suffixes.

Change-Id: Idf2b9706f169484c659582a1a2d38904d5dd81aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-05-18 08:45:21 +00:00
Kari Oikarinen
883d58dacd Fix tst_QDoubleSpinBox::editingFinished failing after other tests
Wait for the spinbox to show become active in the previous test. Also use
QWidget::activateWindow() instead of QApplication::setActiveWindow(). Use of the
latter seemed to result in some confusion where QWidget::isActiveWindow()
returned true but QWindow::isActive() on the underlying window returned false,
leading qWaitForWindowActive() to fail.

Also remove superfluous setting of focus. It was just set and verified.

Change-Id: I023cdc2d272e23b2537b32606b7a3bf35bf671ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-18 07:09:58 +00:00
Thiago Macieira
c359df5ca6 Add support for QSharedPointer<cv qualified>::create()
[ChangeLog][QtCore][QSharedPointer] Fixed a problem that made create()
on a type with const qualification fail to compile.

Task-number: QTBUG-68300
Change-Id: I0825ff5b5f6f4c85939ffffd152f3e55e5b9caae
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-17 15:08:04 +00:00
Andy Shaw
fce6303a35 Remove a reference to a no longer used database server
Task-number: QTBUG-32390
Change-Id: I7556507267be04ca50c4ad0c7d49f3aa5fe31a90
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-05-16 14:40:19 +00:00
Nico Vertriest
d9c430cfd9 Doc: Update connect syntax Order Form Example
Task-number: QTBUG-60635
Change-Id: Ia474a23db7c32e68cb23ffa6ec14b9c6376cadec
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-16 12:00:00 +00:00
Nico Vertriest
57fae860fd Doc: Modify connect statements Echoplugin Example
Task-number: QTBUG-60635
Change-Id: I4313ff65875d20b768d7ad6e9c8322bd5cf7f1ab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-16 11:59:27 +00:00
Nico Vertriest
3b28e3d871 Doc: update connect syntax digitalclock example
Task-number: QTBUG-60635
Change-Id: I9d8411b639e5cf74c9cb03de4b5f6081bb549151
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-16 11:57:51 +00:00
Andy Shaw
b0f3cc1594 sqlite: Allow for duplicated placeholders with just one placeholder
This accounts for a case of a placeholder being duplicated in the
prepare query, but where only one placeholder was used. This amends
e4e87a2ece

Task-number: QTBUG-68299
Change-Id: Ia92ee912facd51a13e7222886debb219b24442b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-16 11:42:25 +00:00
Alexandra Cherdantseva
9c707f140e Windows Platform: Redirect wheel event to a window under mouse cursor
Revert a part of af5c8d04fb
which affected mouse wheel event redirection.

Task-number: QTBUG-63979
Change-Id: Ice88675aadbb8a7477b3758a607db5979d62562c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandra Cherdantseva <neluhus.vagus@gmail.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-16 09:02:40 +00:00
Friedemann Kleint
b145201128 Windows QPA: Fix wrong initial size when launched on secondary screen
Send changed events from QPlatformWindow::initialize()
synchronously so a protentially changed screen takes
effect in QWindow::resize() called by QWidget::show_sys().

Task-number: QTBUG-67777
Change-Id: I889500d458caf0e782bdbc237ce790f0b0bc2d95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-05-16 08:23:42 +00:00
Kari Oikarinen
ae8743bf86 tst_QCommandLinkButton: Add back wait to the beginning of setAutoRepeat()
setAutoRepeat() is failing on macOS and Windows when run together with
defaultAndAutoDefault(). It succeeds when run on its own. Adding the wait allows
it to succeed when run with the other tests as well.

Amends 0cb940b1d3, which removed the wait.

The comment is the same as before. I couldn't see a better way to replace the
wait (QApplication::topLevelWidgets() already returns only the testWidget and
testWidget->isActiveWindow() returns true).

Another theory I had was something waiting for the KeyRelease so I changed
QApplication::sendEvent() uses to QTest::keyClick(). It did not help but that
still seems preferable.

Change-Id: If87d1e6e018751f3068ea4c913ae6731aba41ff0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-16 06:10:08 +00:00
Liang Qi
09cb23f342 Fix build for Android with android-clang
kernel/qnetworkinterface_linux.cpp:172:18: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare]
                if (!NLMSG_OK(hdr, len))
                     ^~~~~~~~~~~~~~~~~~
    kernel/qnetworkinterface_linux.cpp:197:26: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare]
                    } while (NLMSG_OK(hdr, len));
                             ^~~~~~~~~~~~~~~~~~

Change-Id: I3d0a4efc9fc42dd9b0726f2b62ff494220b8026e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-16 06:06:04 +00:00
Liang Qi
5349cb9d3c Fix build for Android with android-clang
dialogs/qprintdialog_unix.cpp:149:15: error: private field 'm_printer' is not used [-Werror,-Wunused-private-field]
        QPrinter *m_printer;
                  ^

Change-Id: Idce515a3e66019756b6ad2d305072e0a89bb823b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-16 06:06:01 +00:00
Thiago Macieira
6e2ad0c79c ucstrncmp: refactor with 32- and 8-byte loads
First of all, this removes the UB that used to try and calculate the
distance between the two strings. That's a valid technique in assembly,
but dangerous in C++ and totally unnecessary. The compiler is perfectly
able to generate loops with a single induction variable all on its own.

Second, this commit makes the main loop use 32-byte comparisons (16
characters at a time), which is a reasonable size for strings. We use
AVX2 if that's available, or an unrolled pair of 16-byte loads
otherwise. After the existing 16-byte comparison, this commit inserts an
8-byte (4-character) comparison and then reduces the final, unrolled
comparison to just 3 characters.

Change-Id: Ib48364abee9f464c96c6fffd152e474b39e1f293
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-15 17:09:01 +00:00
Thiago Macieira
85278a6970 qlalr: fix build in C++17
std::unary_function and std::binary_function are gone. Remove their
uses.

Change-Id: I5d0ee9389a794d80983efffd152c96f0f2149b40
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-15 17:07:09 +00:00