Commit Graph

35019 Commits

Author SHA1 Message Date
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
Gabriel de Dietrich
90c9370d50 QMacStyle: checkbox, radio button are now HITheme-free
This also fixes focus ring thickness on retina
displays except for radio button, for which we
don't allocate enough space around. Instead of
going down the push button madness we currently
have, we leave it as is (i.e., slightly truncated)
until we can come up with a more sane solution
regarding focus rings.

Change-Id: Icd4aa2e08c2558768c91efd7d119879e249b052f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-01-16 02:13:26 +00:00
Gabriel de Dietrich
909cac6174 QMacStyle: Use QPainter to draw focus ring
Using Core Graphics or AppKit has no real advantage.

Change-Id: Ie7e2df23f8da6ca4798092a7c074bbb2f40e2b18
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-16 00:26:27 +00:00
Tor Arne Vestbø
0be8f59d72 macOS: Copy QNSWindowProtocol without referencing it by name
The protocol may be namespaced, in which case the string lookup would
fail, so we iterate the protocols of QNSWindow instead (of which there
is only one, QNSWindowProtocol).

Change-Id: Ic45752c9e3a40f5d42ec82c4287402a3d7a47b09
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-15 19:03:11 +00:00
Eirik Aavitsland
f0cad9b612 Doc: Clarify auto detection of file format in QImage
The documentation of the QImage file loader methods contained a
simplified and somewhat misleading description of the format auto
detection algorithm. Fix up the language and link to the detailed
explanation.

Task-number: QTBUG-51596
Task-number: QTBUG-65438
Change-Id: I33ebc81c78e685c7ec4803fa56efd4e9cbc4eda5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-01-15 15:50:28 +00:00
Jarek Kobus
748836dae8 Don't generate QAction include unconditionally
Generate it only when the form contains some actions.

Change-Id: Ic1d64003ccff6102174771c04999cf7c90ac2ae8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-15 15:50:12 +00:00
Jarek Kobus
000c76ada5 Don't generate QButtonGroup include unconditionally
Add it only when ui contains button groups.

Change-Id: I60a249a36565e6c7c3f7cb51bc146317bc7ddbe5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-15 15:50:07 +00:00
Jarek Kobus
058474884c Don't generate QHeaderView include unconditionally
Generate it only when needed.

Change-Id: I7a89b18ec0f2ee7d55fcad1b3f9701269d7616ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-15 15:50:00 +00:00
Matt Whitlock
1d86e5f84a Add missing dead key symbols
Qt was missing symbols for many dead keys defined in <X11/keysymdef.h>.
These dead keys were thus ignored by the "compose" input module. This
commit adds the missing dead key symbols.

[ChangeLog][Linux/XCB] Added missing dead key symbols, enabling their
use with the "compose" input module.

Task-number: QTBUG-56452
Change-Id: Ib5c37168990c9d9fa99fdd50f63b934c793e8dc4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Matt Whitlock <qt@mattwhitlock.name>
2018-01-15 15:24:59 +00:00
Martin Smith
bcc1eaab70 doc: Fix remaining qdoc warnings in QtDBus
Added many template clauses to \fn commands. Also added or
modified some uses of Q_CLANG_QDOC in some dbus include files
to work around some seriousl ugly template clauses that could
not be added to \fn commands. Also modified a few parameter
names in the documentation.

The first attempt at making this change caused syncqt to fail
to create QtDBus/QDBusPendingReply. This second attempt works.

Change-Id: I96c1fb9bcb1d9debf9409f6baf8c42e18fb9e75d
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-15 15:00:58 +00:00
Orgad Shaneh
6e5edb5a15 XCB: Replace qDebug with qCDebug
Change-Id: I984c3e3288aa4d0b7185ea88ae0c4cf4627a2da3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-15 13:57:22 +00:00
Alexander Volkov
85aa0fd041 Introduce QIcon::fallbackSearchPaths()
... that will be used if an icon can't be found in the
current theme.

The Icon Theme Specification
https://standards.freedesktop.org/icon-theme-spec/latest/ar01s05.html
states that unthemed icons must be searched in the base directories,
i.e. /usr/share/icons, ... But in practice unthemed icons are
installed into /usr/share/pixmaps and this dir is not used as
a base dir for icon themes. So it's better to explicitly specify
fallback dirs to avoid needless access to the filesystem.

Also some KDE application install their own unthemed icons
(into /usr/share/<appname>/pics), that can't be found by
QIconLoader. With this change it would be possible for them
to specify dirs with unthemed icons and thus be displayed
correctly in non-KDE environments.

[ChangeLog][QtGui][QIcon] Added fallbackSearchPaths() that
will be used to find icons missing in the current icon theme.

