Commit Graph

36779 Commits

Author SHA1 Message Date
Oswald Buddenhagen
93362e2607 qmake: slightly optimize processPrlFile() calls
add a parameter that indicates whether the passed filename can be only
the basename of a prl file. if so, we can skip the other attempts at
interpreting the file name. that's not only faster, but also clearer.

Change-Id: I6f6da3f4485216021282a08acaefb53e60e7242a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:44:27 +00:00
Oswald Buddenhagen
caaceb30e6 qmake: refactor QMakeMetaInfo::findLib() interface
move the logic for trying different extensions to
MakefileGenerator::processPrlFile(), which is the only user of that
functionality. that makes findLib() rather trivial and a bit of a
misnomer, so rename it to checkLib().

Change-Id: If9738cc17367452853ab8d3866fa36b5d4b57213
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:44:23 +00:00
Oswald Buddenhagen
eb9da60f0c qmake: purge infra for supporting multiple formats from QMakeMetaInfo
only .prl is actually supported (and we expect this to remain the case),
so just simplify the code.

Change-Id: Ia23f9f257bf89ca214c3deabd8a7744b155c7aa9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:44:18 +00:00
Oswald Buddenhagen
e2b90768ae qmake: prune dysfunct libtool reader from QMakeMetaInfo
in principle, it would be good to be able to read libtool .la files as
an alternative to our "proprietary" .prl files. however, this code was
disabled 15 years ago, three months after being written and never
released, and apparently no-one was missing it.

Change-Id: Ib8b4b4017b6a611f78af4e357ebce4006567e6ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:44:14 +00:00
Oswald Buddenhagen
317b5d9553 qmake: prune pkg-config reader stub from QMakeMetaInfo
this code operates way below the level integrating with a package
manager makes sense. consequently, remove the "TODO item".
support at a higher level is actually implemented anyway.

Change-Id: I8e1e43911dd40aa7585e49c1ad1e37b999779308
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:44:10 +00:00
Tor Arne Vestbø
88867e39bc testlib: Move qtestsystem helpers to their respective modules
Having the helpers in each respective module lets us implement the
helpers using private APIs without forcing the test to add private
dependencies.

It also makes it easier to test Qt using a third party testing
framework (for running the test suite), while still using the helpers
for ensuring tests behave expectedly.

Change-Id: I2a6ce24526ed345f3513548f11da05c7804c203f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-16 15:30:30 +00:00
Frederik Gladhorn
ff78e6fe35 Fix build without 'library'
Without QT_CONFIG(library) qdbus_resolve_conditionally would be declared
but not defined.

Change-Id: Id90f6c736080e4c1609568b3fab1f464c0e46aa3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-16 15:23:27 +00:00
Edward Welbourne
9a58ba4793 Split up many long lines in tst_QLocale
Rewrote some of them away, in the process, using string arithmetic.

Change-Id: Ie1a29abefab001889a22a8bc66c7eee608496786
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2018-07-16 15:23:11 +00:00
Edward Welbourne
cbd6a864e4 Adjust some indentation and spacing in tst_QLocale
This is preparation (the WS-only parts) for splitting up some
over-long lines, in the course of which I also fix some indentation.

Change-Id: I800490e328b5e16d40685dff04c09cd145d5eacf
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2018-07-16 15:23:04 +00:00
Edward Welbourne
042d41e23e Rework CLDR parser to filter out unsupportable number systems
In the process, also have it only scan number systems once, caching
the result, rather than scanning all of them for each locale.  This
means we only see the new warning messages once, too.

Task-number: QTBUG-69324
Change-Id: Ia0695a0ba6159b50748a61e9949ad5bd07e4c4c3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-07-16 15:22:56 +00:00
Edward Welbourne
e000c60ab3 QDateTime: fix some misnamed variables, s/local/zone/
When I wrote zoneMSecsToEpochMSecs I seem to have copied names from
localMSecsToEpochMSecs, that need a s/local/zone/ change to their
names to make sense in this context.  Flipped an if/else for clarity
in the process.

