Commit Graph

33282 Commits

Author SHA1 Message Date
Dominik Haumann
1f0c228448 Fix window activation in QWindowsWindow::setCustomMargins()
Currently, code paths that call QWindowsWindow:setCustomMargins()
automatically also activate the window (=give the window focus).
The reason for this is the call of SetWindowPos (Windows API)
without the flag SWP_NOACTIVATE.

From the Windows API documentation about SetWindowPos() about the
flag SWP_NOACTIVATE:

   Does not activate the window. If this flag is not set, the
   window is activated and moved to the top of either the
   topmost or non-topmost group (depending on the setting of
   the hWndInsertAfter parameter).

It seems the flag SWP_NOACTIVATE is accidentally missing in the
call of SetWindowPos() in setCustomMargins(), especially since
the flag is present in pretty much all other calls of SetWindowPos().

The obvious fix is to add the flag SWP_NOACTIVATE to the call
of SetWindowPos() in setCustomMargins().

So far, this issue exists for a long time, an was possibly
introduced with commit f5fd534603, where setCustomMargins()
was initially added.

Change-Id: Id3f058f8762df17eb3f033ab0b3e1791283937fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-02 10:40:21 +00:00
Edward Welbourne
b44df9937e Clean-up in QDateTime's parsing of ISODate{,WithMs}
Actually check that there's a T where ISO 8601 wants it (instead of
just skipping over whatever's there), with something after it; move
some declarations later; add some comments; and use the QStringRef API
more cleanly (so that it's easier to see what's going on).  Simplify a
loop condition to avoid the need for a post-loop fix-up.

This incidentally prevents an assertion failure (which brought the
mess to my attention) parsing a short string as an ISO date-time; if
there's a T with nothing after it, we won't try to read at index -1 in
the following text.  (The actual fail seen had a Z where the T should
have been, with nothing after it.)

Add tests for invalid ISOdate cases that triggered the assertion.

Task-number: QTBUG-66076
Change-Id: Ided9adf62a56d98f144bdf91b40f918e22bd82cd
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9c111ed8c)
2018-02-01 15:57:23 +00:00
Nathan Collins
9b29133778 Fix QFileDialog::defaultSuffix on macOS
Don't prepend the default suffix to the NSSavePanel allowedFileTypes.
"If no extension is given by the user, the first item in the
allowedFileTypes array will be used as the extension for the save
panel." The user expects to get the suffix displayed to them in the
drop down filter, not the default suffix set by the developer.

Apply the default suffix if neither the user or the NSSavePanel
provide a suffix.

Task-number: QTBUG-66066
Change-Id: I64093b9f3178bd2377a7b65d6f23aed6214a4119
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-01 15:33:35 +00:00
Alex Richardson
4cd90a3579 Fix native QFileDialog initial selection for remote URLs
When using QFileDialog::getOpenFileUrl() with dir set to e.g.
"sftp://foo/bar.cpp" we call q->selectDirectoryUrl("sftp://foo")
followed by q->selectFile("bar.cpp").
Inside  QFileDialog::selectFile() we unconditionally convert "bar.cpp"
to an absolute URL and then call d->selectFile_sys("$CWD/bar.cpp")
This then calls platform integration that detects that an absolute URL
is being passed to selectFile() and therefore overrides the initial
directory.

Initially reported as https://bugs.kde.org/show_bug.cgi?id=374913

This is a regression that appeared some time between Qt 5.7.0 and 5.7.1.
I have not had time to bisect this but the only commit that may have
change behavior in that time range appears to be
007f92c6ee.

Change-Id: I6968abe9ed5c5b9de067c453a7e9d2c5cdb3a190
Reviewed-by: Christoph Resch
Reviewed-by: David Faure <david.faure@kdab.com>
2018-02-01 04:57:11 +00:00
Eike Hein
4a7771f206 QSimpleDrag: Fix mouse release coords for delayed event transmission
On platforms such as XCB, the drag cursor pixmap is shown via a window
(a QShapedPixmapWindow) under the cursor.

The mouse button release event at the end of the drag is received in
this QXcbWindow, but intercepted by an event filter that QSimpleDrag
installs on the QApplication. It then resends it unmodified(!) after
the drag has ended and the drag pixmap window destroyed, causing it to
be delivered to the new top-level window.

The local coordinates in the unmodified QMouseEvent are local to the
drag pixmap window and don't match the window it is delayed-transmitted
to.

