Commit Graph

26141 Commits

Author SHA1 Message Date
Martin Smith
dd3f7c5f2b doc: Correct remaining qdoc warnings in qchar.h and qchar.cpp
Several enum values had to be given \value statements, and a
member function only visible for Windows had to become visible
to clang-qdoc.

Change-Id: I47fbbcf9c5e4333abd13a041ce8fee2c13f9541d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-06 00:26:15 +00:00
Martin Smith
66a0fecfae doc: Correct remaining qdoc warnings in QStringView
Added missing template clause to \fn commands required by clang-qdoc.
Changed a few Q_QDOC macros to Q_CLANG_QDOC.

Change-Id: I20e6855b13df6384b471fc2bb5de27b0e3b44d1b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-05 20:22:13 +00:00
Martin Smith
81e4d039a9 doc: Correct remaining qdoc warnings in qstring.cpp
Added missing template clause to \fn commands required by clang-qdoc.
Removed several obsolete \sa targets. Added a few missing return types
to \fn commands.

Also changed a } to ] in a \fn command in qrandom.cpp.

Change-Id: I0f004a1e57507ff5fb035e822ca8b1baa7faad9b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-05 20:22:01 +00:00
Martin Smith
4d3c55aa31 doc: Correct remaining qdoc warnings in qstack.cpp
Added missing template clause to \fn commands required by clang-qdoc.

Change-Id: Id2cb480a0780025276639c38f595cb21264bd8cb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-05 20:21:49 +00:00
Martin Smith
d72705c96d doc: Correct remaining qdoc warnings in a few files
Added missing template clause to \fn commands required by clang-qdoc
in qsharedpointer.cpp, qscopedpointer.cpp, and qstringbuilder.cpp.

Change-Id: Ifca5b81db96e678a53e40080d351c69f14db604a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-05 20:21:37 +00:00
Gabriel de Dietrich
1e75dcf251 QStyleHelper: Use palette cache key in pixmap key
This reverts commit d7bcdc3a44.

Now that QPalette::setBrush() is a bit smarter (see
c564779c07), we can be
confident the palette's cache key won't change so often.
Therefore, we can use it again as part of every pixmap's
cache key.

Change-Id: I5cab2296a937f9149c7745291e0442eea24f4e9d
Task-number: QTBUG-65475
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-05 17:43:50 +00:00
Martin Smith
698fa094b3 doc: Correct remaining qdoc warnings in qscopedvaluerollback.cpp
Added missing template clause to \fn commands required by clang-qdoc.

Change-Id: Ia7bc899153cccedc28e5083d658f427d322acab7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-05 16:03:47 +00:00
Friedemann Kleint
53fae41e42 QWindowsXPStyle: Remove unused code
Fixes a deprecation warning about QDesktopWidget::screenGeometry().

Change-Id: Ib56b2d3f62ddca60d84b4f626571b5e444304804
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-01-05 15:46:32 +00:00
Albert Astals Cid
5e2f583a67 CUPS: Fix conflict handling
The previous code assumed that ppdMarkOption returning non zero (i.e. it has conflicts)
also meant that the option wasn't applied at the ppd level, but it actually is.

What we need to do is after calling ppdMarkOption parse the tree again looking
to see if any option is conflicting and mark it as such in the UI.

Change-Id: I836f1902d14dc8c176bb06776471cbf4ed11786f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-05 15:38:35 +00:00
Andy Shaw
5e9e4ccdc3 Add an option to scroll the QComboBox on macOS with the mouse wheel
Since there may be some applications that want to make their comboboxes
scrollable or not with the mouse wheel then a style hint is added to
make this toggable. It defaults to true for all platforms except macOS
to keep it in line with existing behavior.

[ChangeLog][QtWidgets][QStyle] Added SH_ComboBox_AllowWheelScrolling as
a style hint to enable/disable the use of the mouse wheel in a QComboBox.
This defaults to true in all styles except the macOS one so there is no
change in existing behavior.

Task-number: QTBUG-53094
Change-Id: I6eb61e1990bfc79e3b3ea82d7b91ee39096fa077
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-01-05 15:01:43 +00:00
Oswald Buddenhagen
2226f01d74 qlalr: fix description
amends 710875efde.

Change-Id: Ia5e9dd6f3b080b876e4dc1eb99f2b43d73999c04
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-01-05 10:32:20 +00:00
Mårten Nordheim
da81b01df8 Change use of qDebug to qCDebug
Task-number: QTBUG-65532
Change-Id: I8b6b8f04f5f6b63eb3c80f140710c8c05291986a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-05 09:37:57 +00:00
Friedemann Kleint
bef0db36ac QtPrintSupport: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: Ib87b2559d0d04fcfa70cabd134ac6936a3c2a261
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-05 08:32:21 +00:00
Thorbjørn Lund Martsum
d5a11a0ec2 Revert "QTreeView: Make sure QHeaderView is notified on layoutChanged()"
It caused some sorting issues.
This reverts commit 93dabeba9d.

Change-Id: Ie8c7f2d47885be6626ddb6284474a78dcf09cf33
Task-number: QTBUG-65478
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-05 08:22:30 +00:00
Allan Sandfeld Jensen
7e9460306b Update qurltlds_p.h
It has been a while and it is supposed to be updated at every release.

[ChangeLog][Third-Party Code] Updated top level domain-list from Mozilla

Change-Id: Ifd3e5fe33166e793908b3ce28d29a507b483dd8a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-01-05 08:22:23 +00:00
Oliver Wolff
9f2ce7e2f6 winrt: Remove -qdevel and -qdebug from command line parameters
These options are used by winrtrunner/Qt Creator to control logging
and debugging behavior and should not influence applications.
Without this change applications that use
QCommandLineParser::process have to explicitly remove these values
from the arguments list or the application will exit with an
"unknown option" error when run from Qt Creator.

As winrt applications do not natively support command line arguments,
breaking the use case of having these values as valid command line
options is acceptable.

[ChangeLog][qtmain][winrt] -qdevel and -qdebug are removed from the
command line arguments and not passed to the application.

Change-Id: I60e5565148fd3dd0155b946607fdf5042139d2e1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-01-05 07:37:20 +00:00
Martin Storsjö
f663c83f9d harfbuzz: Fix building for win64 with clang
Clang errors out on casting from a pointer to a smaller integer
type.

This is an adapted backport of a newer upstream harfbuzz
commit, 03b7a221f701a9b003890878e730ad175c3fdd86.

Change-Id: I0de62d90008021aed6acf4e946ce1d346f9aac8c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-01-05 07:34:23 +00:00
Friedemann Kleint
874c3e3c05 Direct2D: Replace class Direct2DVersion by QVersionNumber
Change-Id: Iad8c659a301c6d71b26964d84a67a51352712218
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-01-04 20:25:10 +00:00
Friedemann Kleint
3439f523b8 QtDBus: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: I0c0ba4e914a1f3b7a324c68c59544a5074f7b075
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-04 20:24:09 +00:00
Friedemann Kleint
98a3502fa5 QtSql: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: I1d0f89784f8fb698828e11ce39086501971f1756
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-04 20:23:54 +00:00
Friedemann Kleint
c9539f340e QtWidgets: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: I2ba95bde2b8bbcca1833dc14c344b9a14394bc1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-04 20:23:40 +00:00
Frank Richter
3edcd9420e Support legacy X11 keymaps
Not all X server vendors support the XKB protocol. Furthermore,
while X.org seems to use keycodes that match the usual keyboard
scancodes, other vendors may not do so. This means that using an
XKB keymap suitable for an X.org server results in garbled input
with servers for other vendors.
Both of these issues are addressed by using the core keycode
information as a fallback.

[ChangeLog][X11] Fall back to X11 core keycode information
if an XKB keymap could not be determined through the connection.

Task-number: QTBUG-44938
Change-Id: I64568aa31113d5a3fd90f70c63320a497db21477
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-01-04 19:47:53 +00:00
Gabriel de Dietrich
c564779c07 Make QPalette::setBrush() check before detaching
Setting the same brush on the same group and role should
not detach nor alter the result of QPalette::isCopyOf().

Task-number: QTBUG-56743
Change-Id: Ic2d0dd757d703b01e8c5d835a8c124b3317653f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-04 18:59:35 +00:00
Liang Qi
79dfc08437 Merge remote-tracking branch 'origin/5.10' into dev
Change-Id: I644cd82b0d952b7d139e0228bf5017f147db77e7
2018-01-04 19:49:26 +01:00
Liang Qi
4ef667d200 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3fa5c9e216201bdf7da260c395f65d7fb95cba0b
2018-01-04 17:24:18 +01:00
Albert Astals Cid
6efbd4381a CUPS: Fix advanced options cancel of the print properties dialog
When the user changes the advanced settings we call
setProperty PDPK_PpdOption so if the user cancels we
need to set them back to what they were originally

Change-Id: Idd0cb413fb1e68dd28cf66f7f66f7e0afb38393e
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-04 13:01:17 +00:00
Albert Astals Cid
030d815eb8 Refactor QPPDOptionsModel a bit
Make the members private and add getters
Make some other functions also private
Move setCupsOptionsFromItems from QPrintPropertiesDialog to QPPDOptionsModel

Change-Id: Ibb555a6e6be53550f30c159c3ad611d55e2a767a
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-04 12:54:53 +00:00
Martin Smith
8700c4dba7 doc: Correct remaining qdoc warnings in qfsfileengine.cpp
Removed a dupicate qdoc comment.

Change-Id: I43214c63bda3dd3ff398b173472306955f8a72b7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:51:51 +00:00
Martin Smith
68c432f90c doc: Correct qdoc warning in QVariantAnimation
Added missing template clause to a template friend function
of class QVariantAnimation.

Change-Id: Ia96dcbb1dad1f6678642564a55991445d0b6ba0e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:51:36 +00:00
Martin Smith
38cfda3c82 doc: Correct remaining qdoc warnings in qmetaobject.cpp
clang required adding template clauses to a few \fn commands.

Change-Id: I4e875f719ed58901d227fb0e6b80d4551f3b6e89
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:51:23 +00:00
Martin Smith
0a383146c5 doc: Correct remaining qdoc warnings in qvariant.cpp
clang required adding template clauses to several \fn commands.

Change-Id: I1ee9855c626b41e499392c05160df01daa5c0618
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:51:09 +00:00
Martin Smith
c2b4681493 doc: Correct remaining qdoc warnings in qtimer.cpp
clang required adding template clauses to a several \fn commands.
There was also a case where Q_QDOC was changed to Q_CLANG_QDOC
in qtimer.h

Change-Id: I1184e507a3fa719fe5049ade80e5da24f52ac851
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:50:55 +00:00
Martin Smith
58a47ccfe5 doc: Correct remaining qdoc warnings in qmutex.cpp
clang required adding template clauses to a few \fn commands.
|| defined(Q_CLANG_QDOC) was also added in qmutex.h.

Change-Id: I7e61f460a8f8f15032094fb35c02f73721a5eb8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:50:42 +00:00
Martin Smith
9e005c9401 doc: Correct remaining qdoc warning in qsignaltransition.cpp
clang required adding template clause to a \fn command.

Change-Id: Ie95a1db90adcc9f6b10a7d2943af574c3b0ce2e2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:50:29 +00:00
Martin Smith
69ad098d17 doc: Correct remaining qdoc warning in qstate.cpp
clang required adding template clause to a \fn command.

Change-Id: Icbe0557f7fa67ba211df5cfbc68baa6cf737d7b1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:50:16 +00:00
Martin Smith
5211f785ff doc: Correct remaining qdoc warnings in qbytearraymatcher.cpp
clang required adding template clauses to a few \fn commands.

Change-Id: I5877c7bebd6a8a7b2630addb656d32e6f2043cf1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:50:04 +00:00
Allan Sandfeld Jensen
f95fbca5f3 Add AVX2 optimized versions of the most basic RGB64 compositions
Speeds up RGB30 and ARGB32-unpremul painting.

Change-Id: I419afdf5c26ceffc0f7557b8f196035056178c9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-04 12:50:01 +00:00
Martin Smith
8ba8efb839 doc: Correct remaining qdoc warnings in qthreadstorage.cpp
clang required adding template clauses to a few \fn commands.

Change-Id: I9972f793b05f423456878514eeaaa19baf8a9785
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:49:49 +00:00
Martin Smith
b09ad740f6 doc: Correct remaining qdoc warnings in qqueue.cpp
Added missing template clause to \fn commands required by clang-qdoc.

Change-Id: I53fe0b2c862cb053119ceab543dacbc4b20466df
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:49:36 +00:00
Martin Smith
8c322c0b2c doc: Correct remaining qdoc warnings in qhash.cpp
Added template clause to several qHash() functions and
created a \typedef comment for QHash::const_key_value_iterator.

Change-Id: Id56191f69bf9f36e606101e46bf1dfa528d88e09
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:49:23 +00:00
Martin Smith
03b226135f doc: Remove duplicate qdoc comments in qiterator.qdoc
The incorrect ones had been removed already, but they
reappeared after a branch merge, I think. This update
removes the old ones again.

Change-Id: Ief971819651fa3517f374d9f226c68bf7f015cb0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-04 12:49:10 +00:00
Martin Storsjö
2873b1bdf0 windows: Link to libversion.a with a lowercase name
MinGW's headers and libraries are lowercase, and MSVC is generally
run on a case-insensitive file system. Referring to libraries with
a lowercase name is more compatible.

This fixes cross-building using MinGW, and matches a similar
change for headers in dfaa32a945.

Change-Id: I728376f239a23c700416643cae98e271bbcdff32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-04 09:03:10 +00:00
Jake Petroules
175d691fa3 Fix the iOS/tvOS platform plugin build on tvOS
This fixes a regression from ba44cdae38.

Task-number: QTBUG-65516
Change-Id: I989b075d3f96170660042349437e4a6a4a115cf9
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-01-04 06:45:23 +00:00
Gatis Paeglis
209d8f10e4 xcb: fix and optimize QXcbConnection::xi2SetMouseGrabEnabled
What was broken:

- m_xiGrab on successful ungrab (XIUngrabDevice) was never set to 'false'.
Which means that we would unnecessarily call XIAllowTouchEvents, even when
we are not grabbing (this did not have any apparent side effects).

What was non optimal:

- Redundant XIQueryDevice calls. XIQueryDevice with XIAllMasterDevices flag
already returns all required devices. Calling XIQueryDevice for every id again
does not make sense.

- Querying for master pointer info on every grab is unnecessary. Simply cache
ids of master devices whenever hierarchy changes.

What remains to be investigated some time later (or never):

The original and the re-factored code grabs all master pointer devices. Not
sure if that is the expected behavior on MPX (Multi-pointer X) systems. Could
there be two context menus, each dismissed separately? MPX concept was introduced
in XI2.0, but testing shows that this setup is not very well supported even on
modern desktop environments. Tested on Ubuntu 16.04, where multiple pointers is
enough for crashing a terminal. Also AFAIK there isn't any bug reports about
broken MPX support in Qt.

Change-Id: I53f99c6efd44abc43a0985e15cff8aae7ebba8f1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-03 09:24:28 +00:00
Christian Ehrlicher
2dedf75819 QTreeWidget: fix visualItemRect()
QTreeWidget::visualItemRect() returned an invalid QRect when a column
was moved and then hidden (or the other way round). The reason was that
the logical index returned by QHeaderView::logicalIndexAt() was again
passed to QHeaderView::logicalIndex() to create the QModelIndexes needed
for QTreeView::visualRect()

Task-number: QTBUG-28733
Change-Id: I8676f21bcab8c05c2260b85d483902f18cbf3e24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-03 07:53:41 +00:00
Christian Ehrlicher
a13a0024d6 QToolButton: adjust menu indicator in RTL-mode
The menu indicator was not adjusted in RTL-Mode to be on the left side
of the text. Use visualRect() to adjust the rectangle before drawing
the PE_IndicatorArrowDown.

Task-number: QTBUG-50084
Change-Id: I20129499f111d06637c98ede23b4635a3fc34a6c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-03 07:53:33 +00:00
Christian Ehrlicher
fb58845d8f QItemViews: Add ability to show QJsonValue::Bool/Double
Q(Tree|Table|List)View was able to display a simple
QJsonValue::String, but not QJsonValue::Bool/Double. This
is an inconsistent behavior which is fixed with this patch.