Change-Id: If2b288532b16d999f6ff0b9241e2dbcbc016b010
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-16 15:22:45 +00:00
Jesus Fernandez
435d1d53bd Use nullptr instead of 0
Change-Id: I37e776b84193d705b48d5d75ad620fd41b271d9e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-16 13:58:23 +00:00
Eirik Aavitsland
9a3359b57b Fix: png handler returning Mono QImage with color table < 2 items
A bit depth 1 png image may contain a single color table item. The png
handler would in such cases reduce the size of the QImage color table
to 1, which could easily lead to crashes later on.

Task-number: QTBUG-69256
Change-Id: I01d78977c121bacc44b823231d8f32ca63d8a98c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-16 13:49:56 +00:00
Eirik Aavitsland
b0797cfed6 QCalendarWidget: update the year label correctly on locale change
The year label in the header would show an unlocalized year
number. Fix by setting it equal to the year editor's correctly
localized string.

Task-number: QTBUG-69038
Change-Id: I87148c607b8fb498c57bcf59bc175154c9e445d1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-07-16 13:49:20 +00:00
Alexander Volkov
6f81dbe674 QLineEdit: Fix behavior of DeleteStartOfWord key
DeleteStartOfWord key behaves like Delete key when the cursor
is at the beginning of the line. Do nothing instead.

Task-number: QTBUG-65855
Change-Id: I56402961b44ec6fe3a382df68a76db36891c4522
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-07-16 10:11:49 +00:00
Frederik Gladhorn
40a98ea750 Use context when connecting to functors in docs
This is the introduction text to signals and slots and should rather
show best practices. Using context is generally advisable to have
life-time of connections under control.

Change-Id: I213b13d978a38e13834cdbccf1bea06d53ba8320
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-16 07:57:55 +00:00
Gabriel de Dietrich
582d221b29 QCocoaTheme: Fix system palettes in macOS 10.14
Some colors, like selectedMenuItemColor, won't return
the right value anymore. Other can be updated to new
system UI element colors for more accuracy.

Task-number: QTBUG-68891
Change-Id: I781ef47791648f332208eb780361c60ffb6fcb96
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-14 18:49:05 +00:00
Andre Hartmann
dc133765ec Doc: harmonize toDouble() and toFloat() for QString and QByteArray
Change-Id: Ic81461899c73c8a68bc3b8bdc1de4be4dd6bdf27
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-07-14 09:55:40 +00:00
Thiago Macieira
b773a02318 ELF parser: fix off-by-one error
I don't know why Arvid subtracted 1 when he wrote this code. But it was
wrong. Fortunately, the section size was not used afterwards, but the next
commit will.

Change-Id: I117816bf0f5e469b8d34fffd153dc8383b00b94a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-14 04:37:48 +00:00
Thiago Macieira
1f27c1161b QPluginLoader: limit the amount of memory used when scanning plugins
When using actual memory allocation, limit to 64 MB, not the full file
size. On most systems, the memory map technique will work, so this won't
even be tried. In any case, we don't need the fix for the OOM situation
that was applied in commit e211ab76d7.

As for the memory mapping technique, this commit limits the allocation
to reasonable values given the virtual memory addressing space. Half a
gigabyte is probably acceptable on 32-bit systems, where there should be
a contiguous space for the OS to allocate the file in. This commit also
fixes an overflow when converting from qint64 of the file size to ulong
(32-bit on 32-bit platforms and on Windows).

For 64-bit systems, we currently limit to 1 TB.

Change-Id: I117816bf0f5e469b8d34fffd153dc1705a8eedc4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-14 04:37:46 +00:00
Thiago Macieira
e92e46348a QCborArray: add const_iterator overloads for insert/erase/extract
They return regular iterators, since the container has been modified.

Change-Id: Id59bdd8f1a804b809e22fffd153f92d4460f9b76
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-14 04:20:47 +00:00
Thiago Macieira
f4950cb6e1 QCborMap: make take() & remove() efficient if the item isn't there
By using constFind(), we won't detach if the item isn't there. Both
extract() and erase() can take const_iterators.

Change-Id: Id59bdd8f1a804b809e22fffd153f92989ef84644
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-14 04:20:41 +00:00
Thiago Macieira
1016c0af74 CBOR: Use "noexcept" directly
All supported compilers support it.

