Commit Graph

33051 Commits

Author SHA1 Message Date
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
Laszlo Agocs
ccca8c9435 Fix dereferencing non-existent TLW with hidden QOpenGLWidget
Amends 2ea90c56f2.

Task-number: QTBUG-61280
Change-Id: Iae086a47f5cbe2e423b0831c3cd226507879cbbb
Reviewed-by: Mika Salmela <mika.salmela@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-20 09:47:46 +00:00
Joerg Bornemann
932fe019fe Remove duplicate qrandom target and source file reference
This fixes the following warnings when building qmake:

Makefile:359: warning: overriding commands for target `qrandom.o'
Makefile:335: warning: ignoring old commands for target `qrandom.o'

Change-Id: I2c7abbe095862303c1969a70f61b8a57009d44ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 09:17:55 +00:00
Joerg Bornemann
ff0006928d Doc: Document the setters QProcess::startDetached supports
Change-Id: I594af26e94582c1edfe7c3182477a2efc4eab2a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-06-20 09:13:21 +00:00
Marc Mutz
29a459d7cc QKeySequence: let Private::decodeString() take QString by value
It calls toLower() on it, and the existence of two strings in scope
has already caused some latent bug where sizes of the two were mixed.

Taking by value means we can use the rvalue-version of toLower().
While that does not guarantee no allocations, we can make sure that at
least in QKeySequence::assign(), we hand in unshared data, by using
std::move().

Change-Id: Ic4a18486a6f4528eba36109dec1a47082cf57055
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-20 08:57:01 +00:00
Marc Mutz
4088f4ce4d QAbstractItemView: add isPersistentEditorOpen()
[ChangeLog][QtWidgets][QAbstractItemView/QTreeWidget/QTableWidget/QListWidget]
Added isPersistentEditorOpen().

Task-number: QTBUG-61139
Change-Id: I74997d9626812fed83591d32c503680575ec0f7c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-06-20 08:55:40 +00:00
Friedemann Kleint
ab420484e7 Fix some qdoc warnings for 5.10
Fix comments for QRandomGenerator.

src/corelib/io/qprocess.cpp:453: warning: Cannot find 'startDetached(...)' in '\fn' bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
src/corelib/tools/qstringiterator.qdoc:122: warning: Cannot find 'QStringIterator(...)' in '\fn' QStringIterator::QStringIterator(QStringView string, QStringView::size_type idx)
src/corelib/global/qrandom.cpp:902: warning: Can't link to 'QRandomGenerator'
src/sql/kernel/qsqlerror.cpp:123: warning: Unknown command '\other'
src/network/kernel/qhostinfo.cpp:296: warning: Unknown command '\other'
src/gui/kernel/qplatformcursor.cpp:97: warning: Cannot find 'QPlatformCursor::OverrideCursor' specified with '\enum' in any header file
src/network/access/qnetworkreply.cpp:307: warning: Can't link to 'QNetworkAccessManager::setRedirectsPolicy()'
src/network/access/qnetworkreply.cpp:307: warning: Can't link to 'QNetworkRequest::RedirectsPolicyAttribute'

Change-Id: Ibc2455b1b657716dfb6192615738dc7f924dbab3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-20 08:54:52 +00:00
Liang Qi
d1ff9b419d Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-06-20 04:28:09 +00:00
Thiago Macieira
8a4ea3f038 Move Q_REQUIRED_RESULT to its correct position
This commit complements commit 3dcc075f4a
for Qt 5.10.

Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-20 04:28:05 +00:00
J-P Nurmi
7011252145 Blacklist tst_QParallelAnimationGroup::deleteChildrenWithRunningGroup()
It is flaky on macOS 10.12.

Task-number: QTBUG-61500
Change-Id: I3dfb6979808dec3a20896c2579dd1f5124c94a70
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-06-19 18:33:47 +00:00
J-P Nurmi
c9713bcd68 Blacklist flaky tst_QGuiEventLoop::testQuitLock() on macOS 10.12
Task-number: QTBUG-61499
Change-Id: I6eebe2305b47f9ae7be128c3d7a7535f6f04a4da
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-06-19 18:33:22 +00:00
J-P Nurmi
8ae55f0d00 Skip unreliable tst_QTimer::moveToThread() on macOS 10.12
Randomly timeouts in the CI.

