Commit Graph

28559 Commits

Author SHA1 Message Date
Gatis Paeglis
28fd625873 configure: remove xkbcommon_evdev transition hack
It was added in c3a963da1f.
wayland was updated in a8fed20181729cae70de43079c4a34ad1780cfd7.

Change-Id: Ibf458815c3b61c5f936f147086db3d2b5782c175
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-07 18:20:56 +00:00
Gatis Paeglis
326658cfcd libinput: use QT_CONFIG(xkbcommon) macro
This patch amends c3a963da1f

Change-Id: I9e66aac4f0f45714343c585c79f37bd76683e103
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-12-07 18:20:49 +00:00
Vitaly Fanaskov
0088f76043 Fix inability to edit lines in QGraphicsTextItem when pageSize is set
Previous implementation relies on the fact that the only text document
with height -1 can grow or shrink vertically, and, hence, a bounding
rect should be updated under this circumstances. But method
QTextDocument::setPageSize might set a height different from -1, and
QGraphicsTextItem will be growing/shrinking vertically as well.
So, we have to relax condition to cover all use cases. Bounding rect
will be updated if new size is different from current size. This also
doesn't affect performance.

Fixes: QTBUG-55527
Change-Id: Id2c8e15d859aff9dde62c8ee14a6859c0c03f0d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-07 16:31:19 +00:00
Edward Welbourne
b60c642ec0 Revise filtering of Content-Length in HTTP cache control
We filter out Content-Length from the cache metadata due to IIS
sending it bogusly on 304 responses; however, we were only doing this
if the cached response had a Content-Length header, which doesn't
happen when the original request was delivered chunked.  Furthermore,
the filtering wasn't limited to the case of 304 responses.  So skip
the "had it previously" requirement and only do this for 304s.

Fixes: QTBUG-72035
Change-Id: Ie5d858e0f0205bf68f0a13a9c9d4a6e844cb3568
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-07 15:59:23 +00:00
Andre de la Rocha
f184f1a481 Windows QPA: Fix QDockWindow Drag & Drop
Pointer messages should not be handled when we are inside a move/resize
modal loop. DefWindowProc() should handle this case instead.

Fixes: QTBUG-72078
Change-Id: I5ad7283bcf0cfe0ff7d21cf5640270c361b8ad8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-07 15:49:56 +00:00
Ivan Čukić
b91e6befeb Preallocate buffer for QLineEdit when used for password input
While the user is entering the password, the string variable that
stores the value might have to reallocate its content from time
to time (when the string needs to grow beyond its current capacity).

When the reallocation happens, the old buffer is freed, but its
data is not zeroed-out. This means that a QLineEdit that serves as
a password input field might leak chunks of the password during
its lifetime, and the leaks will persist after its destruction.

Since the QLineEdit can not control the behavior of the QString
it uses to store the entered value, the only thing it can do is try
to make the reallocations rare.

This patch reserves the space for 30 characters for the string which
stores the QLineEdit value when said QLineEdit is used for password
input. This is enough to make sure no reallocation happens in
majority of cases as barely anyone uses passwords longer than 30
characters.

[ChangeLog][QtWidgets][QWidgetLineControl/security] Preallocate a buffer
for the string that contains the entered value when the QLineEdit serves
as a password input field to minimize reallocations.

Change-Id: I3e695db93e34c93335c3bf9dbcbac832fc18b62d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-07 15:47:39 +00:00
Lars Knoll
70a5fc15fd Use a QMultiMap for the fontengine cache
Cosmetic, so we can avoid using QMap::insertMulti().

Change-Id: If7c971e127af0537dd28bd25f7803804e7e01170
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-07 10:17:07 +00:00
Lars Knoll
6d38a1711c Use a QMultiHash to store persistent model indices
Because insertMulti() is deprecated.

Change-Id: I47208c281209f19045caa15ea748a2986c2cc0cf
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-07 10:16:51 +00:00
Lars Knoll
01a70da3e7 QNetworkCacheMetaData::AttributesMap is not a multi hash
And having duplicated entries in the hash doesn't make any sense. So use
regular iteration and insert for streaming the data in and out.

Change-Id: Ic3983010bdb9e17b207c6038fdccf43659da0e23
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-07 10:16:10 +00:00
Lars Knoll
0023948f83 Remove the model pointer from QPersistentModelIndexData
It can be just as well received from the QModelIndex member.

Change-Id: I72f930206ca2afed730009778ded0e56e4e6f278
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-07 10:15:58 +00:00
Oliver Wolff
f7019fa43b ANGLE: Set ANGLE_COMMIT_HASH and ANGLE_COMMIT_DATE
Fixes: QTBUG-72371
Change-Id: Ia03447b77d4f88eefc760e9bee14dbf3dd79d5a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-07 09:03:19 +00:00
Edward Welbourne
4da0c669d3 QTextCodec::codecForLocale(): clarify and update documentation
Change-Id: If3eec8cfc90cadcbd418807891ccf19b796f4006
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-06 19:13:35 +00:00
Frederik Gladhorn
e61028281f macOS accessibility: Rename parentElement to accessibilityParent
The NSAccessibility protocol has a property accessibilityParent.
This adds the implementation. The protocol will be adopted in a
follow-up commit.

Change-Id: I648cdc201950159e8268743a7fcdd24beb58c1c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-06 13:58:45 +00:00
Daniel Vrátil
97d8be10cd MySQL: Free the results when QSqlQuery::finished() is called
Calling mysql_stmt_free_result() frees the results of the last
executed query while keeping the prepared statement valid. This
allows to keep around prepared QSqlQueries without the overhead
of keeping all the results in memory.

Change-Id: I4589e90857cc4e9a6f9612799bfca967a67e2ab2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-12-06 09:33:45 +00:00
Nick D'Ademo
1986392255 QMdiArea: Do not move active subwindow after tile rearrange
Currently, a tile rearrange will move the active subwindow (if any)
to position zero (top-left). This ignores any tiling order set via
setActivationOrder(). This change removes this move so that the set
tiling order is respected when a tile operation is performed.

Fixes: QTBUG-43356
Change-Id: I2c481f0ffe45e42e811c6b6d476eb4cb65aa5d1f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-06 09:06:18 +00:00
Lars Knoll
01301b0b34 Don't require a default constructor for storing items in a QVector
[ChangeLog][QtCore][QVector] QVector does not require a default
constructor for its template argument anymore.

Change-Id: Idd256dd756829561c21bd9e1e693f2918f1e3247
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-06 09:00:19 +00:00
Timur Pocheptsov
6a28f67677 Add tst_QOcsp auto-test
This patch introduces a private 'API' to enable server-side OCSP responses
and implements a simple OCSP responder, tests OCSP status on a client
side (the test is pretty basic, but for now should suffice).

Change-Id: I4c6cacd4a1b949dd0ef5e6b59322fb0967d02120
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-06 05:14:45 +00:00
Ivan Komissarov
a8dae3ad0b qgraphicslayoutstyleinfo: Improve memory handling
Change-Id: I3d699a89e8833570132cbd03aa575e4f4cf9249b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-12-05 21:50:47 +00:00
Martin Smith
83bf7d8260 doc: Let qdoc ignore Q_DECLARE_INTERFACE
This macro declares three template functions that are different for each use
of the macro. The functions are in the public API but they are not meant to
be documented. This update just defines the macro to be empty so clang in
qdoc will ignore it.

Without this, clang reports a lot of errors incorrectly, but if we let clang
process the macro, it declares all those extra functions which then must be
documented with \internal in the cpp files, and we don't want to do that.

This will probably be redone in a later version using a custom annotation attribute.

