Commit Graph

26078 Commits

Author SHA1 Message Date
Thiago Macieira
67030038f3 Doc: explain how QXmlStream{Reader,Writer} deal with encoding in QString
QXmlStreamWriter does not: it just writes the QString inputs to the
output.

QXmlStreamReader does: it first converts the QString to UTF-8 and stores
locally. Then it tries to decode using the XML encoding header.

Change-Id: I39332e0a867442d58082fffd1503d7652cb9fbff
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-26 20:59:56 +00:00
Thiago Macieira
a6b697ca13 Create corelib/serialization and move existing file formats into it
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.

Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-26 20:59:50 +00:00
Christian Ehrlicher
6578946245 QListWidgetItem/QStandardItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QListWidgetItem/QStandardItem
setData() functions

Task-number: QTBUG-55903
Task-number: QTBUG-63766
Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-26 19:58:26 +00:00
Friedemann Kleint
0901d4290f QFileSystemModel/Win: Fix file system operations failing due to watchers
File system operations like renaming/removing may fail on Windows when
file system watchers are present. Add functions to
QFileSystemModelPrivate to temporarily remove the watchers prior to such
operations and to restore them in case of failure. Use them for
rename/remove (within a feature check for QFileSystemWatcher
and Q_OS_WIN).

Task-number: QTBUG-65683
Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-26 11:36:30 +00:00
Lars Schmertmann
f55c73ede2 Introduce QSslConfiguration::backendConfig
With this change it is possible to use all supported
configurations in different backends without any new interfaces.

Change-Id: Ib233539a970681d30ae3907258730e491f8d3531
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-26 11:34:02 +00:00
Thiago Macieira
9061b7bde0 qsimd_p.h: Reorganize and simplify the x86 intrinsics #includes
All of our compilers support #include <immintrin.h>, so we don't need
the legacy code that includes the earlier versions.

Change-Id: I938b024e38bf4aac9154fffd14f80214d1d744c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-25 21:19:25 +00:00
Allan Sandfeld Jensen
5927acaf65 Add support for converting from std::variant
Adds inline handling of the C++17 type std::variant, so the type will
be resolved if converted into a QVariant.

Change-Id: I31809d70d7f347277389d42a3695836ec7a32d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-25 11:21:32 +00:00
Thiago Macieira
43c44d05ca Update the overflow functions to include qsizetype
Commit 29bc68cf16 added support for
unsigned and commit 5ff7a3d96e later added
support for int. This commit adds support for qsizetype, which isn't int
on 64-bit platforms.

We do this by reorganizing the code and using the generic version of
__builtin_{add,sub,mul}_overflow from GCC 5 and Clang 3.8, which ICC 18
seems to support now too on Linux. That leaves older versions of GCC and
Clang, as well as MSVC, ICC on Windows, and the GHS compiler, to use the
generic implementations, as I've removed the assembly code those
versions of GCC and Clang on x86 are now uncommon.

Note: any older version of ICC probably breaks. We only support the
latest.

Change-Id: I9e2892cb6c374e93bcb7fffd14fc11bcd5f067a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-24 21:13:20 +00:00
Allan Sandfeld Jensen
34e8cafa29 Document the new qfloat16 functions with the other qfloat16 functions
Change-Id: I82d3fcda44a9a49d9027d865f8ed200134d0f79e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-24 21:13:08 +00:00
Allan Sandfeld Jensen
933eac9645 Correct since value of QNetworkRequest::Http2DirectAttribute
It did not make it into 5.10 as far as I can tell.

Change-Id: I01f950c476f2c98f4ed40d2cafd15ecc112a3427
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-24 21:12:59 +00:00
Gabriel de Dietrich
1e905927f0 QMacStyle: CE_Splitter is HITheme-free
Change-Id: I96a5ba5d685d1b8f95fd11489e4e95096d0fa9a4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-24 21:12:25 +00:00
Gabriel de Dietrich
86821094a9 QMacStyle: declare block in drawNSViewInRect() as noescape
Change-Id: Ida67a963ab62c6b974eceeaf9d386b941f357798
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:17 +00:00
Gabriel de Dietrich
0c974c0169 QMacStyle: PE_FrameLineEdit is HITheme-free
CT_LineEdit is as well, so that makes QLineEdit free
of HITheme APIs.

Change-Id: Ia02ce9f1003e5ae9c8bf47dab9ada030feca98ba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:11 +00:00
Gabriel de Dietrich
ce60d9965e QFusionStyle: Properly draw frameless editable combo boxes
Change-Id: If0b6f15dc0a1de38edec5b360b1b8b698d6ad5b8
Task-number: QTBUG-65728
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:11:51 +00:00
Albert Astals Cid
ae3a65122f cups: Clear cups options at the start of QPrintPropertiesDialog::setupPrinter
For some reason the cups options are kept globally instead of per printer at QCupsPrintEnginePrivate
so when setting the printer options on accepting the print dialog, we first need to clear them
and then call the other functions that set them, otherwise, we will "reuse" cups option set on
the previous print.

