Commit Graph

30139 Commits

Author SHA1 Message Date
Marc Mutz
686c44a69b Plug remaining leaks in tests/auto/widgets/kernel
The usual:

- delete return values of QLayout::takeAt(), replaceWidget()
- delete styles
- delete top-level widgets
- delete actions

Either by naked delete, QScopedPointer or allocation on the
stack instead of the heap.

This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/kernel.

Change-Id: I8cc217be114b2e0edf34ad8d60dbf722f900bb7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 21:48:26 +00:00
Kai Koehne
f773ddd026 Fix when calling QSurfaceFormat::setDefaultFormat before Q*Application
Fixes a regression introduced in commit 51767affb.
QOpenGLContext::globalShareContext requires a QGuiApplication to exist.
This wasn't required so far.

Task-number: QTBUG-56614
Change-Id: I07bcf434fca536c4dc50feee7ea17eb541fd589a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-10-21 14:45:30 +00:00
Timur Pocheptsov
512934f7e7 HTTP/2 - fix the handling of PUSH_PROMISE
HTTP/2 allows a server to pre-emptively send (or "push") responses (along
with corresponding "promised" requests) to a client in association with a
previous client-initiated request. This can be useful when the server
knows the client will need to have those responses available in order
to fully process the response to the original request.

Server push is semantically equivalent to a server responding to a request;
however, in this case, that request is also sent by the server, as a
PUSH_PROMISE frame.

The PUSH_PROMISE frame includes a header block that contains a complete set
of request header fields that the server attributes to the request.

After sending the PUSH_PROMISE frame, the server can begin delivering the
pushed response as a response on a server-initiated stream that uses the
promised stream identifier.

This patch:
- fixes the HPACK decompression of PUSH_PROMISE frames;
- allows a user to enable PUSH_PROMISE;
- processes and caches pushed data for promised streams;
- updates auto-test - emulates a simple PUSH_PROMISE
  scenario.

Change-Id: Ic4850863a5e3895320baac3871a723fc091b4aca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-21 14:27:06 +00:00
Anton Kudryavtsev
10b9321c1d qxcbconnection.cpp: fix warning about unused function
isXIEvent() is used iff XCB_USE_XINPUT2 is defined.
So move declaration of the function in XCB_USE_XINPUT2 define scope.

Change-Id: I6f045cd07d572ee7425ee6edc5ac73dcf0afdb37
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 09:14:05 +00:00
Anton Kudryavtsev
016b5bc949 Plugins: use reserve() to optimize memory allocations
Change-Id: Id78ce43137e352292a9933222fe2f92d4ff4d69b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 09:13:09 +00:00
Frederik Schwarzer
92df823ed6 QFileInfo: fix double sentence in apidoc
Change-Id: Ie1cf32565b2fcb828ec381c45595adad1392e2ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-21 09:06:50 +00:00
Frederik Schwarzer
ef88bf02ef Fix some typos in docs and apidocs
While "commonest" is still correct English, it's rather old-fashioned
and "most common" predominates Qt's wording style.

Change-Id: I20d72c098ee40b2a89f91e42f7208fe5b87286a2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-21 09:06:13 +00:00
Erik Verbruggen
49d3bb0058 Normalize realpath(3) output to composed form
All strings coming out of POSIX API calls are converted to composed form
by QFile::decodeName. Do the same for realpath(3) output. This is
especially important for HFS+, which will store file names in decomposed
form, and APIs will therefore return strings in decomposed form.

Task-number: QTBUG-55896
Change-Id: I5e51f4e5712ff26bf9644cbcf9a9603995748892
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-21 07:49:00 +00:00
Kai Koehne
557abfc327 QUrl effective TLDs: update table
There are more than 1000 new entries since the table has been
generated the last time. The autotest needs to be tweaked
because the rules for the .mz domains have changed; use the
.ck domain instead.

Change-Id: Ife692afd46ac41a66604e966e5e8cb57c7aa649c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 06:29:53 +00:00
Marc Mutz
294c870bed QImage: cache colortable size
Coverity threw an error that in the else branch, the expression
colorTableRGB16[tableSize - 1] accesses uninit'ed data. The working
theory is that it fails to perform the implication

   isEmpty() → size() == 0