Change-Id: I78ae4bcc98a3844b803d7ef7b1eba5d5539b043f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-05 13:55:17 +00:00
Sergio Martins
f5654d909a Pass non-trivial types by const-ref in range-loop [-Wclazy-range-loop]
corelib/serialization/qcbormap.h:176:14: warning: Missing reference in range-for with non trivial type (QPair<QCborValue, QCborValue>)
corelib/serialization/qjsoncbor.cpp:820:10: warning: Missing reference in range-for with non trivial type (QJsonValue)
gui/kernel/qguiapplication.cpp:1171:10: warning: Missing reference in range-for with non trivial type (QString)
printsupport/dialogs/qprintdialog_unix.cpp:741:10: warning: Missing reference in range-for with non trivial type (QString)
printsupport/kernel/qprinter.cpp:1851:10: warning: Missing reference in range-for with non trivial type (QVariant)
tools/qlalr/cppgenerator.cpp:463:8: warning: Missing reference in range-for with non trivial type (Name)

Change-Id: I327b0f116e329e55952ed5740a5f5af4b2918392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-05 10:32:03 +00:00
Qt Forward Merge Bot
aec026fe1e Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I54b4c14bed5150d3034ac87907a09254fd78face
2018-12-05 09:18:01 +01:00
Christian Ehrlicher
e2f473f4d4 QListWidget: mark (is|set)Item(Selected|Hidden) as deprecated
QListWidget::(is|set)Item(Selected|Hidden)() are deprecated for a long
time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.

Change-Id: I4567e740f1ebb5841b2e5b50c601fb83a782950c
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 21:01:18 +00:00
Liang Qi
009a5538eb Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-04 19:41:52 +00:00
Mårten Nordheim
e19df161cd _q_makePkcs12: Don't embed a key if we don't have one
Usually we embed the private key for the leaf certificate, but in
Schannel _q_makePkcs12 is also used to create a certificate store for
our CA certificates, which we don't have any private key for.

So lift this restriction.

Change-Id: Ic86a2a6725f2c8272c951148eb97e18a964a36f2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-04 14:26:57 +00:00
Mårten Nordheim
37f773a754 _q_makePkcs12: clean up
Remove braces for single-line bodies, space around binary operators

Change-Id: I958396772966428dcd9694279175fd61d6109b40
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-12-04 14:26:52 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Ivan Komissarov
f5cfc36e3e qgraphicslayoutstyleinfo: Remove useless check
There is no sense in testing the 'm_widget' pointer against null, as the
memory was allocated using the 'new' operator. The exception will be
generated in the case of memory allocation error.

Task-number: QTBUG-71156
Change-Id: I898bac6d9b51b2abd7a5311aa71ac2492c7c042c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-12-04 08:45:18 +00:00
Qt Forward Merge Bot
cf708de03a Merge remote-tracking branch 'origin/5.11.3' into 5.11
Change-Id: Idcb3f03013b54385f2322d9a2a559b41846ece79
2018-12-04 09:38:38 +01:00
Nick D'Ademo
4c58569085 QMdiArea: Take scroll bars into account when tiling subwindows
QMdiAreaPrivate::resizeToMinimumTileSize() does not take into account
scroll bars when calculating the minimum size for the QMdiArea widget.
As a result, if scroll bars are enabled or showing during a tiling
operation, the top-level widget incorrectly expands in size (instead of
utilizing the scroll bars). Therefore, we should only resize the
top-level widget if scroll bars are disabled.

Fixes: QTBUG-40821
Change-Id: I3a8b7582d23fdf12d2b09f3740eea6b60bb395c3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 07:39:16 +00:00
Christian Ehrlicher
8c38b08343 QFormLayout: Fix width calculation when a row has no label
The calculation of the minimum width assumes that when there is no label
for a row, the field occupies the full row. But this is only true when
QFormLayout::SpanningRole is set for this row. This lead to a to small
minimum size for the row / truncated widgets when the row in question is
the longest one in the form layout.
Fix it by checking if it is a spanned row instead if there is not label
when calculating the sizes.

Fixes: QTBUG-18308
Fixes: QTBUG-60800
Change-Id: I1a610c93ab5c7f9cac503721ae99b36f2710c634
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 07:00:37 +00:00
Thiago Macieira
652098d40f QTranslator: add initial largefile support
Using QT_MMAP macro instead of mmap() so we could map more than 2 GB of
the file. Not that the file format supports such a thing, but just in
case.

Change-Id: Iae320a2868db402a993dfffd15689bba1d667c7d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-04 06:51:20 +00:00
Thiago Macieira
121b0bfed5 Make qDetectCpuFeatures() return the CPU features it detected
Micro (nano?) optimization.

Change-Id: Iba4b5c183776497d8ee1fffd1564aa53056f343d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-04 06:38:31 +00:00
Eskil Abrahamsen Blomfeldt
ffeefaac62 Support style name property in QTextCharFormat
The support for setting the style name in the QTextDocument
API was never added, as revealed by the example in the
linked bug report.

The actual bug reported there (style names not working with
some Helvetica Neue) is not reproducible anymore.

[ChangeLog][QtGui][Text] Added support for setting the font's
style name in QTextCharFormat.

Task-number: QTBUG-22813
Change-Id: I8f4d12151c3611aa30965fd963bc93f7c4264e23
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-04 06:18:00 +00:00
Tor Arne Vestbø
b82559244e macOS: Account for LC_BUILD_VERSION when checking SDK version and deployment target
The more modern LC_BUILD_VERSION load command was introduced in the 10.13
SDK to unify the various versions of the LC_*_VERSION_MIN command. When
building with a deployment target of 10.14, the linker will use this
load command instead.

Change-Id: Ic3571fdbfdf4dfb9346128c6f6e75d1e06f86cd2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-12-03 22:44:45 +00:00
Friedemann Kleint
f213e818f0 uic: Generate correctly qualified invocation of QCoreApplication::translate()
Change QApplication::translate() to QCoreApplication::translate()
in generator and tests.

Task-number: PYSIDE-797
Change-Id: I0bbaf1f280b74b3b2a701a39203c059ab82fce1f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-03 19:05:03 +00:00
Friedemann Kleint
68fc972ac8 uic: Remove unused code
Task-number: PYSIDE-797
Change-Id: I6958ad76c138dcb4126cda8b26f23311963d6d37
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-03 19:04:55 +00:00
Lars Knoll
7f4d0405b4 Rename QList<T>::swap(int, int) to swapItemsAt()
The old name was confusing as it conflicted with
QList<T>::swap(QList &other), that was doing something
completely different.

Rename the method to swapItemsAt() which is a lot clearer.

Change-Id: Iac77a1e790a7256766f83a24d2a243c880d875f4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-03 17:57:09 +00:00
Lars Knoll
972f8845a8 Invert include dependencies between QList and QVector
This is a very slight source incompatibility, but required as
a preparation for Qt 6, where QList should inherit QVector or
share the implementation with it.

This requires some special work to correctly instantiate and
export QVector<QPoint> from Qt Core on MSVC.

Change-Id: I1d042c5fafdde7afe59409eda2580871d4832fcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-03 17:57:03 +00:00
Timur Pocheptsov
a8412dc020 Enable OCSP stapling in QSslSocket
This patch enables OCSP stapling in QSslSocket::SslClientMode (OpenSSL back-end
only). OCSP stapling is described by RFC6066 and based on the original OCSP as
defined by RFC2560. At the moment multiple certificate status protocol is not
supported (not implemented in OpenSSL). SecureTransport does not support OCSP
stapling at the moment.

[ChangeLog][QtNetwork][TLS] Added OCSP-stapling support for OpenSSL backend

