Commit Graph

37168 Commits

Author SHA1 Message Date
hjk
d9e2bd5388 rcc: Add some tests
- three more tests cases on expected .qrc generation
- a new test comparing data read via resource with
  the same data directly read from the original file

Change-Id: Ic34e68c9fc3fa110110161b57d4129ae44419020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-24 08:25:42 +00:00
Qt Forward Merge Bot
b73f1cc045 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I1114f90a2ed04a784a66505960b0f2460778726d
2018-08-23 23:01:15 +02:00
Allan Sandfeld Jensen
ed557c0378 Handle uploading of faked sub-images
One trick that is possible to do with QImage is to make it be sub image
of its imagedata by manipulating the data start and bytes-per-line,
we can not upload that directly and need to detect the case and create
a clean copy to upload.

Task-number: QTBUG-70105
Change-Id: I7ce184a0892fb4071b6dcc1a1fd3881a4e0703cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-23 17:32:20 +00:00
Friedemann Kleint
2ab804c452 clangcl: Fix QtGui link error (missing fetchPixelsBPP24_ssse3)
Do not try using SSSE3 if the compiler do not support it.
(see 648ee7aa02).

Task-number: QTBUG-50804
Change-Id: I489b0bbacfde0c647c9d5b71ca3de992d7dc8878
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 14:04:55 +00:00
Mårten Nordheim
4f6fa5b2ae configure: add sources matching names from vcpkg
It's possible to use vcpkg using the -I and -L arguments, but
some of their libraries have different names than what we look for
during configure, so add in those variations.

Change-Id: Iee37197228cc0f15442ecd7ec4fc761f4d526e1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 14:03:28 +00:00
Tor Arne Vestbø
a88645c6f4 macOS: Share deployment target and device arch config between makespecs
Change-Id: Ie06705590b4962d8b09b97e30625ef11af321763
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 13:09:46 +00:00
Shawn Rutledge
e498a1d09d Tablet example: add a menu item to clear the canvas
It's annoying to have to kill the app and start over when it gets too
cluttered.

Change-Id: Ic72e372e5742de4e7c6bb818a3150283498a517b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 12:57:01 +00:00
Tamas Zakor
5ded4e35db cups: Add a QT_CONFIG(dialogbuttonbox) guard
This fixes build with -no-feature-action configuration.
The corresponding dialog is added by:
6c5c1a562c cups: Show a dialog when asked for password

Change-Id: Ic88bdd62c756749959e66252427b5edc2c3ce7cc
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 09:48:03 +00:00
Andre de la Rocha
38cb72b6fd Windows QPA: Force windows to the main screen in certain AMD GPU setups
A multi-screen setup with an AMD adapter set as the 'main display' leads
to using the AMD drivers for OpenGL. This then causes a crash when calling
SetPixelFormat and similar for windows located on another adapter's
screen. This workaround detects the conditions leading to the crash and moves
the window to the main display.

Task-number: QTBUG-50371
Change-Id: I4007c490bdcdc13d6e8bce82983b150aa4930338
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 09:32:32 +00:00
Edward Welbourne
9acd053619 Skip a few unused assignments
Change-Id: Ia631627fb2e4e7eacf912a08d168e7b0a5700db7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-23 09:07:19 +00:00
Johan Klokkhammer Helsing
bc5953f35b tst_QMenu: Skip tests that require real input events on Wayland
Task-number: QTBUG-62188
Change-Id: I942c2ecadafe2caf430aa83fbba5c03a476c1e38
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-23 08:17:19 +00:00
Luca Beldi
da9aeb3e4e Implement QStringListModel::moveRows
Implemented the virtual method moveRows to allow row movement

[ChangeLog][QtCore][QStringListModel] Implemented moveRows

Task-number: QTBUG-69807
Change-Id: I518f48a321bd755ab56f2fe84883d27324cc42ec
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-23 05:51:55 +00:00
Edward Welbourne
c1b15005c6 Fix handling of default content locale data
We iterate theoretically many sources (albeit there's only really ever
one) for this data, so accumulate instead of only keeping the last
(and initialize it as the list it always ended up being, not a
dictionary, so that this can work).

The form of each token is a locale name, so it may be lang_Script just
as readily as lang_LAND; so parse (and validate) the tags more
faithfully to catch both cases.  Abstract that parsing into a function
and use it in both places that need it.

Change-Id: Ibdbc4eafefab6a5ef70646d9fea150f2cb408d05
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-22 18:00:14 +00:00
Edward Welbourne
bbee6fac33 Stipulate which error is expected in try/except
PEP 8 wisely advises against the use of naked except: (unless
re-raising the error).