This patch, therefore, checks for size() == 0 instead of isEmpty(),
which is hardly less readable and might help Coverity understand the
code better.

Then again, Coverity might not understand that the tableSize can never
be negative.  If that's the case, another patch will be needed, but
let's try the simpler solution first.

Coverity-Id: 11420
Change-Id: Ibfe2a798c55af95c8001fa909aa94a6c5bc7c647
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-10-21 06:19:21 +00:00
Marc Mutz
b6df725750 Fix UB (ininited pointer read) in qt_egl_device_integration()
The m_integration member of DeviceIntegration, a naked pointer, was
checked for nullptr in the DeviceIntegration ctor, but never set to
nullptr.

Fix by init'ing it to nullptr in the ctor-init-list.

Coverity-Id: 172056
Change-Id: Ia1dc9b67b9d16a991bba82338eedb19de68f91d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 06:19:13 +00:00
Oswald Buddenhagen
1e701cf062 quote regexps
the parens aren't matched, so the syntax was bogus.

amends 32a3413b13.

Task-number: QTBUG-56580
Change-Id: Ic00ba50844b822c7e4524ae81fbb1bc112a158a9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-10-20 19:23:48 +00:00
Tor Arne Vestbø
837781db52 Add Qt::ISODateWithMs date format, with support in QTime/Date/DateTime
The Qt::ISODate format strips milliseconds, so a new format is introduced
that keeps the milliseconds. A new format was chosen over fixing the
existing format due to the behavioral change of suddenly having ms
as part of Qt::ISODate.

Change-Id: If8b852daed068cce8eee9b61a7cd4576bc763443
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-20 15:15:40 +00:00
Marc Mutz
0cccc23478 QNetworkReplyHttpImpl: Fix UB (member call) in destruction sequence
Found by UBSan:

  qnetworkreplyhttpimpl.cpp:457:29: runtime error: member call on address 0x602000009cf0 which does not point to an object of type 'QNetworkReplyHttpImpl'
  0x602000009cf0: note: object is of type 'QObject'
   1e 00 80 18  20 e0 bb 12 54 7f 00 00  00 f2 00 00 70 61 00 00  02 00 00 00 ff ff ff 06  08 00 00 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QObject'
    #0 0x7f541461b71b in QNetworkReplyHttpImplPrivate::~QNetworkReplyHttpImplPrivate() qnetworkreplyhttpimpl.cpp:457
    #1 0x7f541461b7f0 in QNetworkReplyHttpImplPrivate::~QNetworkReplyHttpImplPrivate() qnetworkreplyhttpimpl.cpp:458
    #2 0x7f540f26df1a in QScopedPointerDeleter<QObjectData>::cleanup(QObjectData*) qscopedpointer.h:54
    #3 0x7f540f26df1a in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer() qscopedpointer.h:101
    #4 0x7f540f26df1a in QObject::~QObject() qobject.cpp:940
    #5 0x7f540e915f6e in QIODevice::~QIODevice() qiodevice.cpp:416
    #6 0x7f5414599bae in QNetworkReply::~QNetworkReply() qnetworkreply.cpp:444
    #7 0x7f54145e6f5e in QNetworkReplyHttpImpl::~QNetworkReplyHttpImpl() qnetworkreplyhttpimpl.cpp:239
    #8 0x7f54145e6f5e in QNetworkReplyHttpImpl::~QNetworkReplyHttpImpl() qnetworkreplyhttpimpl.cpp:242
    #9 0x7f54144b3539 in void qDeleteAll<QList<QNetworkReply*>::const_iterator>(QList<QNetworkReply*>::const_iterator, QList<QNetworkReply*>::const_iterator) qalgorithms.h:317
    #10 0x7f54144b3539 in void qDeleteAll<QList<QNetworkReply*> >(QList<QNetworkReply*> const&) qalgorithms.h:325
    #11 0x7f54144b3539 in QNetworkAccessManager::~QNetworkAccessManager() qnetworkaccessmanager.cpp:496

Fix by moving the emission of the QNetworkReplyHttpImpl::abortHttpRequest()
signal from ~Private, when the public object is merely a QObject anymore,
to ~QNetworkReplyHttpImpl(), when the public class is still itself.