Task-number: QTBUG-12812
Task-number: QTBUG-17158
Change-Id: Id2e0f4cc861311d1ece462864e5e30c76184af8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-03 13:20:05 +00:00
Oswald Buddenhagen
521a85395d configure: actually resolve libraries into full filepaths
this considerably speeds up failures, as no doomed build is attempted,
and produces more reliable results, as no second lookup (which would be
subject to environment changes) is done any more during the build.

in principle, this also opens up possibilities like selecting specific
variants of dependencies, automatically extracting rpaths, etc.

qt_helper_lib.prf also needs to create fully resolved library names now.

Change-Id: I65f13564b635433030e40fa017427bbc72d1c130
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-12-03 11:25:56 +00:00
Eirik Aavitsland
49319734c1 ico image handler: check for out of range image size
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.

Change-Id: I598db817c387867a449040f5be5427c8b8746483
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-03 11:25:30 +00:00
BogDan Vatra
13ed06640c [Android] Fix the ability to override environment and arguments
This mechanism should only be enabled only for debug deployments, but
the check was removed by accident in ca139228ab.

Fixes: QTBUG-72230
Fixes: QTBUG-72132
Change-Id: I3378436e93314fdf254919aed066f1284a4581b3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-03 11:15:26 +00:00
Lars Knoll
416b4cf685 Set correct vertical position for text following a very large image
If the document is paged and contains an image spanning more than one
page, correctly set the y position for everything following that
image.

Change-Id: I1c584c7a907c1728c2965f1dc3fdc56069ab3172
Fixes: QTBUG-59886
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-03 10:42:00 +00:00
Ivan Čukić
5dde7bd922 Erase password data on QLineEdit destruction
The contents of a deleted QString can still remain in memory
and can be accessible by tools that read the raw process memory.
This means that a QLineEdit that serves as a password input field
can leak the password after it is destroyed.

With this patch, the contents of the m_text string member variable
will be zeroed-out before the m_text is destructed. This is done
only in the cases when the QLineEdit serves as a password field.

[ChangeLog][QtWidgets][QWidgetLineControl/security] Zero-out the string
that contains a password entered into the QLineEdit

Change-Id: I8f88f952244bf8a0399c14acf0869439ca0a60ca
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-03 10:05:33 +00:00
Samuel Gaist
5d276d6a1d QNetworkConfiguration: add missing timeout unit to setConnectTimeout doc
Change-Id: I3738e989a41607244b55245222ec3c83dda68198
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2018-12-01 20:37:20 +00:00
Mårten Nordheim
17ced070fd Read font selection flags and use them when querying for metrics
Certain fonts with multiple styles have the same family name. When
loading these as application fonts we were not specific enough when
querying for the text metrics. This meant that e.g. the bold version in
a font family would get the metrics of the regular one.

Fixes: QTBUG-67273
Change-Id: Ic988d62cddde0a1f77ddcaf2891cadc21c9b31e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-30 16:15:03 +00:00
Allan Sandfeld Jensen
d23d146175 Fix alignment of temporary QRgba64 buffers on win32
The alignment of long long on 32-bit windows is only 32-bits, but we
should be safe to assume it is aligned at 64-bit.

Since QRgba64 is a public type, we can't fix the alignment there without
breaking ABI, so instead fix it where temporary buffers are allocated.

At the same time be consistent about using QRgba64 so we can switch to it
enforcing alignment in Qt6.

Change-Id: Ie15c305bc867c62a13df8eb2b1678e92174e1f97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-30 15:14:26 +00:00
Timur Pocheptsov
096d87c8b0 OpenSSL context (1.1) - make the if-fery/switch less ugly
no need in duplicating DTLS-specific cases.

Change-Id: I475c6fb53daa44d60a5054bf3acc8474355b2186
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-30 15:10:07 +00:00
Tor Arne Vestbø
58e66a2573 CoreText: Define font smoothing gamma along with rest of relevant code
Change-Id: I57909603732de6c1a91c744a358968941e64acdf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-30 14:47:50 +00:00
Andy Shaw
2afe4a1a07 Android: Don't use blocking queued when suspending the application
If the application gets suspended when a blocking queued connection is
made then it will cause the application to hang when being resumed.
Therefore a check is needed to still post the event to the other thread
but in a non blocking manner so that it does not cause a hang on return.

Fixes: QTBUG-72101
Change-Id: I6d53c97ed6d9d500559da2a9fd195226d1fc9905
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-11-30 14:47:36 +00:00
Gatis Paeglis
f2b4462f84 xcb: remove old work-around for building with util-wm
Commits that added this code:

7ce8491280 and
f005dee1b3

I guess this was a work-around, before we started bundling
XCB libs a year later in 21bd66e1ea

0.3.8 was released in 2011-04-26 and we are bundling 0.3.9, so
it is safe to remove the include work-around as well.

Change-Id: I5794f40d86e10ebdad984aa4b61311979aaadcf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-30 14:05:13 +00:00
Gatis Paeglis
0de4b326d8 xcb: fix issue with dialogs hidden by other windows
This was a regression from Qt4, due to not setting the window
group leader in WM_HINTS property. Qt4 did set this property.

It was not obvious that something was missing because of the
similarly named WM_CLIENT_LEADER property, which we do set.
Testing revealed that setting WM_CLIENT_LEADER is sufficient
on some DEs, e.g. KDE, Unity, but did not have the desired
effect on e.g Gnome and XFCE.

EWMH/ICCCM specs are known to be ambiguous, WM_CLIENT_LEADER
is only mentioned in the section on the session management, so
it is not surprising that there is this inconsistency between
various WMs.

This patch merely restores a lost WM hint. This solves the
reported issues on major desktops. If we support calling show()
on a dialog before its parent has been shown is still an open
question, which should be handled in QTBUG-72040.

Task-number: QTBUG-56829
Fixes: QTBUG-46626
Fixes: QTBUG-70756
Task-number: QTBUG-72040
Change-Id: Id2c575850e5f4f5af3e57963c577d33572e30b6e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-30 14:05:04 +00:00
Tor Arne Vestbø
e11a3b3f3e CoreText: Base glyph fill color logic on font smoothing algorithm
Change-Id: I22be1efb1f91048745008ea1b49186b39367d122
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-30 14:03:49 +00:00
Tor Arne Vestbø
64037f18d3 CoreText: Respect QFont::NoSubpixelAntialias when deciding glyph format
Change-Id: I846758bce2fd7536f9941b11f23fc0e5d5bc6f1b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 11:19:23 +00:00
Timur Pocheptsov
dae2e6be93 Fusion style - avoid a warning
... printed by QPainter when it gets a pixmap with one or both of
dimensions equal to 0 (and a nullptr as a paintEngine).

Task-number: QTBUG-71806
Change-Id: I978f56c843daab307042e34390fc33f338ce8cf5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 10:44:41 +00:00
Tor Arne Vestbø
b926d5f919 CoreText: Remove handling of QFontEngineMulti's highByte
It's a leftover from when the Cocoa plugin used QFontEngineMulti
exclusively. Nowadays QFontEngineMulti will strip out the highByte
before calling into the real engine. Left an assert just in case..

Change-Id: I6cb26d20a908d7c3aaf096297fca160805fdb85b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 10:35:52 +00:00
Morten Johan Sørvig
eab84914f1 macOS: make QScreen::grabWindow() fast again
Commit 17b73b0d2b regressed performance by grabbing
the entire screen and then copying the grab region.

Move back to grabbing a minimal rectangle instead.
Also handle multi-screen grabs at different device
pixel ratios.

Multi-screen grabbing is handled by grabbing each screen
individually, and then stitching together the result.
The returned pixmap is created using the highest DPR
available, upscaling lower resolution parts as needed.