Task-number: QTBUG-65082
Change-Id: I22c2fe2890f11e283cae4f7ea947aa67ff36f367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-03 07:53:26 +00:00
Lars Knoll
41b4e154d6 Update Text segmentation and line break data to Unicode 10.0
Also adjusted the text segmentation and line break algorithms
so that they can handle the new data, and pass the test suite.

Change-Id: Ib727fd80003e34e96458d7a681996de3fa3691e7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-03 07:47:26 +00:00
Lars Knoll
8bfabb34de Update most Unicode data to version 10.0
The text segmentation data is not being updated in this change,
as it requires additional code changes. Updating those will
come in a follow-up commit.

Change-Id: I5d6b6bc96044e8dd0c25cf6f79756e7f68bf6e7c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-03 07:46:31 +00:00
Lars Knoll
2b2b9c9962 Update QString::isRightToLeft() to take directional hints into account
Make sure we properly handle both directional embeddings as well as
directional isolates to determine the direction of the string.

According to the latest version of the Unicode bidi algorithm,
parts of the string contained inside an directional isolate is
to be ignored when determining the paragraph direction. Embedding
markers themselves are to be ignored as well, but not the characters
inside an explicit directional embedding or override.

This is also some required pre-work to get our BiDi algorithm
updated to the latest version of the standard.

Move the implementation to QStringView and implement the methods
in QString and QStringRef through that implementation.

Task-number: QTBUG-57743
Change-Id: I7f24e09198e22d6359c6534c9ae40a904e94c46e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-03 07:46:20 +00:00
Thiago Macieira
624a186295 Correct "developer-build" in QtTest black list features
Q_AUTOTEST_EXPORT is *always* defined.

Change-Id: I39332e0a867442d58082fffd150560a6042056fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-02 21:48:42 +00:00
Thiago Macieira
9464b7aa93 Update MSVC versions because 2017 is 19.11 too (and 19.12)
So invert the list and let "msvc-2017" be the latest, at least until we
know about a different version.

Change-Id: I39332e0a867442d58082fffd1504c316e27f51d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-02 21:48:35 +00:00
Christian Ehrlicher
631c64582e QTreeView: Fix QTreeViewPrivate::itemAtCoordinate()
QTreeViewPrivate::itemAtCoordinate() did not calculate the correct item when
non-uniformRowHeights is enabled and vertical scroll mode is ScrollPerPixel.
This results e.g. in an activation of the item above when the click happens
on the very first pixel line of an item. Another, more problematic effect was
that once a drop happened on the very first line of an item,
QAbstractItemViewPrivate::dropOn() calculated the root as the drop index
because the visualRect of the calculated item is compared with the drop
position which did not match.

Task-number: QTBUG-57538
Change-Id: If89571bf0fb76fc01d60ba7139f1d985b49d70db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-02 19:35:47 +00:00
Shawn Rutledge
4f76c2dbad Cocoa: make "Send correct mouse buttons for tablets" optional
Add an env variable QT_MAC_TABLET_IGNORE_BUTTON_MAPPING which, if set,
reverts to the old behavior.

The issues that it fixes are:
1) With a Genius tablet, it's not possible to generate a middle-click
at all, regardless of preferences, unless you set this variable
2) With a Wacom mouse (passive mouse used with an Intuos 3), the
side-buttons (normally mapped to forward and back buttons) do not
work unless you set this variable

[ChangeLog][macOS][Tablet support] If you have changed
the button mapping of your Wacom tablet in System Preferences,
it will be respected in Qt applications.  To revert to the
old behavior, set the environment variable
QT_MAC_TABLET_IGNORE_BUTTON_MAPPING

Task-number: QTBUG-57487
Task-number: QTBUG-54160
Change-Id: I0a1c9c6550e4dfe6ee2daa2d993f22691430826c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-02 14:47:05 +00:00
Simon Hausmann
997dd020c1 Fix source code file permissions
Fix permissions after commit ffc8409aa5 -
our source files are not executable.

Change-Id: Idc5103704256b6f73857b645c323492beaabe879
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-02 14:46:47 +00:00
Martin Smith
f28ef0eca9 doc: Correct remaining qdoc warnings in QRandomGenerator
Due to the integration of clang in qdoc, several qdoc warnings
appeared for class QRandomGenerator. This update corrects all
the remaining qdoc warnings.

Change-Id: I92fe9f7d9cb193e145ee8ad0e7198625b9a5bf7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-02 14:17:38 +00:00
Friedemann Kleint
15adf3a652 QtGui/Windows: Fix restoring of changed cursor in restoreOverrideCursor()
Unconditionally apply window cursors restoreOverrideCursor() also for
platforms with override cursor capability in case
a cursor was changed while the override cursor was active.
Amends b05d1c2ebf.

Task-number: QTBUG-65001
Change-Id: I7fd38a27dcf045f2fb48a16abb484342feaab5df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-01-02 10:07:45 +00:00
Liang Qi
9de26a630f Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-02 09:32:37 +00:00
David Faure
bb6f0a5291 QMimeDatabase: only export var for unittests if QT_BUILD_INTERNAL
Change-Id: I7fa25b64cf39667c8cea95431f68baab623c8a2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-02 09:31:37 +00:00
David Faure
739611221c Add QHeaderView::setFirstSectionMovable(), useful for flat treeviews
QTreeView makes columns movable except for the first one
(since Qt 5.0, see commit e0fc088c0c). This is indeed best
for actual trees, but not when using QTreeView as a flat
multi-column list (with no "root decoration"). Then it should
be possible to move the first column.

[ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow
the user to move the first column (like in Qt 4.x) using the new
method QHeaderView::setFirstSectionMovable().

Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-02 09:31:11 +00:00
Lars Knoll
0f315adf91 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	.qmake.conf
	sc/corelib/io/qfsfileengine_p.h
	src/corelib/io/qstorageinfo_unix.cpp
	src/platformsupport/eglconvenience/qeglpbuffer_p.h
	src/platformsupport/input/libinput/qlibinputkeyboard.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/ios/qiosscreen.h
	src/plugins/platforms/ios/qioswindow.h
	src/plugins/platforms/ios/quiview.mm
	src/printsupport/dialogs/qpagesetupdialog_unix_p.h
	src/printsupport/dialogs/qprintpreviewdialog.cpp
	src/printsupport/widgets/qcupsjobwidget_p.h
	src/widgets/widgets/qmenu.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
2018-01-02 09:58:44 +01:00
Andy Shaw
a899e45495 DB2: Pass on the native error codes to QSqlError
Since DB2 can potentially have more than one error code, we need to join
these together using ';' as a separator.

Task-number: QTBUG-142
Change-Id: Idd376df84a8e3ae4c05b4722b4d0020fa4f3edad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-02 08:51:06 +00:00
Andy Shaw
9b361f0e90 Return an invalid QSqlDatabase when accessing from another thread
QSqlDatabase objects can only be used in the thread that the connection
was opened for. So if the driver was created already then we check if
the thread is correct. If it is not then we output a warning and return
an invalid QSqlDatabase.

[ChangeLog][QtSql][QSqlDatabase] QSqlDatabase::database() will return
an invalid QSqlDatabase if the calling thread does not own the requested
QSqlDatabase.

Task-number: QTBUG-216
Change-Id: Ib5a25aa62129e3925f9819109af05961e5178bc5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-02 08:49:40 +00:00
Andy Shaw
52b85212a2 sqlite: Check that there are values to be set when binding
If the values vector is empty then we know already that the paramCount
will still be invalid, so we should just accept that and not check the
reused named placeholders.

Task-number: QTBUG-64923
Change-Id: Ifaa755540c4574f1f76d3f9f129bf0f66b837b70
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-02 06:32:16 +00:00
Samuel Gaist
2b0eb3fac3 Remove use of QRegExp from QSharedMemory
This patch updates the code from QSharedMemory to remove the use
of the deprecated QRegExp class. It also updates the unique key
test to avoid change of behavior going undetected.

Change-Id: I649e615027507898800bb5454a62a6cf8bbb2e18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-30 23:34:00 +00:00
Samuel Gaist
83aca24bc4 Migrate Cocoa QPA backend to use QRegularExpression
This patch updates the Cocoa QPA backend code to use QRegularExpression
in place of the deprecated QRegExp.

Change-Id: I6de2774975e63f8dbff6dad0a842f35c3c4b4f83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-12-30 23:33:50 +00:00
Lars Knoll
f3f4f95536 Bump the minimum required version for harfbuzz to 1.6.0
This is the first version that supports Unicode 10.0.0, which
we now require for Qt.

Change-Id: Iff3cb757eb7d97dace5649262c337a4ed1145199
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-30 15:17:32 +00:00
Lars Knoll
809200a83e Update bundled HarfBuzz-NG copy to 1.7.4
This is the latest released version, fixing a large amount
of bugs and adding Unicode 10 support.

[ChangeLog] Bundled HarfBuzz-NG copy updated to 1.7.4

Change-Id: Idc8092dfc4e593d64fff2fd51ff9e1b3d84049a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-30 15:17:28 +00:00
Lars Knoll
db92f2f3aa Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	.qmake.conf
	mkspecs/win32-g++/qmake.conf
	src/corelib/global/qglobal_p.h
	src/corelib/global/qoperatingsystemversion_p.h
	src/corelib/io/qfilesystemengine_win.cpp
	src/network/bearer/qbearerengine.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetwindow.cpp
	src/widgets/styles/qfusionstyle.cpp
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
2017-12-30 12:09:53 +01:00
Alex Trotsenko
89b0364cde QRingBuffer: avoid reallocations of the data
Since its initial implementation, QRingBuffer had the following
fragilities in the architecture:

  - it does not guarantee validity of the pointers, if new data will
    be appended. As an example, passing an address of the QRingBuffer
    chunk as a parameter to the WriteFileEx() function on Windows
    requires the stability of the pointer. So, we can't add new data
    to the QRingBuffer until the overlapped operation completed
    (related issues were fixed for QWindowsPipeWriter and QSerialPort
    in 5.6 branch by introducing an intermediate byte array);
  - inefficient reallocations in reserve(), if a shared chunk was
    inserted in the queue (we can get a reallocation in the place
    where we don't expect it:

      char *writePtr = buffers.last().data() + tail;  <-  line #133

    ).

Proposed solution is to avoid reallocation by allocating a new
block instead. That was accomplished by introducing a QRingChunk
class which operates on a fixed byte array and implements head/tail
pointers strategy for each individual buffer in the queue. So,
QRingBuffer is no longer dependent on QByteArray's internal
shrink/growth algorithms.

Change-Id: I05abab0ad78e22e4815a196037dfc6eff85325d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-30 10:15:10 +00:00
Alex Trotsenko
48ea14080e QNetworkInterface: fix warning of unused function
That causes compilation error in developer build or when '-Werror'
command line argument is forced:

kernel/qnetworkinterface_unix.cpp:142:12: error: 'int getMtu(int, ifreq*)' defined but not used [-Werror=unused-function]
 static int getMtu(int socket, struct ifreq *req)
            ^
cc1plus: all warnings being treated as errors

So, mark 'getMtu()' as unused in the appropriate branches.

Change-Id: Ib4d74845835962bb12f56baf8e13834c032a0404
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-29 13:57:18 +00:00
Lars Knoll
dcc605beb6 Chop a possible trailing \0 from retrieved text
Some apps (e.g. Chromium) explicitly append a \0 to the text they
transmit through the clipboard. Remove that one, when we retrieve the
text, so it doesn't become part of the text we're pasting.

This was e.g. visible when pasting from chromium to the textedit example.

Change-Id: I9445319e6e5ef304a364e14f794b16557a3cc919
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-12-29 08:14:55 +00:00
Thiago Macieira
198c59dbce tst_QUdpSocket: always use an interface when binding to IPv6
Binding without an interface and expecting the OS to select something is
not supported in all OSes. On FreeBSD, I keep getting EADDRNOTAVAIL. So
modify our test to only join, leave and send to multicast groups with an
interface selection.

With this, all tests either pass or are skipped for me on Linux,
FreeBSD, and macOS. On Windows, this revealed an inconsistency in
behavior, which this commit adds a workaround for.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb6815456494d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-29 00:10:54 +00:00
Thiago Macieira
656804b964 qrandom.h: actually #undef min and max instead of using parentheses
Putting parentheses around the call to (std::numeric_limits<T>::min)()
works, but the trick cannot apply to the min() function declaration on
the same line. So we really need to #undef.

I hope no one after the 1990s still needs these macros.

Task-number: QTBUG-65414
Change-Id: I39332e0a867442d58082fffd15024f8edb293311
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-28 21:30:28 +00:00
Jake Petroules
44da5b8635 Allow moc to handle Unicode output filenames on Windows with MSVC
The C standard library functions cannot handle UTF-8 filenames. Instead,
we need to use the wide-character versions which accept UTF-16 input.

Task-number: QTBUG-65492
Change-Id: If4b3b4eeeec4f3bbb428b8f6b0311a65d01463b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-28 15:29:02 +00:00
Thiago Macieira
6f7b64e2a9 QMap: fix another UB (invalid cast) relating to QMap's end
Like in commit 75cdf654bc, we use the
pointer value of the QMap header (which is of type QMapNodeBase) as a
sentinel. It's never dereferenced. In that commit, the issue was calling
end() directly; in here, it happens when iterating forward from any
element, which means nextNode() can reach back to the header.

However, using static_cast is wrong, so we use reinterpret_cast.

Change-Id: I39332e0a867442d58082fffd15040317704a87ce
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-27 21:01:00 +00:00
Albert Astals Cid
d733014019 CUPS: Refactor the code a bit
Move the selected and selDescription members to a subclass of QOptionTreeItem
since it's only ever used for Option type nodes of the tree

Change-Id: Ic99841c4e04a3afcff0950f72abf12977850f6d3
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-27 16:46:38 +00:00
Thiago Macieira
3d7cdb64fc qfloat16: NaN is not infinite
Change-Id: I39332e0a867442d58082fffd1502b7010424f0f8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-12-27 11:50:09 +00:00
Gabriel de Dietrich
c7faa4ad8f Cocoa QPA: Delete singletons on exit
This involves QCocoaApplicationDelegate and QCocoaMenuLoader.

The former has been modernized to use blocks. The latter was
not being deleted previously.

Change-Id: Ic4cbfed2d9598fa04130675b3330d985b9489a21
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-26 21:43:43 +00:00
Thiago Macieira
b12db22fcf Replace a few hardcoded paths with defaults from paths.h
This removes at least one special-case we had to have, in Android's lack
of /etc/mnttab. Bionic's _PATH_MOUNTED is already /proc/mounts.

Change-Id: I9407dcf22de6407c83b5fffd14fedc638586d0f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-24 02:04:12 +00:00
Thiago Macieira
f95d64d075 Doc: attempt to fix some qdoc errors for QRandomGenerator
This fixes only those that look fixable. There are a number of errors in
the online documentation that look like qdoc tool bugs, like missing
functions (operator==) and documentation text that does not exist in the
source code. This fixes:

 - QRandomGenerator(System) constructor showing up
 - Links for C++ reference documentation not showing up as links

Change-Id: I9e2892cb6c374e93bcb7fffd14fe21db5a6969d9
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-24 02:04:10 +00:00
Christian Ehrlicher
a02b371eb2 QHeaderView: properly connect rows/columnsMoved
QHeaderViewPrivate reimplemented _q_layoutChanged() to handle changes
of rows/columns via layoutChanged/layoutAboutToBeChanged. This worked
fine for Qt4 but since Qt5 only the special signals rowsAboutToBeMoved/
rowsMoved are used for this (8021e2d5e7).
With this change, QAbstractItemViewPrivate::_q_rows/columnsMoved() is
calling the virtual function _q_layoutChanged(). This resulted in a
wrong call of QHP::_q_layoutChanged() for a horizontal header when
a row changed and for a vertical header during a column change. In the
end this can lead to an unhide of hidden sections.

Task-number: QTBUG-54610
Change-Id: Ide4bfc5b24a97746fd1e5af82d3ba08257149157
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-22 16:17:56 +00:00
Tor Arne Vestbø
44ef95a885 iOS: Don't send all touch events async
Commit 77942a1bdf introduced the QScopedValueRollback, but without
assigning it to a local temporary, so the value was rolled back
immediately, resulting in always sending touch events async.

Change-Id: Ic7f65c3d38c46813ff06694e883dae3df138b9d4
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-22 11:13:21 +00:00
Eskil Abrahamsen Blomfeldt
67b1fa48be Update font when text format's letter spacing type is changed
The QTextFormat::FontLetterSpacingType property was added outside
the span of the FirstFontProperty and LastFontProperty, so
the fontDirty flag would not be set when it was changed. There is
no binary compatible way to fix this before Qt 6, so for now, we
add a special case for it.

[ChangeLog][QtGui][Text] Fixed an issue where changing the letter
spacing type of a QTextCharFormat would not cause its font to
update.

Task-number: QTBUG-65345
Change-Id: I5ab53d7f82d529b57edceacfc3fa688c6741cd17
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: C. Boemann <cbo@boemann.dk>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-12-22 05:37:55 +00:00
Gabriel de Dietrich
c5a3022b04 QMacStyle: Minimize size of scrollbar transparency layer
Instead of allocating the full backing store size for
the transparency layer, we make sure we only allocate
exactly as much as needed by the scrollbar.

Change-Id: I55c3172fe3dd2a1f3fd46828463497f9f35cb1ae
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-21 20:53:23 +00:00
Gabriel de Dietrich
e3c79b4356 QMacStyle: Use light color on expanding scrollbar
Change-Id: I4e9c870c8acaaa690f530f847c9927d61a508a94
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-21 20:53:20 +00:00
Gabriel de Dietrich
117148c381 QMacStyle: Bring back submenu indicator
This one fell off the truck while we were removing
HITheme calls. We add it back by simply rendering a
BLACK RIGHT-POINTING TRIANGLE character.

We also fix smaller issues, such as not displaying
any shortcut related to a submenu action — this is
simply not a thing. The spacing between the menu
item's text and the submenu indicator has also been
slightly improved.

Change-Id: I6c768a5506a5eb9528b0dd76acd52b561266d67b
Task-number: QTBUG-64405
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-21 20:53:17 +00:00
Ulf Hermann
ca47afbfaa Fix build with -no-feature-regularexpression
The thing we are looking for in qstandardpaths_unix.cpp is
regularexpression, not QT_BOOTSTRAPPED.

Change-Id: I37eb0cdd8a52b0adfd69f592b84659e8807e35ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-21 18:23:17 +00:00
Ulf Hermann
74027e7f99 Fix build with -no-feature-network
The vnc and tuiotouch plugins depend on network support. The tuiotouch
plugin furthermore depends on a specific feature from network.

Change-Id: I3bc1f7b1dcf3437c6ed0d41cc9e282114a95a39c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-21 18:19:55 +00:00
Thiago Macieira
aad0c8dda1 Fix build with ICC: it miscompiles the F16C intrinsics
By not actually making them intrinsic, leading to linker errors:

 /home/qt/work/qt/qtbase/src/corelib/global/qfloat16_f16c.c:61: undefined reference to `_mm256_cvtps_ph'
 /home/qt/work/qt/qtbase/src/corelib/global/qfloat16_f16c.c:76: undefined reference to `_mm256_cvtph_ps'

I had the workaround applied, but only for "intel_icl", the qmake config
for the Intel compiler compatible with MS cl.exe options. The one for
compatibility with Unix cc (intel_icc) was missing.

Task-number: QTBUG-65367
Change-Id: I39332e0a867442d58082fffd15020e4838b6a01d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-21 15:51:08 +00:00
Friedemann Kleint
309169afd9 QScroller: Fix deprecation warning about QDdesktopWidget:::primaryScreen()
In file included from ..\..\include\QtWidgets/qdesktopwidget.h:1:0,
                 from kernel\qt_widgets_pch.h:71:
..\..\include\QtWidgets/../../src/widgets/kernel/qdesktopwidget.h:71:65: note: declared here
     QT_DEPRECATED_X("Use QGuiApplication::primaryScreen()") int primaryScreen() const;

Use QScreen directly and remove the then unused function realDpi().

Change-Id: I526adb09ba35ed0699338d6a8d044c2ff9a03a1e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-12-21 15:49:44 +00:00
Timur Pocheptsov
54519d7327 Fix signed/unsigned comparison
It breaks a build if warnings are treated as errors.

Task-number: QTBUG-65357
Change-Id: I42d5cbdbd90f831662a6decaebecebef5005e735
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-12-21 15:46:05 +00:00
Dyami Caliri
ffc8409aa5 Use AccessCheck for current user effective file permissions
On Windows, QFileInfo.isWritable() was returning true in situations
where the file would only be writable with elevated privileges. Using
AccessCheck instead of GetEffectiveRightsFromAcl to get the correct
results.

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-30148
Change-Id: I7a3468ac069bf782ca312078e3a84107b6cd468c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-21 15:45:34 +00:00
Mitch Curtis
83fa66b6d2 Add more code examples to QUrl documentation
Code examples make it much easier to learn how an API behaves.
One area that the patch tries to address is the distinction
between a relative URL and a relative path.

Change-Id: Ife52172816b89afb6cd810b07d3573480e2cd747
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-21 12:54:40 +00:00
Mårten Nordheim
2f96813349 Fix typo in QSslKey
Change-Id: I201f4af1dd43a8e74d26652b50f3ad6074952888
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-21 12:15:04 +00:00
Oliver Wolff
33a72ee6f3 winrt: Register ssl socket upgrade callback in Xaml thread
Task-number: QTBUG-65354
Change-Id: If628c73b05854c13086708c193995062c8b9f9e4
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-12-20 11:50:07 +00:00
Allan Sandfeld Jensen
d6473eb186 Fix drawing color fonts with shear and perspective transforms
Fixes the fallback painting used with complex transforms to be able to
handle color bitmap fonts which can't be converted to a path.

Change-Id: Id2851607f673b8fc1aea63f92043d0cdebc0fb9d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-12-20 09:03:37 +00:00
Sergio Martins
17d231039b Don't crash with null receiver/context in new-style connects
old style connects have protection against null sender and null receiver,
but new style only had against null sender.

Change-Id: Ie555ac078412918e60c3b60830fe1f3abfb7f5af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-19 23:03:42 +00:00
Gabriel de Dietrich
afb48f21c8 QCocoaNSMenuDelegate: Improve key-equivalent logic
By using NSEvent.characters instead of NSEvent.charactersIgnoringModifiers,
we may miss sending ShortcutOverride events.

For example, when the user presses Cmd-Opt-o, characters will be "ø"
(on a US keyboard layout) and therefore we'll be looking for the wrong
key-equivalent among the menu items. We only fall back on the modified
string when the search on the unmodified string fails.

As and addendum, we also skip any submenu when doing the key search.
This is not necessary since each menu delegate will get called eventually.

Change-Id: Id793315293a02c99e99d793ad812cff7b4a47821
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-19 21:42:39 +00:00
Gabriel de Dietrich
e996c74164 QCocoaMenu: Derive custom NSMenu class, make delegate a singleton
Out of the box, this saves one delegate instance per NSMenu. It
also weak-couples the NSMenu instance with its owning QCocoaMenu,
making it safer to inspect from the menu delegate.

In the future, this will be helpful for debugging by just overriding
any NSMenu method.

Change-Id: I7eb801009b97f6a8ee2003306c0e152621bbce54
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-19 21:42:31 +00:00
Gabriel de Dietrich
8686f3a347 Conditionally auto-detect Xlib on Darwin platforms
Task-number: QTBUG-65040
Change-Id: I8112d2fac8acf647fc8a669ae5c7920651f0bf08
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-19 19:43:04 +00:00
Alex Trotsenko
7dee74147e Micro-optimize QRingBuffer::chop()
Change the condition to strong equal, as 'bytes' was checked against
wrong value on the start of the function.

Change-Id: Iebd785665ac7bd0941ba4ffd3f315b12efc6ce0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-19 18:07:59 +00:00
Frank Richter
f8b164e1c3 Refactor QXcbKeyboard::updateModifiers()
The current implementation is poorly documented and hides the mapping
between keysyms and modifier bits.
This changeset adds documentation about the inner workings and makes
the keysym/modifier bit mapping reusable. (The latter will be needed for
xkb keymap synthesis if the XKEYBOARD extension is unavailable.)

Change-Id: I70c6d204b2357365db4dafeda680132ab6823ca3
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-12-19 16:18:37 +00:00
Renato Araujo Oliveira Filho
7fd5fe17c2 Fix print to a printer instance
Make sure to use the printer original name as 'cupsPrintFile' function
argument

Testing:
- Create a instance of your print with lpoptions
- Try print a document using the new instance of the printer
- Check if the instance properties was respected

Change-Id: I884b641d1871fe04c7b119c82d4edb4aa41db2f5
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-19 15:23:44 +00:00
Karim Pinter
3af9d77431 Fix pps and imf support for QNX builds
Change from config to feature in the json and pro files.

Change-Id: I58ddac3c4ad739253bae010f1d5023fc1d481047
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-19 11:07:12 +00:00
Milian Wolff
e2c10e99db Cleanup: Use QThread::msleep to sleep instead of select
The old code used select with all-zero parameters and a timeval struct
configured to wait for 50ms. This can be drastically simplified by just
calling QThread::msleep which makes the intention much more clear.

Change-Id: I115b56ae67ae2c2cd03354e16a7bfdf56f8c15b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-12-19 09:36:11 +00:00
Friedemann Kleint
d04187b6a1 Windows QPA: Check validity of device when handling tablet leave
Huion GT-191 has been observed to send spurious leave events.
Amends 127483b5e3.

Task-number: QTBUG-65120
Change-Id: I5dfa003a71be137a7b40cc9c27d7cf2cada6922d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-19 09:29:22 +00:00
Ulf Hermann
152033bec0 Make QT_NO_FUTURE a feature
... and make sure we can compile without it. In particular,
Qt Concurrent depends on QFuture, so we specify it as a condition,
and QtConcurrentException should not depend on future but on
concurrent.

Change-Id: I65b158021cecb19f227554cc8b5df7a139fbfe78
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-19 09:17:06 +00:00
Jan Grulich
f76e3712f1 Fix support for flatpak FileChooser portal
FileChooser portal expects filter property in a(sa(us)) format but by
default, using enum, we will end up with a(sa(is)), thus we have to
specify format for the enum.

Change-Id: I7de971197a0c77d6dca092edda7d428d90394574
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-19 08:32:15 +00:00
Renato Araujo Oliveira Filho
ccc9cd4404 Add i18n support for cups advance options
Used 'ppdLocalize' to translate cups options

Change-Id: I7fea7c26194fd6c6ee62a17d3e35d7c2c5be6d3c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-19 08:08:43 +00:00
Albert Astals Cid
ff67dedaaf QPageSetupWidget::setPrinter: Use printdevice default paper size
This means that actually the paper size set on system settings (or lpoptions) is used instead of A4

Change-Id: I2dd86fd9ba210a335773430328b0ba2d3343395f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-19 08:08:23 +00:00
Albert Astals Cid
414a703036 CUPS: Use printer job-hold-until as default instead of the nohold
This also reads the job-hold-until from lpoptions if set there for the particular printer

Change-Id: Ic60fef675ab9f4760cd99ee9ac417b0478459681
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-19 08:08:13 +00:00
Lorn Potter
23c55cd37c bearermanagment: fix build for --no-feature-bearermanagement
Change-Id: I9e3f44b924e09a8d1a5095dc55d585b3cab33c15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-19 05:58:22 +00:00
Lorn Potter
bcef582b6f Fix scan reply dbus signature in connman bearer backend
Task-number: QTBUG-57844
Change-Id: I1f3035f32d213ec6da95650a946c17c64becf549
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2017-12-19 05:58:07 +00:00
Albert Astals Cid
2831fa7665 CUPS: Use printer job-billing as default instead of the empty string
This also reads the job-billing from lpoptions if set there for the particular printer

Change-Id: Ia4a6961de504005b8dcd9209da0624e9ae9ef7e4
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-18 15:24:05 +00:00
Albert Astals Cid
83538a360e CUPS: Use printer job-sheets as default instead of none,none
This also reads the job-sheets from lpoptions if set there for the particular printer

Change-Id: I35aff103261ef58492779071d866e8a15ac78607
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-18 15:23:43 +00:00
Albert Astals Cid
33f08a68c1 Remove declared but undefined QPageSetupWidget constructor
Change-Id: I54022d00d246c83489ccd171170feec1a1a46673
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-18 15:23:35 +00:00
Albert Astals Cid
ad77a2447e CUPS: Use default cups job-priority instead of 50
This also reads the job-priority from lpoptions if set there for the particular printer

Change-Id: I75d983c377d2135a0b0d3e028829a7384a5e1897
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-18 15:23:29 +00:00
Marc Mutz
b0938cb6c1 QGestureManager: fix UB (invalid pointer comparison)
Comparing pointers with op< that do not point into the same array is
UB. Fix, in the usual way, by using std::less.

Change-Id: Id2c957557719887b2016632d683dbab8af07b34c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-18 13:06:33 +00:00
Richard Moe Gustavsen
0857db89bf Widgets: check if parent exists before calling parent->locale()
If a top level, parentless widget has Qt::WA_WindowPropagation
set, Qt will crash when trying to resolve the widgets locale.
The reason is that we try to access the QLocale of the
non-existing parent.

This patch will add a check if a parent exists before trying
to access it.

Task-number: QTBUG-61213
Change-Id: I09a6351a12dc1fffab3069b70e3d7b3932317c85
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-18 12:08:17 +00:00
Andy Shaw
3841a7dd49 Prevent infinite relayout when adding scrollbars
When one scrollbar is added, this may cause the other to be
needed as well. This change does a second calculation
immediately instead of relying on a signal through a
QueuedConnection.

Task-number: QTBUG-62818
Task-number: QTBUG-56280
Change-Id: Iee9a083e3a6cd3765e6bb9206687a8a6e7f99cff
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-12-18 11:10:48 +00:00
Albert Astals Cid
c61810b6f5 CUPS: Fix lpoptions file not being taken into account
This is actually two fixes.
 * We need to call cupsMarkOptions
 * CUPS differentiates between the "" and the nullptr instance, so we need
   to change the call to cupsGetNamedDest accordingly

Change-Id: If2692e405b6b71f8ee91362e6e72eabd9202d704
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-18 10:10:30 +00:00
Marc Mutz
8b8e53f726 QScroller: maintain activeScrollers as a QList, not a QSet
The number of active scrollers is probably very low, so O(N) vs. O(1)
search can be neglected, compared to the higher cost of allocating and
iterating a QSet. The tipping point is that the public API uses QList,
and the QSet needs to be converted toList() on each (external) access.

Just use a QList.

Change-Id: I5f0b37761923dc94d6dbbbf92973da73f5335e4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-18 09:21:51 +00:00
Friedemann Kleint
e31c79ece4 QtPrintSupport: Fix build
dialogs/qprintdialog_unix.cpp:1104:21: error: incomplete type 'QTextCodec' used in nested name specifier

Amends b4330bc391.

Task-number: QTBUG-54464
Change-Id: I555431d11a5c3f247d4f055d94255d2708c92374
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-12-18 09:11:25 +00:00
Christian Ehrlicher
93dabeba9d QTreeView: Make sure QHeaderView is notified on layoutChanged()
QHeaderViewPrivate::_q_layoutChanged() was not called when used in a
QTreeView because it was explicitly disconnected in setModel().
The disconnect was added sometime prio to Qt 4.3, but there the signal
was connected to the doItemsLayout() slot. This was correct since
QTreeView::doItemsLayout() is calling header->doItemsLayout().
In Qt 4.3.0 _q_layoutChanged() was introduced and the disconnect was
adjusted. But since _q_layoutChanged() is doing much more than
doItemsLayout() (e.g. restoring hidden sections), functionality was
lost. The problem was already observed for Qt 4.6 (QTBUG-18196) but
only partially fixed.

Task-number: QTBUG-41124
Task-number: QTBUG-54610
Change-Id: Id13a9930d0163812e12a0287016bab9c3aa02068
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-12-17 12:42:22 +00:00
Allan Sandfeld Jensen
3dd0308634 Mask potentially undefined alpha in blend_transformed_argb
Makes sure the ARGB32PM that is painted on always have a defined alpha.

Task-number: QTBUG-55645
Change-Id: Ifcf5fcc2127d255518eca4763845a197da6c7914
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-16 09:23:58 +00:00
Jan Grulich
84731fbb2b Add support for FileChooser flatpak portal
Adds support for FileChooser Flatpak portal. To support them we just do
specific DBus calls, which are then caught and forwarded by xdg-desktop-
portal daemon/service. This is needed for Qt applications running in
sandbox.

[ChangeLog][Platform Specific Changes][Linux] Added support for flatpak
portals. Flatpak is a software utility for software deployment and
package management. It provides a sandbox environment in which users
can run applications in isolation from the rest of the system. To
communicate with the system flatpak uses portals, which are designed to
be a bridge between sandboxed applications and desktop/system running on
user's computer. Flatpak runs this service (called xdg-desktop-portal)
automatically. It exports the portals via DBus and they are visible by
default to all applications running under Flatpak.

Change-Id: I4de1402434ba7cbcc805eab51c30f84f8ba0c5c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-16 08:17:05 +00:00
Morten Johan Sørvig
91aa782f01 QDrag: Allow setting cursor for IgnoreAction
This is especially useful on macOS where the default
ignore cursor is the pointer cursor.

Change-Id: I5e14814abd2d59a7f4c4cd1029829ebbed5b3017
Task-number: QTBUG-26724
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-15 16:18:24 +00:00
Sergio Martins
60d99b6413 Rework the "failed to find or load QPA plugin" message a bit
This is one of the most frequent problems users ask for help with, and they
don't even know if the plugin was found but not loaded or simply not found.

Qt knows what happened, so communicate it to the user.

Change-Id: I6003ed4ab3d147a5d159b2002004e53c251cb512
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-15 13:54:37 +00:00
Karim Pinter
9fbd9e066e Derive QPpsObjectPrivate from QObjectPrivate
Fixes 5d4089299a commit,
which was causing a build break if qnx pps is enabled.

Change-Id: I8c29f48bde0187a9db02d6325e8a9a0fae760bcb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-12-15 13:50:13 +00:00
Albert Astals Cid
b4330bc391 Reintroduce the Advanced tab in the QPrintPropertiesDialog
This is mostly a revert of 69de617761 adapted to the new code.

The commit that removed this code said:
 a) there's duplicate settings in the advanced tabs and in the rest of the ui: this easily
    solved with a blacklist
 b) you can set these options in the system settings: probably true, but it is very cumbersome
    to go to the printer settings every time i print to select from which tray the
    paper should be used

