Commit Graph

38787 Commits

Author SHA1 Message Date
Morten Johan Sørvig
790cf25f9d wasm: add local file access private API
Access to the local file system is restricted by the
Web sandbox, and a separate API an implementation is
needed to facilitate this for Qt applications.

This adds a private asynchronous callback-based C++
API for opening a file dialog and reading file content.

The implementation uses a file input html element to
show a file dialog, and then the uses the native File
and FileReader APIs to read the selected file(s).

Change-Id: I4e28baa032d7c3cd63241465f0ae55efd219a05b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 06:49:21 +00:00
Morten Johan Sørvig
c58df2d12e wasm: add qstdweb private API
qstdweb provides a C++ API covering parts of the DOM API
useful for implementing Qt. This currently includes
ArrayBuffer, Blob, File, FileReader, and Uint8Array.

The implementation uses emscripten::val, which currently
proxies via JavaScript, but should at some point be
able to acccess the DOM directly, once WebAssembly
gains such access.

This API should be easier to use than the string-and-casting
emscripten::val API. It is currently private, and can
be changed and extended as needed.

Change-Id: I95a2ad735e511c8da61f3cc21357fbffe3b05d8e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 06:49:10 +00:00
Christian Ehrlicher
7024090e1d QToolButton: fix handling multi-line texts
The patch to elide the QToolButton text when there is not enough space
introduced a regression with multi-line text.
Fix it by using the newly introduced common function to elide multi-line
text.

Fixes: QTBUG-72226
Change-Id: I066ebbd2f360add93406cc29bb4bbbebf599ba42
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-07 05:32:37 +00:00
Christian Ehrlicher
a7ba79553c QCommonStyle: factor out elided text calculation
Factor out the calculation of the elided text from
QCommonStylePrivate::viewItemDrawText() so it can be used by other
painting functions.