Change-Id: I9d45c5f7ec7b342360b745f49ef2939dc588f40b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 10:28:42 +00:00
Gatis Paeglis
c3a963da1f src/3rdparty: remove xkbcommon
The only reason why we bundled this library ~6 years ago was because
it was not available on distributions that we supported at the time,
but library was a hard dependency for XCB plugin. See:
2122e731ab

Later more and more projects started to depend on it (compose input
context plugin, libinput, mir, wayland). The configuration had become
too complex, because some projects used bundled and some used the
version from the system.

Having libxkbcommon in 3rdparty sources is not necessary anymore, after
RHEL 6.6 was removed from the list of supported platforms for Qt 5.12.

Ubuntu 16.04  - 0.5.0
Ubuntu 18.04  - 0.8.0
openSUSE 42.3 - 0.6.1
RHEL-7.4      - 0.7.1

This will also simplify further development, e.g. QTBUG-42181

Bumped the minimal required version 0.4.1 -> 0.5.0.

The patch also contains a code marked with "TRANSITION HACK", which
is temporary needed so we can update the dependent wayland module.

[ChangeLog][Third-Party Code] Removed xkbcommon from bundled sources.
This library is present on all supported platforms. The minimal required
version now is 0.5.0.

Task-number: QTBUG-65503
Change-Id: Iec50829bb6f8fbb19f3c4e4ad62e332beb837de5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-30 09:47:03 +00:00
Allan Sandfeld Jensen
1f1dc3fc4c Fix gamma-correction in QCoreTextFontEngine with Mojave
The code was previously assuming font-smoothing was only used with
A32 font antialiasing, so the corresponding gamma-correction was not
performed.

Task-number: QTBUG-71075
Task-number: QTBUG-71946
Change-Id: I68d8304cf18638239d8bfac32c67333f16ccc7bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-30 00:18:59 +00:00
Mitch Curtis
247baedb25 Doc: specifically list the QToolButton properties that actions affect
Also, add a note that explains that autoRepeat does not affect
QToolButton's autoRepeat property.

Change-Id: I9e95cef9e9d1b5ee6cb1114d0b9a9fad562db601
Fixes: QTBUG-48204
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-29 21:56:29 +00:00
Ville Voutilainen
1eeebae7e3 Fix compilation of qendian's qswap specializations on gcc 4.8
Task-number: QTBUG-71945
Change-Id: Icf2b75c72946f57ebffc880c9238531dea13ab5b
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-29 20:42:33 +00:00
Thomas Miller
6b875f0625 Implement mul_overflow for MSVC arm64
Change-Id: Ia7c79614e6ef21222fb9683b540ac51b45a77c49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-29 18:09:47 +00:00
Albert Astals Cid
6d58a1cecb Fix QPpdPrintDevice::isDefault
How to test:
 * Have two printers
 * Use lpoptions -d to set the default printer to be one and then the
other
 * Use lpstat -d to check setting the default printer worked
 * Use this simple test program and check the resulting values make
sense
    qDebug() << "DefaultPrinter" << QPrinterInfo::defaultPrinter().printerName();
    const QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
    for(const QPrinterInfo &pi : list) {
        qDebug() << pi.printerName() << pi.isDefault();
    }

Fixes: QTBUG-70317
Change-Id: I535d11451c568630a374f5c37d8cac32cbb6d3ab
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-11-29 18:07:30 +00:00
Tor Arne Vestbø
0cf5648ce6 CoreText: Store glyphs in linear RGB when needed by blending algorithm
Instead of tying the linear-conversion to a specific function, we move it
to imageForGlyph and base it on the premise for needing it.