This ends up having fatal, user-visible effects particularly in Qt
Quick: QQuickWindow synthesizes a hover event once per frame using
the last received mouse coordinates, here: the release posted by
QSimpleDrag. This is done to update the hover event state for items
under the cursor when the mouse hasn't moved (e.g. QQuickMouseArea::
containsMouse). The bogus event coordinates in the release event then
usually end up causing an item near the top-left of the QQuickWindow
to assume it is hovered (because drag pixmap windows tend to be small),
even when the mouse cursor is actually far away from it at the end of
the drag.

This shows up e.g. in the Plasma 5 desktop, where dragging an icon
on the desktop will cause the icon at the top-left of the screen (if
any) to switch to hovered state, as the release coordinates on the
drag pixmap window (showing a dragged icon) fall into the geometry
of the top-left icon.

QSimpleDrag contains a topLevelAt() function to find the top-level
window under the global cursor coordinates that is not the drag
pixmap window. This is used by the drop event delivery code.

This patch uses this function to find the relevant top-level window,
then asks it to map the global cusor coordinates to its local
coordinate system, then synthesizes a new QMouseEvent with local
coordinates computed in this fashion. As a result the window now
gets a release event with coordinates that make sense and are
correct.

Task-number: QTBUG-66103
Change-Id: I04ebe6ccd4a991fdd4b540ff0227973ea8896a9d
Reviewed-by: Eike Hein <hein@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-01 04:56:52 +00:00
Christian Ehrlicher
3adfcbf1ed QHeaderView: properly restore section data after layoutChanged()
QHeaderView is doing a complete rebuild of the sections when the layout
changed because everything could have happened. But since layoutChanged
is also called during e.g. sorting, the old data must be restored when
possible.

Task-number: QTBUG-65478
Change-Id: I088d4d843cad362b97df6dc5e0dcb9819b13547f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-29 10:34:31 +00:00
Frank Richter
5a05348fb6 examples: Add localserver feature check for localfortune examples
Change-Id: I536645ddf0a5ead31a2658d03984c1226a7c39c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-27 11:19:06 +00:00
BogDan Vatra
f3397ec659 Don't update the position if the handle was not first pressed
Change-Id: If09a2ca954a3bfca00b5a0839fea2899e7576c1d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-27 09:37:07 +00:00
BogDan Vatra
5f924134ff Check selection handles position
This patch fixes the strange behavior when selecting text.

This patch (on a Left To Right text) makes sure that:
 - the left handle will select text only on the left & above of the right handle
 - the right handle will select text only on the right & below of the left handle

For RTL is way more complicated:
- the left handle is acuatually the right handle but on the left side and it acts as a right handle
- the right  handle is acuatually the left handle but on the right side and it acts as a left handle

Change-Id: Ifca591398103199d5aef479f0a080161c9f44c0e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-27 09:36:55 +00:00
BogDan Vatra
b1fb4f8261 Move selection handles 1mm down
This way the user will not cover with his finger the text with the cursor/selection.
Set the tolerance to 0.5mm which is less then the width of the thinnest letters (e.g. i, I, l)

Change-Id: Ia5d50bd3f4fe79c89d01b3d7f5e5c22e94e8158b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-27 09:36:48 +00:00
BogDan Vatra
626b33dca1 Do not allow empty selections
Allowing empty selections leads to strange behavior, it switches from selection handles
to cursor handle.

Change-Id: Ida69346e2a47b13c92cfd68a555d6b94422bb580
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-27 09:36:39 +00:00
BogDan Vatra
6b1ecb1904 Android: Hide handler(s) if the cursor is not visible anymore
On Android if the edit control is bigger than the remaining screen we resize it, this caused the
handler(s) to remain outside the control.

A better fix will be to ensure that the cursor/selection remains visible when the control is resized
but I don't know if this is the desired behavior on all platforms.

Task-number: QTBUG-62994
Task-number: QTBUG-58700
Change-Id: If43eb7bc1ecde426697694a8f26118e95fccb80c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-27 09:36:25 +00:00
Igor Mironchik
b1a58b20ae Fix missing update of QTreeView on setTreePosition()
There was missing update in setTreePosition() or better to say update
was but in not that part of QTreeView that needed. Now QTreeView
correctly updates and paints tree decoration in a new place on
changing tree position.

[ChangeLog][QtWidgets][QTreeView] Fixed missing update of QTreeView
on changing tree position.

Task-number: QTBUG-65980
Change-Id: Id79ab8fcb39d511245a551068640684dd2a10cb9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-27 05:12:18 +00:00
Konstantin Tokarev
089969540f Remove traces of Growl in QSystemTrayIcon code and documentation
Growl support was removed in Qt 5.8.