Change-Id: Ifb3b19f6d180452bdf3fc26f54629ef780a5d9d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-20 11:03:37 +00:00
Oliver Wolff
0e61323c87 winrt: Added timeout for cancellation of socket read operation
As the function runs on the XAML thread it can make the app
unresponsive/wait forever on a socket close. Thus we should not wait
forever but have a timeout. If the timeout is hit the socket is not
closed properly but hard reset.

Change-Id: I82e9425c0f8195e3465027fdc2417a93f1c1ad91
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-10-20 07:02:10 +00:00
Andy Shaw
2c0033983b macOS: Don't override the set tab text color with white
Originally on macOS it would override any tab text color with white
for the active tab as it would set it directly on the option palette
inside the style code. This would cause it to ignore any changes done
by the user in a changed option, via setTabTextColor or in a proxy
style. Therefore the setting of the color should be done when the style
option is initialized and only if the tab text color has not been
set by the user.

This has the added effect of making it easier to change the color for
tabs via a stylesheet since it will not be overridden in the style but
setup correctly in the option instead.

Change-Id: Ic338e96470112cba71d422bce79e664df0cb188a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-19 15:48:48 +00:00
Andy Shaw
cd081ca96a macOS: Only show menu and allow dragging on proxy when a file path is set
If there is no file path set then it should not be possible to see a
menu or to drag from a proxy icon in the titlebar.

Task-number: QTBUG-56082
Change-Id: Ib8305bcab5717bc8cb7ddabbb079f152debbdded
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-19 15:48:39 +00:00
Andy Shaw
b38145a11d PDF: Handle monochrome images correctly
When an image is considered to be monochrome then it should not be
making the white part of the image transparent, the colors should be
kept as is.

Task-number: QTBUG-56489
Change-Id: I3621ca7be2a0ebe6852363f860c0b3de28d28a31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-19 15:48:31 +00:00
Sérgio Martins
6cfdfad7d4 Don't crash while parsing malformed CSS
Task-Id: QTBUG-53919
Change-Id: I31a0e218e4e41ee217f8f87164f115450d69d42c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-19 15:38:56 +00:00
Clinton Stimpson
ee22c6505a xcb: fix passing of focus from child to its top level QWindow
With the client message _NET_ACTIVE_WINDOW, not all window managers
will pass focus from a child window to its root window, Detect this
child-to-root case, and use xcb_set_input_focus() instead.

Task-number: QTBUG-39362
Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-19 15:24:22 +00:00
Leena Miettinen
6a9e039d19 Doc: Fix link to qsslkey-p11 example in external-resources
Apparently, the example has been moved.

Change-Id: If68e5db87321e8ff4af652a1cbbd0c3243acb515
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-19 14:03:40 +00:00
Marc Mutz
46078f3374 QOrderedMutexLocker: unlock in reverse order of locking
This is an improvement for the following reasons:

- Should mutex locking allocate any kind of resource,
  unlocking in reverse order will free those resources
  in inverse order, which helps typical allocators.
- If the lock pair is contended, by unlocking in the
  same order as locking, we were allowing the waiting
  thread to wake up to take the first lock just to
  find that the second lock is still held by someone
  else.

The order of unlocking has no influence on the correct-
ness of the algorithm.

Change-Id: Id16b0342aef325c14a7bd8836d3a75db68ef2588
Reviewed-by: David Faure <david.faure@kdab.com>
2016-10-19 13:25:01 +00:00
Oswald Buddenhagen
32a3413b13 make-expand cflags before passing them to $$system()
mac/sdk.prf puts some indirections into them.

Task-number: QTBUG-56580
Change-Id: I8ffd2438309702466edd3ad5c51284c7cab4fda9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-19 11:42:26 +00:00
Albert Astals Cid
8249f490ff Document QClipboard::mimeData can be null
The current wording (reference) seems like it's always a pointer to valid stuff

Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6deaaaa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-19 08:58:18 +00:00
Andy Shaw
683c9bc4a8 Windows: Fix regression in QFSFileEnginePrivate::nativeWrite()
Change 0696566b1e caused the block
size to be incorrect for data > 32MB.
Since bytesToWrite changes within the do...while loop, then the block size
can potentially change too each time. So it needs to be recalculated each
time rather than just once.