Change-Id: Ib8fc79ad419ef703abcb82785ac15d4c75fb98e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 18:03:18 +00:00
Tor Arne Vestbø
ec254d2555 CoreText: Add font antialiasing and smoothing helper functions
The font smoothing helper in particular now takes into account whether
or not we're dealing with color glyphs, in which case we shouldn't (or
don't need to) smooth, and also makes sure the QFont::NoSubpixelAntialias
style strategy doesn't affect font smoothing when we're dealing with
non-subpixel-antialiased font smoothing, as on macOS 10.14.

Change-Id: Ibd477158629402c55cafec31576b6d9901d184cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 18:03:06 +00:00
Tor Arne Vestbø
3944f45c4d CoreText: Remove handling of the AppleAntiAliasingThreshold user default
The setting is not relevant for modern macOS applications, and none of
the applications shipped with macOS today are affected by it.

The only code path in macOS that picks it up is +[NSFont initialize] in
the UIFoundation framework, storing it for later so that -[NSFont screenFont]
and -[NSFont screenFontWithRenderingMode:] can use it, but these APIs are
deprecated and we don't use them in Qt.

Other NSFont code paths will not hit these APIs unless screen font
substitution is enabled, something it hasn't been since OSX 10.7.

 https://preview.tinyurl.com/yctpfnqp

Removing handling of this setting allows us to simplify the reasoning
for whether or not antialiasing and font smoothing is enabled for a given
engine.

Change-Id: Ie2809052a1a0815d9bddedd4a6236eb6c898f993
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 18:02:58 +00:00
Val Doroshchuk
2e86b652b7 Fix crash in QSimpleDrag when no platform window
No need to return top level window if it was not created.
It means no platform resources have been allocated.

Events might not be delivered if the wrong window is returned.

Fixes: QTBUG-70544
Change-Id: I43462974f70871470f7b7490dc2b3c08846f77b1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-29 13:14:14 +00:00
Mikhail Svetkin
2a1c368c87 xcb: Use std::move and pass argument by rvalue reference
It will avoid a creation of temporary object and avoid copying.

Change-Id: Ifae5f6f9e36bcb07f4bacc31f151f8adcfa621a3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-11-29 13:13:33 +00:00
Tor Arne Vestbø
ae1f749e9e CoreText: Rename argument to imageForGlyph to better reflect how it's used
The 'aa' argument doesn't unconditionally enabled antialiasing, it just overrides
the check that the pointSize is larger than the antialiasing threshold. If the
styleStrategy has QFont::NoAntialias we still end up without antialiasing.

Change-Id: I7130e7c68d883c2443756242e96790264f583b0f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 12:03:44 +00:00
Tor Arne Vestbø
6b93b01ad6 CoreText: Add helper function to determine if a font has color glyphs
Makes for clearer code than looking at the glyph format.

Change-Id: Id6dd2a7851aac2a42cc27d9e2fb408ce9a5345d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 12:03:44 +00:00
Tor Arne Vestbø
d4e3442fdb CoreText: Modernize font smoothing and antialiasing threshold detection
The way macOS does font smoothing has changed in Mojave, and we need to
take both this new algorithm into account, as well as support users who
set legacy preferences to revert back to subpixel font smoothing.

As a followup to this patch we will tweak some of the existing logic
to take the new font smoothing algorithm into account, so this is
just a first step.

Change-Id: If37014c18515f406b8bb8194c9df7a75c2eb10fc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-29 12:03:18 +00:00
Giuseppe D'Angelo
2a494875b8 OpenSSL: also try the "1.0.2" soname
Turns out that also Debian patches OpenSSL 1.0, changing its soname to "1.0.2".
Therefore, try also to load that one.

Amends 2708c6c11d.

Task-number: QTBUG-68156
Change-Id: I37cc060e90422779a6c29a324ab900f0fb99cfa7
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-29 08:18:44 +00:00
Tor Arne Vestbø
09e3457541 macOS: Share code for resolving CGImage bitmapInfor for a QImage
Removes assumptions about QImage format in a few places.

Change-Id: I515701be53190429a48956c31986fa0804806406
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:17 +00:00
Tor Arne Vestbø
5fd6f4d882 CoreText: Use QCFType instead of manual release/retain
Change-Id: I4925ec0e563e784f542fd44706a214771c6abd2b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:17 +00:00
Tor Arne Vestbø
17cdb28ed5 macOS: Fix use of deprecated enum value
Change-Id: Ibf979837e1adcadcbb100d059b06b1a48157eab6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:17 +00:00
Tor Arne Vestbø
d3ec5a2b09 CoreText: Use QCFType to track CoreFoundation member variables
The operator T() function of QAppleRefCounted should be const so
that the underlying type can be accessed from const member functions
just like the naked underlying type could.

Change-Id: I0819c5795d28442a6ff4db2732e211b183574f9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:16 +00:00
Tor Arne Vestbø
61a94d2d04 CoreText: Share code by using delegate constructor
Change-Id: If3d5d533f98552335517ef61cb748d0117fe3053
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:16 +00:00
Tor Arne Vestbø
9dd2048c1a CoreText: Simplify and share code for loading glyph advances
The function doesn't need the flags argument, nor does it need the
ctfont or fontdef arguments if it's a normal const member function.

It can also be used from QCoreTextFontEngine::stringToCMap(), instead
of duplicating the code. This was originally the case before b4aa5d97
which improved surrogate pair handling, but for some reason the change
introduced the duplicate code instead of just changing the arguments
in the function call slightly.

The use of 0xff000000 to skip certain glyphs looks dubious, and is
probably related to QFontEngineMulti's use of the high byte to
indicate which engine the glyph came from, but the multi engine
strips this away before calling out to the concrete engine so
it could potentially be removed in a later patch.

Change-Id: I6c693595616da1b69fdbe3d7a31e392a8443369d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:16 +00:00
Tor Arne Vestbø
b22c4e593b CoreText: Localize getTraitValue helper function
It's only used in a single function (twice), so let's keep it
closer to the call site.

Change-Id: I7f8ceadc380171237eef3fa6b03ccd6bc89e99af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:15 +00:00
Kirill Burtsev
bd989d1652 xcb: free leaking clipboard events
The leak has been there since the beginnings of Qt 5.0.

Change-Id: I238181dcc63cb4cf8a60b5c565b184d8278d0315
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-11-28 11:19:36 +00:00
Kirill Burtsev
030b17ecc0 QDBusConnection: prevent leaking connection/server on destroy
Amends fix 68964b1023

Change-Id: I05816f4b4d2128ed0b669e124d9c9eef92122ec0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-28 11:19:34 +00:00
Kirill Burtsev
4213f23936 xcb: Fix leaking events on destroy
This patch amends 243c3044b6

Change-Id: Ieeebb1e2b94d7c191bf80a1f439c826c406a0c08
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-11-28 11:19:31 +00:00
Tor Arne Vestbø
9e1cb252e0 Destroy QWindowContainer's fake parent window when not needed
Keeping the fake parent window around in a created state means we're
wasting system resources such as native platform views/windows, and
makes it harder to debug the lifetime of these resources.

The fake window will be re-created if re-parented into at a later
point.

Change-Id: Ib82560e7e565af19d58afe121fd087669a6ffb95
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-28 10:11:08 +00:00
Friedemann Kleint
f4a84ac966 QWindowContainer: Fix warning triggered by QT_ASCII_CAST_WARN
Amends 52bd707f0d.

Change-Id: Icc42edc7a943099b36bfa92fe7cd1a92db344991
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-28 10:10:24 +00:00
Kevin Funk
49d63057e3 qobject_p.h: Use nullptr everywhere
Change-Id: I605e44607cc09775548c1e6b781d476c1627c9c7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 09:47:33 +00:00
Allan Sandfeld Jensen
ae8389e19c Ensure alignment of image-data
Instead of relying on the return value of malloc having the correct
alignment, use proper non-throwing new[] operators.

Change-Id: I06c6c619e21c848f3d184bdb7cef8c5589c1c7ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-28 09:11:28 +00:00
Thiago Macieira
d8962144b4 Fix calculation of the string tab size in QElfParser
First of all, we were using the wrong size variable: instead of the size
of the section, found in the section header, we were using the size of
each section entry in the section table. Since that's usually smaller,
we weren't hitting a problem.

Second, if the string table is the last thing in the file and there's
nothing else after it, not even padding, then offset + section_size can
be equal to the file size. In fact, the .shstrtab section is usually the
last one, as it contains the section names themselves, so it stands to
reason that it's the second to last thing written.

For generic linkers, the last data in the file is the section table
itself, so usually the file is larger by at least a kilobyte, which is
why we haven't hit this bug. It could only manifest as deciding that
certain specially-crafted but valid ELF files were invalid. I can't
think of a way to trick it into thinking an invalid ELF is valid.

That's another reason why this code needs to be rewritten with more
modern coding styles and actually using <elf.h>

Fixes: QTBUG-71443
Change-Id: I1bd327aeaf73421a8ec5fffd156162f2df5557b8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 04:37:43 +00:00
Thiago Macieira
dba6067670 Optimize QSharedPointer::getAndRef with the three-operand testAndSet
Originally QAtomicPointer didn't have the three-operand version,
resulting in code like:
  if (!atomic.testAndSetXxx(expected, newvalue))
       expected = atomic.load();

The three-operand version gives us the current value of the atomic in
case the test failed and it's free in all architectures, unlike the
extra load.

I have to use testAndSetOrdered here because I need the failing load to
use the Acquire memory order, even though that has an extra Acquire for
the successful case we don't need. QAtomicPointer does not have
testAndSetReleaseAcquire.

Change-Id: I1bd327aeaf73421a8ec5fffd1560fe30d3bfd9b8
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-28 04:37:10 +00:00
Richard Moe Gustavsen
f1812aad89 QFocusFrame: protect it from being moved around by accident
If a focus frame is set around a widget that exist inside a
QAbstractItemView, both the focus frame and the widget will
be scrolled when the table is scrolled (since the focus frame
is a child of the view). The result is that after the widget
has been scrolled (which will move the focus frame to the
correct position as well), the focus frame will be scrolled
next, and therefore away from the widget.

This patch will catch this case by always adjusting the
focus frame position when someone tries to move it. Trying
to move the focus frame away from the widget it tracks
will anyway be flaky.

Fixes: QTBUG-63877
Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-27 14:59:52 +00:00
Tor Arne Vestbø
7f6497e623 Ensure QOpenGLWidget FBO is always initialized
QOpenGLWidget uses an FBO internally, that is glCleared whenever
recreated. But for the clear to be visible across shared contexts
we must also issue a glFlush.

QOpenGLWidget defers this flush until the compositing step, in
QOpenGLWidgetPrivate::beginCompose(), based on a flushPending
variable.

This variable is set either after invoking the user's paintGL()
function, or when opening a QPainter on the QOpenGLWidget, via
QOpenGLWidgetPaintDevice::ensureActiveTarget().

Unfortunately, if QOpenGLWidget::paintEvent() is overridden or
intercepted (meaning we will not end up calling paintGL()), but
the overridden paint event does not open a QPainter, we end up
never setting flushPending to true, and end up composing an
uninitialized FBO.

This can lead to rendering issues, or even kernel panics with
some unfortunate GL drivers.

The fix is to ensure the glClear is always flushed before
composing, by forcing a pending flush whenever the FBO is
recreated.

Fixes: QTBUG-70921
Change-Id: I72b596c09dcf54bd0f37668062daaad2d6f7f4bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-27 14:55:17 +00:00
Edward Welbourne
4e01b85115 QDateTimeEdit: fix setDate() if time is in a spring-forward
If the time the widget is set to use falls in the gap skipped by a
spring-forward, setting the date to the day of the spring-forward
turned a valid date into an invalid date-time.  So use the usual trick
to map the "draft" date-time to a valid one.

Fixes: QTBUG-64485
Fixes: QTBUG-58947
Change-Id: Ib8f0f092cd5d6dce3da31eb52cd42150ca0d1fcb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-11-27 14:23:25 +00:00
Friedemann Kleint
d41879db38 Documention: Use const-ref in the snippets for qOverload()
This makes it clearer that const-ref needs to be specified in
the template arguments of qOverload() and related.

Change-Id: I527c8ca853be159af8665e9759d9549df10573b3
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-11-27 14:04:31 +00:00
Timur Pocheptsov
05892bca9b Fix build errors in OpenSSL 1.1 backend
SSL_CTX_set_ciphers is new in 1.1.1.

Task-number: QTBUG-71983
Change-Id: If0ae9f95dcc867c62ed0d3a6a60c22c7f5e1cc9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 36f3eeaf3e)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-27 07:53:46 +00:00
Nick D'Ademo
4744f31e59 QMdiArea: Do not reset tiled flag on spontaneous system window events
Do not reset the isSubWindowsTiled flag if the hide/show event is an
external (spontaneous) system window event, i.e. we should instead
reset this flag when the subwindow itself is directly hidden or
shown. This change ensures that tiling will be performed during the
resizeEvent after an application window minimize (hide) and then
restore (show).