Task Number: QTBUG-54464

Change-Id: I7b1cacf51006dadb10aa6e00fe6dd2ff748fe576
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-15 13:25:21 +00:00
Morten Johan Sørvig
c10f2aaeb7 Disable WiFi bearer plugins on macOS and Windows
Scanning for WiFi networks is causing network disruptions
in the form of higher latency, sometimes globally
for all running applications.

In practice, the default configuration selection algorithm
in QNetworkConfigurationManager prefers configurations
from the generic bearer plugin, due to the way the
plugins are ordered. Removing the platform WiFi bearers
should have no effect on default network configuration
selection.

Task-number: QTBUG-40332
Change-Id: I778281c41a1aaec1949c220a9266677bd788a57a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-15 12:41:41 +00:00
Morten Johan Sørvig
27f70d7826 macOS: remove existing color-profile handling code
This code is unused/not functional.

Use sRGB everywhere instead. This is not a change
of effective color profile: the backing store has
had the sRGB profile assigned since commit ac899f6d
changed it as a side effect.

Change-Id: Ib45cec3acad90db2a0873b052d6bc4a61c894b18
Task-number: QTBUG-47660
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-12-15 12:41:05 +00:00
Timo Aarnipuro
dffa01a438 Add EGLFS integration plugin for Salvator-X on INTEGRITY Multivisor
This plugin uses the Renesas RISP Window Manager.

Change-Id: If813c46ab8d39e966c0a969610841867885dd473
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-12-15 12:27:18 +00:00
Johan Klokkhammer Helsing
034e92b0f4 Android: Set correct input hints when queried through getCursorCapsMode
getCursorCapsMode() now matches the Java implementation in
QtActivityDelegate.showSoftwareKeyboard() which is given to the Android
keyboard on InputConnection creation.

The reason we only saw this bug with some Android keyboards was that many
keyboards never call getCursorCapsMode and just rely on the initial hints.

Task-number: QTBUG-51865
Change-Id: I2aae024d9c77ea14e087e3f51a413d15a684179c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2017-12-15 12:23:17 +00:00
Kai Koehne
f2f75c0228 Doc: Fix paths to 3rdparty license files
Fix paths added in 870423f98b. This caused havoc on case sensitive
file systems.

[ChangeLog][Third-Party Code] Fixed glitch in attribution
documentation for Freetype licenses / Qt Gui.

Task-number: QTBUG-65138
Change-Id: Idb20a1ead772337f97a1262da42c62f6aef04a54
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-15 09:17:41 +00:00
Morten Johan Sørvig
e739e984c3 macOS: Make retina OpenGL work on VMware
Qt requests full resolution OpenGL surfaces by default.
However, when running as a VMware guest it looks like
the OS silently creates low-resolution surfaces.

This is not possible to detect using the standard NSWindow
APIs for converting to backing coordinates or for
reading the backing scale factor. The result of this
is that Qt will incorrectly display one quarter of
the window content only.

Fall back to detecting if the OpenGL renderer is the
Apple software renderer, which it will be on VMware.
Cancel the high-resolution surface request if this
is the case. This needs to be done while we have a
valid OpenGL context.

Task-number: QTBUG-62357
Change-Id: I33bf12b3bb0408249e6d66e0a8ca86b044bea781
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-12-15 08:45:45 +00:00
Thiago Macieira
259acdcb8a qfloat16_f16c.c: inline in qfloat16.cpp if F16C is permitted in there
This is going to be the most common scenario for GCC: all recent
versions allow compiling F16C code in the same source, thus generating
better code.

MSVC is excluded unless AVX is already turned on by the user in the
mkspec file, because it fails to use the VEX-prefixed instructions for
everything else, printing a warning that it knows it should have done
so.

ICC is excluded because it's known to generate invalid code when using
the F16C intrinsics unless F16C is turned explicitly on.

Clang is excluded because it runs into an internal error compiling this
code unless F16C is turned explicitly on.

Change-Id: I57a1bd6e0c194530b732fffd14f58de6a46f0de1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-12-15 07:39:54 +00:00
Tor Arne Vestbø
fddc5a27b1 macOS: Enable using CoreGraphics helper functions from C++ sources
Change-Id: If32c96d224bfb90ba22661b6f5ac3c920acb39d2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-14 19:35:38 +00:00
Friedemann Kleint
1adb1ef6ba QStyleSheetStyle: Draw menu item also when font is set
Task-number: QTBUG-64055
Change-Id: I0674e7b43bb56aa1834c8df10794714dbcc4e5e3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-14 18:23:35 +00:00
Friedemann Kleint
9e1b6b6e53 QFileSystemModel: Enable experimental code path for per-file watching
QFileSystemModel had a #ifdefed out experimental code path for watching
single files to track changes in size, which got outdated over time.

Replace the #ifdef 0 by a check for the environment variable
QT_FILESYSTEMMODEL_WATCH_FILES, fix it up and apply some fixes to
related code to make it work:
- Split file names signaled by QFileSystemWatcher on '/' always.
- Do not instantiate QDirIterator on "", which means "current directory"
  and results in mixed-up directories.
- Check on lastModified() in QExtendedInformation::operator==() so
  that changes trigger an update in _q_fileSystemChanged().
- Fix the #ifdefed out part to compile and not to add directories
  to the watcher.

[ChangeLog][QtWidgets][QFileSystemModel] It is now possible to enable
per-file watching by setting the environment variable
QT_FILESYSTEMMODEL_WATCH_FILES, allowing to track for example
changes in file size.

Task-number: QTBUG-46684
Change-Id: Ia5da9170866416c9529251f889814b23d7a7d069
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-14 18:23:22 +00:00
Giuseppe D'Angelo
00c09e752f QAbstractItemModel: add more checks in begin{Insert,Remove}{Rows,Columns}
Check that the inserted/removed range is indeed valid.

Change-Id: Ifccbe13f0753252ee1450c8668df782dc699f05b
Reviewed-by: David Faure <david.faure@kdab.com>
2017-12-14 18:15:50 +00:00
Oswald Buddenhagen
0a8a759822 fix namespaced build
Change-Id: Ibd16658ef800afe1dec01311cc4ef1a9a6d83929
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-14 18:05:59 +00:00
Oswald Buddenhagen
5dd76ba31c update sqldriver docs
- adjusted to new configure system realities
- centralized 'make install' instructions
- fixed 'make' command for mingw
- externalized the license compatibility question
- removed dated information about postgresql client libs
- removed dated claim that freetds is not stable yet
- updated official sybase client link to point to sap support
- removed apparently bogus "demo" include path from oci instructions,
  based on the archive content description
- removed troubleshooting item about static builds - one can use static
  "plugins" with a static build just fine. and building dynamic plugins
  for a static build is plain impossible to start with.
- removed troubleshooting item about build key mismatch, as build keys
  have been removed in qt5
- removed "general info" sub-section titles, as that's bad style
- misc language and minor content fixes

Task-number: QTBUG-62479
Change-Id: Ic4efa9e20a5966b6fc646062aec6d1a8d4ff4158
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-14 18:05:12 +00:00
Paul Olav Tvete
af70d4ee85 Allow empty namespace URI
W3C Namespaces Standard states that "The attribute value in a default
namespace declaration MAY be empty" (secion 6.2). Analysis and fix
thanks to Eugenio Rustico.

Task-number: QTBUG-63538
Change-Id: Icd8d4df639b9737d8e0d215bf2bea56fe1e161ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-14 16:53:30 +00:00
Jesus Fernandez
345be58100 Fix assert when emitting a signal from a different thread
If a signal is emitted more than once in a multithreaded application the
QSignalEventGenerator::execute function asserts in the check for a valid
signal index. It happens after abandoning the state and all the
connections are disconnected. If we have pending signal to be
processed the QObject::sender() won't be able to resolve the sender
object.

Task-number: QTBUG-61463
Change-Id: I9d4b7266c6dddc9ff2e7453b05a6989876ccb332
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-14 16:30:38 +00:00
Martin Smith
c87ed145f1 doc: fix signatures and missing module headers
The update adds the moduleheader variable to the qdocconf
file for qttestlib.qdocconf and qmake.qdocconf. The problem with
qmake is that it doesn't have a module header file, but it does
have qmake_pch.h, which is used here. This update also corrects
several \fn commands in the qttestlib docs.

Change-Id: I2202b9db96390bac1ee491ca8a99ca9010057ce3
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-14 13:37:51 +00:00
Marc Mutz
5cb54cb5eb QPlatformPrintDevice: use QVector, not QList in the API
QPlaformPrintDevice uses QVector to store, but QList in the getters to
retrieve these data. Port API from QList to QVector to avoid
conversion between the two containers on every access.

Saves almost 4KiB in text size (another 0.9% of QtPrintSupport).

Change-Id: If33df141b87753803c45d9f4dae501a68abe49af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-14 13:35:35 +00:00
Marc Mutz
2356c173b2 QPlatformPrintDevice: store QPageSize/QMimeType/int in QList, not QVector
This commit pains me, because we want Qt to migrate away from QList,
but the QtPrint API stack (all the way to public API, for QPageSize,
and int) is formulated in terms of QList, not QVector, so it makes
zero sense to store data in QVectors just to convert to QList on every
opportunity.

Store QMimeType in QList, too, since that's what QtCore uses.

Saves 3KiB in text size (0.7% of QtPrintSupport).

Change-Id: I71249f60be517cc06973b38d9ccad7a31f348be3
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-14 13:35:32 +00:00
Tor Arne Vestbø
d48c502ce5 Share QWidget update and repaint code for QRect and QRegion
QWidgetBackingStore::markDirty has an optimization for QRect, so we don't
want to unify these two functions by calling update/repaint(QRegion(rect)).

Change-Id: Id2a42f478f71863da45697041e0ab0130c74b9d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-14 13:11:51 +00:00
Tor Arne Vestbø
3d65284b60 QWidget: Remove dead code for handling painting without a backingstore
Change-Id: Iacf852c8620ea06d790cddcf6774b772f754e08a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-14 13:11:43 +00:00
Andy Shaw
9832f0ab85 Copy argv[0] to prevent it pointing to invalid memory later
If QCoreApplication is recreated, it is possible the previous argv[0]
pointer has become invalid, so we should not rely on it. So to prevent
that, we copy the original argv[0] to a static QByteArray.

Task-number: QTBUG-58919
Change-Id: Idadd4cb78e4281830165fb681ea7925109f316ff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-14 09:39:40 +00:00
Eskil Abrahamsen Blomfeldt
ff2ae36551 Windows: Support application fonts as fallbacks
In order to support the generated EUDC.TTE font for
End-User Defined Characters on Windows, we need to allow
fallback fonts which are not part of the default font
collection. This is the same as change
21c7421d4e, but adapted to
the fallback font code path.

Without this change, the EUDC file would still be loaded,
but it would be loaded through the GDI fallback, and we
would display an error message on the console.

Task-number: QTBUG-44594
Change-Id: Id2404228c7fd345523e4e5c99f31862e256930e3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-14 09:01:45 +00:00
Timur Pocheptsov
2086c183c1 Fix/workaround a quirk in SecureTransport
We set anchors from QSslConfiguration::caCertificates. On macOS these
anchors are by default copied from the system store, so I expected
setting 'trust those anchors only' should not break anything.
Somehow, on 10.11 SecTrustEvaluate fails to evaluate a valid
certificate chain (apparently because it has an intermediate
certificate, it's just a guess, since their API/docs are too poor
to explain well what was the real cause) as I can see connecting,
for example, to google.com - we have a chain with a valid root,
say it's GetTrust CA and we have it also in our list of anchors we set
on trust, but evaluation fails with: kSecTrustResultRecoverableTrustFailure:

"This means that you should not trust the chain as-is, but that
the chain could be trusted with some minor change to the evaluation
context, such as ignoring expired certificates or adding an
additional anchor to the set of trusted anchors."

Since none of certs is expired, and the required anchor already set,
this must be some bug in SecureTransport. For macOS (deployment
target) < 10.12 we fallback to the original version of the code
(the one that unfortunately does not allow us to limit the set
of trusted anchors by what client code wants to trust).

Change-Id: Ie42fd77c3eb6ef7469812aa0d7efff88a003c0b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-14 04:54:35 +00:00
Gatis Paeglis
9dc7904556 xcb: update libXi version requirement in the README file
... from 1.7.4 to 1.7.5 (released Sep, 2015).

Some more locking issues were fixed after 1.7.4. Testing
for a prolonged period of time has showed that 1.7.5 does
not cause a system lock-up.

[ChangeLog][Platform Specific Changes][X11 / XCB] Minimal libXi
version requirement has been updated from 1.7.4 to 1.7.5. This
is because XIAllowTouchEvents is known to deadlock with libXi 1.7.4
and earlier. When touch events are never received, this is not
an issue. Plain mouse / keyboard systems are not affected.

Task-number: QTBUG-62224
Change-Id: Ie70264b9af0390df33c417f660350d4bce48c6d3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-12-13 22:50:33 +00:00
Tor Arne Vestbø
ba44cdae38 Teach QPlatformWindow about safe area margins and implement for iOS
The safe area margins of a window represent the area that is safe to
place content within, without intersecting areas of the screen where
system UI is placed, or where a screen bezel may cover the content.

QWidget will incorporate the safe area margins into its contents margins,
so that they are are never smaller than the safe area margins. This can be
disabled by unsetting the Qt::WA_ContentsMarginsRespectsSafeArea widget
attribute, which is set by default.

