Commit Graph

32872 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
88e56d0932 Improve rounding of QRect::toRect
Avoid the dimensions of the rounded QRect being off by more than one
pixel. This ensures the aligned containing rect also contains the
rounded rect.

Task-number: QTBUG-56420
Change-Id: Ib79110e51ab80de2dc83d01ea83fc5fbf3852e75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-26 21:35:38 +00:00
Tor Arne Vestbø
67ee72f314 macOS: Merge QCocoaWindow::setWindowShadow into its only caller
Change-Id: I14149231d12658c59e3f9f87f2943ccdfbea4d43
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-26 13:24:52 +00:00
Richard Moe Gustavsen
bb918db849 QDateTimeEdit: update cursor blinking code to match new API
Update old, if-deffed out, code to match changed method
signatures.

Change-Id: If9751599c9446f8dbd554a41ab97f597258fa1c5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-06-26 13:23:11 +00:00
Friedemann Kleint
b8fd4e1a48 Add debug operator for QStorageInfo
Change-Id: Ia788a882a11443237ac362631d55b4dcd6d6b44f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-26 08:00:39 +00:00
Friedemann Kleint
6634c424f8 Restrict QStyleHints::showShortcutsInContextMenus() to context menus
Amends c2c3452ba5.

Task-number: QTBUG-49435
Task-number: QTBUG-61181
Change-Id: I4de9dcb45a86fc2db07185a4a499a511fb1a1567
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-06-26 08:00:23 +00:00
Joerg Bornemann
5c6210e345 Support more than 62 instances of QWinEventNotifier
QWinEventNotifiers were limited to 62 instances, because of
WaitForMultipleObject's limitation to MAXIMUM_WAIT_OBJECTS - 1 handles.

Use the RegisterWaitForSingleObject API which does not have this
restriction and executes waits in threads managed by the system. A
central manual reset event per event dispatcher is signaled in the
RegisterWaitForSingleObject callback and waited for in the event loop.

[ChangeLog][QtCore][QWinEventNotifier] QWinEventNotifier is not
restricted to 62 instances anymore.

Task-number: QTBUG-8819
Change-Id: I2c749951453a4b699cc50dada0d6017440b67a4a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-06-26 05:05:38 +00:00
Sean Harmer
58d3a3eda2 Register avx2 as private feature
Needed for the SIMD options in Qt 3D.

Change-Id: I9a9def83a6aa50b9a45c9526aa4e7415679ec308
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-25 17:43:45 +00:00
Thiago Macieira
af7267209c QRandomGenerator: Rework the fallback seeding
qdeadlinetimer.cpp and qelapsedtimer_*.cpp are not part of the bootstrap
library. Instead of adding them there, just remove this entropy source
from bootstrapped builds (instead of just qmake).