Change-Id: Ib37f52f1162b493be3413fc59951be2f30701439
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-27 00:49:01 +00:00
Qt Forward Merge Bot
ec5e692c1c Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I04afffdce6b78856d0301eb583f21d334c7466b0
2018-11-27 01:00:36 +01:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Vitaly Fanaskov
ba13c6c08f Fix calculation of text margin if line edit contains side widgets
The previous implementation leads to infinite chain of showing/hidden
line edit under circumstances described in QTBUG-54676. We basically got
the situation when size hint were calculated differently depending on
the line edit visibility state. In this case toolbar layout have to
show/hide extension button and line edit a lot of times and can never
leave this "loop" (please note, that the chain is much more complicated
in reality):
Resize toolbar -> Set layout geometry -> Size is OK to display line edit
-> Set layout geometry -> Hide extension button -> Set layout geometry
(wrong size is calculated here, so "run out of space") -> Hide line edit
-> Set layout geometry -> Show extension button -> Set layout geometry -
> Size is OK to display line edit ... And we're in the "loop"

Clear button is hidden if there is no text in a line edit.
In the previous implementation, the button was always visible, only
opacity was changing in order to "hide" the button. It resulted to
incorrect size hints (regular and minimum).
In the current implementation the button is really hidden/shown, and
size hints calculated correctly.
Also updated unit test for line edit.

Remove code duplication in functions for calculation text margin

Fixes: QTBUG-54676
Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-26 16:03:33 +00:00
Lars Knoll
f91d1e0809 Documentation fix
Most of our containers do not require a default constructor for
the template argument. Of course some operations (such as reserve)
still need it.

Change-Id: If080c422a1ffc13b8cb5e0915cee9a7adee81adc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-26 07:04:29 +00:00
Lars Knoll
b98c43ea60 Compile with QT_STRICT_ITERATORS defined
This will be the only options for Qt 6, so make sure the code compiles now.

Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-26 07:04:24 +00:00
Lars Knoll
c2bf0cac95 Warn when using deprecated methods
Change-Id: Id6e65d83e9279407b4b02967e4044f33d8c6ae01
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-26 07:04:19 +00:00
Friedemann Kleint
b1a9a7794f Add setter for property QStyleHints::showShortcutsInContextMenus
Add a tri-state setter logic similar to the other properties.

Fixes: QTBUG-71471
Change-Id: Iddb5be18a037634a53ad8725bddb91c12fb33fed
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-24 11:39:05 +00:00
Friedemann Kleint
45a6397e3e QStyleHintsPrivate: Use member initialization
Task-number: QTBUG-71471
Change-Id: I368193bc363944825c01da5337738fd0a7ba2219
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-24 11:39:00 +00:00
Friedemann Kleint
70d131af33 Windows: Fix embedded application not getting focus after clicking outside
Amend the check introduced by bde6a04949
to not apply to embedded windows and plugin applications.

Fixes: QTBUG-71991
Task-number: QTBUG-7081
Change-Id: I80b3dc0fa20ee3447a4bc4bbb41e66d4d90ab726
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-24 11:38:18 +00:00
Allan Sandfeld Jensen
bfe53c7da5 Optimize QRgba64::toArgb32() and premultiplied()
Using similar techniques as used for QRgb qPremultiply and friends

Change-Id: I4be68cb01dc3b634cf370323884e824674205998
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-24 11:31:19 +00:00
Friedemann Kleint
7264bf19db Windows: Add a default setting for hasBorderInFullScreen
The hasBorderInFullScreen only has an effect when set before
the window is shown or switched to fullscreen. This is currently
not possible in the QML case since the window is only accessible
after all properties (including visibility) have been set.
Add a function to set a default value.

[ChangeLog][QtPlatformHeaders][QWindowsWindowFunctions] Add a default
setting for hasBorderInFullScreen

Task-number: QTBUG-47247
Task-number: QTBUG-71855
Change-Id: I3952e3f34bc4eb134cf1c5265b4489fc74112688
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-24 09:11:21 +00:00
Friedemann Kleint
27f08ab494 Long live Q_DISABLE_COPY_MOVE!
When using Q_DISABLE_COPY, clang-tidy reports:

warning: class 'Foo' defines a non-default destructor, a copy constructor
and a copy assignment operator but does not define a move constructor or a
move assignment operator [cppcoreguidelines-special-member-functions]

Add convenience macros to suppress move constructor/assignment
as well.

[ChangeLog][QtCore] Added macros Q_DISABLE_MOVE and Q_DISABLE_COPY_MOVE
complementing Q_DISABLE_COPY.

Change-Id: I0b07495ef4ef06c714f7368c706168613c3fe7bc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-24 09:11:05 +00:00
Lars Schmertmann
de83447830 Add support for Diffie-Hellman keys to QSslKey
This is necessary to provide details for the key too,
when the server is using DHE-RSA-AESxxx-SHAxxx.
Amends 7f77dc84fb.

Change-Id: I8ab15b6987c17c857f54bc368df3c6c1818f428c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-23 22:58:05 +00:00
Timur Pocheptsov
36f3eeaf3e Fix build errors in OpenSSL 1.1 backend
SSL_CTX_set_ciphers is new in 1.1.1.

Task-number: QTBUG-71983
Change-Id: If0ae9f95dcc867c62ed0d3a6a60c22c7f5e1cc9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-11-23 13:45:18 +00:00
Friedemann Kleint
76dafc9b94 Add translator's comment to the copyright note
State the policy that so far only exists in the localization wiki
and is currently not followed by all translators.

Task-number: QTBUG-57697
Change-Id: I2aa9f1bbd244b53e48e59f625520a7f86d2df347
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-23 13:25:18 +00:00
Edward Welbourne
d8b401959f Recognize E along with e as exponent character in asciiToDouble
Fixed a misguided condition in the check for bogus texts in the sscanf
branch of the decoder; it checked for 'e' but neglected 'E', which is
just as valid.

Change-Id: I9236c76faea000c92df641930e401bce445e06c8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:33 +00:00
Edward Welbourne
ce159d1a3e Fix toFloat()s between float and double ranges and document
Revised some toFloat()s to be consistent with the matching
toDouble()s; previously, they would return infinity if toDouble() did
but return 0 if toDouble() got a finite value outside float's range.
That also applied to values that underflowed float's range, succeeding
and returning 0 as long as they were within double's range but failing
if toDouble() underflowed.  Now float-underflow also fails.  Amended
their documentation to reflect this more consistent reality.
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toFloat] QString, QByteArray and QLocale returned
an infinity on double-overflow (since 5.7) but returned 0 on a finite
double outside float's range, while setting ok to false; this was at
odds with their documented behavior of returning 0 on any failure.
They also succeeded, returning zero, on underflow of float's range,
unless double underflowed, where they failed.  Changed the handling of
values outside float's range to match that of values outside double's
range: fail, returning an infinity on overflow or zero on underflow.
The documentation now reflects the revised behavior, which matches
toDouble().