Task-number: QTBUG-59679
Change-Id: I28410b747b2033fc0ef6286a11c88cd0c07eb247
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-06-19 18:32:55 +00:00
Liang Qi
ce09ef4313 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/plugins/platforms/android/qandroidplatformintegration.h
	src/plugins/platforms/windows/qwindowscontext.cpp
	src/plugins/platforms/windows/windows.pri
	src/tools/uic/cpp/cppwriteinitialization.cpp
	src/widgets/doc/src/widgets-and-layouts/gallery.qdoc

Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
2017-06-19 16:12:34 +02:00
Andy Shaw
b2cb83ecbb Pass the absolute path with the file when finding files
When generating a project, the directories can be specified as arguments
to the qmake call. As a result files can either be incorrectly added to
the project with a leading slash, or can end up duplicated. By passing
the absolute path with the file, it ensures that the file is added
correctly and no duplicates occur as a result.

Task-number: QTBUG-48342
Change-Id: If774de8d7f5cceca80042a25a3aa4e5b045249da
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-19 08:39:40 +00:00
Olivier Goffart
a232251992 Moc: Don't error out when parsing namespace __identifier(...)
Present for example in the Windows's Atlbase.h header.
We should not abort the compilation, just ignore that construct

Task-number: QTBUG-56634
Change-Id: Id6e4c9f03cb1cef46e330f4fbcae80ce4f3730c6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-19 07:32:18 +00:00
Oliver Wolff
56a29f0e91 winrt: Fix tst_QDialog::showFullScreen
show will use the platform's default flags but the test actually checks
for the flags that were set before so we have to use setVisible(true)
instead.

Change-Id: I52c055ec07d6f0dee626626318c875aefdf67484
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-19 07:06:04 +00:00
Oliver Wolff
9ed46c2853 winrt: Fix tst_qurl
Change-Id: Ia7e33e3892f888ead1357f5cd522480f514421e3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-19 07:06:02 +00:00
Oliver Wolff
0086bf62a2 winrt: Fix tst_qtextstream
Change-Id: I5e8076a344a50f70e9618ff7b2e9258182601957
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-19 07:06:01 +00:00
Oliver Wolff
5a1f25a1bd winrt: Fix tst_qlanguagechange
Change-Id: Ic11a81b49cc2e7a3fcb895d1556b44baf8c1d6fe
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-19 07:06:00 +00:00
Oliver Wolff
9c75ee6858 Fix tst_QOpenGlConfig for platforms with builtin test data
Change-Id: Ifd57002b730987105554514b3498f5e3bb4962e4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-19 07:05:59 +00:00
Oliver Wolff
096cdb3c04 Fix tst_qfile::size for configurations using builtin test data
As the files are packaged into the binary, they have to be
extracted, before they can be ::open'ed.

Change-Id: Ie83086a2b9a73b6b0de462bdb52a71bb277ae06f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-19 07:05:57 +00:00
Oswald Buddenhagen
dd23ed3dbd Merge 5.9 into 5.9.1
Change-Id: I229386dc3e0283dc7e5ad1c580ffcb335c67601c
2017-06-19 08:19:54 +02:00
J-P Nurmi
97eec16e4f Android: fix missing wheel events
Change-Id: I65b4f6a8fcbdad537a984064e332a4a1f34a265a
Task-number: QTBUG-43669
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-06-18 12:59:14 +00:00
Allan Sandfeld Jensen
68bcbe2470 Fix tst_QImageReader::imageFormatBeforeRead
The test was never loading images from a valid path, and thus never
had any fullfill the base option which meant nothing was tested.

Making it work revealed that the Format option on BMP formats doesn't
predict semi-transparent files.