Task-number: QTBUG-56616
Change-Id: I9880d0985f2d0242c30e67230be7271eb806db95
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-19 08:05:32 +00:00
Anton Kudryavtsev
a9835dfe55 QJsonDocument: fix repetition of 'document' in doc
Change-Id: I8909336274b2c72e526d63fe9e21368550de6678
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-19 07:34:56 +00:00
Friedemann Kleint
f939e7ea73 Testlib: Move classes inheriting QBenchmarkMeasurerBase to separate header
QBenchmarkTimeMeasurer uses the 3rd party header cycle_p.h which may
include windows.h on Windows (32bit). This can cause clashes in qmltest,
which uses QBenchmarkMeasurerBase. Move the derived classes to a separate
header to prevent this.

Change-Id: I943a11c32a575594e6e79e722e8809b42de35092
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-19 06:21:51 +00:00
Anton Kudryavtsev
6a7b683817 Plugins: optimize string usage
Prefer QStringRef methods to avoid allocations.

Use startsWith/endsWith rather than comparing substrings;
and avoid substrings where references suffice.

Use new QStringList::join(QL1S).

Change-Id: I46c44aca96578633370006d613eb0ac13f7cfc03
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 17:52:04 +00:00
Anton Kudryavtsev
a769b34754 QLocale: optimize string usage
Use QStringBuilder more.
Avoid quadratic behavior when prepending zeros
in a loop, prepend whole string intead.
Use const API more for CoW types.

Change-Id: If114107dc3d9876b9a7c77bc0071878cb6e00892
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 17:45:10 +00:00
Anton Kudryavtsev
f620ad1499 QJsonDocument: enable NRVO for gcc in toJson()
Change-Id: I1b639272d38f8463b17a85a406addb74bb572756
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 17:42:27 +00:00
Anton Kudryavtsev
3d76031217 QJsonDocument: don't re-call QVariant::type() in if-else chain
Replace if-else chain with switch statement.

Change-Id: Idd2d0198178685bdaf8f77fa6cae5025ea9de561
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 17:42:02 +00:00
Marc Mutz
e80faf3db6 QTimer: don't circumvent <chrono> safety net
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
violate a principal design rule of <chrono>, namely that non-
narrowing conversions are implicit, but narrowing conversions
need duration_cast. By accepting any duration, we allow non-
sensical code such as

   QTimer::singleShot(10us, ...)

to compile, which is misleading, since it's actually a zero-
timeout timer.

Overloading a non-template with a template also has adverse
effects: it breaks qOverload().

Fix by replacing the function templates with functions that
just take std::chrono::milliseconds. This way, benign code
such as

    QTimer::singleShot(10s, ...)
    QTimer::singleShot(10min, ...)
    QTimer::singleShot(1h, ...)

work as expected, but attempts to use sub-millisecond
resolution fails to compile / needs an explicit user-
provided duration_cast.

To allow future extension to more precise timers, forcibly
inline the functions, so they don't partake in the ABI of the
class and we can later support sub-millisecond resolution by
simply taking micro- or nano- instead of milliseconds.

Change-Id: I12c9a98bdabefcd8ec18a9eb09f87ad908d889de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 16:06:28 +00:00
Anton Kudryavtsev
4a4368df56 QAndroidPlatformTheme: wrap char* in QL1S to avoid warnings
Change-Id: Idcc70038051b03366aa447f3a4c48912d3f911d5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-10-18 15:17:03 +00:00
Tor Arne Vestbø
4cb614c7ab Apple OS: Handle QSetting strings with embedded zero-bytes
Saving strings with embedded zero-bytes (\0) as CFStrings would
sometimes fail, and only write the part of the string leading
up to the first zero-byte, instead of all the way to the final
zero-terminator. This bug was revealed by the code-path that
falls back to storing e.g. QTime as strings, via the helper
method QSettingsPrivate::variantToString().

We now use the same approach as on platforms such as Windows
and WinRT, where the string produced by variantToString() is
checked for null-bytes, and if so, stored using a binary
representation instead of as a string. For our case that
means we fall back to CFData when detecting the null-byte.

