Commit Graph

34946 Commits

Author SHA1 Message Date
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
4cce7dc19d Test Russia's post-DST transitions are reported correctly
This is a regression test for bugs resulting from failure to take
account of the MS TZ APIs fake-DST handling of standard-time
transitions happening during DST.  Has to skip the 2014 test on Win7,
as it's so old it doesn't know about the (for it) "future" transition.

Task-number: QTBUG-42021
Change-Id: I853b86d03a86f0269371bf1622bf63882fb8ee5d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-19 13:57:38 +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
Martin Smith
0f9f716f36 doc: Remove inappropriate qdoc comment markers
Removed the '!' from two comments because the functions being
documented are static functions declared and defined in the
.cpp file. They are not public.

Change-Id: Ie3b2c32c64102634b6b2a4c438da191536a426d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-18 18:25:27 +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
Nico Vertriest
8688f2d4ab Doc: add doc to Anchor Layout Example
Task-number: QTBUG-60635
Change-Id: Iec6cae8c3caeac4bfabddae79b6ed2b47c5f2edf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-18 09:24:39 +00:00
Martin Smith
1c8f7082f7 doc: Add missing return types to \fn commands, fix mis-specified ones
This update corrects several qdoc warnings about undocumented
parameters, which are actually caused when the return type is not
included in the \fn command, or when the return type is mis-specified
(includes static, or lacks needed template parameters).

Change-Id: Ic49139b88424e93609fbd01bc0836436d13a8f9a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-18 06:32:32 +00:00
Martin Smith
8b9b3e2f29 doc: Fix remaining qdoc warmings for Vulkan stuff
Several uses of #if QT_CONFIG(vulkan) were modified to
for classes QVulkanFunctions and QVulkanDeviceFunctions
was added to qplatformvulkaninstance.h, because the
include file that contains them doesn't exist when
vulkan isn't there.

Change-Id: I392202ab5fe9bb4c558a991870e6ebf79254aec0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:25 +00:00
Martin Smith
20be99dec5 doc: Add missing return types to \fn commands
Added void return type to several \fn commands.
The return type should always be included with
the \fn command in clang-qdoc.

Change-Id: Ie751eb1430eff668f33f8d86e0b1454bd1d2f582
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:16 +00:00
Martin Smith
e65caf92af doc: Remove qdoc marker from inside #if 0 block
clang sees the comments inside #if 0 blocks when they
occur in source files. Therefore qdoc comments can't
appear inside those blocks.

Change-Id: I5c9c7e9e002042710a5c26252bc7029b2d163dcf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:09 +00:00
Martin Smith
706e8a0295 doc: Fix remaining qdoc warnings in qabstractitemmodel.cpp
Some enum values were qualified with the enum name, which is not
required in the \value command. The qualifications were removed.

Change-Id: Ic67003ae04b558f437b331bd3e01af88ace0e888
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:01 +00:00
Martin Smith
52d761e60a doc: Fix remaining clang parsing errors in QtTest
This update also corrects all the remaining qdoc warnings
in the mnodule.

Change-Id: I1cea2cb1dd515d075a1e49a52ca78fc407c3a324
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:31:53 +00:00
Martin Smith
0a3061e871 doc: Fix remaining clang parsing errors in QtWidgets
Removed two unnecessary \fn commands. Also documented
a parameter correctly.

Change-Id: Ia2f22a76a18fc42127bd24b132750373675b6853
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:31:44 +00:00
Martin Storsjö
5eaecaa966 Undef interface in more places, fixing builds with libc++ on windows
After including windows.h, interface is a define that expands to
"struct" (unless WIN32_LEAN_AND_MEAN is defined). This name is
used as a normal identifier in multiple places within Qt.

This has already been worked around in a number of places
(in e.g. 3ba61d9baa and
786d23bb49).