Change-Id: Ia0dfdb48b330d33ad370bdb9f6b205046aa919da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-22 18:00:06 +00:00
Tony Sarajärvi
c9c770d775 Extend blacklisting of tst_QWidget::maskedUpdate to cover all openSUSEs
Fails on previous 42.3 and also 15.0. Just covering "opensuse" saves
us from new commits every time we upgrade our openSUSE. We have a bug
open of it after all.

Task-number: QTBUG-51399
Change-Id: I5c0869daea41b1886faba3d0caaa0804a3705d54
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-22 14:32:55 +00:00
Allan Sandfeld Jensen
991b251e39 Fix big-endian build of qopengltextureuploader
Badly placed endif and lacking a break statement.

Change-Id: Id6a3fb13b40e8ae8029e74f7668bafb6e0b9dd06
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-22 14:32:45 +00:00
Liang Qi
ee51a2c4dc tests: blacklist tst_QDialog::showFullScreen() on macOS 10.13 in CI
Task-number: QTBUG-70109
Change-Id: I70b998c1853462f8ea2037cff59e9598923743e5
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-22 14:32:38 +00:00
David Faure
5a1861399b QFileDialog: make QFileDialog::selectFile resolve remote dirs correctly
The code was assuming local files, and broke with remote dirs.
Testcase: `kwrite sftp://localhost/tmp/file.txt` and then Ctrl+O,
the initial directory was $PWD instead of the remote dir.

Change-Id: Ie24d4c1b2b3278dce44274af0066105bd1bf9b34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-22 11:26:12 +00:00
Liang Qi
9be1256e0c Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-22 10:31:09 +00:00
Allan Sandfeld Jensen
dc82a0f4f3 Smooth image scaling for 64bit images
Adds support for smooth scaling 64bit images.

Task-number: QTBUG-45858
Change-Id: If46030fb8e7d684159f852a3b8266a74e5e6700c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-22 10:03:15 +00:00
Mikhail Svetkin
bbed8013cc Mark qBound/qMin/qMax as constexpr
On MSVC2015 Q_DECL_CONSTEXPR is defined as empty.

Change-Id: I8beb919f75cf2066ffc7ac10d5abfaa1712fc1bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-22 08:55:06 +00:00
Liang Qi
7533156b68 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/gui/text/qtextengine.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h

Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
2018-08-22 10:35:12 +02:00
Thiago Macieira
330290e049 QPluginLoader: pave the way for Qt 6 plugin meta data
We want to store the metadata size and get it from the plugin in Qt 6.

Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bebc2914d9a3c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-21 23:59:44 +00:00
Mitch Curtis
76c328b2b3 Fix spacing in << operator for QEvent
Turns

     QNativeGestureEvent(ZoomNativeGesturelocalPos=686.855,312.836,
         value=0.0259857)

into

     QNativeGestureEvent(ZoomNativeGesture, localPos=686.855,312.836,
         value=0.0259857)

Change-Id: Id30860a3c7a1b6da583369126a31934ddb32d4b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-21 14:45:58 +00:00
Allan Sandfeld Jensen
07eda676e4 Fix big-endian build
Declare rbSwap<QImage::Format_RGBA8888>, so we don't end up in a
fallback definition not used by little-endian.

Task-number: QTBUG-69951
Change-Id: I8512bba76da7d59a27593d37c70283d881c3e8fc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-21 13:31:44 +00:00
Friedemann Kleint
cf0ea18ac4 QWidgetWindow: Ensure Qt::WA_Mapped is set on obscured parent widgets
Frameless obscured windows do not receive WM_PAINT/expose events on
Windows. Qt::WA_Mapped needs to be set on them to ensure updating works.

Task-number: QTBUG-39220
Task-number: QTBUG-52039
Task-number: QTBUG-58575
Task-number: QTBUG-63927
Change-Id: Ic6c11f2be96378b6a6b61296f1f3e13cd49b50a6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-21 13:18:07 +00:00
Christian Kandeler
5be5b798b2 androiddeployqt: Add auxiliary mode
In this mode, library and other dependencies are copied into the build
directory, and the XML templates in the build directory are updated
accordingly, but the project is not built or installed.
Needed by qbs.
No existing code has been touched.

Change-Id: Ib8015f7c2315b39dfb21750fecc8618bce03cb8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-21 08:24:53 +00:00
Friedemann Kleint
65b95b61d6 MinGW: Exclude failing value of tst_QEasingCurve::setCustomType()
After updating MinGW toolchain from 5.3.0 to 7.30 test starts to fail.

Task-number: QTBUG-69947
Change-Id: I850d854b27e1cb4e1dd2cb600e8e79bd18bff4a0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-08-21 07:12:19 +00:00
Friedemann Kleint
81d6cf71cc Windows QPA: Add option to detect AltGr key presses
According to MSDN, AltGr key presses are sent as a
sequence of SYS left Ctrl + right Alt.