Change-Id: I28e6bfd2fe4d7c552848446fa9913df78589d15b
Reviewed-by: Christian Andersen <csandersen3@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-07 05:32:30 +00:00
Friedemann Kleint
5c98d15a45 Fix some deprecation warnings in examples
googlesuggest.cpp:163:36: warning: ‘void QTreeWidgetItem::setTextColor(int, const QColor&)’ is deprecated: Use QTreeWidgetItem::setForeground() instead [-Wdeprecated-declarations]
xbeltree.cpp:187:34: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
imageitem.cpp:114:21: warning: ‘void QGraphicsItem::setMatrix(const QMatrix&, bool)’ is deprecated: Use setTransform() instead [-Wdeprecated-declarations]
xbelreader.cpp:143:48: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
xbelgenerator.cpp:103:55: warning: ‘bool QTreeWidget::isItemExpanded(const QTreeWidgetItem*) const’ is deprecated: Use QTreeWidgetItem::isExpanded() instead [-Wdeprecated-declarations]
xbelwriter.cpp:90:55: warning: ‘bool QTreeWidget::isItemExpanded(const QTreeWidgetItem*) const’ is deprecated: Use QTreeWidgetItem::isExpanded() instead [-Wdeprecated-declarations]
xbelhandler.cpp:97:50: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
node.cpp:180:60: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
node.cpp:181:64: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
chip.cpp:82:81: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
chip.cpp:84:40: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
chip.cpp:108:93: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
roundrectitem.cpp:65:42: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
roundrectitem.cpp:97:51: warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
roundrectitem.cpp:105:34: warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
splashitem.cpp:82:57: warning: ‘void QPainter::drawRoundRect(int, int, int, int, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
robot.cpp:116:53: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
robot.cpp:176:49: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
robot.cpp:200:49: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
mandelbrotwidget.cpp:120:41: warning: ‘const QMatrix& QPainter::matrix() const’ is deprecated: Use transform() instead [-Wdeprecated-declarations]
composition.cpp:344:47: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
composition.cpp:346:46: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
colorswatch.cpp:89:34: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
mainwindow.cpp:81:62: warning: ‘void QTreeWidget::setItemSelected(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setSelected() instead [-Wdeprecated-declarations]
puzzlewidget.cpp:172:35: warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
spreadsheet.cpp:191:37: warning: ‘QColor QTableWidgetItem::backgroundColor() const’ is deprecated: Use QTableWidgetItem::background() instead [-Wdeprecated-declarations]
spreadsheet.cpp:198:32: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
spreadsheet.cpp:203:24: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
spreadsheet.cpp:238:47: warning: ‘QColor QTableWidgetItem::backgroundColor() const’ is deprecated: Use QTableWidgetItem::background() instead [-Wdeprecated-declarations]
spreadsheet.cpp:249:38: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:494:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:509:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:513:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:527:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:531:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:545:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:549:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:563:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:567:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:581:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:585:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:599:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
starrating.cpp:91:46: warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
document.cpp:341:36: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
document.cpp:342:39: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
document.cpp:343:36: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:88:39: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:89:39: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:188:52: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:264:56: warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
plugindialog.cpp:128:49: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
tetrixboard.cpp:361:74: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
tetrixboard.cpp:408:32: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
tetrixboard.cpp:412:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
mandelbrotwidget.cpp:120:41: warning: ‘const QMatrix& QPainter::matrix() const’ is deprecated: Use transform() instead [-Wdeprecated-declarations]

Change-Id: If0afabbc35ef25f127f211c11699011d4ae4ae65
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 22:12:23 +00:00
Friedemann Kleint
ca65efb0cc Add deprecation exclusion around deprecated calls in deprecated code
Fix:
io/qdir.cpp:1087:16: warning: ‘static void QResource::addSearchPath(const QString&)’ is deprecated: Use QDir::addSearchPath() instead [-Wdeprecated-declarations]
io/qprocess.cpp:1178:34: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
image/qpixmap.cpp:997:48: warning: ‘static QPixmap QPixmap::grabWidget(QObject*, const QRect&)’ is deprecated: Use QWidget::grab() instead [-Wdeprecated-declarations]
text/qfont.cpp:2218:29: warning: ‘QString QFont::lastResortFamily() const’ is deprecated [-Wdeprecated-declarations]
itemviews/qitemdelegate.cpp:1008:41: warning: ‘static QPixmap* QPixmapCache::find(const QString&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations]

Change-Id: I51259edc175b1f55f61ded3af50ebfffd8c304a8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 22:12:16 +00:00
Timur Pocheptsov
71a1c66ab9 Feature 'ocsp' - fix a broken win-64 build
Alas, we have to do the job ossl_typ.h failed to - undef macros
coming from wincrypt.h (?) and clashing with identifiers/naming
conventions not exactly very wisely chosen by OpenSSL.

Change-Id: I1725c4f769be64dbb391d040b2c1574b20b65151
Fixes: QTBUG-73322
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-02-06 22:12:10 +00:00
Allan Sandfeld Jensen
0d3b913da7 Switch epilogues of AVX2 conversions to single step
Not only is it fewer instructions but all the logic except for load and
store can be identical to the main loop.

Change-Id: I2caac0c7504d94e404bd8cfe5080aff07ba2d465
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-06 22:12:03 +00:00
Friedemann Kleint
a6f25dedd8 Windows style, themes: Fix deprecation warnings
Fix:
qwindowstheme.cpp:287:77: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
qwindowstheme.cpp:336:37: warning: 'const QBrush& QPalette::foreground() const' is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
qwindowstheme.cpp:861:102: warning: 'static bool QPixmapCache::find(const QString&, QPixmap&)' is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations]
qwindowsvistastyle.cpp:635:56: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
qwindowsvistastyle.cpp:707:60: warning: 'static bool QPixmapCache::find(const QString&, QPixmap&)' is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations]
qwindowsxpstyle.cpp:743:58: warning: 'const QMatrix& QPainter::deviceMatrix() const' is deprecated: Use deviceTransform() instead [-Wdeprecated-declarations]
qwindowsinputcontext.cpp:448:49: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]