After qrandom.h was included in <QtCore/QtCore>, this header
implicitly includes <random>. In libc++ on windows, this header
then transitively includes windows.h, exposing the clash with
the name "interface" in even more locations than before.

For cases within qtbase internals, it could also alternatively be
handled by defining WIN32_LEAN_AND_MEAN while building QtDbus, but
for occurrences in public headers, the undef trick needs to be
used.

Change-Id: I89754f38f55ae7f2145255a2c8a71b23492be6a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 04:44:44 +00:00
Albert Astals Cid
e0b769eeda Unix: Fix page size margins when changing page size
Change-Id: I55435cf500c656eeec61e6c61bbf195df356ffeb
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 21:36:47 +00:00
Albert Astals Cid
f56f47bc64 Unix: Fix default printer page size margins
Regressed with ff67dedaaf

Before ff67dedaaf the print dialog
would not let you select less margin than the minimum printer
supported margin, this brings back the old behavior

Change-Id: I22f4e8ebf8ffa7c1653d61b7073a9ee582cf453b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 21:36:41 +00:00
Christian Ehrlicher
ef60435d2f QCommonStylePrivate::viewItemSize: fix text height calculation
QCommonStylePrivate::viewItemSize did not adjust the width when the item
had a decoration or a checkbox. This lead to a too big width used for
the layouting and therefore sometimes the calculated height was too
small.

Task-number: QTBUG-30116
Change-Id: I4468daa9820b9a8aa00fe959ab9b73fec23cc24e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-17 19:08:11 +00:00
Christian Ehrlicher
ec7e870e70 QSortFilterProxyModel: annotate some deprecated functions as deprecated
QSortFilterProxyModel::clear() and filterChanged() are deprecated since
Qt4.3 but not annotated with QT_DEPRECATED.

Change-Id: Ia468203802b6be0596f0a48d51f1da3fa55b724b
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-17 18:16:00 +00:00
Gabriel de Dietrich
6df308c0d7 QMacStyle: Set WA_MacShowFocusRect for checkbox, radio button
This fixes small and mini checkbox and radio button
focus rings since the previous HITheme removal patch
(90c9370d50). But also allows to properly draw
the focus ring outside the widget's boundaries, as
it's common in macOS.

More importantly, we pave the way to use QFocusFrame
for most widgets and, eventually, implement the focus
ring animation.

Finally, we tweak the spacing between the indicators
and their respective label.

Change-Id: I4bf7ac1a06ce924a043f0365e487777d0b20a104
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-17 18:14:59 +00:00
Tor Arne Vestbø
7ade6ac3c0 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-01-17 12:22:58 +00:00
Friedemann Kleint
6e4a330d61 Cups Print Dialog: Change the message box titles to Caps
Amends 608301d4c8.

Task-number: QTBUG-1311
Change-Id: I01cd60f0676f4e0501d411151492b4f867653053
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 12:13:54 +00:00
Christian Ehrlicher
87a929cc9d QPrintDialog/Unix: compile with gcc 4.8
Passing parameters via auto to a lambda function is a c++14 extension
which is not supported by gcc4.8.

Change-Id: I335b2a2f5ba02f5440c2e7ccc81d4156e8b29484
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 12:01:44 +00:00
d3fault
1a4cc8d57b Add QIODevice::NewOnly and QIODevice::ExistingOnly OpenMode flags
When QFile::open is called with the NewOnly flag, the call will
fail if the file already exists. As usual, if the file does not exist,
it will be created. Like QTemporaryFile, there is a guarantee from
the operating system that you are not accidentally creating a new file
on top of an older file. When QFile::open is called with the
ExistingOnly flag, the call will fail if the file does not exist. The
ExistingOnly flag only provides new functionality when used with the
WriteOnly flag. For ReadOnly it provides no change in functionality,
as ReadOnly by itself already never creates.