Add an option to detect AltGr as modifier key.

Task-number: QTBUG-69317
Change-Id: I30ce169d2e6dbbae194ff714abfbc732b53652ce
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-21 06:30:53 +00:00
Heikki Halmet
d3dc3e7743 Extend blacklisting of qeventdispatcher to cover WinRT
They have been blacklisted on windows and macOS previously. Now failing
on WinRT as well.

Task-number: QTBUG-69962
Change-Id: I30ca23005b082e820ee896fa36a8984a1536ad6b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-21 05:39:39 +00:00
Oswald Buddenhagen
5a03b75c50 Merge dev into 5.12
Change-Id: I63f632b595f66d2fc93e9aa713500e3799e3df2a
2018-08-21 02:32:50 +02:00
Albert Astals Cid
0e7724079f Allow setting the QIcon fallback theme
This allows apps that know their icons are
in a given icon theme to set that theme as
fallback, so in case the user theme does
not include them, the icons can still be found.

This solves the problem of missing icons
that often happens when running KDE applications
on a GNOME desktop.

Change-Id: I4e5543d598012352a29ff79dab0357506d986b6d
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-20 21:42:58 +00:00
Friedemann Kleint
67cc8fea10 XCB: Do not create instance of QPlatformIntegration for invalid displays
Extract a static factory for QXcbConnection objects and pass
potential connection errors to qxcbmain.cpp, which will then return 0.

Task-number: QTBUG-68859
Change-Id: I9c0faf82462a78a576360c19bef251ad1d034d84
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-08-20 16:52:29 +00:00
Rolf Eike Beer
6553921dd5 QWindowsStyle: respect rectangle when drawing PE_IndicatorViewItemCheck
The hardcoded value is based on the values set in qcommonstyle.cpp, but
in case this is changed using a proxy style the actual values are not
respected. They would even be wrong if nothing is changed but
QStyleHelper::dpiScaled(13.) does not return 13.

Change-Id: Ib451d07800b3b4e8cafd1f4fef84cd9bf02f9bba
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-20 13:02:41 +00:00
Alexander Shevchenko
2d3098f77c Fix qtbase build for Windows ICC with MSVC 2017 15.8
After 0ef66e98cc was merged, the same should be done to
Windows ICC toolchain.

Task-number: QTBUG-69997
Change-Id: I1d76d8b59f87151a9064d9f7dcc3136dc1215633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 11:42:59 +00:00
Kai Koehne
2a9223830c Doc: Remove duplicate thread-safe documentation from logging macros
qdoc now handles \threadsafe also for macros, so we can remove the
explicit \note.

Change-Id: Iabeb7f69d237e7024a4f584adc516951b06d752b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-08-20 10:43:45 +00:00
Johan Klokkhammer Helsing
b9923b30f0 tst_QWidget: Explain why some tests fail on Wayland
Task-number: QTBUG-66849
Change-Id: Ie6295bd402f6bc960c16f1e4b3b5a786017453e1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-20 10:04:22 +00:00
Edward Welbourne
1acafb1207 Use std::partition_point for faster searches among transitions
QTzTimeZonePrivate's methods were iterating transitions from first to
last, or last to first, to find where .atMSecsSinceEpoch crossed some
threshold; but the transitions are sorted in order of increasing
.atMSecsSinceEpoch, so binary chop would be more efficient than such
linear searches.  So use std::partition_point() instead.

Change-Id: I65c43cb20fca6685a22ea52a4ca2f1089c128ebf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:27:27 +00:00
Edward Welbourne
98b030fc95 Scale a correction by a factor of a thousand that it was missing
The difference between two transitions' offsets is measured in
seconds, but we add it to a time in milliseconds; so it needs to be
scaled to fit.  Fortunately rarely enough applied that it hadn't
caused any reported problems.

Change-Id: I11f9f9e46d43d748220e072ad7504d4c8c5bf192
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:26:33 +00:00
Edward Welbourne
e4cee4bd57 Add some local const variables to save some repeated computation
QTimeZonePrivate::dataForLocalTime() makes repeated use of the times
sixteen hours before and after the target local time, so compute those
up front once instead of each time they're needed, giving them
expressive names and making code terser.

Change-Id: I4b682cc6de2adb98c3ee5489eec4b63ac1090961
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:26:10 +00:00
Edward Welbourne
4932cef5b8 Cast away -Wclass-memaccess warnings in QVarLengthArray methods
With g++ 8.2.0, I get warnings when a QVarLengthArray<QString> calls
remove() or prepend(), as some tests in tst_QVarLengthArray do, as
they call memmove() "writing to an object of type ‘class QString’ with
no trivial copy-assignment; use copy-assignment or copy-initialization
instead"; which may indeed be a good argument for not using
QVarLengthArray<QString>, but its own tests do.