Change-Id: I00a52a27b066caeb135ad4124f71ef3e09beafbf
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 22:11:56 +00:00
Gatis Paeglis
27065bdc50 ibus: allow filterEvent() from QWindowSystemEventHandler::sendEvent()
The async mode, which is also default mode will recurs if
QIBusPlatformInputContext::filterEvent() is called from
QWindowSystemEventHandler::sendEvent() callback.

The sync mode works fine without this patch.
Modes can be toggled via IBUS_ENABLE_SYNC_MODE envvar.

Removed redundant #ifndef and renamed one variable to
something more meaningful.

Change-Id: I8773445cef10212464cff09e3a70487fb38ac3fd
Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-06 22:11:49 +00:00
Gatis Paeglis
c0ebec51e3 xcb: respect big-request encoding in max request size
From big-request specification:

"This extension defines a mechanism for extending the length
field beyond 16 bits. If the normal 16-bit length field of the protocol
request is zero, then an additional 32-bit field containing the actual
length (in 4-byte units) is inserted into the request, immediately
following the 16-bit length field."

Meaning that the request requires 4 additional bytes. This patch provides
a convenience API for calculating maximum request data size.

Besides fixing QTBUG-73044, it was also discovered that calculations
for xcb_image_put (in QXcbBackingStoreImage::flushPixmap) were wrong.
The code assumed that xcb_get_maximum_request_length() returns bytes,
but what it actually returns is length which is measured in four-byte
units. This means that we were sending 4x less bytes than allowed by
the protocol. Furthermore, use the actual 'stride' (bytes per line) value
when calculating rows_per_put. The new stride value was introduced
by 760b2929a3, but was not updated in
rows_per_put calculations.

Fixes: QTBUG-73044
Done-with: JiDe Zhang <zccrs@live.com>
Done-with: Mikhail Svetkin <mikhail.svetkin@qt.io>
Change-Id: I06beb6082da3e8bc78225a87603914e796fe5878
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-02-06 22:11:44 +00:00
Christian Ehrlicher
edc455c69b QtWidgets: mark QDialog/QFileDialog functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - QDialog::setOrientation()/orientation()
 - QDialog::setExtension()/extension()/showExtension()
 - QFileDialog::setNameFilterDetailsVisible()/isNameFilterDetailsVisible()
 - QFileDialog::setResolveSymlinks()/resolveSymlinks()

Change-Id: Ibbd5b4192ea8ab483d6b2a8dbf9879f29f9ee86d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-06 22:11:38 +00:00
Christian Ehrlicher
d6d33f0b80 QtWidgets: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - QLayout::margin()/setMargin()
 - QComboBox::autoCompletion()/setAutoCompletion()
 - QComboBox::autoCompletionCaseSensitivity()
 - QComboBox::setAutoCompletionCaseSensitivity()
 - QTextStream& operator<<(QTextStream&, const QSplitter&)
 - QTextStream& operator>>(QTextStream&, QSplitter&);

Change-Id: Ic16b36bf647413b5b3ea2d9105981b95370b3178
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-06 22:11:33 +00:00
Christian Ehrlicher
4715ca7bc5 Cleanup QtCore examples
Cleanup QtCore examples:
 - use new signal/slot syntax
 - use 0 instead nullptr
 - remove unneeded includes
 - use initializer lists
 - replace foreach with range-based-for loop

Change-Id: I5581f485fa0e9ccf3f4ce6f643908832bc6959bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-06 22:11:27 +00:00
Michal Klocek
7910dd0a54 Add llvm linker detection to configure
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01240.html

This is currently only used for webengine, where link time really matters.

New configure options:
* force 'lld'  '-linker lld' or' --linker=lld'
* force 'gold' '-linker gold' or '--linker=gold'
* force 'bfd' '-linker bfd' or '--linker=bfd'

Note before by default gold was always forced (if supported) now default linker
is system default one.

[ChangeLog][Tools][configure & build system] Added --linker=[bfg,lld,gold] configure flag.