QLayouts will automatically use the contents area of a widget for their
layout, unless the Qt::WA_LayoutOnEntireRect attribute has been set. This
can be used, along with a contents margin of 0 on the actual layout,
to allow e.g. a background image to underlay the status bar and other
system areas on an iOS device, while still allowing child widgets of
that background to be inset based on the safe area.

[ChangeLog][iOS/tvOS] Qt will now take the safe area margins of the
device into account when computing layouts for QtWidgets.

Change-Id: Ife3827ab663f0625c1451e75b14fb8eeffb00754
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-13 20:47:15 +00:00
Lars Knoll
59febb49e4 Fix a bug in the generation of the Unicode joining property data
The code that was supposed to initialize the joining property of
characters to the correct defaults was actually applied after reading
in the data from the Unicode file, and was in a couple of cases
overwriting explicitly specified data in ArabicShaping.txt

Task-number: QTBUG-63191
Change-Id: Ie35261039b2211a827322ca11afacd9555ccefc7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2017-12-13 19:14:49 +00:00
Eskil Abrahamsen Blomfeldt
9e99dba4a2 Windows: Add font fallback for EUDC glyphs
EUDC, or "End-User Defined Characters", is a concept in Windows,
where the end-user can create a local fallback font of default
glyphs for the PUA (Private Use Area, a range of Unicode
not reserved to any writing system), and these glyphs will be
used when displaying the character using a font which does not
itself support the code point.

To support this in Qt we look up the default EUDC font in the registry
and add it to the fallback fonts if it is available. We use the
font for code page 1252. This has been tested on a couple of systems,
and appears to always be present. The font is added to the front of
all fallback lists, so that it will override other fallbacks,
such as Segoe UI Symbol, which happens to assign glyphs to the PUA.
If there is no end-user defined fallback, then Segoe UI Symbol will still
be used as before.

Note that this required a small change in the code to get canonical
font names. The EUDC font that Windows generates will only have a
name set for the current locale, and we expected all fonts to have
an English name. Instead, the code has now been changed to prefer
the English name if one is present, but accept any other name if
there is nothing in English.

[ChangeLog][Windows][Text] Added support for End-User Defined Characters
in Qt.

Task-number: QTBUG-44594
Change-Id: I83ae68b6d16e9b50e990dfb3ac3d294b7b2a5113
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-13 14:42:50 +00:00
Oliver Wolff
457fe3e8e2 ANGLE: Fix resizing of windows
Use the correct height/width values when calculating
the vector for resizing the window content and the
new size as viewport size.

Task-number: QTBUG-62475
Change-Id: I33a8dc1379a908e991b04bc31dfc6254a6d005c9
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-13 13:07:52 +00:00
Oliver Wolff
27c840f5d4 Fix typo
Change-Id: If6111c59b958ba03f6ec5966af5cf443cae5cf9b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-12-13 13:07:48 +00:00
Marc Mutz
27aacfb61e QString: fix documentation of NUL-termination of unicode(), data(), constData()
(or lack thereof).

* `QString::utf16()` reallocates if `*this` has been constructed using
  `fromRawData()`.

* `QString::data()` ensures a writable string, so will detach from raw
  data.

* `QString::unicode()`, `constData()`, and `data() const` do not. They
  just return `QStringData::data()`, which may point to raw,
  non-NUL-terminated data.

These functions can therefore not possibly have the same behavior, but
were documented the same.

Fix.

Also drop the discussion of operator[](size()), as that, too, was not
correct, and anyone who indexes with op[] beyond size() - 1 should not
rely on proper behavior.

[ChangeLog][QtCore][QString] QString::unicode(), constData() and
`data() const` do not return a NUL-terminated string. This was true
before, but the documentation claimed the opposite.

Change-Id: I1437f57cd02bdf80264e8559608b46aa749c23a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-13 10:55:59 +00:00
Allan Sandfeld Jensen
ae55e75b1b Paint text decoration where the text is
For multi text-item texts we should render the text decoration at the
same position as the text-item part is, and not always from the
beginning of the line.

Task-number: QTBUG-60422
Change-Id: I9aa58fc164122ad1fae9716b8b18bdfbbbd778a9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-12-13 08:43:39 +00:00
Albert Astals Cid
e79efe94e3 Allow access to ppd file and ppdMarkOption via QPpdPrintDevice::property/setProperty
Change-Id: I47b49b52121950fa8e3ea7a056974d9f3033490f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-12-13 08:17:50 +00:00
Albert Astals Cid
70f6a35c8f Introduce QPrintDevice::property/setProperty
So we can access QPlatformPrintDevice internals if needed

Change-Id: Ib37c5717713f37262ef12d7b61793d80f05baf4a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-12-13 08:17:44 +00:00
Samuli Piippo
98b7ad7682 QNX: fix slog2 for QNX7
Change the include header to sys/slog2.h, which is available
in both QNX 6.6.0 and 7.

Task-number: QTBUG-64033
Change-Id: I26d8c5451376bab33e11f4784ca772f84cd6fc28
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-13 06:50:53 +00:00
Laszlo Agocs
782eb1a114 Report modifiers correctly in mouse events with evdev and libinput
Task-number: QTBUG-60694
Change-Id: I7b1625e5f31e49cd2ab18a83bbd0f65f9b58088d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-12-12 20:21:15 +00:00
Laszlo Agocs
7257862fb2 Set sharedPainter correctly for QGraphicsEffect
Autotest is taken from the previously reverted
8b1377fde1.

Task-number: QTBUG-60231
Change-Id: I44dd79cba22b6baefdd6d95c176790bef0b7eafe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-12-12 20:21:07 +00:00
Laszlo Agocs
6a5ca7240a Fix QEGLPbuffer::isValid() with surfaceless contexts
Task-number: QTBUG-65125
Change-Id: Idcd87804ab63031e48ff2f72eb98c986bfa39f25
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-12-12 20:21:00 +00:00
Friedemann Kleint
4a4efd5693 qwindowsopengltester.cpp: Fix -Wclazy-strict-iterators
Change-Id: Id22096197aa5bf406ea1f072e8b5ca2a90578eec
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-12 20:20:32 +00:00
Friedemann Kleint
9b597a09f1 QtGui/Windows: Fix wait cursors remaining active
In QWindowPrivate::applyCursor(), do not apply override cursors
when the platform supports QPlatformCursor::OverrideCursor.

Complements b05d1c2ebf.

Task-number: QTBUG-65001
Change-Id: Ie84cc30ad99b22e037aae829a2ce847ec4bf900f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-12 20:20:17 +00:00
Friedemann Kleint
141bca90e1 Windows QPA: Fix handling of override cursors
Override cursors were not restored when nested or in a dual
monitor setups.

The default cursor stored in QWindowsCursor::m_overriddenCursor
was clobbered by subsequent calls to QWindowsCursor::setOverrideCursor().
This caused for example the wait cursor to remain active when
switching to Help Mode in Qt Creator. Add a check preventing that.

Make the variable static so that it is shared between the cursors
of multiple screens.

Amends b05d1c2ebf.

Task-number: QTBUG-65001
Change-Id: Iead5804d317f73dedd78d22c1c85c62b5349ab83
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-12 20:20:13 +00:00
Heikki Haveri
e55c7974db Fix Android Service thread getting stuck in service startup
This change allows services using QAndroidService to function properly.
A service using a plain QCoreApplication is still affected.

The original code uses postfix decrement, causing an off-by-one error in
reference counting, which, in turn, fails to properly release a semaphore.

Fix by using deref() instead, which is also more readable, and consistent
with the use of ref() elsewhere in the code.

Task-number: QTBUG-64728
Change-Id: I99b59307638d619506c594f86de6d7d202d755f2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-12-12 20:12:49 +00:00
BogDan Vatra
280b8b79c0 Allow the users to disable the text handles
The user can set QT_QPA_NO_TEXT_HANDLES to 1 to disable the text handles.

Change-Id: I974af4d79c86259288035fe20b6a9d0c6d047af8
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-12-12 20:12:30 +00:00
Simon Hausmann
495833b796 [ChangeLog][QPA][eglfs] Fix crash when using cursors and multiple GL contexts
The hash from QOpenGLContext* to cursor texture/shader data can
accumulate dangling pointers if the program uses multiple contexts on
the same screen. This is fixed by moving the cursor data into the
platform context. The code for deleting the texture and shader program
is omitted as it is tied to the life time of the context and the GL
context deletes its resources automatically upon destruction.

Task-number: QTBUG-65119
Change-Id: Ic3b8e5669d14949af811bdf047e7d47000216180
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-12-12 19:18:38 +00:00
Christian Ehrlicher
06e903cf68 QHeaderView: Use correct font for drag'n'drop indicator pixmap
QHeaderViewPrivate::setupSectionIndicator() did not honor the font
set for the QHeaderView which results in a wrong font in the indicator
pixmap. Fix it by using the correct font for the dragged section as
it is done in paintEvent()

Task-number: QTBUG-65017
Change-Id: I5393c6861073de22f30ffa13e12c5e2cf8aa7776
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-12 19:07:10 +00:00
Christian Ehrlicher
26aa20407d QHeaderView: Fix painting vertical headers in rtl mode
In rtl mode, the headers were not painted correctly. The style option
selectedPosition was not filled correctly and the paint rect needed
to be adjusted by one pixel to fit the table grid.

Task-number: QTBUG-56520
Change-Id: Ib92d5ab6ff730bba67eca35c83cd638e613f58b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-12 19:07:07 +00:00
Christian Ehrlicher
eff7a5f38c QFileSystemModel: properly align file size column
The file size column was not properly horizontally aligned. The model
only returned Qt::AlignRight with no horizontal alignment. This lead
to a top alignment within QStyle::alignedRect().

Task-number: QTBUG-64098
Change-Id: Iaef30200a63bd0975c88a67d0af2eb1d5254f588
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-12 19:07:04 +00:00
Thiago Macieira
48d677365a QStandardPaths: fall back to a default if PATH isn't set
Change 28666d167a simplified
QProcess::start{Process,Detached} by using findExecutable() instead of
using execvp, but this introduced an unintended side effect when the
PATH environment variable isn't set. It turns out that most libc have a
default fallback in that situation, which we didn't apply.

This commit applies the default directly to findExecutable(), which
seems sensible.

[ChangeLog][QtCore][QProcess] Fixed a regression that made QProcess be
unable to find executables when the PATH environment variable on some
Unix systems wasn't set. This behavior should not be relied upon since
many systems do not have sensible fallback values for PATH.

[ChangeLog][QtCore][QStandardPaths] findExecutable() will now apply the
default value for the PATH environment variable (as returned by the
POSIX confstr(3) function or found in <paths.h>) if the variable
isn't set in the environment.

Task-number: QTBUG-65076
Change-Id: I9407dcf22de6407c83b5fffd14feda6c1f509210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-12-12 19:06:57 +00:00
Friedemann Kleint
e055efb445 Do not allow drag events when window is blocked by modal window
Check for QWindowPrivate::blockedByModalWindow in
QGuiApplicationPrivate::processDrag().

Task-number: QTBUG-46287
Change-Id: I8f43de8389f34458f9e10b37b94806b47a50d40a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-12-12 07:19:54 +00:00
Tor Arne Vestbø
b0f142e353 iOS: Ensure that the cursor rect doesn't trigger an inverted scroll
If the cursor is at the top of the screen, it may end up with a cursor
rect that extends beyond the screen after we pad it. We need to make
sure it's constrained by the screen geometry before checking if it's
within the available geometry.

Task-number: QTBUG-65041
Change-Id: I115f49d359b3c2e10219a6b8aa5ad051f44256a7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-11 21:17:39 +00:00
Tor Arne Vestbø
3d720f38fa iOS: Implement QIOSScreen::refreshRate to account for 120Hz displays
Task-number: QTBUG-64968
Change-Id: If96f6cde8f2fc6d91beb842d82a881fe057260b5
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-11 21:17:34 +00:00
Friedemann Kleint
fefd9de52a Windows QPA: Emulate aboutToHide(), aboutToShow() signals of QPlatformMenu
Wrap the call to TrackPopupMenu accordingly.

Complements 7849aa6e96.

Task-number: QTBUG-64628
Change-Id: Ia370e566266e96ab690ce5ed41d06dea7cafd4e4
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-11 19:06:30 +00:00
Thorbjørn Lund Martsum
d2d6c6f781 QWidgetResizeHandler - undo (potential) move break
When the mode is center we are typically moving the dock widget,
but we should however not stop if the mode is Center.
Though the regression
(in commit e662b4ed721ee36f0a17cc413494b7d09395d52e)
is not easy to reproduce it is clear
that the code later may call "mouseMoveEvent(e)" and the
mode is also checked for being Center and in that case
the eventfilter (function) returns true (not false).

Change-Id: I3936ec56833d613f78920d9ccf8ddb66e19e9802
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-08 20:47:22 +00:00
Jake Petroules
f0d226e4c5 Add a "shim" to allow use of Clang 5's __builtin_available everywhere
This is mostly relevant for Apple platforms, where we can use the new
unguarded availability warnings to guarantee that proper version checks
are present when using APIs that are not necessarily available on the
deployment target.

Change-Id: Ie408704b2924e1220491a9ea30f0141dfa4867d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from 70422449ef)
2017-12-08 19:23:04 +00:00
Michael Dippold
dbabe27b5b Android: Support caps lock
MetaKeyKeyListener augments the meta state of the keyboard, we need
to also check the KeyEvent.getMetaState().

Task-number: QTBUG-61369
Change-Id: I07a5d7b1b741a958bc94e1f1677dc1f2256220b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-12-08 18:22:51 +00:00
Martin Smith
a942721edc doc: update dbus sources for clangqdoc
Changed some uses of Q_QDOC to Q_CLANG_QDOC;
eliminated some uses of Q_QDOC; correct some
function signatures used for qdoc; added docs
for swap() functions.

Change-Id: I0d3c62d462bd3b10fd35d411bdfb93d952e6423d
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 17:38:06 +00:00
Martin Smith
f4ad5ede58 doc: clangqdoc must always see GL typedefs
QT_NO_OPENGL must not be defined when running clangqdoc
because there are opengl elements that must be documented.
That means clang will see uses of GLxxx, which might not
be included on some platforms. For example, clang must
parse the declaration for class QOpenGLFramebufferObject,
which uses GLuint, GLenum, and GLbitfield, because there
is documentation to be published for that class in
qopenglframebufferobject.cpp.

This change uses Q_CLANG_QDOC to first undef the needed
GLxxx types and then provide suitable typedefs for them.
This technique is also used in qglshader.h.

This works for macOS, but is it the right way to solve the
problem?

This change also removes some \overload commands, because
they shouldn't be used on constructors. And some \fn commands
that are made unnecessary by upgrading to clang.

Change-Id: I4ac658e951b3f2011698005f0238d4dea85fc403
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 17:37:54 +00:00
Serge Lysenko
5a40143ed6 Fix persistence of custom colors palette in QColorDialog
QColorDialog does not save custom colors after application
relaunching, if those colors were changed with drag'n'drop

Task-number: QTBUG-64500
Change-Id: I8ba6e1ef4e078f7b93463e7b20c9e21659d4777e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-08 16:33:49 +00:00
Eskil Abrahamsen Blomfeldt
4d88d79aa5 Update usage of QFontMetrics::width() to new API
QFontMetrics(F)::width() has been deprecated and is replaced by
horizontalAdvance(). This updates all usage of it in tests and
documentation.

It is worth noting that many or most of the usages of
QFontMetrics::width() probably intended to use boundingRect().width(),
but since it currently works, I have not looked into that, just
replaced the function name mechanically.

Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-08 15:06:32 +00:00
Marc Mutz
cd56e843cc Android: port away from QRegion::rects()
Use being()/end() instead.

The region of whose rects() we iterate here is modified in the loop
body, so take a copy of the rectangles. Since QVector is still
missing a range constructor, use std::vector. This does not cause
extra copies, since the QVector inside QRegion would detach anyway,
when the QRegion is modified inside the loop.

Change-Id: Ib973e825b55d9c9568936cb80180858163d87379
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-12-08 14:35:40 +00:00
Andre de la Rocha
87ae689ed6 Rename headers in platformsupport/windowsuiautomation
Private headers must end with _p.h.