How to reproduce:
 * Open print dialog, set some advanced option to a non default value, easiest one is print in grayscale
 * Print
 * Check it prints in grayscale
 * Open print dialog, check the advanced options are all on default values
 * Print
 * Check it incorrectly prints in grayscale

Change-Id: I59aacaf30db844ad40887d6b771f9354557852b6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-24 21:10:09 +00:00
Friedemann Kleint
cb142954c5 XCB: Implement native window dump for diaglib
Extract a helper function to determine the window title from QXcbConnection
and add an invokable function to the native interface that dumps the window
tree similar to existing functionality on Windows.

Change-Id: I5544d69ea2b801eb16d3b5b8d64021b3e567b0d8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:39:16 +00:00
Friedemann Kleint
8e3c6f165b Improve debug formatting of QInputMethodQueryEvent
Add more queries, output the query enumeration value
and output the hints as flags.

Change-Id: Icfc648a8d6e144074455ecebae1b25c3c3e1063e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:38:56 +00:00
Yulong Bai
2a3f226e32 QMenuBar::mouseReleaseEvent: fix triggering hidden actions
While menubar actions are hidden, as menubar was too narrow
to contain them, by clicking the blank area, where the action
was supposed to place, can still trigger the action.

Task-number: QTBUG-65488
Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-24 14:24:41 +00:00
Martin Smith
4ca0d76454 doc: clang-qdoc must not see certain function declarations
The macro Q_DECLARE_INTERFACE declared some qobject_cast() functions
that clang-qdoc must not see in the contexts where the macro is used.
This update prevents that from happening by ensuring that Q_CLANG_QDOC
is not defined when the macro is defined.

This update also adds a \fn command for a declaration of qobject_cast()
that was missing in the documentation. There are two versions of the
function, one with a const parameter and one with a non-const parameter,
and they both share one qdoc comment.

Change-Id: Ic74d0aaae62767cd0391474ee95ae3f4f820b06e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:02:08 +00:00
Martin Smith
f28d0d8ae8 doc: Add documentation for swap() functions
The functions had been added without documentation.
This update adds the documentation.

Change-Id: Ib29e9356b26c248b5fcc9f13ecf77371fbae054a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:58 +00:00
Martin Smith
f30d733d1c doc: Add more missing return types to \fn commands
Added missing return types to \fn commands and removed
some unnecessary \internal comments.

Change-Id: Ie6691f83a1c510134d1e83c3d98758360a67217e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:50 +00:00
Martin Smith
f53cbd2688 doc: Fix a property declaration for clang-qdoc
The * must be adjacent to the type for clang-qdoc.

Change-Id: Icc3dedcb2f4cd426993901b8f3003c942e753c68
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:42 +00:00
Martin Smith
43fbf30efa doc: Fix many qdoc warnings, mostly missing return types
Fixed many cases of missing return types in \fn commands.
Added a fake GLxxx typedef for a GL type that wasn't there
because the GL includes weren't accessible. Also added some
fake declarations for a few functions declared in namespace
Qt in QtWidgets that must be seen by qdoc in QtCore.

Change-Id: Id82476042d0563d32fa85c4ae81a58c1298a468a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:26 +00:00
Anton Kudryavtsev
d5aaa5635c QOffscreenIntegration: add missing override
Change-Id: I8165b44e28bd8da637e75e5b11bc429cdf2deb02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-24 08:48:33 +00:00
Friedemann Kleint
43b9c9b993 QDockWidgetTitleButton: Limit icon size to dpiScaled(10) on Windows
Adding larger pixmaps to the icon caused the icon to grow.

Task-number: QTBUG-38776
Change-Id: I29148d70afa55e287f2ad254e449a98c4aa631fb
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:46 +00:00
Friedemann Kleint
d58162127a QCommonStyle: Add dock title bar icons
Add larger pixmaps for the dock title bar icons; override
them by the XPM in fusion style to maintain the behavior.

Task-number: QTBUG-38776
Change-Id: I7d0e022bbf620d2aad2b6ee011b8bb9a745d7c3b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:35 +00:00
Friedemann Kleint
f61304fc77 Rename existing dock title icons to contain "macstyle"
Make way for adding dock title icons to QCommonStyle.