To separate strings from regular byte arrays, new logic has
been added to variantToString() that wraps the null-byte
strings in @String(). That way we can implement a fast-path
when converting back from CFData, that doesn't go via the
slow and lossy conversion via UTF8, and the resulting QVariant
will be of type QVariant::ByteArray. The reason for using
UTF-8 as the binary representation of the string is that
in the case of storing a QByteArray("@foo") we need to
still be able to convert it back to the same byte array,
which doesn't work if the on-disk format is UTF-16.

Task-number: QTBUG-56124
Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8
Cherry-picked: 764f5bf48c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 14:35:08 +00:00
Friedemann Kleint
158231e073 QCommonStyle::standardIcon: Add 64x64 Qt logo pixmap for SP_TitleBarMenuButton
For SP_TitleBarMenuButton, the style defaulted to standardPixmap()
would return a 16x16 XPM encoded pixmap from qcommonstylepixmaps_p.h.
This resulted in a too-small menu icon when displaying QMdiSubWindow
with the default icon set on a High DPI screen with
Qt::AA_DisableHighDpiScaling set.
Add a larger icon from resources.

Change-Id: If88c606a31ee9499f520089365f685ec75e0ddad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-18 14:08:41 +00:00
Marc Mutz
ed5d04fcfc QOrderedMutexLocker: fix UB (pointer comparison with <) in static relock()
Comparing pointers that do not point into the same array using
operator< is UB. You need to use std::less<>.

The QOrderedMutexLocker ctor already used std::less to compare
pointers, but the static relock() function was not fixed.

Amends 5007352164.

Change-Id: I584d382391dd5a2af75020a4e77f3e42ee5d5708
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-10-18 13:46:11 +00:00
Frederik Schwarzer
cbb2ba23e2 Qt 5.7 requires C++11 so this hint is not needed anymore
Change-Id: I7e267c69ccf3835e4d69b4c612f1baaf40d8be39
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-18 12:14:17 +00:00
hjk
983d9e0c1a Fix DBus compilation
Don't use C++11 nullptr in 5.6.

Change-Id: I57e9595b2e1cede995eed09878bf02ee30482659
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
2016-10-18 08:04:45 +00:00
Oswald Buddenhagen
3a1245fdac slightly improve logging of library probing
Change-Id: Idd137251c6db5effd3571591d837d49e8fb9525d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-18 05:59:19 +00:00
Oswald Buddenhagen
7c1d640c0c stop exporting the library versions
all users of this functionality have been removed, and not emitting the
version info saves quite some noise from the generated files.

the reason why the users have been removed is that it was unreliable in
the first place: if a dependency is found without pkg-config, no version
information would be available.

the extraction of the version via pkg-config itself is kept in place, as
configure tests could be potentially optimized by utilizing it.

this reverts much of commit 48b4e0bf6f.

Change-Id: I01917f3b2a56b747d7cc54955141d20d23d0990a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-18 05:59:14 +00:00
Oswald Buddenhagen
14fed674ae propagate the correct library variable to the private module pri
amends 310bf3f57.

Change-Id: I6706e9435b7af558a3639d5824330d57430bb057
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-18 05:59:08 +00:00
Lars Knoll
a81b399345 Compile uic and qdbusxml2cpp more often against libbootstrap
Otherwise, those tools do not compile in configurations which exclude
features that these tools require (e.g., -no-feature-textcodec).

Change-Id: I9f27257221755a35a48ae2efa9df63f1a319118e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-10-18 05:58:40 +00:00
Eskil Abrahamsen Blomfeldt
ce2ae6ebd8 Windows: Fix rendering of MingLiU fonts at some scales
At certain sizes and scales, GDI will clip away the bottom line
of pixels when rendering the MingLiU fonts. Since DirectWrite
renders it correctly, we force the use of DirectWrite in this case.
This also requires supporting classic GDI rendering in the DirectWrite
engine, to make sure the rendering still looks correct.

Note that this does not cover the corner case where the font is loaded
directly from data with QRawFont.

[ChangeLog][QtGui][Windows] Fixed rendering error when using the
MingLiU fonts at certain combinations of pixel size and scale.

Task-number: QTBUG-49346
Change-Id: Ie026c0d5932717858c4536dae077013eb6a1eafc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-10-17 15:39:42 +00:00
Oswald Buddenhagen
4ebe8cefde make also configure tests not see %LIB% and %INCLUDE% under mingw
amends 03ae6ad8e.