Change-Id: I0dc55ba958b29356a3b0a2123d6b8faa24d4c91e
Task-number: QTBUG-33123
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-15 10:12:22 +00:00
Albert Astals Cid
537af27302 Simplify ifs since PP_WHITESPACE and WHITESPACE are the same
Change-Id: Ib18c60270d9275840db051f1eec86227cc8f6c1c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-15 10:11:31 +00:00
Olivier Goffart
66e56762e1 Test for leaks in QMetaObject::invoke with functors
Task-number: QTBUG-65462
Change-Id: Ifa9735f5610a6df3ceabd286a0321e87bbd05ca3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-14 22:36:27 +00:00
Thiago Macieira
57318ce8c2 QMetaObject::invokeMethod: don't leak the slot object
QMetaCallEvent references up, so we need to drop by one. In all other
cases, we need to drop the reference to zero and delete.

[ChangeLog][QtCore][QMetaObject] Fixed a memory leak that happened when
the new-style call to invokeMethod() was used.

Task-number: QTBUG-65462
Change-Id: I39332e0a867442d58082fffd15034b99e31c92a1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-14 22:36:20 +00:00
Tor Arne Vestbø
d1f2208eec Fix QNX 7 build
Missing return value after 114f795221.

Task-number: QTBUG-65747
Change-Id: I8881fc70f76a163e7b1f032c7a7485ab09f852b1
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-01-14 19:54:08 +00:00
Sergio Martins
e459130e70 qstylesheet: remove a few unneeded memory allocations
One foreach too many, creating a temporary container.
Converted to range-loop, as drive-by change.

Change-Id: Ie2bb94a7147edcfc0d8b5f479604f5ebe113d7cb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-13 12:21:02 +00:00
Martin Smith
f40cc95d05 doc: Add template clause to qstyleoption_cast functions
clang-qdoc requires the template clause in \fn commands
for template functions.

Change-Id: I4999fdbd3e12d883b5a4e0d68509cbcf919a31b0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:19:13 +00:00
Martin Smith
114d52ce49 doc: Remove several uses of '/' as continuation character
clang-qdoc doesn't need continuation characters in \fn commands.

Change-Id: I25e262451822e3d4e2bce8866bcbd5540458844b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:19:06 +00:00
Martin Smith
73cffd710c doc: Add missing template clauses in qitemeditorfactory.cpp
Added several missing template clauses to member functions.

Change-Id: I95b46de84c9afa74b74fc36818094b0fff41f755
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:59 +00:00
Martin Smith
d893ccf6cd doc: Add missing template clauses in qvulkaninstance.cpp
Added a few missing template clauses to member functions
of QVulkanInstance<T>.

Change-Id: Ie13f7e97f6a2183ee66d7ea275bc56a2bc3588e8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:51 +00:00
Martin Smith
3e0d24ded3 doc: Add missing template clauses in qmatrix4x4.cpp
Added a few missing template clauses to member functions
and friends.

Change-Id: Ie5ca557ddcc1dfd90ef5e80fc4e8213dfb32a03c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:42 +00:00
Martin Smith
a0eb5c3b32 doc: Add missing class qualifiers to uses of FormatRange
struct FormatRange is contained in QTextLayout, so uses of it as
parameters in friend functions of struct FormatRange must be
qualified with QTextLayout::

Change-Id: I6d3ad3020240bff3b948fb571971694b44708c54
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:32 +00:00
Martin Smith
b290b3336e doc: Add missing class qualifiers to uses of Tab
Tab is contained in QTextOption, so it needs that class qualifier.
Also removed a useless qdoc comment.

Change-Id: Ic37f0fc8cb97c2b022f69293e8fd50f0a5a2b649
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:22 +00:00
Martin Smith
0b637760a5 doc: Add missing class qualifier to \fn for constructor
A class qualifier was missing in a \fn command.

Change-Id: I0bb34912c0b33a3c615a6e9aef68e7e0cd28d037
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:18:09 +00:00
Martin Smith
64c0bff69a doc: Add QTouchEvent qualifier to uses of QTouchPoint
QTouchPoint is declared inside QTouchEvent, so \fn commands
for functions in QTouchPoint must use QTouchEvent::QTouchPoint::
as the qualifier.

Change-Id: I1dffe9f43f9f8bddbaa8fab9f77cf17802cf8b26
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 18:17:54 +00:00
Jake Petroules
13c71ac816 Fix memory leak in QStandardPaths::displayName() on Apple platforms
Task-number: QTBUG-65687
Change-Id: Ie795c8ac715e36656dabcbcdf8976d303ebaf0d1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-12 18:13:17 +00:00
Andre Somers
abbd26f553 Add QModelIndex::siblingAtColumn and ::siblingAtRow
Data in item models is most often organized in rows, where each column
contains an attribute of the item represented by the row. Often when
sibling is used, it is to request another piece of data from the same
row. Having a specialized version makes this easier and less awkward
to do, simplifying

auto sibling = index.sibling(index.row(), columnOfInterest);

to

auto sibling = index.siblingAtColumn(columnOfInterest);

For symmetry reasons, siblingAtRow(rowOfInterest) was also added.

Change-Id: Ib203b2cdb16154cbb2680d16fb5c6a7538f33d07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-12 15:12:53 +00:00