Task-number: QTBUG-38776
Change-Id: If1729478f55f0bce5e04399d0cca98afd2facb31
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:32 +00:00
Andy Shaw
efec288f58 itemviews: When an index widget gets focus, update the current index
By ensuring that the current index follows the focus of an index widget,
we can ensure that moving the cursor will happen in the way that is
expected from the focused widget.

Task-number: QTBUG-27793
Change-Id: Ia36891a94ce41c7d12fba678de23a6f3b69374ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-01-22 09:50:03 +00:00
Anton Kudryavtsev
6f9c5c85ca QTextItemInt: replace 0 with nullptr
While touching the code, move initialization from
body of ctor to initializer list

Change-Id: Idfcb4fb771d1414268f8685874395ca54b20621a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-22 08:20:13 +00:00
Yulong Bai
4d898a73e6 QMenuBar: Fix repetitive emission of triggered() when using addAction(QString)
The action which added by QMenuBar::addAction(const QString &text) already
connected relevant signals and slots implicitly, however, while
QMenuBarPrivate::updateGeometry -ing, it reconnects them
if there's a extension button associated with a hidden popup menu.
In that case the QMenuBar::triggered would be fired twice.
Since the QAction's ownership may be changed or added dynamically,
there are still very rare cases like several widgets share the same
QAction object to result in this problem.

[ChangeLog][QtWidgets][QMenu] Fixed a bug in QMenu that caused QMenuBar::triggered
to be fired multiple times.

Task-number: QTBUG-25669
Change-Id: I4d52e82a2136a992e0b37118e41237d96a2c5d22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-21 17:54:47 +00:00
Liang Qi
b3e7e9b182 Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-21 15:39:37 +00:00
Frank Richter
2e5294883b Windows QPA: Avoid 'large' mouse cursors over RDP
On some combinations of RDP client and server a large mouse cursor
results in a hang of the RDP session. However, the 'touch' drag
facility (creating a transparent window) works just fine, so use
that when encountering a large cursor on RDP.
(The threshold of 96 for a 'large' cursor was extracted from the
spec, as that is the largest supported size mentioned.)

Change-Id: I9782c45e8bd6640f36bb5a392961681a99e214e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-21 11:08:12 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
2018-01-20 22:36:19 +01:00
Martin Smith
5e8bc07cb2 doc: Fix several minor qdoc warnings
The fixes included undocumented enum values, which are now
marked as omitted, adding a test for Q_CLANG_QDOC for a
couple windows enum values, adding \fn commands for a pair
of member functions in QLocale, and a \fn command for an
obsolete function in QSqlError.

Change-Id: I12a8ea7287039096b9cfe7870d2ab213a3d78dcf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 13:54:37 +00:00
Martin Smith
99dc25c686 doc: Fix all remaining non-link qdoc warnings
The fixes included adding missing '!' characters to qdoc comment
markers, correct misspelled words, adding documentation for an
anonymous enum type, and replacing Q_QDOC with Q_CLANG_QDOC.

There remain 12 qdoc link warnings in QtBase.

Change-Id: I00447722e6e029f5aed273b3cd571cef33c119b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 13:54:22 +00:00
Igor Mironchik
046622cdf3 Fix explicitly set width not being respected
The size of the QStaticText was always adjusted, even if setTextWidth()
was used. Now size of the QStaticText is calculated according to
the set width of the text, and if no width was set, then the
automatically adjusted size is used.

[ChangeLog][QtGui][QStaticText] Fixed explicitly set width not being
respected.

Task-number: QTBUG-65836
Change-Id: If2f9f6952fb168f4bcb6d8fabfdc7360f8a36485
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-20 11:22:53 +00:00
Alex Trotsenko
1303327a71 QNativeSocketEngine: fix typo in warning message
Change-Id: Ic53a8a53b882f1e6b6434b943fff0a6fcd95f341
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 10:52:01 +00:00
Allan Sandfeld Jensen
dd58ddd5d9 Add rvalue overload of insert/prepend to QVarLengthArray and QVector
Improves performance and STL compatibility by adding rvalue versions
of prepend and insert.