Change-Id: I7035a0f63ebfbce940ce7a17a6142cf177480798
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-18 12:59:10 +00:00
Allan Sandfeld Jensen
f5f98da54e Fix reading qle_signedbitfield as int
The type-cast to int for qle_signedbitfield was wrong for all cases
where width + pos != 32. The class is currently only used two places
though, both where that happen to apply.

Change-Id: I108c565b75c9f29dd49b5e2e39f84910d17ead85
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-18 12:59:05 +00:00
Tony Sarajärvi
da8701ff57 Blacklist tst_QGuiEventLoop::processEvents in macOS 10.12
Task-number: QTBUG-61131
Change-Id: Ia54d0976f73e733199503e3510daf3d6fa4253a7
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-18 12:59:02 +00:00
Tony Sarajärvi
603963e07d Extend blacklisting of tst_QElapsedTimer::elapsed to cover macOS 10.12
Task-number: QTBUG-58713
Change-Id: I0c467c1abcdd1284910e0a61f98646e943eae377
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-18 12:58:58 +00:00
Tony Sarajärvi
8875e28372 Blacklist flaky tst_QTimeLine tests on macOS 10.12
Task-number: QTBUG-61037
Change-Id: I604bbc815c16a5ab436d2ff4936d96d3a2d27dab
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-18 12:58:53 +00:00
Oswald Buddenhagen
8b080e59c5 rename qglobalstatic.cpp -> qglobalstatic.qdoc
it contains no code.

Change-Id: Ie8a43abb2db3d040f7046206adf2bf555960dd9c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-17 06:48:10 +00:00
Oswald Buddenhagen
9d90bbd7b1 rework detection and use of clock_gettime()/librt
recent versions of glibc include clock_gettime() inside libc itself.

Task-number: QTBUG-41009
Change-Id: I7401773be99682a356bf06a69571d11c4b15978b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-17 06:48:04 +00:00
Oswald Buddenhagen
72d4f0750b don't auto-create install targets for static libs
these are not meant to be deployed, so the install hack should skip
them.

Task-number: QTBUG-42830
Change-Id: I870499dca2cfea87bf0048f019d651ce9cc5d788
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-17 06:47:59 +00:00
Oswald Buddenhagen
c0e94dd093 don't overwrite pre-existing INSTALL for target
while it's mildly insane that we auto-generate install targets to start
with, we can at least refrain from doing so if there is one already.

as it happens, this removes the need for excluding the qt build
explicitly.

Task-number: QTBUG-38452
Change-Id: I74d5df447fba525fa79896c9be2c71d82bc2c6ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-17 06:47:54 +00:00
Oswald Buddenhagen
ed07bdcb5f make sql drivers independently configurable
our binary packages come without many sql drivers, because they have
proprietary dependencies we cannot ship. not every user wants to build
all of qt from scratch, so it makes sense to make it possible to
"enrich" the existing installation by compiling just the drivers. to
enable this, the drivers' configuration must be independent. but note
that it's still not possible to configure a single driver - the entire
sqldrivers directory is configured at once.

a side effect of this is that the availability of the sql plugins
cannot be made known with publicFeatures any more, because there is no
associated module pri file to put that information into. that should be
made inconsequential by making qtHaveModule() work for plugins.

Task-number: QTBUG-58372
Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-17 06:47:48 +00:00
Alexander Volkov
78731b434e xcb: Remove XIproto.h include from qxcbxsettings.cpp
It indirectly includes X.h with LSBFirst and MSBFirst macros.
Use XCB_IMAGE_ORDER_LSB_FIRST and XCB_IMAGE_ORDER_MSB_FIRST
macros instead and remove unneeded XCB_USE_XLIB guards.

Change-Id: Ic24c9605d0a627253f2793f9feab6c6e19dcda08
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
(cherry picked from commit 538b9f504c)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-06-16 18:16:25 +00:00
Friedemann Kleint
bd263452cd Revert "QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists"
The change causes drawing artifacts in Qt Creator.

This reverts commit 8b1377fde1.

Task-number: QTCREATORBUG-18322
Task-number: QTBUG-60231
Change-Id: Ic05507b0c23ea612fa5a9b92163380059b6e710d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-06-14 13:00:35 +00:00