Change-Id: Ia168bcacf7def0df924840d45d8edc5f850449d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:24 +00:00
Edward Welbourne
a992367403 Change documentation of some toDouble()s to reflect reality
They actually return infinity if conversion overflows, while still
setting ok to false; they were documented to return 0 on failure, with
no mention of this special handling of overflow.  Documented reality
rather than changing the behavior.  Gave underflow as an example of
failure other than overflow (toDouble()s do indeed fail on it).
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toDouble] QString, QByteArray and QLocale return
an infinity on overflow (since 5.7), while setting ok to false; this
was at odds with their documented behavior of returning 0 on failure.
The documentation now reflects the actual behavior.

Fixes: QTBUG-71256
Change-Id: I8d7e80ba1f06091cf0f1480c341553381103703b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:06 +00:00
Edward Welbourne
6dcc13d402 Make QCOMPARE()'s handling of non-finite float match double
The qCompare() implementation for double was handling infinities and
NaN the way tests need, but the one for float didn't; it has just the
same need, so apply the same fix.  Extends 79493a3ee1.

Change-Id: I8425026acb61d535e449f579b77fdcd609157f7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-23 10:04:20 +00:00
Frederik Gladhorn
bc1678c618 macOS accessibility: fix crash for NSAccessibilityVisibleCharacterRangeAttribute
VoiceOver or other tools may query this property even when there is no text
interface. Make sure not to crash by verifying that the interface is supported.
Found while using AccessibilityInspector to verify other changes.

Change-Id: If7ee21b7616f091b71e86bab03a871ddbabe9200
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-11-23 09:50:00 +00:00
Boris Dušek
18b1dc35e9 macOS a11y: Implement AXInsertionPointLineNumber with AXLineForIndex
Follow DRY and do not repeat implementation of basically the same
thing, especially now that the implementation is no longer completely
trivial.

AXLineForIndex can be considered a primitive attribute, and
AXInsertionPointLineNumber a derived attribute, hence this opportunity
to not repeat oneself.

Change-Id: I64b596d8351e681f4438b91400a767407612c118
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-23 06:43:10 +00:00
Boris Dušek
6be4a67322 Align implementation of LineForIndex with InsertionPointLineNumber
On macOS, the accessibility implementation of InsertionPointLineNumber
currently reflects a fix for issue (QTBUG-49437). While it seems from
testing this issue no longer requires such a fix, it still is a nice
optimization for single-line edits. So we hereby bring the same
optimization to LineForIndex parameterized attribute as well, and
makes the code for both attributes consistent.

Change-Id: I18b8cc249b6c65a25150f4e503999b04437e0306
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-23 06:43:04 +00:00
Boris Dušek
9dc19d6716 qcocoaaccessibilityelement.mm: Document convertLineOffset function
Change-Id: I359768a7cbd4c3e1e11a453a32bb28add891cf20
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-23 06:42:54 +00:00
Boris Dušek
9f6f796a50 Fix VoiceOver interaction with multiline text components
`convertLineOffset` requires exactly one of `line` and `offset`
parameters to be -1.

[ChangeLog][macOS][Accessibility] VoiceOver now reads all lines in
multiline text components when navigating by lines.

Change-Id: I2872c4f5255a33dd2b493b46b22e672eb5779ee8
Fixes: QTBUG-71563
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-23 06:42:51 +00:00
Tor Arne Vestbø
736dfc3c63 Remove unused inRepaint member of QWidgetPrivate
The code that used it was removed in 55fa3c189f 6 years ago.

Change-Id: I76e42f147342feb1bda9bc2c5aa882af62757812
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-23 00:52:06 +00:00
Tor Arne Vestbø
52bd707f0d Improve logging of QWindowContainer operations
By explicitly identifying the fake window created for the window
container.

Change-Id: Id67a6e22588d04e68f5ede09bc078bb387c12e0b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-23 00:51:59 +00:00
Tor Arne Vestbø
1931aedcf8 macOS: Track changes to our NSView's superview and window properties
As a start, we just log the changes, but going forward we can use this
to report parent changes to QPA or get rid of old QNSWindows.

Change-Id: Id3625fb0b7608d85240f58bdecc70a5892075da3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-23 00:51:54 +00:00
Tor Arne Vestbø
5f49788e33 macOS: Allow raising and lowering child windows
Change-Id: Ic598d200e2f774ced489a37c33b7a02767db4402
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-23 00:51:48 +00:00
Christian Ehrlicher
794140fb86 QGraphicsProxyWidget: Don't crash within setWidget() when a child proxy has no assigned widget
QGraphicsProxyWidget::setWidget() is checking if the newly assigned
widget is already assigned to a child proxy widget without checking if
the child has a widget assigned at all which lead to a nullptr reference
if it is not the case.
Therefore check if the assigned widget is a valid pointer.

Fixes: QTBUG-15442
Change-Id: I006877f99895ca01975bdcad071cfcf90bea22ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-22 16:43:38 +00:00
Dmitry Shachnev
d0fadae79f qnetworkinterface_unix: Use qstrncpy instead of strlcpy
strlcpy is not available on some UNIX platforms, such as GNU/kFreeBSD.

qstrncpy is available everywhere and has similar semantics (in addition
it fills the rest of buffer size with NULL bytes, but that does not
cause extra work as our buffer sizes are small).

Change-Id: I76c5905eba248fd9fbc1f63f05e88e0617f8407a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-22 16:42:09 +00:00
Michal Klocek
4538dd7ec4 Remove need for glXGetProcAddressARB
We do already require glXGetProcAddress in line 241.

Fixes: QTBUG-71488
Change-Id: Id0f3bc256a71097241b99d2dcba927c1165e980e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-11-22 15:20:40 +00:00
Timur Pocheptsov
cbac5a1a6e QLocalSocket (windows) - remove broken setErrorString
We report two types of errors - those found by our code and errors
coming from the OS. setErrorString(), despite its name, does not just
set a string, but extracts a windows error code via GetLastError() and
then calls _q_winError(). This is wrong: some arbitrary error code (or
no error) can be reported when it was actually an error found by
Qt. Worse yet, string operations (allocations etc.) can potentially
clear the real error code. So remove setErrorString(), set errors
explicitly if it's the application code error or use _q_WinError
directly.

Task-number: QTBUG-71744
Change-Id: I67277d84006c4ad365f5636caf850e1f3ba4e1dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-22 14:28:29 +00:00
Allan Sandfeld Jensen
7c93f1cf5d Remove macOS specific path that causes reverse vertical advance
This special case of macOS appears to be outdated and now causes a bug.

Change-Id: Ie9c074bb69eda7abfe3d123f807b517334cc2958
Fixes: QTBUG-69803
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-11-22 14:26:59 +00:00
Tor Arne Vestbø
14984bd59a macOS: Don't assume platform input context is our own
A plugin (such as the Qt virtual keyboard) may provide a platform
input context.

Change-Id: I349ac6c4b96a3536bcde0d44a785cb7bb989fcc6
Fixes: QTBUG-68328
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-22 14:26:46 +00:00
Joerg Bornemann
eef9b4f0d5 Use msvc qmake scope where appropriate
Use 'msvc' instead of 'win32-msvc' or even 'win32-mscv*'.