Task-number: QTBUG-52244
Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-17 04:32:47 +00:00
Christian Ehrlicher
0aecac1dcf QItemDelegate::doLayout: only call QStyle::pixelMetric() once
QStyle::pixelMetric(QStyle::PM_FocusFrameHMargin) was called three times
in the worst case but it returns a constant value. Therefore cache this
value and call pixelMetric() only once.
Since this code is duplicated from QCommonStylePrivate::viewItemLayout()
also change it there.

Change-Id: I6d5f0a8d2b1373bd36f0520f404e6a3cb0794f12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-16 18:53:38 +00:00
Tor Arne Vestbø
ea7a9d694b logging: Factor out how to determine if a category is the default category
Change-Id: I00a94c8c3ce2c0cba5263e6fbc499794dc7ef38f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-16 18:02:02 +00:00
Andy Shaw
6121c40018 Cocoa: Use the whole geometry when in fullscreen mode for popup menus
When in full screen, then the geometry available is the whole screen
not including the menubar or dock area. This ensures that it does
not leave space for the dock area.

Task-number: QTBUG-39403
Change-Id: I15d7b7764d83282e1ee057628680a338b72711a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-16 17:02:10 +00:00
Renato Araujo Oliveira Filho
03c33a0d85 Move color/grayscale option to cups advanced panel
CUPS has a complex way to configure colors for printers, and this can not
be represented only by radio buttons.
Because of that all colors related options will be available only in
the advanced panel.
The color/grayscale option will still be available when printing to a file.

Change-Id: I1592e779009bd80b6dfc18dde760db4154e46439
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-16 17:01:39 +00:00
Martin Smith
41a6877fe8 doc: Fix remaining qdoc warnings in platformheaders
clang needed to see so type definitions that aren't there
for some platforms, so this update provides defaults when
qdoc is running.

Change-Id: I15e635b31dd651457f828f90c8dd132959c826e6
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-16 16:59:09 +00:00
Allan Sandfeld Jensen
d2bb79be5e Let XFCE use Xft settings
Task-number: QTBUG-56809
Change-Id: Idf6c2fc7b1520547d44d06a40f1f93278ef2d3e6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-16 16:16:44 +00:00
Nico Vertriest
b4aaf3abe0 Doc: revamp Animated Tiles example
Task-number: QTBUG-60635
Change-Id: Iceb53e7c0df88bb51589a1cc86e905dbc60a856e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-01-16 15:21:12 +00:00
Nico Vertriest
a24b4c7c8a Doc: add documentation to Blur Picker example
Task-number: QTBUG-60630
Change-Id: I228b8257839115c561529184faa75275c69bb8a8
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-01-16 15:21:02 +00:00
Tor Arne Vestbø
e2a546a18b Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
2018-01-16 11:48:55 +01:00
Erik Verbruggen
99b89d30fa Prevent O(n^2) behavior when calling QObject::deleteLater
When a deleteLater event is queued, a check if done if the same event
for the same receiver is queued before by scanning all pending events.
This leads to quadratic behavior, which is quite noticeable. By using
an unused bit in QObjectData, this can be prevented. Now the duplicate
event scanning in QCoreApplication is only done for the quit event.

Task-number: QTBUG-65712
Change-Id: Ie505acbbec802f91ebd0b94ac067e362c2476113
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-16 08:20:22 +00:00
Takao Fujiwara
53cbc3c5b4 IBus: Delete deprecated DBus APIs
IBus 1.6 will remove the deprecated DBus APIs; GetAddress() GetEngines()
These APIs are replaced with DBus GET properties.

Change-Id: I427494dd0685d523ac07366be528127d98ad7d7c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-16 07:30:00 +00:00
Andy Shaw
cb714248a8 Use font set in the style option if there is no font set in the rule
If the stylesheet does not have a rule that manipulates the font at all
for the menu item, then it should use the one passed into the style
option instead.

Task-number: QTBUG-65034
Change-Id: I6cae3fad3cc22d5ab2b984e4a58b14303bcd6d03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-16 05:08:04 +00:00