Commit Graph

38664 Commits

Author SHA1 Message Date
Morten Johan Sørvig
c1f4286a5c Wasm: Implement QThread::idealThreadCount()
Read the navigator.hardwareConcurrency property.

Task-number: QTBUG-64625
Change-Id: I2ad582b67e4b0ddac3e3c21febab55543b2e1d6d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 16:14:31 +00:00
Morten Johan Sørvig
de4f256d48 Wasm: enable thread support
configure.json: Make the “thread” feature be allowed
for wasm but disabled by default.

Change qmake.conf and wasm.prf to enable Emscripten
pthreads mode:
- Add USE_PTHREADS=1 linker flag
- Add PTHREAD_POOL_SIZE linker flag with a default pool size (4).
- Add TOTAL_MEMORY linker flag to set available memory (1GB)

It is possible to override options such as PTHREAD_POOL_SIZE
from the application .pro file using QMAKE_WASM_PTHREAD_POOL_SIZE
To change TOTAL_MEMORY, use QMAKE_WASM_TOTAL_MEMORY

Make qtloader.js work in pthreads mode:
- The Module.instantiateWasm callback must provide the module
  in addition to the instance to Emscripten.
- Set Module.mainScriptUrlOrBlob so that the pthreads web workers
  can access the main script

Task-number: QTBUG-64625
Change-Id: I1ab5a559ec97c27c5fc24500ba5f863bcd275141
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 16:13:26 +00:00
Morten Johan Sørvig
6e7a7d5fb9 Wasm: enable source map support for debug builds
The source map location can be configured by setting
QMAKE_WASM_SOURCE_MAP_BASE in the .pro file. Fall back
to “http://localhost:8000” if not set.

Task-number: QTBUG-72002
Change-Id: I9da80dacdefc272f267e5db4caac274d93ba4479
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 16:11:23 +00:00
Allan Sandfeld Jensen
60addee938 Improve ARGB32ToRGBA64 conversions
Improves the precision so 255 values map to 65535 exactly.

Change-Id: I366f408e8c6047d52acbed35e9d665249bbaba2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-07 14:27:47 +00:00
Morten Johan Sørvig
928cab5ff1 wasm: add public API for local file access
The web sandbox restricts access to the local file system,
which means Qt needs new public API to provide such
access to applications.

This adds a new static, asynchornous getOpenFileContent()
function to QFileDialog, which will show a file dialog,
read the file contents once a file has been selected, and
finally call the user-provided callback with the selected
file name and file data.

  auto fileReady = [](const QString &fileName, const QByteArray &fileContents) {
    // Process file
  }
  QFileDialog::getOpenFileContent("*.*", fileReady);

This API can be expanded in at least two ways in the
future: allow reading multiple files, and allow file
streaming by returning a QOIDevice.

Change-Id: I011b92fbcf21f0696604e66b7f9eb265c1a07aaa
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-02-07 06:49:31 +00:00
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
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
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
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
Christian Ehrlicher
860bfc69e4 QtGui/QPainterPath: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - addRoundRect()
 - subtractedInverted()

Change-Id: I4707c07e983a4ac65ec3706d25b09ec01a9de62c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-02-02 12:49:34 +00:00
Christian Ehrlicher
e56401818b QtGui/QPainter: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - initFrom()
 - setMatrix()/matrix()/deviceMatrix()/resetMatrix()
 - setWorldMatrix()/worldMatrix()/combinedMatrix()
 - setMatrixEnabled()/matrixEnabled()
 - drawRoundRect()
 - setRedirected()/redirected()/restoreRedirected()

Change-Id: I0daed72c0ef06c192309f02366a7201154e75ac9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-02-02 12:49:30 +00:00
Christian Ehrlicher
daee9af969 QtGui: mark obsolete QPixmapCache::find() functions as deprecated
QPixmapCache::find(QString) and QPixmapCache::find(QString, QPixmap&)
are deprecated since Qt4 times.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: Iaf185f69afe02203559a1c812fbb4a95c9049a1d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-02-02 12:49:25 +00:00
Christian Ehrlicher
df39627fa3 Examples: cleanup foreach usage
Replace deprecated foreach macro with range-based for loop

Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-02 12:49:19 +00:00
Giuseppe D'Angelo
7847e6bc02 Enable deprecation warnings by default
With Qt 6 in sight, people need to start moving away from
their deprecated APIs, as we want to remove them all in 6.0.
We are marking deprecated APIs with deprecation attributes,
but by default we're disabling deprecation warnings, making
them an opt-in by the user.

We need to do the opposite: make deprecation warnings enabled
by default, and have an opt-out define.

[ChangeLog][QtCore][Important Behavior Changes] Qt now
enables by default warnings when using APIs marked as
deprecated. It is possible to disable such warnings by
defining the QT_NO_DEPRECATED_WARNINGS macro. The old
QT_DEPRECATED_WARNINGS macro which was used to enable
this warning now has no effect (warnings are automatically
enabled).

Task-number: QTBUG-73048
Change-Id: Ie2b024fd667eb876b6ac9054cbbbc5a455cb9d5c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-02 02:31:05 +00:00
Paul Wicking
2bc362c9fa Merge dev into 5.13
Change-Id: I8113c6d8735a151bd152e6096f8c8b8e63a05474
2019-02-01 13:33:26 +01:00
Friedemann Kleint
5de981d3bc QtNetwork: Fix some messages in OCSP stapling
Amends a8412dc020.