Change-Id: I00a36cd955194ca8ceee52841a89ca579da01284
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-01-26 17:26:39 +00:00
Eskil Abrahamsen Blomfeldt
f5b1b10a11 Android: Fix compilation with warnings-are-errors
Variable was added in e2e874415e
but is not used anywhere.

Change-Id: Iff1e7c20317bb489978eb77d24b8da12493d7e45
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-01-26 11:18:43 +00:00
Friedemann Kleint
b0310ddd16 hellogles3 example: Fix start-up crash when using dynamic GL
Move the instantiation of QGuiApplication to the top since it is
required by QOpenGLContext::openGLModuleType().

Task-number: QTBUG-55671
Change-Id: I506cee193fe2ba48400851588a8ef079848bc2f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-26 09:47:45 +00:00
Ville Voutilainen
342bb5b03a Do a static_cast in bit-blasts that are UB
Without this, building Qt and Qt applications fails with GCC 8.
The errors look like this:
writing to an object of type ‘class QPointer<QQuickPointerHandler>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]

Task-number: QTBUG-65691
Change-Id: Ie5a30814125deca7a160b9a61f5aa3f944ee1ac9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-25 18:20:20 +00:00
Joni Poikelin
a87b549edf Fix compilation with -no-feature-regularexpression
Change-Id: I4d213a266034d388af723337deeeb4cdd1f5cbdb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-25 14:47:46 +00:00
Andy Shaw
965bcca6d4 Cocoa: Explicitly hide popup windows when the application is hidden
When the application is hidden then Qt will hide the popup
windows associated with it when it has lost the activation
for the application. However, when it gets to this point it
believes the popup windows to be hidden already due to the
fact that the application itself is hidden. As a result,
when the application is restored it causes a problem with
the still visible popup window as it is taking the input
events without responding to them.

Therefore we need to explicitly hide the windows right before the
application is hidden to ensure that they are actually hidden
correctly.

Task-number: QTBUG-58727
Change-Id: I4be1e1c0b1388d0c9ec872e7732185670998b7af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-25 06:40:18 +00:00
Andy Shaw
a5810375bf CoreText: Add Apple Symbols as a fallback to cover some symbols
Since braille characters are not included in Apple Unicode MS, we
extend the fallback to include Apple Symbols to cover those too.

Task-number: QTBUG-63510
Change-Id: I3977f1f9b7370a9fe9cfde643c86518e006c050a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-24 13:48:09 +00:00
Kai Koehne
c4b596fb79 Document licenses for all Qt modules
Follow the example of the other modules and explicitly mention
the valid licenses on each module landing page, optionally
combining it with trademark information.

Change-Id: I9f1fea0f002e0ab607da89a0cbfe7c53060582d7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 13:19:24 +00:00
Mitch Curtis
aaacae8fe7 Document what the QT qmake variable does in more detail
Make it clearer what the variable actually does by mentioning
that it makes its headers available for inclusion and causes
it to be linked to the binary.

Change-Id: I72821d4bceea7a92e91175ba6c5acc4c3377d7b7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-24 11:52:31 +00:00
Andy Shaw
1d9547c9a4 Don't indefinitely wait for data if it was able to read some data
Passing -1 to waitForReadyRead() may cause it to wait for some time
but the data retrieved may be enough for processing. So if 0 is passed
from read, indicating that there is potentially more to come, then
it will do a waitForReadyRead() then for more data to come.

Change-Id: I75f270d1f124ecc12b18512cc20fb11f7a88f02e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-24 05:54:31 +00:00
Laszlo Agocs
a69a0e8254 glx: Avoid losing the stereo flag in QSurfaceFormat
Task-number: QTBUG-59636
Change-Id: I38394009993e92ab9db853a1450687fc48e471f5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-01-23 20:24:39 +00:00
Gabriel de Dietrich
0236e3ab94 QStyleSheetsStyle: Avoid possible division by zero
Change-Id: I5a7588c07106227e2a8b5e1f180230ef5b0342d1
Task-number: QTBUG-65228
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-22 20:07:46 +00:00
Gabriel de Dietrich
631f68c972 QFusionStyle: Set alpha on color before creating pen
This affected PE_IndicatorCheckBox in some cases.