[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads of
prepend and insert.

[ChangeLog][QtCore][QVector] Added rvalue overloads of prepend
and insert.

[ChangeLog][QtCore][QVarLengthArray] Can now contain movable but
non-copyable types, such as std::unique_ptr.

Change-Id: I6c946acc5b67502c91c52ac5dea67cedb1af93a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-20 09:27:14 +00:00
Igor Mironchik
0d23b7f074 Use QColor(0, 0, 0, 0) to mark body text in QStaticText
QStaticTextPrivate::paintText() now uses QColor(0, 0, 0, 0) to mark
body text. QPainter's pen color was used before this commit
(that was always black) that leads to different colors of body text if,
for example, links are in body (first block painted with correct color
set by QPainter::setPen() but after link body text was always black).
Now QPainter::drawStaticText() will draw body text with set pen in
any case.

[ChangeLog][QtGui][Important Behavior Changes] Fixed a bug where
QStaticText would not use the QPainter's pen color for text when other
text colors were also in use. Internally this reserves
QColor(0, 0, 0, 0) for use with QStaticText.

Task-number: QTBUG-45957
Change-Id: If3e180e3083cdac1b4236e738acd15572f19ab69
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-20 09:23:30 +00:00
Lionel CHAZALLON
276ec1ab00 eglfs/kms : implement nativeResourceForScreen
This will return the crtc_id for the given screen.

Change-Id: Ia4510a730e2d98c705f382644e2ab5a432612c02
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-20 07:01:08 +00:00
Lionel CHAZALLON
731651af99 eglfs: Forward nativeRes.ForScreen.() to backends
Change-Id: I928f97483806ee74ca844941eed455ff4f9d9508
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-20 07:00:31 +00:00
Edward Welbourne
1d2e3a5452 Don't try (Any,Any,Any) before a partially-specified locale
We unconditionally tried Any-ing out various tags of a locale without
checking the remainer weren't Any, which would get us the C locale in
some cases where we might have done better.  So check some retained
tag isn't Any before Any-ing out any tag.

In the process, add a separate variable for the ID with likely tags
filled in, to distinguish it from the supplied localeId (thereby
somewhat clarifying what's afoot) and save duplicating the
construction of this.

Task-number: QTBUG-64940
Change-Id: Ibd9f1aba6862434cf00fbf77ba00288ac9a50a3b
Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-19 13:57:25 +00:00
Allan Sandfeld Jensen
0ffc39806e Fix cast-function-type gcc 8 warning
Gcc 8 now warns against casting functions taking references to
functions taking pointers:

warning: cast between incompatible function types from ‘QVariant (*)(const int&, const int&, double)’ to
‘QVariant (*)(const void*, const void*, double)’ [-Werror=cast-function-type]

Suppressed by casting over void(*)().

Change-Id: I48bee53253b8e87110e8a49efa761fc2add89c5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 18:22:44 +00:00
Christian Ehrlicher
e6fa35ff14 Sync QItemDelegate::doLayout with QCommonStylePrivate::viewItemLayout
QItemDelegate::doLayout added a margin after the checkbox which is not
done within QCommonStylePrivate::viewItemLayout. This created a small
but visual difference between using QItemDelegate or QStyledItemDelegate.
The additional margin was removed from viewItemLayout somehwere between
4.4 and 4.5 so it was intentional.

Change-Id: I2fc3f287fe8b181355edeebec9626c49d85fe74d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-18 18:01:39 +00:00
Martin Storsjö
bfc96c9c0e Only define QT_FASTCALL on x86_32
The __fastcall calling convention is silently ignored on other
architectures. The GNU attribute regparm is allowed but doesn't
make sense on x86_64. On other architectures, the attribute isn't
supported at all.

This fixes building with clang for MinGW/ARM and ARM64.

Change-Id: Ice1c6eadd0e90b2e5e34736542ee49a25dc67fe6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 16:02:07 +00:00
Allan Sandfeld Jensen
0ed471419a Fix gcc 8 string-op-truncation warning
Don't use the full size of dest in strncpy, we override the last byte
anyway afterwards.

Change-Id: I9f1618cc9019e0060f01deed58a726caa1989d3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 16:01:29 +00:00
Morten Johan Sørvig
4944f4d57c Cocoa: Prevent crash on focusObjectChanged()
Don’t crash on focusObjectChanged to a QWindow with
a null QPlatformWindow.

Change-Id: Ibf426521d6c8f8b2b2e94d5b92020fa510a74133
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-18 12:44:31 +00:00
Anton Kudryavtsev
f0c38af8a7 QFontEngine: use QStringBuilder more
Change-Id: I7dd00080962a245e5fc67ef623d7b3a4dab69c80
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-18 11:33:37 +00:00
Friedemann Kleint
d4079b0797 uic: Support id-based translations
Use Ids from newly introduced id attribute depending
on the global form setting.

Change-Id: I0a5094d5543c0714c88511fa159b60afc9be3c81
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-18 11:31:09 +00:00
Martin Storsjö
8072c36eeb Skip arm pixman drawhelpers on windows just like on ios
Windows on arm (which uses clang, or msvc, but no gcc is available for
that setup) can't assemble these sources.

(On linux, builds with clang force deferring it to the external
assembler, but for windows on arm, no gas compatible external
assembler is available).

Change-Id: I139572257884cfdc57d3c32061a8c2e28c6e24de
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-18 10:32:57 +00:00