Change-Id: Idaa13510da70243c6176b96db846d629cd65c7af
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-02-06 22:11:22 +00:00
Andy Shaw
5133e22ae2 Add support for setting the peer verify name via the QNetwork* classes
This adds functions to QNetworkRequest to be able to set the
peerVerifyName. An overload of connectToHostEncrypted is also added to
have an extra argument to allow setting it directly in this manner too.

Fixes: QTBUG-73125
Change-Id: I371e90035b53a74c9eb3cef64f367e307dce073e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-02-06 22:11:17 +00:00
Karim Pinter
8a7c373f8e QNX QPA: Add support for Qt Virtual Keyboard
If the QT_IM_MODULE environment variable is set, then it loads the
IM module accordingly, otherwise it is using the PPS one, if it is
available.

Task-number: QTBUG-54576
Change-Id: Icb8b474805053d8297029096365783c2cabc2cbc
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2019-02-06 22:11:11 +00:00
Liang Qi
4c165e6834 Disable Docker-based test servers on macOS temporarily
The coin agent starts to crash after the docker-compose call.

Need to have qt5 5.13 integrated first, then fix the real issue later.

Task-number: QTQAINFRA-2717
Task-number: QTQAINFRA-2750
Change-Id: I3dcd963b1c5cea0b2197f1589398d8a9ed18f46f
Reviewed-by: Aapo Keskimolo <aapo.keskimolo@qt.io>
2019-02-06 22:04:54 +00:00
Andreas Hartmetz
ddb5d39045 QMetaObject::Connection overview documentation improvements
Try to better describe what it is and what it does. Also mention
its strongest use case.

Change-Id: Ib5c3e8a3c9b96169c139c5d7e8995a6a49d7d5e1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-02-06 10:35:03 +00:00
Edward Welbourne
150c6fb74b Add testlib selftests for double and for non-finite float and double
Tidied up the existing float tests in the process.
(In particular, s/SUCCESS/PASS/ since that matches real test output.)
These verify that QCOMPARE() handles floats and doubles as intended.
Extended the existing qFuzzyCompare tests to probe the boundaries of
the ranges of values of both types, in the process.

Revised the toString<double> that qCompare() uses to give enough
precision to actually show some of the differences being tested there
(12 digits, to match what qFuzzyCompare tests, so as to show different
values rather than, e.g. 1e12 for both expected and actual) and to
give consistent results for infinities and NaN (MinGW had eccentric
versions for these, leading to different output from tests, which thus
failed); did the latter also for toString<float> and fixed stray zeros
in MinGW's exponents (which made a kludge in tst_selftest.cpp
redundant, so I removed that, too).

That's further complicated handling of floating-point types, so let's
just keep an eye on how expensive that's getting by adding a benchmark
test for QTest::toString().  Unfortunately, default settings only get
runs that take modest numbers of milliseconds (some as low as 40)
while increasing this with -minumumvalue 100 or more gets the process
killed - and I'm unable to find out who's doing the killing (it's not
QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell).
So results are rather noisy; the integral tests exhibit speed-ups by
factors up to 5, and slow-downs by factors up to 100, between runs
with and without this change, which does not affec the integral tests.
The relatively modest slow-downs and speed-ups in the floating point
tests thus seem likely to be happenstance rather than signal.

Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-06 10:11:22 +00:00
Alexander Volkov
f6edb0ef72 Improve keyboard navigation in QListView when isWrapping is enabled
Search the previous item or the next item in a model instead
of searching them on visual layout. This way the cursor will
not stop at the beginning or at the end of a row or a column.