Change-Id: I4f8a64948b32a54e67a285df4ec7788f60739ffb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:08:50 +00:00
Kai Koehne
54d062160d Document version of copied valgrind, kernel headers
Task-number: QTBUG-69276
Change-Id: If2d5d796fd9d414a41036187a178d88c2e93b5ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 07:50:04 +00:00
Eike Ziller
67984b265a QMimeDatabase: Fix MIME detection issues with magics in MIME hierarchies
Assume two MIME types A and B are registered, both with the same glob
pattern, A being parent of B, A with some magic rule, and B with another
magic rule. Given a file that matches the glob pattern and the magic rule
of A, the resulting MIME type depended on the order of registration of A
and B, because it would just check if some glob matching MIME type was
also a subclass of the magic matching MIME type.

The patch prefers the the MIME type that matches by magic if that
matches by glob pattern as well (i.e. A in our example).

The "recommended checking order" of the spec does handle that case.

Task-number: QTBUG-44846
Change-Id: I2af43f6199faf9a42cd9c35d3a045441afbd6217
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-20 07:32:58 +00:00
Edward Welbourne
fe9a37ac48 QTimeZonePrivate::dataForLocalTime(): cope with negative DST offsets
The tz database's latest update now records the cases where summer
time is deemed standard and winter-time is deemed DST.  (This doesn't
change what the offsets are, just how they're described.)  The
resulting negative DST offsets mess up the algorithm for converting
local time to UTC, causing tst_QTimeZone::transitionEachZone() to fail
for Europe/Dublin in the hour before its transition; so refine the
algorithm to cope with the new case.

Task-number: QTBUG-69980
Change-Id: I24003872fffb03b2903161859158d0ce998b3073
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 06:04:25 +00:00
Samuel Gaist
346c15102b Add support for QRegularExpression to QSortFilterProxyModel
This patch implements the support for QRegularExpression in
QSortFilterProxyModel.

[ChangeLog][QtCore][QSFPM] QSortFilterProxyModel now supports
QRegularExpression.

Task-number: QTBUG-46810
Change-Id: If932d55f98f9b8bcf3a72c03ffd51da52cb50ad1
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-19 11:38:42 +00:00
Samuel Gaist
bcd80eebf9 Implement exact match expression builder for QRegularExpression
QRegularExpression doesn't offer a direct equivalent of QRegExp's exact
match.

There are several places in the Qt sources that use this feature. This
patch implements a small helper function that builds the expression as
recommended in the documentation and updates the related code.

[ChangeLog][Core][Tools] QRegularExpression now provides
anchoredPattern() which is a helper function to build regular
expressions used for exact matching.

Change-Id: Idbbf142c4c5cb9b62abf8229f4ce85fd4409e5d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-19 11:38:26 +00:00
Thiago Macieira
6228c0528c QGraphicsAnchorLayout: move some private classes to a namespace with Q
Avoids polluting the global namespace

Change-Id: Ie01831ddac5446fdbdeefffd15468b5ca22d5e7b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-19 08:48:36 +00:00
Samuel Gaist
5dd9616f6d Replace QRegExp by QRegularExpression in QFileSystemModel
[ChangeLog][Widgets][Dialogs] QFileSystemModel now uses
QRegularExpression internally for wildcard matching. Note
that QRegularExpression might not give the exact same
result as QRegExp as its implementation follows strictly
the glob patterns definition for wildcard expressions.

Change-Id: I6ca893833ff7b5b7f678221bb9bc623fd17c1cfa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-19 04:03:49 +00:00
Samuel Gaist
a2c85bffbe Migrate QDir to use QRegularExpression
The match method still uses QRegExp. This patch updates the code to use
QRegularExpression and translates the wildcard patterns to a suitable
form for QRegularExpression.

[ChangeLog][Core][QDir] QDir now uses QRegularExpression internally for
wildcard matching. Note that QRegularExpression might not give the
exact same result as QRegExp as its implementation follows strictly the
glob patterns definition for wildcard expressions. Nevertheless, the
tests for QDir return the same results as before.

Change-Id: I095959443ac7362f7534e35454eff038061fca82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-08-19 04:03:29 +00:00
Samuel Gaist
3746eb8412 QRegularExpression: refactor wildcard translation
This patch refactors the wildcardToRegularExpression method to generate
a simpler regular expression. It also fixes some shortcomings of the
previous implementation.

Tests have been updated to ensure all cases are properly supported.

Change-Id: I454e3fe8fe0bb663b2f319d6fa2fa8aec626c50d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-18 21:59:38 +00:00