Change-Id: Ia63339322a38fedea93d93728ef5c32fba95d76f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-12-08 14:34:08 +00:00
Martin Smith
4f9575ecbc doc: Fix all qdoc errors in QtConcurrent
These errors resulted from the improved parsing provided
by clang, which required rethinking which elements of the
QtConcurrent API should be visible to clangqdoc. The basic
problem is that clang must see declarations for all types
used by a type, or else it either gets lost and fails to
parse a type correctly, or it simply refuses to include
the type in its AST.

Change-Id: Iaa699c287e67d1288fcb2d83a9dbbaf07521d0cc
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:06:02 +00:00
Martin Smith
d3af09fdb2 doc: Fix qdoc errors for \fn commands in QtConcurrent
This change updates the \fn commands in the QtConcurrent
module, which makes extensive use of templates. Some of the
update \fn commands are very long as a result.

A few cases of the tag trick were used to fix qdoc errors
for some complicated template function signatures that were
marked \internal anyway.

Change-Id: I8546b89030c51bb9dddf38fa10bc0248d901aa51
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:50 +00:00
Martin Smith
64d976ef1a Add template text to \fn commands in QScopedPointer
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.

Change-Id: If45465880933174f1481a8be292474be191cfd45
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:39 +00:00
Martin Smith
b2cad63cc1 doc: Add template text to \fn commands in qglobal.cpp
This update corrects many qdoc warnings in qglobal.cpp caused by
incomplete \fn commands. It also corrects many undocumented parameter
errors caused by clang's requirement that the formal parameter names
be the same in both the declaration in the include file and the \fn
command.

Some formal parameter names were changed in the declarations in the
header file.

Change-Id: I4cd38f30461c585b97ec11923cdbc81a41fe00b8
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:30 +00:00
Martin Smith
efdcc88462 doc: Change invokeMethod() comments to work with clang
There were four dummy declarations for struct QMetaObject that were
needed by old qdoc to allow documentation of some very complicated
function signatures that old qdoc could not parse. clangqdoc can now
parse these signatures, but, unfortunately, old qdoc is still used to
parse \fn commands in .cpp and .qdoc files, so the dummy declarations
are still needed in struct QMetaObject. However, clangqdoc now
sees that two of the four dummy declarations are actually duplicates
of the other two, and then old qdoc complains when it can't find all
four of the function nodes, when it parses the four \fn commands.
This update removes the duplicate dummy declarations and the two
redundant \fn comments. The remaining two \fn comments are
updated accordingly.

This change also moves a couple of qdoc comments so they are located
with the function definitions that they are documenting.

Change-Id: I85e2492ba0380b01c3700b3dc7db0913d6429701
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:17 +00:00
Edward Welbourne
1c1f42b4dc Deduplicate a common check for legacy codes
All of QLocalePrivate::codeToLanguage()'s legacy codes were
two-letter, so duplicated a "third letter is 0" check; pulling it out
in front of them all will get any three-letter code more promptly to
the final fall-back, while saving the two-letter codes repetition of
the check.

Change-Id: I8ee81a526adaa7b24c11c1de7a1750d87deb5fb3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2017-12-08 13:27:31 +00:00
Liang Qi
812bb236dd Merge remote-tracking branch 'origin/5.10.0' into 5.10
Change-Id: I6dcf85067ec226136c207ea69ca9d66736c84db5
2017-12-08 13:56:17 +01:00
Ville Voutilainen
9856f869f5 Fix documentation for function objects with map/reduce
The documentation claims that function objects just work with
map-reduce. They work for the map function, but not for the reduce
function. Making them work for the reduce function was deemed
too complex for questionable benefit, so this patch explains
the situation and provides a work-around.

Task-number: QTBUG-22710
Change-Id: I7f706468e36031bc261234310d331001b96e5137
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-08 04:43:38 +00:00
Shawn Rutledge
216b680830 Improve QTabletEvent::rotation documentation
- There was a typo
- It has not been limited to the 4D mouse for some time now
- The Apple Pencil now supports rotation too

Change-Id: I96e20a56491fbcb80e19dc39d0b48b543217aa24
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-07 20:07:16 +00:00
Marc Mutz
48230dc882 QRegion: deprecate rects()
It was superseded by begin()/end() in Qt 5.8.

The eventual removal of rects() will allow greater flexibility
in the implementation's choice of data structure (std::vector,
e.g., or QVarLengthArray).

Remove all traces of rects() from the documentation. This means
we need to copy information previously contained in the rects()
docs to functions which previously just referred to rects(), in
particular the begin()/end() familiy of functions.

Change-Id: I90809809783252f7c552f24b4841f1e965580284
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-07 19:10:15 +00:00
Gatis Paeglis
79d78d814a xcb: verify if xrandr present before using xcb_randr* APIs
Not doing so might break the connection. We have had similar
issues before, e.g. QTBUG-45312.

Change-Id: I95f15d24773fc92b052578bd72d1ba264d0a5f63
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2017-12-07 17:56:10 +00:00
Jan Murawski
b461ac36ed Add command line switch to help output
Add the command line switch added in change
184c5470f534119b27c1a4caec29d699aba9c234 on qtdeclarative to the
help output of the qmltestrunner application.

Change-Id: I9f42719500e0039afa6a5b0f1f365611855229b3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-12-07 08:22:29 +00:00
Tor Arne Vestbø
a73de7ce2d iOS: Harden logic for when it's safe to use the graphics hardware
To fix QTBUG-52493 we tied the exposed state of a window to the
application being in the foreground. This has the result of a
visible flash of black between hiding the launch screen and showing
the first frame of the application, as the application is still
waiting for UIApplicationStateActive to begin rendering, which
happens after iOS hides the launch screen.

According to the iOS OpenGL ES Programming Guide, it should be safe
to render GL in UIApplicationStateInactive as well, and even in
UIApplicationStateBackground, as long as the rendering finishes
before the UIApplicationDidEnterBackgroundNotification returns.

To ensure that we catch any bugs in this area, checks have been
added that verify that no rendering happens while in the background
state.

Task-number: QTBUG-63229
Task-number: QTBUG-52493
Task-number: QTBUG-55205
Change-Id: Ib42bedbeddd7479ab0fb5e5b7de9f5805658e111
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-07 00:12:42 +00:00
Marc Mutz
33be3fe92b QVector: drop QRegion friendship: it's not needed
I don't know when it ceased to be needed, but QRegion no longer
does anything fancy with QVector.

Change-Id: I1bdfefc84724c379fab76dada35575666144df12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-06 22:40:15 +00:00
Tor Arne Vestbø
933497bace iOS: Ignore view layouts while in the background
Despite the OpenGL ES Programming Guide telling us to avoid all
use of OpenGL while in the background, iOS will perform its view
snapshotting for the app switcher after the application has been
backgrounded; once for each orientation. Presumably the expectation
is that no rendering needs to be done to provide an alternate
orientation snapshot, just relayouting of views. But in our case,
or any non-stretchable content case such as a OpenGL based game,
this is not true.

Instead of continuing layout, which will send potentially expensive
geometry changes (with isExposed false, since we're in the background),
we short-circuit the snapshotting.

iOS will still use the latest rendered frame to create the application
switcher thumbnail, but it will be based on the last active orientation
of the application.

To ensure that we pick up the right geometry when rotating the device
while the app is in the background, we treat applicationWillEnterForeground
as Qt::ApplicationInactive, which matches the recommendations of the
OpenGL ES Programming Guide to "re-create any objects and restart your
animation timers".

Change-Id: Ia9c27f85f996ecf30284c825b43447aa7099224e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 20:47:05 +00:00
Tor Arne Vestbø
e37c9d5d5f iOS: Harden application state change logic
Make sure we catch application state changes as early as possible,
and deal properly with any changes delivered before we have an app
to send them to.

Change-Id: I6d0ea0398f9fab88fc182342769b075cb144227f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 20:46:51 +00:00
Marc Mutz
8aacde5937 QAlphaPaintEngine: port away from QRegion::rects()
Use begin()/end() instead.

The old code extracted the rects from the region, then checked for a 'complex'
region (by comparing the number of rectangles against 10), and replacing the
region with the bounding rect if it was too complex. It then went on to adjust
the rectangle list it had gotten from the original region to match the new.

Simply delay getting the rectangles until after we have modified the region.
Since there are many member function calls in-between, take a copy of the
region to iterate over later, rather than relying on the region to be left
untouched by all the code in-between.

Change-Id: I49ddf4d545520ab435ab6b89eec3d24cf371823e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:31:28 +00:00
Marc Mutz
a016bed95f xcb: port away from last QRegion::rects()
Use begin()/end() instead.

In QXcbShmImage::flushPixmap(), instead of gettings different rects(),
depending on a bool parameter, just call yourself again with the
modified QRegion, which we can then just iterate over.

Change-Id: I6d4f7c6e4e5d2a24520716847ca9331bf39337c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:31:00 +00:00
Marc Mutz
9e18722086 xcb: share code for QRegion -> xcb_rectangle_t[] conversion
... between QXcbWindow and QxcbShmImage.

Replaces one QRegion::rects() call (to be deprecated), fixes potential overflows
that QXcbShmImage did not handle, but QXcbWindow did, and saves ~1KiB of text size.

Change-Id: I55d37021164feefe0cb3e60bd6d22b1976a6467b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:30:57 +00:00
Marc Mutz
0302697370 QtGui: port away from QRegion::rects()
Use begin()/end()/rectCount() instead, which don't require QRegionPrivate
::vectorize() calls.

In QPaintEngineEx::clip(), the rectCount() == 1 case called clip(QRect), but
forgot to return, causing another clip(QVectorPath) call with the same
arguments. Fixed.

Change-Id: Ife33112fc8006ed4bdff6409e2b8465ce7acb9d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:30:55 +00:00
Marc Mutz
28fbd13e22 xcb: use a more efficient unique_ptr instantiation
Wrap std::free() in a function object, to avoid having to carry around
state (the function pointer) inside unique_ptr objects. This shrinks
unique_ptrs back to sizeof(void*).

Change-Id: I32a711192c5485dc04e3b36a1ddabf02d1e9d4f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-12-06 18:30:49 +00:00
Tor Arne Vestbø
77942a1bdf iOS: Try to detect and deal with delayed touch delivery due to gestures
A UIGestureRecognizer may have its delaysTouchesBegan or delaysTouchesEnded
properties set, which causes iOS to not deliver touch events to the view
until the recognizer has failed recognition of its gesture.

In that case, the touch event is not delivered via [UIWindow sendEvent:]
as usual, but via _UIGestureEnvironmentSortAndSendDelayedTouches. The
latter function is apparently not reentrant, as opening a native alert
dialog in response to the touch delivery will result in the dialogs's
buttons to stop working, probably because they themselves use gestures.

Unfortunately iOS maintains two internal gesture recognizers on iPad,
of type _UISystemGestureGateGestureRecognizer, probably related to the
swipe-from-bottom gesture used for multitasking. Without any workaround,
these two recognizers will result in any tap on the bottom part of the
screen to be delivered delayed, which may introduce stuck alert dialogs
as described above.

UITouch has a gestureRecognizers property, but unfortunately this property
does not give us any information in the cases where we need it, so we
have to use an heuristic involving a UIWindow subclass to detect the
case where event delivery is delayed. As there is no way to prevent
the user from recursing into an event loop when delivering the event,
our only hope is to deliver the event asynchronously.

Task-number: QTBUG-64577
Change-Id: I11d9caa8c4542dc80426a9e58ea555914bed433e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 16:17:18 +00:00
Tor Arne Vestbø
58a409c6dc iOS: Implement QPlatformScreen::name for easier debugging
Change-Id: I077bec93fe2086c38ebe986b322977a50a1ab27d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 16:17:15 +00:00
Alex Trotsenko
d02a6b938e QAbstractSocket: clear error code to match the error description
Since 5.10, QIODevice resets the error string on opening. So, we should
set the error code to UnknownSocketError accordingly.

Change-Id: I0dd314788ffc182d6837f9d06b51e41d6de59d7e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-06 11:09:01 +00:00
Martin Smith
6fed5cf4e2 doc: Add missing template parameters to \fn commands
This update corrects many qdoc warnings in qsharedpointer.cpp and
qshareddata.cpp caused by incomplete \fn commands. Template stuff
was added to the \fn commands.

Change-Id: Ic10bcf04477d5f3d5380aeb1e58050a88f03005a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 10:04:28 +00:00
Martin Smith
aefb3a9a07 doc: Ensure clangqdoc sees declarations
This update corrects several uses of #ifdef macros
that needed updating because qdoc now uses clang to
parse header files.

Change-Id: I285efa4629a1a5d5bcbfaf701eeafbd0e9f1e43e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 10:02:31 +00:00
Albert Astals Cid
ceccdff4e9 Remove QPageSetupWidget::selectPrinter
t's only ever called after setPrinter so merge the code

Change-Id: I4b5d593edbe62b64354e81c19112fa87b0555fdc
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 09:57:24 +00:00
Albert Astals Cid
072dd59de7 Remove QPrintPropertiesDialog::selectPrinter
It is only ever called after the constructor, so merge the code

Change-Id: I5c75a2cd367af401b41920f51754a64dc6c6eb40
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:37 +00:00
Albert Astals Cid
881690969c Remove QCupsJobWidget::setPrinter
It is only ever called after the constructor so merge the code

Change-Id: I381165ad90c85342e5db3c16327d729388b71fb2
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:11 +00:00
Albert Astals Cid
f135d515e8 Remove QPrintPropertiesDialog::applyPrinterProperties
It's only ever called after the constructor so merge its code to the constructor

Change-Id: Icca88764f725b9aeaa08ee7387da8885be247fba
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:00 +00:00
Albert Astals Cid
fb1836898f Remove QUnixPrintWidgetPrivate::applyPrinterProperties
And move it's code to the only place it is called, the QUnixPrintWidget constructor,
that means we can remove the if that checks if propertiesDialog is not null since
at that stage we know it is null

Change-Id: I81cdaa0505fa6fe64a45c7d1f5c3e277400cbbf7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:27:48 +00:00
Albert Astals Cid
2ecfdf87b8 Remove QPrintDialogPrivate::applyPrinterProperties, no one calls it
Change-Id: Ic140f62e5cb63c6a4b7f4fa10ca243d8bb055c4e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:27:39 +00:00
Gatis Paeglis
083d3b885e xcb: remove redundant QT_XCB_DEBUG_XINPUT* envvars
In Qt 5.4 these envvars were replaced with categorized logging
59ba84d31c. This is not a public
API, the log output is useful mostly for developers and it can
still be used via QT_LOGGING_RULES, so there is no good reason
to keep the old envvars around. By using QT_LOGGING_RULES, we
can access even more xinput2 logs than is available via
QT_XCB_DEBUG_XINPUT*.

Change-Id: I2b12b8696043bc8bf8310f49f0cdc2ba1b8708ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-12-06 07:27:13 +00:00
Martin Smith
e827fec40f doc: Add class qualifiers to parameter types
This change supplies several missing class qualifiers for
parameter types and function return types.

Change-Id: I569026e4da0948902fcc13557003d3748b85dd82
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:12:44 +00:00
Martin Smith
929ea50393 doc: Document remaining anonymous enums
This change adds qdoc comments for the remaining nameless
enum types.

Change-Id: I4da8b67883c8020323437cf74c938d3655d8c384
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:11:48 +00:00
Martin Smith
329e09a3c3 doc: Add missing template text to \fn commands
This update corrects about 200 qdoc warnings caused by incomplete
\fn commands for member functions of template classes. It can be
used as an example of how to fix \fn commands that suddenly cause
qdoc warnings now that qdoc uses clang to parse the \fn commands.

For example, with the old qdoc, we had this \fn command, which the
old qdoc handled correctly:

\fn QAtomicInteger::operator T() const

For the new clang-based qdoc, this \fn command must be written this way:

\fn template <typename T> QAtomicInteger<T>::operator T() const

However, the documentation generated by the clang-based qdoc looks the
same as it did in the old qdoc.

Change-Id: I7803b3b7ec7c6b8b3cc1be789bc36921438f527e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:06:16 +00:00
Eric Lemanissier
b08c195264 fixup oversight in QStringView::lengthHelperPointer
amends 3b61cd6ad7

Change-Id: I3afa008299b8fcccae8943e545b536a68b17bd1a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-06 07:04:31 +00:00
Marc Mutz
6fd1895900 styles: port away from QRegion::rects()
Use begin()/end() instead.

Drop the special handling of rectCount() == 1, since with begin()/end(),
we no longer take the hit of creating a QVector just to be able to return
it from rects().

Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:17:05 +00:00
Marc Mutz
634344411e platform plugins: port away from QRegion::rects()
Use begin()/end()/rectCount() instead.

Change-Id: I5c642c4a2c64da65d3f37159396c86073818ca95
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:17:02 +00:00
Marc Mutz
784ed9b4f7 QtTestLib: port away from QRegion::rects()
Use begin()/rectCount() instead.

Change-Id: I08cef424bf24ecf3c058e9b87411f2a5775ffb33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:16:56 +00:00
Liang Qi
3d175cd541 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-12-05 21:59:30 +00:00
Andy Shaw
87efdd8c7f Android: Reserve space for the QVarLengthArray, so we can use append
When the QVarLengthArray was initialized with a size then append would
add to the end of that. Therefore we need to use reserve to get the
desired effect.

Task-number: QTBUG-64905
Change-Id: Ia1ebeb26cd31bc5e92bd7f81079506a266b845bf
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-12-05 17:07:39 +00:00
Thiago Macieira
138d34b9c8 QFileSystemEngine: Work around Android bug in rejecting hardlinks
Android Marshmellow intentionally forbids use of hard links. See
 https://code.google.com/archive/p/android-developer-preview/issues/3150

However, instead of using EPERM or another error code that indicates the
hard linking operation itself has a problem but there are no other
problems, Android developers stupidly chose to use EACCES, an errno code
that only indicates permission problems.

In any case, since the call will never succeed, we shouldn't even try.

Task-number: QTBUG-64103
Change-Id: I9e2892cb6c374e93bcb7fffd14fc5d1082bd60a3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-12-05 15:36:23 +00:00
Dongmei Wang
ff7dbda3b0 xcb_qpa_lib: Fix "undefined reference to `dlsym'" error
Change-Id: I37515542571ef37f4361e72b8db4547ff1e1b86a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-05 15:17:49 +00:00
Martin Smith
8c8459258f doc: Fix qdoc errors in qfsfilengine.cpp
A few parameter types in \fn commands were not
qualified with their class name. They had to be
qualified because they were in a base class of
the class being documented.

Change-Id: Ic0b43be689d17a0a539ee977c0db6e20eb05d5fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-05 13:41:50 +00:00
Liang Qi
53b141dceb Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/ios/quiview.mm

Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
2017-12-05 13:37:21 +01:00
Friedemann Kleint
77687bc64e QFileSystemModel::index(): Add a list size check
This prevents an out of range assert when monitoring directory
with activity (for example, temp).

Task-number: QTBUG-62841
Change-Id: Id3aa4098e9bbd665c7b17a667516885fa7c7f473
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Martin Rotter <rotter.martinos@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-05 09:05:38 +00:00
Dongmei Wang
b8a6e2b6e8 QColor: write signed 64-bit integer in a platform-independent way
When building Qt 5.6.2 with gcc 4.1.2 on Fedora 8, a compilation error
happened when compiling the code below
QColor::name()
{
...
   case HexArgb:
       return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8);
...
}