Task-number: QTBUG-12812
Task-number: QTBUG-17158
Change-Id: Idcdf9ad39a43373097e2c3f31a62ce1b3cb46c22
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-02-01 10:35:09 +00:00
Ryan Chu
481db443d5 Regenerate TLS certificates after docker machine resumes
After the system reboots, the docker machine is created, but in a
stopped state. As stated in the docker docs, you might get errors when
attempting to connect to a machine or pull an image from Docker Hub.

For instance, Error checking TLS connection: ...

The solution is to regenerate TLS certificates of docker machine after
machine resums.

Change-Id: I8781ac0f0790aeda6cc778aee9c44d03c2b788d3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-01-29 12:56:38 +00:00
Friedemann Kleint
201dde1f31 QFileDialog: Fix deprecation warning
Fix:
dialogs/qfiledialog.cpp:3698:43: warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
    dir = getEnvironmentVariable(path2);

Change-Id: If8d93374cf2900974bcbd14caf2b1ef488409518
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-01-29 11:26:46 +00:00
Mårten Nordheim
698078680f Schannel: Add ALPN support
[ChangeLog][QtNetwork][SSL] The Schannel backend now supports ALPN and
thus HTTP/2.

Change-Id: I1819a936ec3c9e0118b9dad12681f791262d4db2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-28 21:35:11 +00:00
Christian Ehrlicher
004d7168a3 Cleanup Widgets examples - includes
Cleanup the Widgets examples - adjust includes to Qt coding style and
remove unused includes and formward declarations

Change-Id: I9f2e513284ad631337ff52ec9c0b98645055dcca
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:43 +00:00
Christian Ehrlicher
64b2eb7490 Cleanup Widgets examples - replace foreach
Cleanup the Widget examples - replace foreach with a standard for loop

Change-Id: I59cb2bf4494201f9f0228b07a8bb936ce40da46f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:39 +00:00
Christian Ehrlicher
f9e6f8efda QtGui: mark some image functions as obsolete
Mark functions which were obsolete since Qt4 times as deprecated so they
can be removed with Qt6:
 - QBitmap::transformed(QMatrix)
 - QImageIOHandler::name()
 - QImageWriter::setDescription()
 - QImageWriter::description()
 - QPixmap::fill()
 - QPixmap::grabWindow()
 - QPixmap::grabWidget()
 - QTransform::det()

Change-Id: I8523065eb59a3242c4c4c195f31ae15c4dcbf8f7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-01-28 19:37:36 +00:00
Christian Ehrlicher
8f65160c44 QtGui/Text: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
 - QTextFormat::setAnchorName()/anchorName()
 - QTextList::isEmpty()

Change-Id: Ic1f5317980d116c846def3645d2a6cd61ba8679d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-01-28 19:37:33 +00:00
Christian Ehrlicher
4ee8f75572 QtBase: 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: I914b6b2151554c06acc2d244eff004524cbb9a82
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:30 +00:00
Christian Ehrlicher
9f971ca816 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: I8d7e9c838da1399988a830669d58fc7f2f010696
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:26 +00:00
Christian Ehrlicher
6298850293 QtCore: 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: I101a61f5fad71cadb73bba9a8fd5dce6cc0836d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:22 +00:00
Liang Qi
e3621dd6bd Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2019-01-28 19:30:32 +00:00
Ryan Chu
71cd5a6f36 Select single-name SSL certificate for test servers using host network
On Windows and macOS, the containers are deployed into a virtual
machine using the host network. All the containers share the same
hostname (qt-test-server), and they are connected to the same network
domain (local).

When running test in such platforms, use the single-name SSL certificate
(qt-test-server.local) for SSL related tests.

Change-Id: Idf33e01e8dd8814510d848b87b59b5fc0edc903e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-28 14:03:34 +00:00
Mårten Nordheim
d8d60696da QSslSocket: Fix isMatchingHostname when the CN is an IP Address
Change-Id: Id083c1434fcb3a64af40e6f8df720719c1029ca7
Fixes: QTBUG-73289
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-28 14:03:30 +00:00
Christian Andersen
6a7e2fedef Windows: improve QTimer::remainingTime when called before processEvents
This checks that intenalHwnd in QEventDispatcherWin32::remainingTime is
initialized. If calling remaningTime, before createInternalHwnd
is called, the timeout member in the WinTimerInfo struct is not
initialized and contains a random value. This adds a check for that and
in that case returns the requested timer interval as the timer has not
yet been started. createInternalHwnd is called on the first request to
process events.

It also adds a test for checking the remaining time. But the issue can
only be seen if solely running the remainingTimeInitial test in
tst_QTimer. If running the test along side another test the other
test likely calls processEvents indirectly, which hides the issue. I
don't know if this is an issue in practice (the bug has been there
for as long a the git history goes back, 2011), but it causes the
basic_chrono test to fail if run as the only test.

Change-Id: I05c35105da778912dedf8d749aa7c953841d986e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-28 06:34:03 +00:00