Fixes: QTBUG-14444
Change-Id: I0ef203a4dcd876e4c50559fb87e61585f07434d1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-06 09:50:58 +00:00
Qt Forward Merge Bot
670b843369 Merge "Merge remote-tracking branch 'origin/5.12.1' into 5.12" into refs/staging/5.12 2019-02-06 10:52:13 +00:00
Qt Forward Merge Bot
e4c29088c8 Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: I486f3c51df4b60fe60b75ba642636a835a75f731
2019-02-06 10:28:01 +01:00
Thiago Macieira
37352b23a9 x86: Disable AVX support on 64-bit MinGW
GCC for 64-bit Windows has a bug that it fails to properly re-align the
stack pointer for use with 256-bit memory addresses (AVX). Therefore,
there's about a 50/50 chance that any function using AVX will have an
improperly-aligned stack. In release mode, stack accesses should be
rare, but in debug mode they happen frequently. Either way, this is a
ticking time bomb, so we disable.

Clang is not affected.
32-bit MinGW is not affected.
64-bit in other OSes with GCC are not affected.

Fixes: QTBUG-73539
Change-Id: Id061f35c088044b69a15fffd1580967808f31671
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-02-06 08:11:29 +00:00
Boubacar DIENE
b319d14110 Fix "error: too many arguments to function media_get_entity_by_name()"
Since the official v4l-utils-1.12.0 release, media_get_entity_by_name() function expects
only two arguments instead of three as in older versions thus breaking build of eglfs_kms_vsp2
backend.

Cf. https://git.linuxtv.org/v4l-utils.git/tree/utils/media-ctl/mediactl.h#n253

Fixes it by creating an overloaded wrapper function that will choose the right
version based on the signature of the media_get_entity_by_name function pointer
argument.

Fixes: QTBUG-73427
Change-Id: Idab52558b6f2f23137456c21e33ece1ef0e9aa4e
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-02-06 07:36:34 +00:00
Kari Oikarinen
eb60877fe9 QWizard: Correctly calculate watermark size hint
If we have have AA_EnableHighDpiScaling on and have loaded a @2x image, layout
calculations can't use the real pixels of the QPixmap directly.

Fixes: QTBUG-73401
Change-Id: I1891411a0e359e0148476f73b6cc3a128893a374
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-06 07:19:01 +00:00
Kari Oikarinen
54bcb9d42f Blacklist tst_QGraphicsItem::cursor on WinRT
It is the flaky test causing most failures in qtbase at the moment.

Task-number: QTBUG-73545
Change-Id: Id9c5db27ebd08a4cf3c119d2fada12fdf1a5d2a0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 07:17:22 +00:00
Joerg Bornemann
8e6231f4eb Fix install targets for generated private headers
Header files of modules that specify generated_privates are usually
not yet available at qmake-time. Thus, the installation rule must not
check for the file's existence.

Change-Id: Ifc7ff95422912d255744c9006382ff181176ae77
Fixes: QTBUG-71340
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-02-06 07:17:46 +00:00
Joerg Bornemann
05bcfb9011 Normalize some SIGNAL/SLOT signatures
...for a minor performance gain.

Change-Id: I4bef867055e069926fdc24fa98a6f94b6a0630e2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-02-06 07:17:44 +00:00
Volker Hilsheimer
c66ddd7aba Include relevant example code in documentation of setUrlHandler
By only looking at the function prototype, it's tempting to assume that
the handler needs to be registered with the usual SLOT macro. That is
not the case.

The code snippet is already included in the class description, but it
doesn't hurt to repeat it here.

Change-Id: If24fdca41a4bd976ebd1156c9e1106469388265c
Fixes: QTBUG-50484
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2019-02-06 04:15:26 +00:00
Eirik Aavitsland
a2b8f891fa Doc: decrease confusion about HSV vs HSL in QColor
The non-qualified hue() and saturation() etc. refers to those values
in the HSV, not HSL, color model. Make this more explicit in the
documentation to avoid confusion.

Task-number: QTBUG-73129
Change-Id: Ief337672966ac72d0d0c3606d8d68acf01ffe7ee
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-02-05 22:47:46 +00:00
Eirik Aavitsland
01f090e9e4 Fix QColor::toCmyk() for rgb(0, 0, 0)
We translate all pure gray colors into cmyk having c,m,y=0 and only
the k value expressing the darkness. But a fix introduced to avoid
division by 0 caused rgb(0, 0, 0) to be an exception to this; it ended
up being translated as c,m,y,k=1 instead.