Doing this just for the new API. We should do it throughout Qt, but only
if it won't interfere with the header review.

Change-Id: Id59bdd8f1a804b809e22fffd153f9254688e5152
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-14 04:20:38 +00:00
Thiago Macieira
503646a331 QCborValue: Silence Coverity warning about null-pointer dereference
It's a false positive, since we've checked that the item HasByteData.
But it's cheap to rewrite so the warning is silenced.

>>>     CID 190741:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a null pointer "this->byteData(idx)".

Change-Id: If48c5c2e920c433298f1fffd153f7534be42a30b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-14 04:20:32 +00:00
Thiago Macieira
6fd98af332 QCborValue/QDebug: restore decimal state after hex
Found by Coverity:
>>>     CID 190746:  API usage errors  (STREAM_FORMAT_STATE)
>>>     Changing format state of stream "dbg" for category basefield without later restoring it.

Change-Id: If48c5c2e920c433298f1fffd153f74f9bbe7ef29
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-14 04:20:28 +00:00
Thiago Macieira
5e66767fca Make sure there's an event dispatcher in QWindowsRemovableDriveListener
In order to add the listener, we need to hook into the internal HWND.
Creating the QThreadData (thus adopting the thread) and the event
dispatcher are ok because they would happen anyway. QFileSystemWatcher
works only with the Qt event loop.