Change-Id: I6f10dabd2ca4093f4c1bdaa2bd0ebf73c02e8d12
Task-number: QTBUG-65737
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Yulong Bai <yulong.bai@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-22 20:07:35 +00:00
Thiago Macieira
d80b0eb12c Doc: make a note about use of QStringLiteral with non-ASCII chars
Both ICC and MSVC have bugs concatenating strings and that's despite the
standard giving an example ([lex.string] table 9) that says that
  u"a" "b"
is the same as
  u"ab"

We can't change to preprocessor concatenation (u ## STR) because that
fails when QStringLiteral is used with a macro instead of an actual
string literal.

Task-number: QTBUG-65479
Change-Id: I39332e0a867442d58082fffd1504a0a868c291ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-22 08:09:25 +00:00
Otto Ryynänen
6d50f746fe Support for Q_OS_ANDROID_EMBEDDED and android-embedded build flags
The Embedded Android build (Boot to Qt Android injection) is defined by
having both Q_OS_ANDROID and Q_OS_ANDROID_EMBEDDED flags defined,
as well as having Qt config android-embedded.
This commit enables the possibility to build embedded Android builds.
(i.e. Qt build for Android baselayer only, without JNI)

Change-Id: I8406e959fdf1c8d9efebbbe53f1a391fa25f336a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-20 18:16:59 +00:00
Andre de la Rocha
e211ab76d7 Handle OOM condition in the validation of plugin metadata
A large plugin dll (e.g., one with many MB of debug info) could cause
a 32-bit application to crash when the entire dll file could not fit
within the address space of the process. The code for validating a
plugin library and retrieving metadata from it first tried to map
the entire file in memory, which failed for large files, returning
NULL. In this case, the code tried then to read the entire file via
QFile::readAll(), which deep below caused a bad_alloc exception in
malloc, resulting in the termination of the application. This change
handles the case where the library could not be mapped into memory,
in spite of memory mapping being supported, by reporting the error
and returning false, making the plugin unavailable.

[ChangeLog][QtCore][QPluginLoader] Fixed a bug that would cause the
Qt plugin scanning system to allocate too much memory and possibly
crash the process.

Task-number: QTBUG-65197
Change-Id: I8c7235d86175c9fcd2b87fcb1151570da9b9ebe3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-01-19 14:10:53 +00:00
Tero Alamäki
dc742e9394 Enable glyph cache workaround for Mali-T880
Change-Id: I531e57c26e886cd8de09ca860d7e10b05d1a724b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-19 07:57:49 +00:00
Kai Koehne
13f6eb9773 Doc: Mention exact Qt version the third party attributions apply to
We do add, remove or update third party code in minor releases,
sometimes even in patch level releases. However, the documentation is
supposed to be valid for all existing Qt 5 versions, but doing this for
attributions would require infrastructure we don't have.

Therefore rather make it explicit which Qt version the attributions
apply to. Also mention since when Qt is available under LGPLv3
(starting with Qt 5.4).

Task-number: QTBUG-65665
Change-Id: I328b5bf0c143f78ea61aad51f0644c3cbb6dee49
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-19 06:30:06 +00:00
Edward Welbourne
957c1d9abd Use a proper test for absolute path for qmake's location
QFileInfo.isRelative() deems any path starting with a slash to be
absolute; on MS-Win, such paths need a drive specifier (unless they're
UNC), so use IoUtils's more robust test for absolute paths.

Change-Id: I7d0872a87833cbf1cc1a6ef107941adc4c529624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-18 19:47:29 +00:00
Edward Welbourne
f9b8ea4b0e Fix QMacTimeZonePrivate::previousTransition() for early after epoch
The native APIs don't support previous transition, only next after a
stipulated date.  The prior code started its search at the epoch; if
used for a time before the first transition after the epoch, this
found no transitions so returned invalid data, when the last
transition before the epoch would have been suitable.  It also wound
through all transitions since the epoch, on its way to the selected
time, which was potentially laborious.

Instead, start a year before the stipulated time; this should get a
transition if the zone uses DST.  If it doesn't, start with the first
known transition and binary-chop our way to one within a year of the
last before the stipulated time; then wind forward one transition at a
time, as before.  The chopping is actually faster than binary: each
time we find a transition after the interval mid-point but early
enough, we move the early end of our interval to the transition, which
is later than the old interval's middle.  Using halving, starting with
a vast interval, should thus only incur modest cost, while ensuring we
give up early when no transition data is available at all or the
zone's first transition ever was after the stipulated time.