Fix by catching the potential div-by-0 situation earlier and directly
set the orthodox cmyk translation: c,m,y=0,k=1.

Fixes: QTBUG-73171
Change-Id: I3774eaf9d96e096ac5c47c55d28881bea2bd1309
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-02-05 22:47:33 +00:00
Eirik Aavitsland
66c3a71e91 Painter path stroking: fix capping of beziers ending in tight turns
For some overly tight beziers where the start or end point and the
next control point are closer than the pen width, the stroker's
shifting algorithm will produce a start/end tangent pointing in the
opposite direction from what is expected, for one of the sides. This
would break the square and round capping logic. Fix by detecting the
situation in the capping function and reversing the tangent when
necessary.

Change-Id: I48f4f017403d7b289b0483dd2b3a7ff1bbd0cf2a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-05 22:47:16 +00:00
Eirik Aavitsland
e96641d881 Fix xbm image format handler: properly reject invalid files
The read_xbm_header() function is used to check for valid file header,
containing valid width and height values. But in case of an invalid file,
the check could depend on uninitialized variables.

Change-Id: I9f933ed6e38d86109e5b5a8d55fe763ab928d749
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-02-05 22:47:07 +00:00
Allan Sandfeld Jensen
a6aacdd560 Fix convertARGBToARGB32PM_avx2 and convertARGBToRGBA64PM_avx2
The tails was off since f370410097

Fixes: QTBUG-73440
Change-Id: If86178c6cad3f87d9b5f0f89e90354d49cd386a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-05 17:04:25 +00:00
Christian Ehrlicher
93cebb3837 QtWidgets/Graphics-/ItemViews: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - QGraphicsItem::matrix()/setMatrix()/resetMatrix()/sceneMatrix()
 - QGraphicsItemAnimation::reset()
 - QGraphicsScene::isSortCacheEnabled()/setSortCacheEnabled()
 - QAbstractItemDelegate::elidedText()
 - QAbstractItemView::setHorizontalStepsPerItem()/horizontalStepsPerItem()
 - QAbstractItemView::setVerticalStepsPerItem()/verticalStepsPerItem()

Change-Id: I7244078552ebeac9dfbcf3291b3ae0c44cc2c1d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-05 16:55:23 +00:00
Christian Ehrlicher
1b90684948 QtWidgets: replace 0 with \nullptr in documentation
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.

Change-Id: I5e5bc1ae892f270d7c3419db1c179053561f1b26
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-05 16:55:13 +00:00
Christian Ehrlicher
0059de2d1b QtGui documentation: cleanup
Cleanup the QtGui documentation:
 - use new signal/slot syntax
 - use range-based for loop instead foreach

Change-Id: Id49ff2cbe78f28a06ca0fb63e6ca6f7dc2736f7b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-05 16:55:03 +00:00
Christian Ehrlicher
3514aedbf3 QtWidgets documentation: cleanup
Cleanup the QtWidgets documentation:
 - use new signal/slot syntax
 - use range-based for loop instead foreach

Change-Id: I621b1ddac108d3df676209241d93d9b4f04a25fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-05 16:54:53 +00:00
Christian Ehrlicher
b76a923a8e QAnimationDriver: mark obsolete functions as deprecated
Mark the two long obsolete (and empty) functions as deprecated so they
can be removed with Qt6:
 - setStartTime()/startTime()

Change-Id: I7ee1d99ff194860e41723909f81adc181a71ec7c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-05 16:54:33 +00:00
Christian Ehrlicher
0736e050cb QMenuItem: fix rendering with css styling
The rendering of a css styled menu item with icons or checkmark was
partially fixed with aa1bc47942 but
introduced some other painting regressions, especially in RTL mode.
Fix it by syncing the code with fusion and windows style. With this
patch a menu text with a check mark but no icon is now aligned exactly
the same as a menu text with a icon.