qtbase/src/gui/painting/qcolor.cpp:527: error: integer constant is too large for ‘long’ type

gcc 4.1.2 was unable to handle 0x100000000. The patch is to use Q_INT64_C to
append "LL" to 0x100000000 to avoid the compilation error.

Change-Id: I000e65a5c897ef2d78fcfe4e212d832eb488a762
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-12-05 07:29:25 +00:00
Gabriel de Dietrich
8d5842a2d8 minimal QPA: Make font DB creation more flexible
Prioritize CoreText over Fontconfig since the former is the
native one on macOS, and any other native font DB on its
respective platform. We introduce a new 'fontconfig' option
to allow using Fontconfig instead. This works similarly to
'freetype' overriding the default font engine on Windows. A
propos of which, 'freetype' now does the same on macOS.

Change-Id: Ic8168820d1d01fddc2f26e046abb65b8ab765f89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-04 22:32:48 +00:00
Martin Smith
e6aae7df04 doc: Fix all qdoc errors in qnumeric_p.h
These errors resulted from clang parsing function
declarations for functions that were not meant to
be documented. Here they are hidden from clang
with #ifndef Q_CLANG_QDOC

Change-Id: I256b49830b63188bf0a685cb393d469f2f2ca315
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 19:11:36 +00:00
Friedemann Kleint
2c6c044500 Fix qdoc warnings for 5.10
src/corelib/global/qrandom.cpp:915: warning: Cannot find 'bounded(...)' in '\fn' qreal QRandomGenerator::bounded(qreal highest)
src/corelib/tools/qstring.cpp:774: warning: Command '\snippet (//! [qCompareStrings-QSV-QSV])' failed at end of file 'qstring/main.cpp'
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QStringView qTrimmed(QStringView s)
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QLatin1String qTrimmed(QLatin1String s)
src/corelib/global/qrandom.h:171: warning: No documentation for 'QRandomGenerator::System'
src/corelib/global/qrandom.h:105: warning: No documentation for 'QRandomGenerator::bounded(double highest)'
src/corelib/global/qrandom.h:84: warning: No documentation for 'QRandomGenerator::generate64()'
src/corelib/global/qrandom.h:77: warning: No documentation for 'QRandomGenerator::generate()'
src/corelib/global/qrandom.cpp:799: warning: No such parameter 'sseq' in QRandomGenerator::seed()
src/corelib/global/qrandom.cpp:1096: warning: Can't link to 'operator()()'
src/corelib/tools/qstring.cpp:8982: warning: Can't link to 'qStartsWith()'
src/corelib/tools/qstring.cpp:9203: warning: Can't link to 'qTrimmed()'
src/corelib/tools/qstring.cpp:4798: warning: Can't link to 'qConvertToLatin1()'
src/corelib/tools/qstring.cpp:4825: warning: Can't link to 'qConvertToLocal8Bit()'
src/corelib/tools/qstring.cpp:4928: warning: Can't link to 'qConvertToUcs4()'
src/corelib/tools/qstring.cpp:4884: warning: Can't link to 'qConvertToUtf8()'

Change-Id: I5c7c89b230d3d1de8a679c10833319a470a44e80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-04 18:04:04 +00:00
Gatis Paeglis
bcd0e43eb9 xcb: fix regression with missing XI_PropertyEvent
Wacom stylus proximity detection had stopped working: it was not
detecting which type of tool is in use, so all stylus types
acted as a generic drawing stylus.

Selecting XI_PropertyEvent on a root window fixes the problem.
There is nothing in the XI2 specification that says that this
property would not be supported on non-root windows. Possibly
it is bug in the X server. Anyways, selecting XI_PropertyEvent
on a root window in this case actually is better. Property event
contains a global state information, there is nothing window
specific in it, so there is no need to select it for every native
sub-window.

It is worth noting that XI_HierarchyChanged also seems to work
only when selected on the root window (according to my testing
results). And on XI2 author's blog post about XI_HierarchyChanged
it says [1]:

"These events are sent to all windows, so it doesn't really
matter where you register. The traditional approach is to
register on the root window."

This kind of further confirms that it might be bug in X Server's
implementation.

[1] http://who-t.blogspot.no/2009/06/xi2-recipies-part-2.html

Task-number: QTBUG-64911
Change-Id: I8582675bf835239932e23f4596966dc167495e30
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-12-04 16:20:33 +00:00
Morten Johan Sørvig
29104c85db Cocoa: Disable “Hide” menu item on open popups
Follow native behavior and disable ⌘H and the “Hide”
menu item if there are any open popup windows.

Task-number: QTBUG-58727
Change-Id: Iad38cc5cce29e0081613417c53b154ae0f05857e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-04 13:46:46 +00:00
Martin Smith
5e0ef2defd doc: Add missing template text
There are two fake classes in qendian.h that exist only documenting
a lot of operator functions, but now that clang is being used to parse
all C++ code, when a class is a template class, clangqdoc must see its
template stuff to recognize template type T, for example. Hence, this
update adds template<typename T> to some fake class declarations used
only for documentation purposes. ie, inside #ifdef Q_CLANG_QDOC.

Change-Id: I1988b77cd7f3bb97067e7107dd00de34770e9fed
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-04 13:39:57 +00:00
Yulong Bai
c9f68a5858 QFusionStyle: fix the checkbox rendering in HiDPI situation
1. Make the checkbox's box size hidpi scale-able. Making the size
not only anchored to icon size, but also the menuItem's rect height
in empty or too small icon cases.

2. Make the checkmark's pen width in propotion to the box's size
to keep consistent visual effects among different dpi settings

3. Also make the radio button hidpi scale-able.

Task-number: QTBUG-63576
Change-Id: I4369aaa18ee68908a26a118cf04292ee4c3e9847
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-04 13:08:35 +00:00
Martin Smith
49bb359580 doc: Fix qdoc errors for \fn commands in endian functions
This change updates the \fn commands in the endian
functions, which are template-based. clangqdoc now
parses these \fn commands and expects to see all the
template stuff in the signatures.

Change-Id: I94c1aba8d710c97b8d41184d64b5341c88ece297
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 12:04:10 +00:00
Martin Smith
a69675a9f9 Add template text to \fn commands for QGlobalStatic
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.

Change-Id: I920d9cc4bef710f276267a34b6b9d49f7412adb0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 07:19:36 +00:00
Peng Wu
8f1b4a9081 Support ForwardKeyEvent signal in ibus input context
For ibus-hangul, it needs ForwardKeyEvent signal to fix
the commit issue.

[ChangeLog][plugins][ibus] Support ForwardKeyEvent signal

Change-Id: If41e75bed9ec4e3126db05c8ece4a51d2bc3c3fd
Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-04 06:36:07 +00:00
Martin Smith
e27bb2fd25 Remove two obsolete qdoc comments
The macros Q_GLOBAL_STATIC(Type, VariableName) and
Q_GLOBAL_STATIC_WITH_ARGS(Type, VariableName, Arguments)
were documented in qglobal.cpp, but both qdoc comments
were marked \internal. More recent documentation for the
macros also exists in qglobalstatic.qdoc, and the qdoc
comments there are not marked \internal. clang-qdoc
reports errors indicating that both macros havew been
documented in two places. This update removes the older
comments that are marked \internal.

Change-Id: I1c319b831d705d86eb4142b9963dbf56edc72772
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-03 18:34:15 +00:00
Martin Smith
c3e0f09e33 doc: Fix qdoc errors for \fn commands in QGenericMatrix
This change updates the \fn commands in QGenericMatrix
clangqdoc now parses these \fn commands and expects to see
all the template stuff in the signatures.

Change-Id: Icf815606f98271aae1959adc633e918e7f241aa0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-03 11:37:25 +00:00
Jan Arve Sæther
0c9e379dd8 Use a custom QAnimationDriver to take control over time
This should reduce flakyness of tests.

Change-Id: I26e0a97f7cd3e7cee2ffb44188300c37578cddd7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-12-02 19:58:30 +00:00
Alex Trotsenko
0873e5abb6 QProcess/Unix: do not toggle a state of the write notifier twice
_q_canWrite() unconditionally disabled the write notifier before the
writing, and might have enabled it again afterwards. This caused
unnecessary processing in the event dispatcher and could result in
extra system calls.

Actually setting the state at the moment when the write buffer size
is determined is enough.

Change-Id: I81f9ec27d95a5a9bdb83cc6a842b6ae95f002b96
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-02 19:42:11 +00:00
Martin Smith
24a0b641c1 doc: clangqdoc needs to see all GLxxx typedefs
Clang needs to see declarations for GLclampf, GLSizei,
and GLboolean.

Change-Id: Id1c1310e4877b32bb8fc2e6d4f743999842b3f06
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 17:30:17 +00:00
Martin Smith
f1817ea9ce doc: Add default openGL typedefs for clangqdoc
When Q_CLANG_QDOC is defined, ensure that the following openGL
types are defined:
typedef int GLint;
typedef int GLsizei;
typedef unsigned int GLuint;
typedef unsigned int GLenum;
typedef unsigned int GLbitfield;
typedef float GLfloat;
typedef float GLclampf;
typedef bool GLboolean;
typedef void GLvoid;
typedef char GLchar;
Running clangqdoc with these on macOS fixed over 500 qdoc errors!

There were also some functions that declared the parameter list as void.
It was also shown as void in the \fn command for each function in the
.cpp file, which is wrong. When the function is declared in the header
as int func(void), it should just be \fn int classname::func() in the
.cpp file.

Change-Id: I6489d499f0830e5ba97c085ed5dadfad5affecb7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 17:29:59 +00:00
Martin Smith
1a78e16d19 doc: Fix three "Cannot tie" errors
Two of the three functions were for functions that
should not be documented. The third was a function
protected by #ifndef Q_OS_DARWIN, which required a
test of Q_CLANG_QDOC in the header and cpp files.

Change-Id: Id2ab3e4f2ea896dc628a622de2e80a19c18eb9fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:58:07 +00:00
Martin Smith
7cfd6f0e1e doc: Fix some ref qualifier documentation errors
Some member functions of QImage were upgraded to use ref qualifiers,
but the documentation wasn't updated correctly to account for this.
This change update the documentation for those member functions to
show the ref qualifiers in the documentation.

Change-Id: I0ff4011e9d0251062d5616d69e9dda6bdbc1c136
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:47 +00:00
Martin Smith
87cce3e061 doc: Don't let qdoc see some defines that cause trouble
This update surrounds some #defines with #ifndef Q_CLANG_QDOC
because they define some names that conflict with formal parameter
names. Otherwise, clang starts replacing formal parameter names
with $27 etc, when qdoc runs, and that causes trouble for qdoc.
The change also replaces one use of Q_QDOC with Q_CLANG_QDOC.

Change-Id: I6e93bf1e0d30d7590280b6f18f0e694556050685
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:26 +00:00
Martin Smith
e210b1233d doc: Correct a few minor qdoc errors
A use of Q_QDOC is changed to Q_CLANG_QDOC.
A misspelled std type name is corrected.
A few extraneous ';' are removed.

Change-Id: Ic49f64a3b97f645268a8ecbbca5f0eef0456bb33
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:07 +00:00
Friedemann Kleint
22ec92a201 QSettings/QConfFile: Fix reading on NTFS symbolic links
The code checked on QFileInfo::size() whether the file had any content.
The check failed for NTFS symbolic links since QFileInfo::size() returns 0
for them. Workaround by using QFile::size() instead.

Task-number: QTBUG-64121
Change-Id: I303414b5a560d1ed8fbc53d969e53f9e2899ae5c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-02 11:01:34 +00:00
Martin Smith
beb9ca92df doc: Correct all remaining clangqdoc warnings in qpointer.cpp
This update corrects many qdoc warnings in qpointer.cpp caused by
incomplete \fn commands. Template stuff was added to the \fn commands.

Change-Id: I39bcd5db1cb4257d574918155dc49414a8b00c3d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 09:38:53 +00:00
Martin Smith
6bc994f3fd doc: Correct all remaining clangqdoc warnings in qdebug.cpp
This update corrects many qdoc warnings in qdebug.cpp caused by
incomplete \fn commands. It also corrects many undocumented parameter
errors caused by clang's requirement that the formal parameter names
be the same in both the declaration in the include file and the \fn
command. The name changes don't seem to be objectionable in this file.

Change-Id: I0630a0e05e651b58608b2f2116df70dcf0e83a45
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 09:38:36 +00:00
Martin Smith
1ca60025d9 doc: Add missing template text and parameters
This update corrects many qdoc warnings in the documentation
for the QFuture classes caused by incomplete \fn commands.
Template text and parameters was added.

Change-Id: I360c9db191230b19a9b174a43468d3de1eb24549
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 09:38:12 +00:00
Martin Smith
e2cdfd54c9 doc: Fix qdoc errors for \fn commands in algorithm functions
This change updates the \fn commands in qalgorithms.qdoc.
clangqdoc now parses these \fn commands and expects to see
all the template stuff in the signatures.