Task-number: QTBUG-65443
Change-Id: I96c14540fc2600837e6a22e480fb8dc36cb37220
(cherry picked from commit 7c0b706488)
(cherry picked from commit a090076e93)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Jason Dolan <jason.t.dolan@gmail.com>
2018-01-18 14:27:42 +00:00
Oswald Buddenhagen
016ab238b6 configure: express dependency of fontconfig on freetype more clearly
use a "use" entry instead of including the transitive dep into the list
of libraries.
this also removes the redundant check of freetype features from the
fontconfig test code.

Change-Id: I86b78028255c9bf0a62be5ec0f97a62ef3fda36f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 13:54:25 +00:00
Oswald Buddenhagen
f6f6958a3e configure: inline D3D11_QUERY_DATA_TIMESTAMP_DISJOINT test
amends a96656a8fb.

Change-Id: Ic434c272bfe985ea0410090537b8a22aad3192f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 13:48:34 +00:00
Oswald Buddenhagen
b772d9cbd7 fix example source installation of qrc/rc files in subdirs
such a project structure violates the assumption that the referenced
resources are specified relative to the sub-project root, so we must
resolve them to absolute paths manually.

Task-number: QTBUG-65753
Change-Id: I8bcd5c6e7d7c6a713e5fcd3668be7d2f23169501
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-01-18 13:48:23 +00:00
Edward Welbourne
e86f3c0188 qmake: require a drive in a DOS path for it to be absolute
For Q_OS_WIN, a path is only truly absolute if it includes a drive
letter; merely starting with a slash is not enough.  (We can't support
UNC paths, so don't even try: qmake runs various commands in the
source directory using CMD.exe, which doesn't support UNC as PWD.)
This requires, when resolving a path relative to a root, transcribing
the root's drive to such not-quite-absolute paths.

Changed QMakeGlobals, $$absolute_path() and $$relative_path() to now
use IoUtils::resolvePath() rather than delegating to QDir's absolute
path method, since that doesn't correctly recognize the need for a
drive letter (and qmake did run into problems with some paths, from
splitPathList and a failing test, as a result).

Moved existing ioUtils tests for handling of relative / absolute paths
out into separate functions and expanded significantly.  Fixed some
existing tests to use an absolute path where one is needed; added two
tests involving driveless (but rooted) paths; and fixed the test init
to set a value for QT_HOST_DATA/src property (the lack of which lead
to an assertion failure with this fix).

Task-number: QTBUG-50839
Change-Id: I2bfc13c1bfbe1ae09997274622ea55cb3de31b43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-18 13:46:54 +00:00
Oswald Buddenhagen
3149d0fb13 use correct path separators when invoking testcases on windows
Change-Id: Iad541f0d62ffdb2751da6225b9d40229d7d9a03f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-18 13:46:44 +00:00
Andy Shaw
bed6292dde Win: Document limitation regarding registry types not being preserved
QSettings does not preserve the original key type in the registry, it
will set the type for the key based on the value that is being set.
Therefore we should make it clear that existing key types will be
overridden as this can cause some problems with types we do not
directly support (such as REG_EXPAND_SZ).

Task-number: QTBUG-2894
Change-Id: Ib2f2eed02759591e69fefb98a4a1f3cf897dd5cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-18 10:50:48 +00:00
Liang Qi
0688a755e6 Merge "Merge remote-tracking branch 'origin/5.9.4' into 5.9" into refs/staging/5.9 2018-01-18 10:05:21 +00:00
Liang Qi
bd46858d69 Merge remote-tracking branch 'origin/5.9.4' into 5.9
Change-Id: If83012432650a697fe4e8e773ade366589b63b0d
2018-01-18 10:59:44 +01:00
Frank Richter
2b47afadc0 gtk3: Disable native file dialogs on GTK3 < 3.15.5
Showing file dialogs if running on a system that has an older GTK3
version installed results in a crash. Do a version check at runtime
and disable native file dialog support if the version is too old.
(GTK3 bug: https://bugzilla.gnome.org/show_bug.cgi?id=725164)

Change-Id: I77bd23f1298333412bae04f52153e1a224ddf470
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2018-01-18 09:03:09 +00:00
Frank Richter
1aae404a4c QProcess/Windows: Include PID in pipe names
Although qt_create_pipe() tries again if the pipe name is already
in use, it doesn't handle the case when another user has created
the pipe with the name (the error is "access denied" in that case).
The chance that it happens is small, but it can be entirely
eliminated by including a unique part in the pipe name, in this
case the PID.

[ChangeLog][Windows] Named pipes internally created by QProcess now
contain the PID in their name to ensure uniqueness.

Change-Id: I079f1b68695c1ddea3eccad241061d11e08b60f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 07:52:43 +00:00
Andre Hartmann
a575859618 QThreadPool: Add missing semicolon after class in documentation
Makes it easier to copy and paste the snippet into a code editor.

Change-Id: I27c0a7aa268bd4fd0af885e929f67a28f083dabf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-17 22:57:42 +00:00
Mitch Curtis
8c023326c7 config_help.txt: document that some sanitize combinations are not valid
Saves people the trouble of trying it out themselves. When I tried
"address" and "thread", I got:

cc1plus: error: -fsanitize=address and -fsanitize=kernel-address
are incompatible with -fsanitize=thread

Change-Id: I48ae817e60d0b71d5349e1dbce8706cc8430c2c4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-17 18:09:41 +00:00
Alexander Shevchenko
40e8749188 unify windows mkspecs: update definitions
mingw-w64 toolchain:
- add missing compiler definitions, similar to
  'msvc-desktop.conf' toolchain,
- describe the reasons of missing compiler definitions, available in
  'msvc-desktop.conf' toolchain,
- add missing 'QMAKE_CXXFLAGS' and 'QMAKE_CXXFLAGS_WARN_ON' variables,
  similar to 'msvc-desktop.conf' toolchain.

ICC on Windows toolchain:
- add 'QMAKE_CFLAGS_OPTIMIZE_FULL' variable, similar to 'gcc-base.conf'
  toolchain, though left it unused for now,
- add missing flags to 'QMAKE_CFLAGS' variable, similar to
  'msvc-desktop.conf' toolchain,
- update deprecated 'Qwd' flag with 'Qdiag-disable',
- use 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable instead of '-Od' flag,
  similar to 'gcc-base.conf' toolchain (ICC implies '-O2' optimization
  level by default, while MSVC implies '-Od'),
- add 'QMAKE_CFLAGS_UTF8_SOURCE' variable, similar to
  'msvc-version.conf' toolchain; use a workaround to initialize it,
  until '-utf-8' flag would be supported by ICC on Windows,
- update deprecated '-Qstd=c++1z' flag with '-Qstd=c++17',

MSVC toolchain:
- remove 'incremental' from MSVC 'CONFIG' variable, since it has
  relevance only for the Unix generator,
- add 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable, used in ICC for Windows
  toolchain,
- add empty 'QMAKE_LIBS' variable, similar to 'win32-g++' toolchain,
- add 'uuid.lib' library to 'QMAKE_LIBS_GUI' variable, similar to
  'win32-g++' toolchain,
- add C++14 and C++17 language support flags, though left them disabled
  for now, similar to 'win32-icc' toolchain.

Change-Id: Ideef62d0422674184836faa655bfc5d09a5f612f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-17 03:30:36 +00:00
Friedemann Kleint
9de2ef6f5a QWidget: Fix a crash when platform window creation fails
Add a check on the platform window to QWidgetPrivate::create_sys().

Task-number: QTBUG-65783
Change-Id: I077882e1cf22ef49bb6f578f7460493ef48c9627
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-16 20:53:17 +00:00
Erik Verbruggen
99b89d30fa Prevent O(n^2) behavior when calling QObject::deleteLater
When a deleteLater event is queued, a check if done if the same event
for the same receiver is queued before by scanning all pending events.
This leads to quadratic behavior, which is quite noticeable. By using
an unused bit in QObjectData, this can be prevented. Now the duplicate
event scanning in QCoreApplication is only done for the quit event.

Task-number: QTBUG-65712
Change-Id: Ie505acbbec802f91ebd0b94ac067e362c2476113
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-16 08:20:22 +00:00
Gabriel de Dietrich
0d9208cecb QMacStyle: Revert state changes for PE_IndicatorMenuCheckMark
The changes introduced in 0e810e27a5
turn out to be incompatible with our style sheets styling. We
partially revert the style option state check, so that the look
for a highlighted PE_IndicatorMenuCheckMark only depends on
State_On, as it's expected in QWindowsStyle and QCommonStyle.

[ChangeLog][QtWidgets][QMacStyle] PE_IndicatorMenuCheckMark
goes back to only depend on State_On for its highlighted look.

Change-Id: I20f8e712196b5515bd5528ff6eedcdca9df5856f
Task-number: QTBUG-65773
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-16 06:53:43 +00:00
Andy Shaw
cb714248a8 Use font set in the style option if there is no font set in the rule
If the stylesheet does not have a rule that manipulates the font at all
for the menu item, then it should use the one passed into the style
option instead.

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