Fixes: QTBUG-66380
Fixes: QTBUG-70491
Fixes: QTBUG-72817
Change-Id: I83a95d15eb130e7f72471820b53c3cd5554d9334
Reviewed-by: Nick D'Ademo <nickdademo@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-05 08:25:00 +00:00
Christian Ehrlicher
d726ccb83c tst_QHeaderView: fix defaultSectionSizeTest() on High-DPI screens
tst_QHeaderView::defaultSectionSizeTest() fails on High-DPI screens
because the default minimum section size is greater than the values used
for testing the header sizes. Therefore the test will fail.
Fix it by explicitly setting the minimum header size to something
smaller than the test values.
Also add a debug line to output the default minimum section sizes so
other failures due to this problem can be debugged better.

Fixes: QTBUG-73309
Change-Id: I257f341cef9381f140aa4d4f68376c5edadc39cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-05 08:24:45 +00:00
Tor Arne Vestbø
850c922036 macOS: Don't deliver update requests for windows that need display
If a window needs display due to e.g. being resized, we need to wait
until the corresponding expose event has been delivered before we
resume update requests, otherwise the update requests may result
in partial paints that do not fully cover the area needing display.

Change-Id: Ibfb54bfe3c2e85b606ef67d34a6a5fdb85456edd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-02-04 21:53:54 +00:00
Andy Shaw
9435526d50 qmake: Add variables for setting the version number and name in Android
This makes it much easier to have the version information set for an
Android APK without having to manually modify the AndroidManifest.xml
each time.

[ChangeLog][Android][qmake] Can now set the version name and code for
Android using ANDROID_VERSION_NAME and ANDROID_VERSION_CODE respectively
in the pro file.

Change-Id: Ie6813bc3a7444f7baa5e772b93bc2695d9b81e57
Done-with: Markus Maier <markus.maier@rosenberger.de>
Reviewed-by: Markus Maier <markus.maier@rosenberger.de>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-02-04 16:57:07 +00:00
Joerg Bornemann
29d5a287ab Make the Makefile a dependency of default targets for nmake
If the user changes the .pro file, the Makefile is supposed to be
re-generated by calling qmake again. NMake however lacks a "Makefile
remake feature" like GNU make has.

The generated Makefiles for nmake however have already a proper
Makefile target that can be used to re-generate the Makefile. What was
missing is the dependency from an entry-target in the meta-Makefile.

Now changes in the .pro file trigger a re-generation of
Makefile.Debug/Makefile.Release when calling nmake without target
arguments or with "debug" or "release".

Fixes: QTBUG-29193
Change-Id: I9f2dd5deba4a043ab6c9502bb0b0ba83dc843612
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-02-04 08:10:25 +00:00
Yuhang Zhao
3bf895c8d5 qtmain_win.cpp: Remove unused header files
1. Removed all Qt header files and make it a pure win32 project because it doesn't use any Qt features.
2. According to MSDN, CommandLineToArgvW is in shellapi.h, so replace ShlObj.h with it.

Change-Id: I3daacb97f34664ac36f8e887a2c31d38f611b16e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-04 01:58:42 +00:00
Yuhang Zhao
aea357c6bd qtmain_win.cpp: Improve coding style
Change-Id: I08c722f4ff8a088d13af5b7d9cfbc88258d533ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-03 12:23:04 +00:00
Yuhang Zhao
fd1ebef13e qtmain_win.cpp: Replace NULL with nullptr
Change-Id: I727a07a3c56c97cf6f18929b2440f49f0cbb860d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-03 06:43:34 +00:00
Christian Ehrlicher
ae44da62ef QtGui: replace 0 with \nullptr in documentation
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.

Change-Id: Ieffbfffa76e3018257b667a3e8ad6e3b88486cde
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-02 12:49:45 +00:00
Christian Ehrlicher
2bfb89e133 QtWidgets: replace 0 with \nullptr in documentation
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.

Change-Id: Id8056dc2364a372e40bc04e8cb9fcc443e49fb18
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-02 12:49:39 +00:00