To compensate, store all the bits instead of trying to combine them into
just one 32-bit word. We've got a few new sources from the stack and
libc, plus two more ELF auxvec values that the Linux kernel supplies
(inspired by OpenBSD's getentropy_linux.c, which is used in Bionic).

Task-number: QTBUG-61492
Change-Id: I1d5a585d4af842f9a66ffffd14c999ae8c44f46c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-25 08:01:55 +00:00
Thiago Macieira
a372b56d69 Revert "Add QDeadlineTimer to the bootstrap library"
This reverts commit e147c3d413. There is
one symbol from QDeadlineTimer that isn't in qdeadlinetimer.cpp for
performance reasons. Anyway, QDeadlineTimer is no longer needed, as the
previous commit removed its need.

Change-Id: I9b79e7f052824a475ba8ab16fe8ad10874794b8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-25 08:01:49 +00:00
Mitch Curtis
8dd8acf8bb qt_findAtNxFile(): account for .9 (9-patch image) extensions
Currently a file with a .9.png extension will only have its @2x variant
found if it follows this format:

foo.9@2x.png

Since ".9" should be considered part of the file suffix, it should
ideally be able to look like this and still be picked up:

foo@2x.9.png

This patch makes qt_findAtNxFile() account for .9.* extensions.

This is needed for the image-based style support in Qt Quick Controls
2, which uses 9-patch images.

qmlbench benchmark results using
benchmarks\auto\creation\quick.image\delegates_image.qml with
QT_SCALE_FACTOR=2 show no difference in performance after this patch
is applied.

[ChangeLog][QtGui] High DPI variants of 9-patch images can now be
loaded using the following syntax: "foo@2x.9.png"

Change-Id: I6d1384113bef21b4fe85a104ee6b16869c93b077
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-24 21:24:53 +00:00
Oliver Wolff
d9206926d8 winrt: Enable network proxy support
[ChangeLog][QtNetwork][QNetworkProxy] Setting of network proxies is now
supported on UWP.

Task-number: QTBUG-45495
Change-Id: I71fed57910197760334f8e7d2aeac36c4e0d4f51
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-24 17:18:37 +00:00
Tor Arne Vestbø
f5d178976a macOS: Simplify recreateWindowIfNeeded debug output
Change-Id: I0e12502de544f79636ec1a67b87bc856ddfc6675
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-24 12:33:46 +00:00
Laszlo Agocs
b55970ec0f Work around qvulkanfunctions.h not getting installed
Change-Id: I975dd975bab8f57091218fca4db7a32ac6008c18
Reviewed-by: Joni Jäntti <joni.jantti@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-06-22 12:04:57 +00:00
Kevin Ottens
7e7cd1c294 Sort the keys before comparing them in the test
The return order of the keys is random, so let's sort both first, then
we can compare the lists. Should get rid of the test flakiness.

Change-Id: I2e89d3cc603da6a4667b3677350baa4d40d59b45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-22 11:57:33 +00:00
Frederik Gladhorn
808969527a Move Linux/at-spi debug to categorized logging
Task-number: QTBUG-48593
Change-Id: Icf17137e7953e08db39bfac0282f6e06b1f58686
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-06-22 11:50:37 +00:00
Morten Johan Sørvig
1dcc91b395 Blacklist qFutureAssignmentLeak on OpenSUSE CI
Flaky test, fails on openSUSE_42_1.

Change-Id: Iea5e262578b9960f9facde4fc4e863192058921f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-22 11:36:09 +00:00
Morten Johan Sørvig
f657dda888 QtWidgets: Change QTLWExtra::window from QWindow to QWidgetWindow
Revert commit a1d4e4c9: We’re now using QWidgetWindow
API from QWidget code.

Add QWidgetPrivate::windowHandle() which returns
a QWidgetWindow pointer. Use this function to remove
casts where QWidgetWindow API is used.

Change-Id: Ie66a69b5c0461f297996118dc907e1d7b3d78df5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-22 11:34:45 +00:00
Morten Johan Sørvig
e3bdad13be Correctly set native widget window visibility
After d7a9e08f, calling QWindow::setVisible(true)
is a no-op if the widget is already visible.

Use QWidgetWindow::setNativeWindowVisibility() instead
to set visibility for the native window directly.

“Upgrading” widgets to be native widgets now works
again.

Change-Id: Id68dd8241f3afe00670c07e30e2b2ade9c150354
Task-number: QTBUG-61006
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-22 11:34:30 +00:00
J-P Nurmi
3ee6d8d336 Split QTest::qExec()
Split into (internal) QTest::qInit(), qRun(), and qCleanup(), that
allow qtquickcontrols2 to initialize the test framework once, repeat
the tests for all built-in styles (Default, Material, Universal), and
finally cleanup things:

    $ ./tst_qquickbutton text
    ********* Start testing of tst_QQuickButton *********
    Config: Using QtTest library 5.10.0, Qt 5.10.0 (...)
    PASS   : tst_QQuickButton::Default::initTestCase()
    PASS   : tst_QQuickButton::Default::text()
    PASS   : tst_QQuickButton::Default::cleanupTestCase()
    PASS   : tst_QQuickButton::Material::initTestCase()
    PASS   : tst_QQuickButton::Material::text()
    PASS   : tst_QQuickButton::Material::cleanupTestCase()
    PASS   : tst_QQuickButton::Universal::initTestCase()
    PASS   : tst_QQuickButton::Universal::text()
    PASS   : tst_QQuickButton::Universal::cleanupTestCase()
    Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 2215ms
    ********* Finished testing of tst_QQuickButton *********

Notice that QTest::qExec() cannot be called multiple times, because
it would print the headers/footers/results separately for each round.

Change-Id: Ibb24b694491d4e790db32e40837c3a5c6d9d2840
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-22 11:32:46 +00:00
Liang Qi
7323cd8dc2 testlib: add key sequence function
[ChangeLog][Qt Test] Added keySequence() function.

Task-number: QTBUG-53381
Change-Id: Ib7c3f966fe607f00475ae74aaf070cb988d00141
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-22 07:56:18 +00:00
Tor Arne Vestbø
eecf64f61d macOS: Remove support for child NSWindows
The private feature was only used by QToolBar to solve QTBUG-33082, but
the solution doesn't work, and complicates the macOS platform plugin
quite a bit.

A better solution is likely to use Core Animation layers, which is a
direction we're going in anyways. To make it easier to modernize the
macOS platform plugin, including moving to using layers, we remove the
child NSWindows codepaths for now.

Change-Id: I4b19464be3980fd84dd7af8316d4d5e85ba813b1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-06-21 20:25:31 +00:00
Tor Arne Vestbø
3d8a70c045 macOS: Move QNSWindow implementation into separate file
Change-Id: Ie75419c7ffb7a8fdf78d53e1ea14afee63ef1656
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-06-21 20:25:26 +00:00
Samuli Piippo
8af7b5ba5a QStyleHelper: add missing forward declarations
Fixes build with -no-accessibility.

Change-Id: Ia58c11b22f08a51d5978e4a002480d265aa10fbd
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-06-21 07:22:31 +00:00
Allan Sandfeld Jensen
e5e1fac136 Move endian integers to qendian_p.h
The endian integers have more use than just in QJson, and is already
used separately by QtDeclarative. This patch moves q_littleendian out
of qjson_p.h and matches it with a corresponding q_bigendian, and puts
it to use in simplifying endian handling in the ico image handler.

Change-Id: I975bb701a089256db8ced3cb53b4bd62cdfb02dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-21 06:37:24 +00:00
Kevin Ottens
4d70e03002 [Shader Graph Gen.] Introduce QShaderNodesLoader
This class allows to node definitions from a JSON representation. This
will come in handy to ship preset prototypes for use with
QShaderGraphLoader.

Change-Id: I3f3b5d7852e17d484069b4814ee6e5910997c613
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:51 +00:00
Kevin Ottens
093752faf3 [Shader Graph Gen.] Introduce QShaderGraphLoader
This class allows to load a shader graph from its JSON representation.
To avoid duplicating the shader snippets inside of the JSON which would
be a maintenance nightmare, we instead allow to register a set of node
prototypes by their name and only refer to said names inside the JSON.

Change-Id: I3e7b39e8b3c25f51f331a0a59dda883ac8e2bc57
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:46 +00:00
Kevin Ottens
ad2faa3c63 [Shader Graph Gen.] Introduce QShaderGenerator
This class is meant to generate code from shader graphs

Change-Id: I1cf22352387f3f9f55e7589aa77a296689836911
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:40 +00:00
Kevin Ottens
4212451884 [Shader Graph Gen.] Introduce QShaderGraph::Statement
This is our "byte code" representing a flattened graph. It will be used
as input for the code generation.

Change-Id: Ie02a60d07c035f3d16872e79931eb7cde168a8d1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:36 +00:00
Kevin Ottens
29a748511a [Shader Graph Gen.] Introduce QShaderGraph
This allows to connect our nodes together via ports. This way user code
can assemble a shader from simpler blocks.

Change-Id: I168dcf4af6aa11ad47b68d91e5a55e96ca922678
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:30 +00:00
Kevin Ottens
3a78c62bb2 [Shader Graph Gen.] Introduce QShaderNode
Nodes will allow to describe inputs, outputs or value transformations in
a shader graph.

Change-Id: I44f806d9595fd0e68fc9026cda2b4fa0a62af283
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:25 +00:00
Kevin Ottens
22cd7b02bf [Shader Graph Gen.] Introduce QShaderNodePort
The ports will be used to connect nodes from our shader graphs.

Change-Id: I9d4fbb1f7bd8320c4373ebb166a4fe13bd1482c9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:18 +00:00
Kevin Ottens
57b6b2f527 [Shader Graph Gen.] Introduce QShaderFormat
This is the first building block toward a node based generator for
shader programs.

QShaderFormat will be used by the other classes to qualify in which
format the code snippets and includes used are.

Change-Id: I11aefc6bb359832a853ed1b6bec302dc3516cfc4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:12 +00:00
Giuseppe D'Angelo
e80a3b49c0 Item widgets: API cleanups
A few functions ended up in the wrong visibility section.
For instance, it should be perfectly fine to call indexFromItem
even from non-subclasses. We can't change that in Qt 5, make a note
for Qt 6.

Change-Id: I277d831ef1a4b3dcae99bef299ea334954d5b0d3
Reviewed-by: David Faure <david.faure@kdab.com>
2017-06-20 20:52:28 +00:00
Allan Sandfeld Jensen
fc7f58b300 Mark bswap and related methods constexpr
Marks the bswap methods constexpr and removes the special versions
explicitly using builtins as both clang and gcc automatically
recognizes bswap code and replaces it with builtins.

Change-Id: I07258431ac2588f6046682ffb9c832e650faf66a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 16:39:24 +00:00
Thiago Macieira
e7f962d271 QDate::shortMonthName: remove faulty month test
QLocale already takes care of validating the month inputs, so no need to
spend cycles and binary size for the invalid case.

This commit also removes the check from QDate::longMonthName and the day
name functions so that all functions remain similar.

Task-number: QTBUG-61399
Change-Id: Ia53158e207a94bf49489fffd14c7bd8b121dd132
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-20 16:37:47 +00:00
Thiago Macieira
fffbdb4c37 Doc: add a note about QRandomGenerator returning the sign bit set
Found this in a few uses of qrand() that assumed the result would be
non-negative.

Change-Id: Ia53158e207a94bf49489fffd14c7c029515cf42c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-20 16:37:40 +00:00
Thiago Macieira
0669f71b0c QRandomGenerator: don't internally rely on QT_HAS_INCLUDE
GCC didn't support it until version 5 or 6, so add configure tests for
both <random> and <sys/auxv.h>. Normally I'd say "upgrade", but this is
too low-level and important a feature.

There's a good chance that all our supported compilers have <random>
anyway. As for <sys/auxv.h>, it's present on Glibc, Bionic and MUSL, but
I don't see it in uClibc (AT_RANDOM is a Linux-specific feature).

Change-Id: Ia3e896da908f42939148fffd14c5b2af491f7a77
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-20 16:37:35 +00:00
Giuseppe D'Angelo
4de4051406 QPicture: mark deprecated functions with the QT_DEPRECATED macros
These functions should never be used, they've been deprecated
since Qt 5.0.

Change-Id: I71744eba3ff3b94487dd040ddd6af4fb11f382b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-20 16:10:30 +00:00
Alex Trotsenko
3d77c3629c QWindowsPipeWriter: remove inefficient member
'numberOfBytesToWrite' is an equivalent of buffer.size(), which is
inlined.

Change-Id: I15706a8851734cc085b1f400b78f4820bb6e72c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-20 15:35:00 +00:00
Jesus Fernandez
821533b61f Fix uninitialized members
CID 181185:  Uninitialized members  (UNINIT_CTOR)
Non-static class member "key" is not initialized in this constructor nor in any functions that it calls.

Change-Id: I8f2c18263a0dc81b98eb398d618184bf761c02e1
Coverity-Id: 181185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 15:17:22 +00:00
Thiago Macieira
e147c3d413 Add QDeadlineTimer to the bootstrap library
Task-number: QTBUG-61492
Change-Id: Ia53158e207a94bf49489fffd14c944fee45cf46a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-20 14:48:26 +00:00
Sami Nurmenniemi
462c75be9e Add support for input contexts to offscreen platform
This is needed to use qtvirtualkeyboard with offscreen platform

[ChangeLog][Platform Specific Changes] Input context support to
offscreen platform

Task-number: QTBUG-60268
Change-Id: Id24dc8b0461036923df2c1624bcb913d28e0819e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-20 14:48:22 +00:00
Edward Welbourne
c24ad1896a Eliminate in/out arguments from QDateTimeParser::parse()
Its first two arguments were non-const references that it modified.

A copy of the first was already being passed back in the returned
struct; and the one caller that wanted the modified value was in fact
copying this copy back over the QString it had passed in (that was
thus equal already).  So passing by value is fine.

The second's only change was increment by a field I've just added to
StateNode in refactoring parse(); so we can let the caller do that
adding, instead.

Change-Id: I05abb644f3e5a60f94b03292302dd1bbe996cce9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:54:45 +00:00
Edward Welbourne
0fdbd239c0 QDateTimeParser: partial break-up of long method to eliminate goto
Method parse() was very long, had an inner block purely to isolate
many variables and had a clean-up block at the end to which it would
goto from within that 300-line block.  Split out that block as a
separate function, turn goto into premature return, clean up the
result.

Change-Id: I63ded0c0afacf4a1972a3a62c2d81834950ab729
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:54:35 +00:00
Edward Welbourne
3fe9e5dff7 Eliminate out-parameters from QDateTimeParser::parseSection()
Return a struct instead.  This frees parse() of an assumption that -1
is an error value and leaves one in/out argument.  Made this last an
actual pointer argument instead of a non-const ref.  Shuffled the
remaining arguments so that this in/out is last and the offset into it
at which it gets modified is immediately before it.  Removed a
spurious qdoc comment in the process.

Change-Id: I7d980e70a7711b1d706151eedce956fe2093e48e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:54:27 +00:00
Edward Welbourne
e2eafc0c27 QDateTimeParser: consolidate #if-ery around QT_NO_DATESTRING
Some private methods were conditioned on QT_NO_TEXTDATE but called
(without #if-ery) by methods conditioned on QT_NO_DATESTRING; and
various private methods without #if-ery were only called by methods
within.  Consolidate to #if methods all on QT_NO_DATESTRING.

Change-Id: I1dd18037e4e7407c07041036cc5b871b7d693016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:54:19 +00:00
Edward Welbourne
68f19fb630 QDateTimeParser: implement parsing of time-zone specifiers
The serialization of date-times understood time-zones (indicated by a
't' in a format string) but the parsing didn't (so viewed the 't' as a
literal element in the format string, not matched by the actual zone
it needs to parse), although some tests expected it to.
This made round-trip testing fail.

Implemented parsing of time-zones.
Re-enabled the formerly failing tests.

[ChangeLog][QtCore][QDateTime] Added support for parsing of time-zones.

Task-number: QTBUG-22833
Change-Id: Iddba7dca14cf9399587078d4cea19f9b95a65cf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:54:07 +00:00
Edward Welbourne
02b7ec05d5 Be (somewhat more) consistent about the value of pi
Use M_PI (and friends), where possible, in favor of hand-coded
approximations of various (in)accuracies.  Where that's not available
(e.g. fragment shaders), use the same value that qmath.h uses for
M_PI, for consistency.  Replaced math.h with qmath.h in places that
defined a fall-back in case math.h omits it (it's not in the C++
standard, although M_PI is in POSIX); or removed this entirely where
it wasn't used.

Reworked some code to reduce the amount of arithmetic needed, in the
process; e.g. pulling common factors out of loops.  Revised an
example's doc to not waste time talking about using a six-sig-fig
value for pi (which we no longer do) - it really wasn't relevant, or
anything to be proud of; nor did the doc mention its later use.

Task-number: QTBUG-58083
Change-Id: I5a31e3a2b6a823b97a43209bed61a37b9aa6c05f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:53:46 +00:00
Edward Welbourne
82deb0ad16 Update CLDR to v31.0.1
The formatting of times in Norwegian has changed to use colon rather
than dot between hours, minutes and seconds:
http://cldr.unicode.org/index/downloads/cldr-30#TOC-Other
tst_QLocale gets a matching revision.

Change-Id: I35a16080def5fbadd62144a0b44be8110b9be29b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2017-06-20 09:53:21 +00:00
Shawn Rutledge
9d23aebb27 Add QLocale::formattedDataSize and consolidate use cases
It should be easier to translate sizes in bytes to human-readable
strings consistently rather than having to repeat this code (and the
string translations) in various places.  The FileDialog in QtQuick.Controls
has a use for this, too.

[ChangeLog][QtCore][QLocale] Added QLocale::formattedDataSize() for
formatting quantities of bytes as kB, MB, GB etc.

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I27bca146c3eba90fa7a5d52ef6626ce85723e3f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:53:14 +00:00