Change-Id: I1adfb8d5de59b26e37bd35c5e8e4410d084d8d93
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:43 +00:00
Oswald Buddenhagen
d715667b20 normalize name of plugin default linkage overrides
QTPLUGIN.<foo> is better used with valid variable names, which is not
the case when the plugin type contains slashes (plugin subtypes) or
dashes (just so). normalize these chars to underscores.

Change-Id: Icc93d952b93fef342e2fc93f20e9c5dd010dd734
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:39 +00:00
Oswald Buddenhagen
9a3073a98d don't strip off plugin subtypes
this code is meant to strip off the file name if provided (as the
accessibility plugin in qtdeclarative does), but clearly overshot the
mark by stripping the subtypes (as needed by qtmultimedia, and soon
qtbase as well). use a stricter regexp which matches only names with an
extension, which is a Good Enough (TM) approximation.

Change-Id: I63afe9c7b1b0ebf4da530dcf558e9c84ae3c85ec
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:36 +00:00
Kai Koehne
9d696af6cd Disable WindowsContextHelpButtonHint for Dialogs that are not QWidget
Do not set WindowsContextHelpButtonHint directly in Windows QPA plugin,
but instead rely on logic in QWidgetPrivate::adjustFlags for widgets.

If WindowsContextHelpButtonHint is set, a '?' button is shown in the
windows decoration. If pressed, an EnterWhatsThisMode event is generated
that is consumed in QApplication that then calls into the QWhatsThis
singleton, which changes the mouse cursor, and informs the top-level
QWidgets about the state change etc.

For QGuiApplications though the event is not generated, which makes the
button useless by default. In addition, QWhatsThis only works with top
level QWidgets, not e.g. QQuickWindows. So for apps using QApplication
and QtQuick.Controls this means that the "What's this mode" is never
exited.

Given that the paradigm is somewhat outdated on the desktop it is unlikely
that Qt Quick Controls will implement support for What's this. Anyhow,
QWidgetPrivate::adjustFlags sets the hint for Qt::Dialogs, too,
so there's no need to set it the Windows QPA plugin.

[ChangeLog][Windows] 'What's this' button is now shown by default
only for QWidget dialogs.

Task-number: QTBUG-56239
Change-Id: I1ea3e92ade723b5865c8f2e19674413433658942
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2016-10-17 13:31:53 +00:00
Liang Qi
d90b155c60 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/macx-ios-clang/features/resolve_config.prf
	src/testlib/qtestcase.qdoc

Change-Id: Icefa63056ffb37106f35299a8f19165535571799
2016-10-17 11:02:54 +02:00
hjk
d71bb504a6 Fix QtGui compilation without OpenGL
Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6def516
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-16 15:14:13 +00:00
J-P Nurmi
063997f44f QMenu: don't force platform instance creation on construction
There's a conflict between QGtk3Menu and QDbusPlatformMenuBar. The
problem is that on Unity the type of the platform menu instance must
be different depending on whether the menu is in the global menubar or
a standalone context menu.

Since QMenu creates a platform menu instance at construction time, it
does not yet know whether it will be added into a menubar. QMenuBar
checks that the QMenu already has a platform menu instance, and passes
it to the platform menubar. As a result, a QGtk3Menu instance is passed
to QDbusPlatformMenuBar.

Currently, a standalone QMenu does not use the native platform menu
instance. Only menus that are added to a QMenuBar do. Therefore we
don't need to create the platform instance when QMenu is constructed,
but only after it is added to QMenuBar. The platform menu instance
creation is implemented in QMenuBarPrivate::getPlatformMenu(), and
QMenu::setPlatformMenu() calls syncPlatformMenu() to take care of
syncing the QMenu properties and actions to the new platform menu
instance.

The macOS-specific methods QMenu::toNSMenu() and QMenu::setAsDockMenu()
rely on the platform menu instance, and must therefore create it on
demand.

This is a hot fix for the release blocker, not a long term solution.
In the future, if standalone QMenus are made to use native platform
menu instances, the instance must be created lazily when the menu is
about to be made visible.

Task-number: QTBUG-56526
Change-Id: I044933cabb1639406fe47908dfc4b1903af214d1
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-16 14:10:29 +00:00