[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused
addPaths() to crash on Windows if adding a path to be watched on
removeable storage, if that addPaths() was called on a thread not
created by QThread and no QEventLoop has been created yet.

Task-number: QTBUG-69320
Change-Id: If48c5c2e920c433298f1fffd153ee20bea56c62f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-07-14 04:20:07 +00:00
Thiago Macieira
56d52e1f1a QThread: Centralize the creation of the event dispatcher
In some places we call startingUp(), in others we don't. It's probably
ok for those that have just created an object of a given class, which
knows whether the virtual call is necessary or not. But for the generic
case, we do call it.

Change-Id: If48c5c2e920c433298f1fffd153ee1cc75703204
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-14 04:20:05 +00:00
Thiago Macieira
f6425da424 Fix Windows+ICU build
qstring.cpp(6655): error C2065: 'lhs': undeclared identifier

Change-Id: Id59bdd8f1a804b809e22fffd15405ed7607bdaca
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-14 04:20:02 +00:00
Timur Pocheptsov
bcbfa36663 SecureTransport - cleanup the code a bit
No need in ugly macro ioErr and if-ery, no need in generic noErr.
SecureTransport has its own,  more specific error codes: errSecIO
and errSecSuccess (which have the equivalent values).

Change-Id: Ifd99fbcbee290fe27caa0c258923f4527c047ba8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-14 04:06:05 +00:00
Paul Wicking
2d20342c99 Doc: Remove redundant \code
The preceding snippet contains the same line of code. It is unclear
why this line is repeated, and it does not seem to serve a purpose.
This patch removes the line of code and the QDoc command used to set
it apart from the preceding snippet.

Task-number: QTBUG-56772
Change-Id: I400b22aa75ee4542bfb67f7e47e3c31c577a39e5
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-07-13 17:44:22 +00:00
Michael Dippold
c80611a459 Android: Support mouse hover
Android supports hover events through the generic motion event. Routed
mouse events to specific mouse handler.

Task-number: QTBUG-42799
Change-Id: Iee17c71c09d84f52235e66ec08c65ffa30ec9cd9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-07-13 17:20:34 +00:00
Kai Koehne
46c2241a57 Update bundled sqlite to 3.24.0
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.24.0

Task-number: QTBUG-69274
Change-Id: Icf3d7b2c1af0fb67033fd39240bee0cacccaf96f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-07-13 14:36:08 +00:00
Kai Koehne
e37fe8110d Doc: Remove reference to Unicode 4.0
It's unclear when the reference to Unicode 4.0 standard
got added - it certainly predates the qt 4 git repository.
Anyhow, nowadays we're using later versions, and it doesn't
make much sense to highlight one specific version here.

Instead, use the correct technical term - UTF-16 code unit.
Also I added a 'correspond _to_', which sounds more common
to me.

Task-number: QTBUG-56699
Change-Id: I4bdcd9060cb2b11521638019c15ef7ab67aa768b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-07-13 14:28:41 +00:00
Friedemann Kleint
019dd88d2c QStringView: Add compare() member function
There was no public API for doing case-insensitive comparisons
of QStringView.

Task-number: QTBUG-69389
Change-Id: I1b021eefec35e135b97fb87704c8dc137232d83d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-13 13:32:34 +00:00
Tor Arne Vestbø
5624e3c97d macOS: Add logging when applying new window state
Change-Id: Ibbd38b27b9251a0a4a9fd4224529e2131e167b89
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-13 13:31:02 +00:00
Tor Arne Vestbø
b724a13c88 macOS: Group window state handling in QCocoaWindow
The flow of changing the window state, especially for fullscreen, is
complicated enough that it helps to keep the code together.

Change-Id: I216ff95c03fc149f42a0199f7c3bc4fb04ff5e6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-13 13:30:42 +00:00
Edward Welbourne
41f737a12c Correct Unix QStorageInfo's QStorageIterator::next()'s loop logic
The loop was accepting any line with at least three entries, but the
code that then used this line needed four entries.  At the same time,
the loop's check had to be repeated, in rearranged form, after the
loop, to handle some failing cases.  Restructuring the loop, and
demanding at least four entries, fixes all of this, although care must
be taken about the virtual file-system lying about .atEnd().

[ChangeLog][QtCore][QStorageInfo] Fixed a bug on Android that could
cause QStorageInfo to skip some filesystems (if the mount table is a
virtual file and contains any short lines) or crash (if the mount
table contains any 3-field lines).

Change-Id: I1c2674372d0d0b7d16937de4345a910bc7d6e0ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Johannes Rosenqvist <xeroc81@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-13 12:47:53 +00:00
Oswald Buddenhagen
3303715099 configure: pull ahead gcc-sysroot processing
the sysroot flags need to be established even before setting up the
spec, because as soon as that happens, toolchain.prf will try to
determine the default paths and cache them.

this also fixes sysroot use in toolchain flag support tests, which run
(somewhat) independently from the toolchain setup.

Task-number: QTBUG-63483
Change-Id: I7be1540e766dac58fb16f63176aa8d2879b51ae0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-13 11:09:07 +00:00
Nicolas Ettlin
7d05144dde Fix the copyright attribution for the HarfBuzz dependency
Task-number: QTBUG-69260
Change-Id: I03079bee5eb17f87f48690e800517831f6215975
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-07-13 10:20:55 +00:00
Timur Pocheptsov
d74ced697e Extend the feature 'dtls' to handle missing DTLS support in OpenSSL
OpenSSL has 'no-dtls' configure option (or can be too ancient to properly
support it), we shall respect such builds. This patch extends configure.json
with a 'dtls' test and adds protection against linkage/compile-time
issues in the QtNetwork's code.

Change-Id: I0c0dd94f5c226115cee4285b82c83aa546555aea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-13 04:50:38 +00:00
Timur Pocheptsov
58065cedf7 OpenSSL: remove unused symbols/declarations
These are leftovers from the prototype version of DTLS connection
and no code is using them now.

Change-Id: I3970a56303a59ce95e9c22344fac89e89f6559c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-13 03:57:38 +00:00
Thiago Macieira
04c57b6886 QFile::copy(): don't trust the old file metadata cache
Instead, let's just use sendfile(2) in a loop until it returns 0, which
indicates EOF.

[ChangeLog][QtCore][QFile] Fixed a regression in QFile::copy() that
caused the original file not to be copied entirely if it was modified
outside of this QFile object between the last time we checked its size
and the copy() call. Note this is not a prevention against race
conditions.

Task-number: QTBUG-69417
Change-Id: Id59bdd8f1a804b809e22fffd15406c8aa31f4a1e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-12 20:15:20 +00:00
Edward Welbourne
9c0d34da52 Add missing init()-if-dirty in two of ICU's QCollator::compare()s
Both delegate to the one that did do the if dirty: init() check, but
only after they've tested whether d->collator is set, which it might
not be when dirty.

Change-Id: I77533d6d32c4a8c9b42797c77003e50f5820775a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-12 13:41:05 +00:00
Johannes Rosenqvist
23870b3cad Fix QStorageIterator where the last line in /proc/mounts is skipped
On Android systems QStorageIterator uses /proc/mounts to parse mounted
volumes. For every call to QStorageIterator::next() a check was done
to see if we had reached EOF with atEnd(), but didn't take account of
the last call to file.readLine(), which might contain a valid entry.

[ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused the last
entry in the mtab file to be ignored on Android.

Task-number: QTBUG-60215
Change-Id: I064452002922c72ffa1c8954fec5f28738c42bae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-12 13:28:42 +00:00
Andre de la Rocha
20d6dac63c Add Windows Pointer Input Messages support
Replaces the handling of tablet/touchscreen/touchpad/mouse input with a
unified implementation based on the Windows Pointer Input Messages added
to Windows 8. The legacy implementation is still used for Windows 7.

Task-number: QTBUG-60437
Change-Id: I0a0f48ee9d5365f84ba528aa04c6ab1fe4253c50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-07-12 09:52:07 +00:00
Andre de la Rocha
dffbf4a7f6 Fix use of QTest::mouseMove() in widgets tests
Fixing some issues that could cause intermittent or environment-dependent
failures. One kind regards the use of multiple QTest::mouseMove()
calls in sequence internally using the QCursor API, causing timing
dependent failures. Switching to the override that does not require the
QCursor API, where possible. Other test could fail depending on the size
of the screen.

Change-Id: I4a368955ddbb48f729dcdf74c20eb163329936b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-07-12 09:51:56 +00:00
Tor Arne Vestbø
d6fb64267f macOS: Correctly restart display-link when window is moved between screens
Change-Id: I4b9cdd3d259965f9094ef1bbbca3ebed8df18443
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-12 09:49:35 +00:00
Jüri Valdmann
97e88dcb92 cbordump: Fix build with linux-clang-libc++
../cbordump/main.cpp:716:15: error: use of undeclared identifier 'LC_ALL'
    setlocale(LC_ALL, "C");
              ^

Change-Id: Ibff2345ffa99894cdcd48323f8c365d01ebd6300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-12 09:42:28 +00:00
Timur Pocheptsov
86632bd377 QSslSocketBackendPrivate - avoid recursion while handing errors
The logic seems to be simple - if client code on error signal
tries to close TLS socket and this socket has buffered data,
it calls 'flush' and 'transmit' or even 'startHandshake' as
a result, which in turn will set and emit error again. To auto-
test this, we initiate a handshake with pre-shared key hint
on a server side and both client/server sockets incorrectly
configured (missing PSK signals). We also do early write
into the client socket to make sure it has some data
buffered by the moment we call 'close'.

Task-number: QTBUG-68089
Task-number: QTBUG-56476
Change-Id: I6ba6435bd572ad85d9209c4c81774a397081b34f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-12 09:16:25 +00:00
Nathan Collins
e40f23f098 Add QStyle::SH_SpinBox_StepModifier style hint
This patch allows the developer to pick which keyboard modifier
increases the number of steps a QAbstractSpinBox takes when the user
interacts with it.

The modifier can be either Qt::ControlModifier (default),
Qt::ShiftModifier or Qt::NoModifier. Qt::NoModifier disables the step
modifier. Note that on macOS, Control corresponds to the Command key.

Holding the modifier increases the step rate when:
- scrolling;
- pressing the up/down keys;
- pressing the spin box up/down buttons.

[ChangeLog][QtWidgets][QStyle] QStyle::SH_SpinBox_StepModifier allows
the developer to pick which keyboard modifier increases the number of
steps a QAbstractSpinBox takes for the following interactions:
scrolling, up/down keyboard keys and the spin box buttons. The
Qt::ShiftModifier can now be used, or the feature can be disabled
using Qt::NoModifier. Previously, only Qt::ControlModifier could be
used as the modifier.

Change-Id: Ib5518127e86a8f67798a9a1d6e860c6e35896e6f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-07-12 09:07:32 +00:00