Change-Id: Id9492bf80eca494eb2b5b8d7364b8485ed1a047e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 09:37:49 +00:00
Martin Smith
bac26da9af Add template text to \fn commands in QPair
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.

Change-Id: I49302d0792c8a4c5a36c671142796a48d384b548
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 09:37:22 +00:00
Martin Smith
4411848026 Add template text to \fn commands in cache classes
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.
Removes about 150 qdoc warnings.

Change-Id: I63c6cae5613f0bb23527607230b6edf7fac33740
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-01 19:35:53 +00:00
Martin Smith
6530b036c7 Add template text to \fn commands in QVarLengthArray
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters. This
change eliminates about 150 qdoc warnings.

Change-Id: I23632e739b529cd56a6cae1a29df2e7131a05292
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-01 19:35:37 +00:00
Alexander Volkov
7c7a95cd09 Revert "QApp: Method to check for native style usage."
This reverts commit 958a4c9087.

QApplicationPrivate::usesNativeStyle() introduced by that commit
was never used. We have an untested method that is furthermore
may return wrong results because it relies on the comparison
'app_style->objectName() != QApplicationPrivate::desktopStyleKey()',
but not all styles set their object names.

Conflicts:
    src/widgets/kernel/qapplication.cpp
    src/widgets/kernel/qapplication_p.h

Change-Id: I48d221f9387381db9ed51a7a068bfd0a0c2ed58d
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
2017-12-01 19:29:29 +00:00
Alexander Volkov
a6b7447058 Disable some implicit conversions with QT_RESTRICTED_CAST_FROM_ASCII
Non-const arrays are not literals, so their encoding may be
not defined at compile-time and they should be converted
explicitly.

Change-Id: I2a65e095224f48efafeaa97fd85134697a1e5bf0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-01 19:29:14 +00:00
Marc Mutz
4c704fad08 QMetaObject::Connection: mark move ctors Q_DECL_NOTHROW
Drop the #ifdef Q_COMPILER_RVALUE_REFS - we require that since Qt 5.7.

Change-Id: Ib4c6f559b014915f43875ec6791bfda3f24a109b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-01 18:52:14 +00:00
Friedemann Kleint
15557a12de QImage: Output some bytes of first scanline on verbose debug streams
Change-Id: I1003c2b4109112fb2d2733a156120a041d7bd695
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-12-01 18:08:09 +00:00
Timur Pocheptsov
306c32f50e Fix out of bounds reads in qdnslookup_unix
When the response from res_nquery is too big for the buffer used to receive it
(of size PACKETSZ, a mere 512 bytes), the returned responseLength is the
size of the data that would have been delivered, had there been enough space.
Trying to process all of the data, including what wasn't delivered, leads to
reading past the end of the buffer, which either causes a crash or leads to
rubbish (from the stack) in the resulting QDnsRecords.  Easy to reproduce
using many long TXT records.

Replace the array with a QVarLengthArray; when the response is big, resize()
and retry, so as to actually get all of the data, so that we can process
it all. A follow-up patch will fix the case when even the second call/resize
buffer is not enough and we have to use TCP.

Task-number: QTBUG-64742
Change-Id: I173beb531e11a3828fd9c97f437afc192766035e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-01 15:05:41 +00:00
Andy Shaw
c4ba2b1c70 Copy the numericalPrecisionPolicy when copying the QSqlDatabase
As the numercialPrecisionPolicy can be set and subsequently retrieved
from the QSqlDatabase's driver, then when copying the QSqlDatabase, we
need to set that appropriately too.

Task-number: QTBUG-10452
Change-Id: I2c63748365ab4e9fbc29d8d460d80d2e2a0ee385
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-01 10:52:44 +00:00
Andy Shaw
33b03d99cd Remove code that refers to PostgreSQL 7.2 or older
We haven't had support for anything older than 7.3 for a long time, so
this removes the code to save having to maintain it any further.

Task-number: QTBUG-644
Change-Id: If0635f3bef5138a00a0e77011a70f23d0bffda32
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-01 10:52:32 +00:00
Martin Smith
b23c52ea81 Add template text to \fn commands in container classes
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters. It
eliminates nearly 2000 qdoc warnings.

Change-Id: Ibe047424396a8f99f8bd64efea1b0d8cc7c7527d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-01 10:48:22 +00:00
Alexander Volkov
fbda8acc92 QFutureWatcher: Use nullptr as a default value in constructor
... to make user code buildable with gcc [-Werror=zero-as-null-pointer-constant].

Change-Id: I309953acd7154511660302aa9826410276cfe41b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-12-01 10:15:40 +00:00
Andy Shaw
11a2e0aa2d Cocoa: Ensure menus for a dialog's menubar are validated correctly
Although the items were enabled for a dialog's menubar they were not
appearing as such because Cocoa will query the menu item's target to see
if it has a worksWhenModal selector. Therefore to ensure that the menu
item will be enabled, we need to add this selector to our delegate and
return YES from it when the window for the menubar is the dialog.

Task-number: QTBUG-44584
Change-Id: Ic62dc027d563069d2f5c2b7bf9810184bd76de39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-12-01 10:11:18 +00:00
Kimmo Ollila
de250dd22c Add EGLFS integration plugin for Qualcomm msm8996au board
Change-Id: I5bed1fd690daa72492e7ec5f24e80198a2592986
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-12-01 10:07:20 +00:00
Kimmo Ollila
f4498db196 Add configure test for INTEGRITY EGLFS openWFD integration plugin
Change-Id: I846f9e555df4f64097b5634707515d45c13a521c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-01 10:07:04 +00:00
Eskil Abrahamsen Blomfeldt
153311706c macOS/iOS: Fix garbled text under some conditions
There seems to be an issue in CoreText which may cause an existing
font descriptor to give unreliable results if it refers to one of
the system theme fonts. Since we do not know all function calls
or events that may trigger this bug, the safe route is to always
create fresh font descriptors when creating fonts for these
descriptors. The impact on performance should be small, as Qt has
its own internal caches.

[ChangeLog][macOS/iOS][Text] Fixed an issue where text using
one of the system theme fonts would under certain circumstances
display random glyphs.

Task-number: QTBUG-63476
Change-Id: I9e9b253018c63976345eec1439a6b78de2cab869
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-12-01 07:55:47 +00:00
Friedemann Kleint
673762b02e qwindowsmime.cpp: Fix clazy -Wclazy-container-anti-pattern
qwindowsmime.cpp(1267,10):  warning: allocating an unneeded temporary container [-Wclazy-container-anti-pattern]
qwindowsmime.cpp(1274,14):  warning: allocating an unneeded temporary container [-Wclazy-container-anti-pattern]
qwindowsmime.cpp(1383,10):  warning: allocating an unneeded temporary container [-Wclazy-container-anti-pattern]
qwindowsmime.cpp(1429,16):  warning: allocating an unneeded temporary container [-Wclazy-container-anti-pattern]
qwindowsmime.cpp(1450,20):  warning: allocating an unneeded temporary container [-Wclazy-container-anti-pattern]

Change-Id: I9188a0478b4be0c5c8f064578bbe027e33b67b89
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-12-01 07:27:15 +00:00
Friedemann Kleint
1f1f3a2b88 Fix -Wclazy-qstring-arg in Windows code
plugin\qlibrary_win.cpp(119,55):  warning: Use multi-arg instead [-Wclazy-qstring-arg]
plugin\qlibrary_win.cpp(155,55):  warning: Use multi-arg instead [-Wclazy-qstring-arg]
plugin\qlibrary_win.cpp(168,55):  warning: Use multi-arg instead [-Wclazy-qstring-arg]
socket\qlocalserver_win.cpp(228,61):  warning: Use multi-arg instead [-Wclazy-qstring-arg]

Change-Id: I0feadd3a5cce5ac2ba09630a38b867981d48a391
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-01 07:27:13 +00:00
Gabriel de Dietrich
32326a4b3b macx-clang: Opt-in xcb QPA support with XQuartz
Enable xcb QPA plugin when XQuartz is available. This is done
in a single build, alongside the Cocoa version.

We delegate part of the configuration stage to pkg-config, so
this becomes a requirement. Ensure that

    PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig

is in your environment, or pkg-config is properly set up.

Tested with the following configure options:

configure \
   -pkg-config \
   -fontconfig -system-freetype \
   -system-xcb -xkb -no-opengl \
   -qt-xkbcommon -qt-xkbcommon-x11

Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-01 01:19:46 +00:00
Gabriel de Dietrich
728c325a51 QtServiceSupport: Remove redundant condition
The condition for the 'services' sub-project in platformsupport.pro
was identical to the one guarding genericunix.pri in services.pro.

We can't remove the condition in platformsupport.pro because that
would result on an empty static library, which is not supported on
some platforms, like macOS.

Change-Id: I5c80737d9527bdd75dde44e33e5063f3d7aeecb7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-01 01:19:38 +00:00
Friedemann Kleint
155f954d99 Fix -Wclazy-connect-not-normalized in Windows code
qwindowsxpstyle.cpp(289,35):  warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]
qwindowsxpstyle.cpp(292,35):  warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]

Change-Id: I773530452c0837c5066f9174c25ae37e57086e76
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-11-30 20:50:46 +00:00
Laurent Montel
0fe3ff5c51 PrintSupport: modernize connection signal/slot
Change-Id: I6e482cd9503e96cc43ead21122d3690cdb18151c
Reviewed-by: David Faure <david.faure@kdab.com>
2017-11-30 20:40:21 +00:00
Laurent Montel
6a3f41aa46 Printsupport: not necessary to check pointer before to delete it
Change-Id: Ib2a7823224c45b6e9110016b2f5756e1b2fd8f3c
Reviewed-by: David Faure <david.faure@kdab.com>
2017-11-30 20:40:18 +00:00
Laurent Montel
40192995a5 PrintSupport: convert 0 with nullptr (c++11)
Change-Id: I35a8022c78427c9b4d4a9d9941770d22c36c3be8
Reviewed-by: David Faure <david.faure@kdab.com>
2017-11-30 20:40:13 +00:00
Oswald Buddenhagen
26e9a6a514 configure: make *_LIBS_{DEBUG|RELEASE} always work
... and not only when the source explicitly specifies build variants.

Change-Id: Iac6c8fda8f431d5fb50fada8338d1b660ab040d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-30 20:25:08 +00:00
Oswald Buddenhagen
0f1b8fd2dc work around flex bug
flex emits code using isatty(), but fails to include the required
unistd.h. we can work around it by including the header ourselves.

Task-number: QTBUG-64771
Change-Id: I05313eeb79f7a0e25365dee5f05a0142f87209ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:24:39 +00:00
Edward Welbourne
c27348985d Simplify date-time formatting in textForRole()
QAbstractItemDelegatePrivate::textForRole() was formatting date and
time separately, then gluing the parts back together with space.
QLocale can do that just fine itself (it has a toString() overload
that handles a QDateTime) and might even (some day) do it better.  To
my mild surprise, this proved sufficient to fix a problem with
date-time display in tool-tips, when the date-time includes a zone.

Extracted the date-time part of an existing selftest into a test of
its own and extended it to test times of each spec-type; verified that
the non-local spec cases of this all failed before this fix.

Task-number: QTBUG-61069
Change-Id: I6d6be0c27be9a557d8afc3ced200a10b2aaff816
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-11-30 20:21:42 +00:00
Edward Welbourne
454bbbe787 Clean up in TZP-Win's calculateTransitionLocalDate()
It's decoding a SYSTEMTIME in the slightly quirky manner of MS's
timezone APIs (year 0 means annual, with wDay as 1 through 4 for the
first through fourth, or 5 for the last, of a specified week-day
within a month) and the calculations to go with it were a little
opaque.  So clean it up, document what it's doing (and why) and assert
some things that should be true.  Also, only copy one int, instead of
a whole structure, to change from their day-numbering to ours.
Expand on a related TODO comment in its caller, at the same time.

Change-Id: Iffd95c094c37fc1081b73b2a267cfdcd29aeb4ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:20:40 +00:00
Edward Welbourne
205df620a0 Pull several structs and static functions into an anonymous namespace
The implementation of QWinTimeZonePrivate used many static functions
and at least one struct; to which I've added.  Put these all into an
anonymous namespace (thereby keeping the struct types out of the
linker's sight): make them local the C++ way, rather than the C way.

Change-Id: Ibdce0865234b5d4ebbdc90628cc4d9e790ed6321
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:20:35 +00:00
Edward Welbourne
6deb0f0dcc Fake a "first transition" at the start of time
QTimeZonePrivate::dataForLocalTime() needs a transition before the
time it starts at; MS's time-zone data tends to omit old zones (before
2007, in the case of Win7 for Casablanca - which had interesting
transitions before that), so all we can do is extrapolate backwards
from there; but a first rule is indeed apt to be a no-transition rule,
describing the zone's status up to the first known transition.  So
fake a "start of time" transition to return for this case, that
describes this prefix of history.

Change-Id: Iaf178cbebc3b1e599cbde3437a0af75d9f6ca432
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:20:15 +00:00
Edward Welbourne
35176c2289 Avoid underflow on arithmetic with possibly-first transition times
A transition time may represent the beginning of time; as such,
arithmetic on it might underflow, e.g. on adding a negative zone
offset to compare with a given time.  So move the arithmetic to the
other side of the comparison in such cases.

Change-Id: I1697a03ebf74679ff86059664dd2b173b9c4c367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:20:10 +00:00
Edward Welbourne
68bcccac22 Take account of single-transition hacks in MS time-zone APIs
When a year contains a real change of standard time without any DST,
MS's APIs still claim to have both a DST start and a DST end; one of
them is bogus and positioned on the start (or end) of the year,
producing no change in offset from the end of the previous (or into
the start of the next) year.  So code round that.

Task-number: QTBUG-42021
Change-Id: Ieb6161cfb77db8a57dc181097f117316f9d1c13c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:20:05 +00:00
Edward Welbourne
88d5ba5409 QWinTimeZonePrivate: make transition searches more efficient
Iterate rules (now that there's fewer of them than years) with only a
secondary iteration on years (when needed - in which case it should
never need more than two iterations).  In particular, avoid iterating
years to the MIN_YEAR and MAX_YEAR extremes on failure; fail faster !

Change-Id: I354af8e0cb1e484c8abda279991e6e1824f9f7d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:19:59 +00:00
Edward Welbourne
a99c773972 Refine handling of wMonth checks in QWinTimeZonePrivate
The MS API documents that the two TIME_ZONE_INFORMATION date fields
either both have wMonth clear (when there is no DST) or both have it
set (for each part of a DST pair).  This rule is followed even when
there's a standard time change without DST, with perverse results I'll
deal with in a later commit.  Add code in init() to verify the rule is
followed and qWarning() if not.

A year with no transitions doesn't imply no earlier or later year has
transitions, so don't give up on searches for transitions because of
it.  Also fix a potential uninitialized variable bug, related to
data() breaking out of a loop on such a year.

Change-Id: I1ad86c07e54b2eb835a2e02d18dc64022f52a0d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:19:54 +00:00
Edward Welbourne
81ad5bc838 Tidy up QDateTimeParser code to make it easier to reason about
Note that the relevant cases are all numeric, eliminate a redundant
variable (the min of two others, one of which was provably <= the
other), invert and rename a boolean (that was always used negated),
eliminate a case that couldn't arise (and assert this).

Change-Id: I9ef9cedbeb608c7cd56ddc618ddfb921966edfbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:19:35 +00:00
Edward Welbourne
b4ef4469ba QDateTimeParser: reject all short values in fixed-width fields
Previously, a 1, 2 or 3 for "dd" would be rejected because 10, 20 or
30 would fit in the field and be valid; but 4 or more was accepted,
even though it was too short for the field, because no suffix could
make it valid within the field-width.

[ChangeLog][QtCore][QDateTime] When parsing dates and times from
strings, fixed-width date-time fields, such as a "dd" for day,
QDateTime now rejects all values that should be padded, rather
than only doing so when the value is a prefix of some value that
would fill the field-width.  Use a single letter for the field,
e.g. "d" for day, if you want to accept short
values. (QDateTimeEdit is not affected.)

Task-number: QTBUG-63072
Change-Id: I22d223c50057c3edab4ef7f01d9ed0f58e9139c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-11-30 20:19:29 +00:00