Change-Id: I21dc7748a4019119066aea0a88a29a61827f9429
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-22 14:16:52 +00:00
Andrew Smolko
755521aba6 Fix hang in QMacPasteboard::formats()
PasteboardGetItemCount() can return -1 as result to unsigned variable,
so the further loop will iterate "forever". Return early to avoid hang.

Change-Id: Ie91dba1c193d04513f0496d20bd0b6b0b5b6c151
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-22 14:02:03 +00:00
Eirik Aavitsland
e71b640f3c Fix crash when painting with pattern brush to print device on macOS
CGContextRelease was called twice, both manual and from the destructor
of QMacCGContext.

Change-Id: Icba7dcda37af7e1f7c72937b3dd2d2cc4ea22c63
Fixes: QTBUG-71934
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-22 10:01:35 +00:00
Liang Qi
bf58c70546 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/io/qdir.cpp
	src/corelib/kernel/qtimer.cpp
	src/corelib/kernel/qtimer.h

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
2018-11-22 01:53:29 +01:00
Oswald Buddenhagen
54dabdd1e8 wasm: fix qpa plugin build system integration
fix the plugin name (it was missing the leading 'q') and the name used
in configure (the latter making it unnecessary to mess with it in the
mkspec). the qt.prf override which forced linkage of the plugin is also
removed due to being completely redundant.

Change-Id: I94687a34a295c36754e36a298af902b656ba2ecc
Reviewed-by: Kyle Edwards <kyle.edwards@kitware.com>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2018-11-21 23:08:05 +00:00
Thiago Macieira
2842088cb7 Unbreak the build with ICC on Windows
qlogging.obj : error LNK2019: unresolved external symbol __fastfail referenced in function
"void __cdecl qt_message_fatal(enum QtMsgType,class QMessageLogContext const &,class QString const &)"
(?qt_message_fatal@@YAXW4QtMsgType@@AEBVQMessageLogContext@@AEBVQString@@@Z)

Fixes: QTBUG-71868
Change-Id: I42a48bd64ccc41aebf84fffd156590a93fe9da53
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-21 05:37:17 +00:00
Lars Knoll
ac4b2a2b8e Don't start a new page when printing very large images
Don't start a new page to print a very high line of text if
that line wouldn't fit on one page in any case. In that case
we have to break the image up onto several pages anyway, so
we might as well start it immediately.

Change-Id: I823aa4961df179054476755c8f5df2e03874661f
Fixes: QTBUG-59885
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-21 05:36:46 +00:00
André Klitzing
be92e67fbf Add log output if library does not exists
Any other method logs this here, too. This helped
to find the problem of QTBUG-71027.

Change-Id: I2d1f6199837d778ada62dac357764b0609e99692
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-11-21 05:36:31 +00:00
Timur Pocheptsov
d5b3ddffae QMacStyle: account for QStyleSheetStyle using QTabBar directly
in this case w->parentWidget() is not QTabBar, but QTabWidget and we
never draw PE_IndicatorTabClose control (before the recent major
re-write in qmacstyle we never tested the actual type).

Task-number: QTBUG-61092
Change-Id: I87c4813258cc2b483b2ef278c4a2f8796973af1c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-21 05:35:21 +00:00
Allan Sandfeld Jensen
37f617c405 Add qfloat16 support to QCOMPARE
Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-20 21:34:13 +00:00
Frederik Gladhorn
1135cf3df4 Add missing "We mean it" warning
Change-Id: I1e836f2c1f37813d7ab9343df9f6679aefe6a2ca
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-11-20 21:01:16 +00:00
Tor Arne Vestbø
9c560eb8b5 macOS: Improve logging during QNSView/QNSWindow deallocation
Change-Id: Ie6945f2a1f35db6d1259b77ee63137abcaf68318
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-20 19:51:18 +00:00
Tor Arne Vestbø
12045801f7 macOS: Use shared NSWindowDelegate instead of one per window
All the delegate callbacks give us the relevant NSWindow, so we don't
need one delegate per window just to be able to resolve the correct
platform window.

Change-Id: I8e44186da63bf01f029bb0b1fefcd8880f49dda6
Fixes: QTBUG-65693
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-20 19:51:05 +00:00
Tor Arne Vestbø
6c1656397a macOS: Ensure NSWindow delegate is released in sync with its NSWindow
Releasing it in [QNSWindow closeAndRelease] is wrong, as we only call
that method from a few call sites, and can easily end up with a normal
dealloc by means of e.g. the [m_nsWindow release] in ~QCocoaWindow.

This still leaves Xcode thinking we have a single leaking delegate
per active NSWindow, as it apparently doesn't realize we're calling
release manually. This needs to be investigated further.

Task-number: QTBUG-65693
Change-Id: I9105602274d8532465e5108aba2b05bf253268e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-20 19:51:00 +00:00
Liang Qi
574bf5d9aa Correct QT_FEATURE_settings in qconfig-bootstrapped.h
This amends 4d180586cd.

Change-Id: Ia008e618f726f113f84cf4caa8d5f30442dbbb64
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-20 13:26:21 +00:00
Christian Ehrlicher
ca3ac2e1c7 Documentation: update Q_DISABLE_COPY documentation
Q_DISABLE_COPY annotates the functions as deleted but this was not
mentioned in the documentation.
As a drive-by adjust some indentations.

Change-Id: I808fe3f1ce9f949d2ba41436661569ab0f2a9f73
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-11-19 11:45:29 +00:00
Christian Ehrlicher
8ad9bdf957 QScrollBar: fix horizontal scrollbars in RTL mode
When a QScrollBar had a stylesheet the subControlRect() was not properly
mirrored which lead to a wrong scrolling behavior.
Fix it by adjusting the resulting rect with visualRect().
This reverts 00c9ec63a5 since it did not
completely fixed the issue for all use cases.

Fixes: QTBUG-27279
Fixes: QTBUG-38748
Fixes: QTBUG-40443
Change-Id: I19718287be7b4cfc9dbe6951fff99ae48264a855
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-19 11:45:24 +00:00
BogDan Vatra
6fdf398ab4 Android: Prepare for the worst, when the NDK will remove all GNU tools
In NDKr18 Google removed GCC, most probably the massacre will not end
there and they will remove all GNU tools, so we need to start using LLVM
ones.

This patch still keeps the compatibility with GNU tools if the Qt was
built with android-g++ mkspec.

Change-Id: Ibe1979577e08ce63604d55fc5bbd5f64b3737675
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-19 11:45:20 +00:00
Vitaly Fanaskov
5242540ee4 Fix message about licensing options in the About Qt box
Removed versions count.
Replaced "different" -> "multiple".

Fixes: QTBUG-57697
Change-Id: I924e4706a089fe244f0ea6c3a660a8a4529502a2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-19 11:45:14 +00:00
Lars Knoll
199f9c5448 Fix vertical alignment of inline images
Inline images can have 4 different alignments. Unfortunately,
AlignTop and AlignBottom can only be set once we have laid out
the whole line and know the total height of the line, as one
could otherwise end up with lines that are too high.

To fix this, position the images for these cases in a second loop
after we have calculated the length of the line and the maximal
image height in that line.

Task-number: QTBUG-59310
Change-Id: I1fd4cd39e43a13d1967b9f5c9ce8270a99269cd9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-19 11:45:09 +00:00
Liang Qi
4d180586cd Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
2018-11-19 12:42:10 +01:00
Luca Beldi
c0c4be672b Fix constness of QPaintDevice arguments
QFont, QFontMetrics, QFontMetricsF and QTextLayout constructors
use only const methods of QPaintDevice so there is no reason
for them to require a non-const pointer argument

Fixes: QTBUG-65967
Change-Id: Ibfcdef2a25f0cd4284dad76135fc4c9bf5667d7a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-19 10:41:54 +00:00