Commit Graph

26308 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
fd3f732489 Add documentation entries for new qvector/qvarlength methods
Change-Id: I4be1605ed8c9022795d5132203ad947e78481e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 14:49:46 +00:00
Anton Kudryavtsev
0c0ee82bff QString:: add remove() overload taking QLatin1String
[ChangeLog][QtCore][QString] Added remove() overload taking QLatin1String

Change-Id: I11ddb8b8603144effe44f89d0d02e131a255122c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 14:49:15 +00:00
Andre de la Rocha
5c60e4b8f9 Fix HiDPI rendering issues in the WindowsVista style
Fixing miscellaneous rendering issues to make the WindowsVista
style look good on High DPI displays:
- Fixed size/resolution of combo box arrows, and changed to native look.
- Fixed vanishing horizontal line in the frame of line edit widgets.
- Fixed gaps in combo box popup.
- Fixed size/resolution of arrow in push button menu.

Task-number: QTBUG-49374
Task-number: QTBUG-65237
Task-number: QTBUG-65238
Change-Id: If68c2fae7472def3c19636483af741ca8ed2c490
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:46:11 +00:00
Andre de la Rocha
0b2ebfd414 Fix HiDPI rendering issues in the Windows style
Fixing miscellaneous rendering issues to make the Windows
style look good on High DPI displays:
- Fixed size/resolution of combo box arrows.
- Fixed size/resolution of scroll bar arrows.
- Fixed size/resolution of check boxes.
- Fixed size/resolution of radio buttons.
- Fixed the frame of default buttons.

Task-number: QTBUG-49374
Task-number: QTBUG-65237
Change-Id: Ib7e2ef2ed027c50dbac23b16a73f7033000552f1
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:45:51 +00:00
Andre de la Rocha
8f582a4cc5 Fix HiDPI rendering issues in QCommonStyle
Fixed size/resolution of combo box and scroll bar arrows.

Task-number: QTBUG-49374
Change-Id: I3016b082b5eb7149fbe0c0e740525ab8506ce391
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:45:41 +00:00
Joni Poikelin
b7e4367387 Fix some cases of scaled text disappearing with freetype
Commit a56ee60791 changed type of advance
to short, restoring this fixes at least some cases where glyphs were
disappearing.

Task-number: QTBUG-65838
Change-Id: I33b252d91fb7541eaea3275b1950a048941869a6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-02 12:54:04 +00:00
Anton Kudryavtsev
cdebc1a138 QString: optimize remove()
In remove(const QString &str, Qt::CaseSensitivity cs)
call remove(QChar c, Qt::CaseSensitivity cs)
if str.size() is equal 1. It prevents quadratic behavior
for that case.

Change-Id: I9a7ab3019c580343533c8c6c6a04b6b0c8c1fb55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 11:08:11 +00:00
Liang Qi
f115ae7001 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp

Change-Id: Ia28ea4f29d308ba3aa16c2a86ffc57049c6ea590
2018-02-02 11:57:48 +01:00
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
Friedemann Kleint
daabb8f63d QtEdidSupport: Fix private headers
Fix warnings:
QtEdidSupport: WARNING: qtbase/src/platformsupport/edid/qedidparser_p.h does not have the "We mean it." warning
QtEdidSupport: WARNING: qtbase/src/platformsupport/edid/qedidvendortable_p.h does not have the "We mean it." warning

Amends 5f7ab88055.

Change-Id: I3868096344480d509d7b7c1833389adaa67623a0
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-02-02 07:21:49 +00:00
Friedemann Kleint
120abd19a9 Skip QWSIF::WindowScreenChanged events if the screen is unchanged
WindowScreenChanged events might be reported repeatedly from the QPA backends
until the event has reached GuiApplicationPrivate::processWindowScreenChangedEvent()
which sets the screen. Ignore events in case the screen is already correct.

Task-number: QTBUG-65580
Task-number: QTBUG-62971
Change-Id: Ie5fc9830771e816db942355efbe5a48e829914cb
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-02 07:21:24 +00:00
Jan Grulich
e8bf3a2ce7 Fix opening of flatpak FileChooser portal
My assumption before was that show() method calls exec(), but it seems
to be vice-versa and so QML applications using QFileDialog were not able
to open dialogs as they use visible property, which in turn calls show()
method. I made the show() method to call new openPortal() method where
I moved the actuall DBus call from exec() method. The exec() method now
internally calls show(), at least this is my assumption and it seems to
behave like that from my testing.

Change-Id: I27a5b0198e9ff1a9ea031f9ae45b57ceae99c6ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 05:54:43 +00:00
Liang Qi
15ae794966 Merge remote-tracking branch 'origin/5.10.1' into 5.10
Change-Id: Ibbe355f5e8ef12e5ffeb4e33b6a80760c3e2b464
2018-02-01 19:44:11 +01:00
Thiago Macieira
69d2501ee1 Revert "QVariant: convert QDateTime and QTime to string with milliseconds"
This reverts commit ab1e507574. That was
supposed to be a minor behavior change, but ends up having visible
effects such as QtXmlPatterns xs:dateTime type now reporting sub-second
fractions. So we're reverting in 5.10 and re-applying in 5.11.

Change-Id: I741e49459c9a688c1c329d6cbd521cd4a0b2aa84
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-01 16:09:34 +00:00
Christian Strømme
eadf9e542f Android: Don't rely on QDir::homePath() to get the application directory
If the QLoggingRegistry gets called as part of the static initialization
phase, it would call into Android's QStandarPaths implementation, which
assumed that the HOME env. variable was already set. Since the variable
isn't set before main is called, QDir::homePath() returns the root path,
which would be cached and always returned.

With this fix we now call Android's getFilesDir() directly, which will
always return the right path. Since the font locations are also relying
on an environment variable being set, we no longer cache that either.

Task-number: QTBUG-65820
Change-Id: If45f3d5f0e87b808a62118ae95c31b492885646a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-01 16:09:31 +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
Tor Arne Vestbø
538b1b5076 Android: Defer initialization of logging rules until qApp construction
On Android, we load the application library, and its dependencies (Qt),
on Android's main thread (thread 0), and then spin up a secondary
thread (thread 1), that we call main() on.

If any QObject is constructed during loading of the application library
or any of Qt's libraries, via static initializers or constructor
functions, we will set QCoreApplicationPrivate::theMainThread to
thread 0, which will confuse Qt later on when it's being run on
thread 1, and will result in a warning during QCoreApplication
construction:

 QApplication was not created in the main() thread

This situation can easily lead to a crash as well.

Unfortunately logging via qDebug/qCDebug and friends will trigger
this too, as they internally use QObject.

Fixing the root cause of this is under investigation, but for now
we will partially revert fa2a653b3b for Android. The effect
is that any qCDebug with a "qt.*" category before qApp construction
will turn into a no-op, like it was before fa2a653b3b.

This patch does not cover the case of a regular qDebug, or a qCDebug
with a non-Qt category. Those will still produce the same symptom,
as before fa2a653b3b.

Task-number: QTBUG-65863
Change-Id: I95675731d233244530d0a2a1c82a9578d5599775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-01 13:28:01 +00:00
Tor Arne Vestbø
7d1962cada macOS: Handle update requests via setNeedsDisplay more carefully
Instead of trying to detect situations where we need to send a real
expose event instead of an update request in response to a drawRect
call, we keep track of when we've asked the view to display due to
a requestUpdate call, and only deliver the corresponding drawRect
as an update request if no other code has asked the view to
display.

This should cover all cases of asking the view to display, issued
from our code or from AppKit, such as the view changing its backing
scale factor, or otherwise needing a real expose event.

Task-number: QTBUG-65663
Change-Id: I1783787823aee889dad8e48f34a1cb0f1b7b06bd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-01 13:07:03 +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
Liang Qi
27e8612fa4 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I6b40ecee4db13e6329e7a0433b57c5bca473c63f
2018-01-29 20:49:24 +01: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
Thiago Macieira
678aae2c43 QBitArray: add manipulate a dense bit array directly
[ChangeLog][QtCore][QBitArray] Added fromBits(), which creates a
QBitArray from a dense bit array, and bits(), which returns that.

Change-Id: Ia9c88b83534240a5872dfffd150b1c8b1c36ced5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-28 22:15:05 +00:00
Rafael Roquetto
48bce2e8f0 Support for LTTNG and ETW tracing
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.

Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-28 19:17:02 +00:00
David Faure
2b7de16fbe QMimeType: remove unwanted *.bin as preferredSuffix for octet-stream
This leads to an automatically appended .bin when saving a file.

https://bugs.freedesktop.org/show_bug.cgi?id=101667
https://bugs.kde.org/382437

Fixed upstream in shared-mime-info 1.10

Change-Id: I125a0bc72c91a082706bf2bf149adcf63ff1ec6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-28 19:13:28 +00:00
Thiago Macieira
08559d2b77 JSON: use the new isLatin1 function
It's vectorized, so it should be faster than this version.

Change-Id: I56b444f9d6274221a3b7fffd150c1519eb999cdc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-27 17:51:32 +00:00
Thiago Macieira
c375503fa0 Add a few methods to check if a string is US-ASCII or Latin1
isLatin1(QLatin1String) is provided for completeness sake, in case some
generic code operates on both QLatin1String and QString/QStringView.

Change-Id: I5e421e32396d44e4b39efffd150b99a18eedf648
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-27 17:51:24 +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
Allan Sandfeld Jensen
39f76b4325 Fix broken rendering of RGB30 and ARGB32 on machines with AVX2
Two small changes late in the review process were flawed.

Change-Id: I4b1f6e3fdb8e17000a2e11bc30aae1b29d9f43a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-27 00:34:15 +00:00
Thiago Macieira
67030038f3 Doc: explain how QXmlStream{Reader,Writer} deal with encoding in QString
QXmlStreamWriter does not: it just writes the QString inputs to the
output.

QXmlStreamReader does: it first converts the QString to UTF-8 and stores
locally. Then it tries to decode using the XML encoding header.

Change-Id: I39332e0a867442d58082fffd1503d7652cb9fbff
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-26 20:59:56 +00:00
Thiago Macieira
a6b697ca13 Create corelib/serialization and move existing file formats into it
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.

Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-26 20:59:50 +00:00
Christian Ehrlicher
6578946245 QListWidgetItem/QStandardItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QListWidgetItem/QStandardItem
setData() functions

Task-number: QTBUG-55903
Task-number: QTBUG-63766
Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-26 19:58:26 +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
Friedemann Kleint
0901d4290f QFileSystemModel/Win: Fix file system operations failing due to watchers
File system operations like renaming/removing may fail on Windows when
file system watchers are present. Add functions to
QFileSystemModelPrivate to temporarily remove the watchers prior to such
operations and to restore them in case of failure. Use them for
rename/remove (within a feature check for QFileSystemWatcher
and Q_OS_WIN).

Task-number: QTBUG-65683
Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-26 11:36:30 +00:00
Lars Schmertmann
f55c73ede2 Introduce QSslConfiguration::backendConfig
With this change it is possible to use all supported
configurations in different backends without any new interfaces.

Change-Id: Ib233539a970681d30ae3907258730e491f8d3531
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-26 11:34:02 +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
Liang Qi
9f065554ff Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I7bfb75083f60190aa1def82d153f89925a92fd56
2018-01-26 10:09:06 +01:00
Joerg Bornemann
6dbf357609 Fix asserts and crashes in QWinEventNotifier activation loop
The backwards iteration was done under the assumption that the only
valid modification of the winEventNotifierList in a slot connected to
activated() would be the removal of the notifier itself. This is wrong.

Instead, iterate forwards, like before 85403d0a, and check the index
against the current list size in every iteration. This ensures that we
do not run out of bounds while the list is modified.

Also, retry the activation loop if the list was modified by a slot
connected to activated(). This ensures that all notifiers with signaled
handles are activated.

Task-number: QTBUG-65940
Change-Id: I25f305463b9234f391abc51fe0628d02f49b6931
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-26 06:14:01 +00:00
Alexey Safronov
e5c02b2579 Doc: fix wrong link to the example snippet in QApplication class
Change-Id: Ib9a1b107dd8d2cd4bf541c3edf19a602fde6356f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-01-25 22:41:00 +00:00
Thiago Macieira
ab1e507574 QVariant: convert QDateTime and QTime to string with milliseconds
This way, it's lossless.

Change-Id: I5e421e32396d44e4b39efffd150b744e40fff3a1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-25 22:40:40 +00:00
André Klitzing
7f310be85b Update bundled libjpeg-turbo to version 1.5.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 1.5.3

Change-Id: I8c0caec3c92ba199b1a3baac9a523cc399c8001f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-01-25 21:50:35 +00:00
Thiago Macieira
9061b7bde0 qsimd_p.h: Reorganize and simplify the x86 intrinsics #includes
All of our compilers support #include <immintrin.h>, so we don't need
the legacy code that includes the earlier versions.

Change-Id: I938b024e38bf4aac9154fffd14f80214d1d744c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-25 21:19:25 +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
Morten Johan Sørvig
f0b8d90402 Cocoa: Make dialogs non-resizable again
Fix regression from commit 8b3a120a where also dialogs
got NSResizableWindowMask, making them have a Zoom
button.

Task-number: QTBUG-65668
Change-Id: I21054b3aa6fc11eab3d93f78ede44ae771522e2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-25 15:03:10 +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
Allan Sandfeld Jensen
5927acaf65 Add support for converting from std::variant
Adds inline handling of the C++17 type std::variant, so the type will
be resolved if converted into a QVariant.

Change-Id: I31809d70d7f347277389d42a3695836ec7a32d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-25 11:21:32 +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
Thiago Macieira
7d6bf37049 MSVC: Don't set a DLL base address for 64-bit
The linker complains:

 LINK : warning LNK4281: undesirable base address 0x67000000 for x64 image; set base address above 4GB for best ASLR optimization

And it's not really required anymore, as the recommended /DYNAMICBASE is
the default.

Change-Id: I56b444f9d6274221a3b7fffd150caab1beecfd43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-24 21:20:47 +00:00
Thiago Macieira
43c44d05ca Update the overflow functions to include qsizetype
Commit 29bc68cf16 added support for
unsigned and commit 5ff7a3d96e later added
support for int. This commit adds support for qsizetype, which isn't int
on 64-bit platforms.

We do this by reorganizing the code and using the generic version of
__builtin_{add,sub,mul}_overflow from GCC 5 and Clang 3.8, which ICC 18
seems to support now too on Linux. That leaves older versions of GCC and
Clang, as well as MSVC, ICC on Windows, and the GHS compiler, to use the
generic implementations, as I've removed the assembly code those
versions of GCC and Clang on x86 are now uncommon.

Note: any older version of ICC probably breaks. We only support the
latest.

Change-Id: I9e2892cb6c374e93bcb7fffd14fc11bcd5f067a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-24 21:13:20 +00:00
Allan Sandfeld Jensen
34e8cafa29 Document the new qfloat16 functions with the other qfloat16 functions
Change-Id: I82d3fcda44a9a49d9027d865f8ed200134d0f79e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-24 21:13:08 +00:00
Allan Sandfeld Jensen
933eac9645 Correct since value of QNetworkRequest::Http2DirectAttribute
It did not make it into 5.10 as far as I can tell.

Change-Id: I01f950c476f2c98f4ed40d2cafd15ecc112a3427
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-24 21:12:59 +00:00
Gabriel de Dietrich
1e905927f0 QMacStyle: CE_Splitter is HITheme-free
Change-Id: I96a5ba5d685d1b8f95fd11489e4e95096d0fa9a4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-24 21:12:25 +00:00
Gabriel de Dietrich
86821094a9 QMacStyle: declare block in drawNSViewInRect() as noescape
Change-Id: Ida67a963ab62c6b974eceeaf9d386b941f357798
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:17 +00:00
Gabriel de Dietrich
0c974c0169 QMacStyle: PE_FrameLineEdit is HITheme-free
CT_LineEdit is as well, so that makes QLineEdit free
of HITheme APIs.

Change-Id: Ia02ce9f1003e5ae9c8bf47dab9ada030feca98ba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:11 +00:00
Gabriel de Dietrich
ce60d9965e QFusionStyle: Properly draw frameless editable combo boxes
Change-Id: If0b6f15dc0a1de38edec5b360b1b8b698d6ad5b8
Task-number: QTBUG-65728
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:11:51 +00:00
Albert Astals Cid
ae3a65122f cups: Clear cups options at the start of QPrintPropertiesDialog::setupPrinter
For some reason the cups options are kept globally instead of per printer at QCupsPrintEnginePrivate
so when setting the printer options on accepting the print dialog, we first need to clear them
and then call the other functions that set them, otherwise, we will "reuse" cups option set on
the previous print.

How to reproduce:
 * Open print dialog, set some advanced option to a non default value, easiest one is print in grayscale
 * Print
 * Check it prints in grayscale
 * Open print dialog, check the advanced options are all on default values
 * Print
 * Check it incorrectly prints in grayscale

Change-Id: I59aacaf30db844ad40887d6b771f9354557852b6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-24 21:10:09 +00:00
Liang Qi
c7170915c7 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-01-24 18:36:41 +00:00
Konstantin Tokarev
d2b2511f88 QNAM should prepend Host header to the header list instead of appending
When original QNetworkRequest is missing "Host" header (which is the most
common case), it is provided automatically from request URL. However,
resulting header is appended to the list, i.e. after all headers specified
by user, which may include a big bunch of cookies.

To the contrary, RFC 7230 suggests: "However, it is good practice to send
header fields that contain control data first, such as Host on requests
and Date on responses, so that implementations can decide when not to
handle a message as early as possible". Many other user agents are
following this suggestion.

Task-number: QTBUG-51557
Change-Id: I1448ed3ae124f5ce86a8ca8ff35f5d05476a005d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-24 16:54:49 +00:00
Friedemann Kleint
95a08a711e Windows QPA: Suppress bogus resize events when using native menus
Account for the (not yet created) native menu height when handling
the initial resize message.

Complements 7849aa6e96.

Task-number: QTBUG-65917
Task-number: QTBUG-55967
Change-Id: I65c75d796634ecf1a90a72fef8ff3e6e89de11c4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-01-24 16:06:50 +00:00
Friedemann Kleint
cb142954c5 XCB: Implement native window dump for diaglib
Extract a helper function to determine the window title from QXcbConnection
and add an invokable function to the native interface that dumps the window
tree similar to existing functionality on Windows.

Change-Id: I5544d69ea2b801eb16d3b5b8d64021b3e567b0d8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:39:16 +00:00
Friedemann Kleint
8e3c6f165b Improve debug formatting of QInputMethodQueryEvent
Add more queries, output the query enumeration value
and output the hints as flags.

Change-Id: Icfc648a8d6e144074455ecebae1b25c3c3e1063e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:38:56 +00:00
Yulong Bai
2a3f226e32 QMenuBar::mouseReleaseEvent: fix triggering hidden actions
While menubar actions are hidden, as menubar was too narrow
to contain them, by clicking the blank area, where the action
was supposed to place, can still trigger the action.

Task-number: QTBUG-65488
Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-24 14:24:41 +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
Liang Qi
c97eb3e18e Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/global/qglobal.cpp
	src/corelib/global/qrandom.cpp
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Change-Id: Icc10543a1f2db5d640d01796bfec70a63517a6b2
2018-01-24 13:38:25 +01:00
Val Doroshchuk
a966991b3a Fix a crash when QMovie::speed is set to 0
Setting speed to 0 means the current frame will continue to be shown,
the finished signal is not emitted, and state remains QMovie::Running.

Task-number: QTBUG-65758
Change-Id: I681d902e3211c5899b21043e5177b7c73d5d3fb5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 10:13:00 +00:00
Martin Storsjö
f7524d73e3 Don't set no_clang_integrated_as for the disabled pixman asm on clang/mingw
There's no external arm assembler to fall back on here. The
actual assembly is already disabled since 8072c36eeb,
but passing the empty assembly file to any random external
assembler could end up producing an empty object file for the
host environment instead of the target, in a cross build.

This wasn't an issue as long as the clang compiler only was identified
as g++ within mkspecs, making no_clang_integrated_as a no-op. If
the mkspec actually identifies it as clang, this config can't
be added here.

Change-Id: I0f20b9b2a8d13b5e7e1b654e391d88b639c031bf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-24 10:10:52 +00:00
Martin Smith
4ca0d76454 doc: clang-qdoc must not see certain function declarations
The macro Q_DECLARE_INTERFACE declared some qobject_cast() functions
that clang-qdoc must not see in the contexts where the macro is used.
This update prevents that from happening by ensuring that Q_CLANG_QDOC
is not defined when the macro is defined.

This update also adds a \fn command for a declaration of qobject_cast()
that was missing in the documentation. There are two versions of the
function, one with a const parameter and one with a non-const parameter,
and they both share one qdoc comment.

Change-Id: Ic74d0aaae62767cd0391474ee95ae3f4f820b06e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:02:08 +00:00
Martin Smith
f28d0d8ae8 doc: Add documentation for swap() functions
The functions had been added without documentation.
This update adds the documentation.

Change-Id: Ib29e9356b26c248b5fcc9f13ecf77371fbae054a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:58 +00:00
Martin Smith
f30d733d1c doc: Add more missing return types to \fn commands
Added missing return types to \fn commands and removed
some unnecessary \internal comments.

Change-Id: Ie6691f83a1c510134d1e83c3d98758360a67217e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:50 +00:00
Martin Smith
f53cbd2688 doc: Fix a property declaration for clang-qdoc
The * must be adjacent to the type for clang-qdoc.

Change-Id: Icc3dedcb2f4cd426993901b8f3003c942e753c68
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:42 +00:00
Martin Smith
43fbf30efa doc: Fix many qdoc warnings, mostly missing return types
Fixed many cases of missing return types in \fn commands.
Added a fake GLxxx typedef for a GL type that wasn't there
because the GL includes weren't accessible. Also added some
fake declarations for a few functions declared in namespace
Qt in QtWidgets that must be seen by qdoc in QtCore.

Change-Id: Id82476042d0563d32fa85c4ae81a58c1298a468a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:26 +00:00
Anton Kudryavtsev
d5aaa5635c QOffscreenIntegration: add missing override
Change-Id: I8165b44e28bd8da637e75e5b11bc429cdf2deb02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-24 08:48:33 +00:00
Friedemann Kleint
43b9c9b993 QDockWidgetTitleButton: Limit icon size to dpiScaled(10) on Windows
Adding larger pixmaps to the icon caused the icon to grow.

Task-number: QTBUG-38776
Change-Id: I29148d70afa55e287f2ad254e449a98c4aa631fb
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:46 +00:00
Friedemann Kleint
d58162127a QCommonStyle: Add dock title bar icons
Add larger pixmaps for the dock title bar icons; override
them by the XPM in fusion style to maintain the behavior.

Task-number: QTBUG-38776
Change-Id: I7d0e022bbf620d2aad2b6ee011b8bb9a745d7c3b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:35 +00:00
Friedemann Kleint
f61304fc77 Rename existing dock title icons to contain "macstyle"
Make way for adding dock title icons to QCommonStyle.

Task-number: QTBUG-38776
Change-Id: If1729478f55f0bce5e04399d0cca98afd2facb31
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:32 +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
Martin Storsjö
e39a9de330 pcre2: Disable JIT on windows on arm/arm64
sljit, the JIT in pcre2, doesn't quite fully work on windows on
arm yet (although the subset of functionality used by pcre2 might
mostly work). On arm64, it fails to compile (although working around
that failure is pretty easy), when using clang in MinGW mode
(where __GNUC__ is defined, making the JIT auto-enabled).

Disable it in these configurations until it has been fully tested
and fixed upstream first.

Change-Id: Ie9681cb7cdd1960586ba194c71e057eb918cb419
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-01-23 19:19:46 +00:00
Friedemann Kleint
5c0bd3961f Fix resize event flood when moving windows with High DPI scaling
Correctly scale the requested geometry in the constructor
of QWindowSystemInterfacePrivate::GeometryChangeEvent().
Amends 3a31c70879.

Task-number: QTBUG-57608
Task-number: QTBUG-65580
Change-Id: I0ef60deda69bb61ab57972e02c342b7773e1da6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-23 18:40:09 +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
Jeremy LUGAGNE
c561c3b8b4 Fix -developer-build due to missing Q_DECL_OVERRIDE
Change-Id: Ie7a2ff0e42131afef1bdec853d09c3b447f9748c
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2018-01-22 13:52:34 +00:00
Andy Shaw
efec288f58 itemviews: When an index widget gets focus, update the current index
By ensuring that the current index follows the focus of an index widget,
we can ensure that moving the cursor will happen in the way that is
expected from the focused widget.

Task-number: QTBUG-27793
Change-Id: Ia36891a94ce41c7d12fba678de23a6f3b69374ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-01-22 09:50:03 +00:00
Anton Kudryavtsev
6f9c5c85ca QTextItemInt: replace 0 with nullptr
While touching the code, move initialization from
body of ctor to initializer list

Change-Id: Idfcb4fb771d1414268f8685874395ca54b20621a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-22 08:20:13 +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
Yulong Bai
4d898a73e6 QMenuBar: Fix repetitive emission of triggered() when using addAction(QString)
The action which added by QMenuBar::addAction(const QString &text) already
connected relevant signals and slots implicitly, however, while
QMenuBarPrivate::updateGeometry -ing, it reconnects them
if there's a extension button associated with a hidden popup menu.
In that case the QMenuBar::triggered would be fired twice.
Since the QAction's ownership may be changed or added dynamically,
there are still very rare cases like several widgets share the same
QAction object to result in this problem.

[ChangeLog][QtWidgets][QMenu] Fixed a bug in QMenu that caused QMenuBar::triggered
to be fired multiple times.

Task-number: QTBUG-25669
Change-Id: I4d52e82a2136a992e0b37118e41237d96a2c5d22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-21 17:54:47 +00:00
Liang Qi
b3e7e9b182 Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-21 15:39:37 +00:00
Frank Richter
2e5294883b Windows QPA: Avoid 'large' mouse cursors over RDP
On some combinations of RDP client and server a large mouse cursor
results in a hang of the RDP session. However, the 'touch' drag
facility (creating a transparent window) works just fine, so use
that when encountering a large cursor on RDP.
(The threshold of 96 for a 'large' cursor was extracted from the
spec, as that is the largest supported size mentioned.)

Change-Id: I9782c45e8bd6640f36bb5a392961681a99e214e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-21 11:08:12 +00:00
Liang Qi
50e8acd06b Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-01-20 22:51:18 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
2018-01-20 22:36:19 +01: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
Martin Smith
5e8bc07cb2 doc: Fix several minor qdoc warnings
The fixes included undocumented enum values, which are now
marked as omitted, adding a test for Q_CLANG_QDOC for a
couple windows enum values, adding \fn commands for a pair
of member functions in QLocale, and a \fn command for an
obsolete function in QSqlError.

Change-Id: I12a8ea7287039096b9cfe7870d2ab213a3d78dcf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 13:54:37 +00:00
Martin Smith
99dc25c686 doc: Fix all remaining non-link qdoc warnings
The fixes included adding missing '!' characters to qdoc comment
markers, correct misspelled words, adding documentation for an
anonymous enum type, and replacing Q_QDOC with Q_CLANG_QDOC.

There remain 12 qdoc link warnings in QtBase.

Change-Id: I00447722e6e029f5aed273b3cd571cef33c119b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 13:54:22 +00:00
Igor Mironchik
046622cdf3 Fix explicitly set width not being respected
The size of the QStaticText was always adjusted, even if setTextWidth()
was used. Now size of the QStaticText is calculated according to
the set width of the text, and if no width was set, then the
automatically adjusted size is used.

[ChangeLog][QtGui][QStaticText] Fixed explicitly set width not being
respected.

Task-number: QTBUG-65836
Change-Id: If2f9f6952fb168f4bcb6d8fabfdc7360f8a36485
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-20 11:22:53 +00:00
Alex Trotsenko
1303327a71 QNativeSocketEngine: fix typo in warning message
Change-Id: Ic53a8a53b882f1e6b6434b943fff0a6fcd95f341
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-20 10:52:01 +00:00
Allan Sandfeld Jensen
dd58ddd5d9 Add rvalue overload of insert/prepend to QVarLengthArray and QVector
Improves performance and STL compatibility by adding rvalue versions
of prepend and insert.

[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads of
prepend and insert.

[ChangeLog][QtCore][QVector] Added rvalue overloads of prepend
and insert.

[ChangeLog][QtCore][QVarLengthArray] Can now contain movable but
non-copyable types, such as std::unique_ptr.

Change-Id: I6c946acc5b67502c91c52ac5dea67cedb1af93a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-20 09:27:14 +00:00
Igor Mironchik
0d23b7f074 Use QColor(0, 0, 0, 0) to mark body text in QStaticText
QStaticTextPrivate::paintText() now uses QColor(0, 0, 0, 0) to mark
body text. QPainter's pen color was used before this commit
(that was always black) that leads to different colors of body text if,
for example, links are in body (first block painted with correct color
set by QPainter::setPen() but after link body text was always black).
Now QPainter::drawStaticText() will draw body text with set pen in
any case.

[ChangeLog][QtGui][Important Behavior Changes] Fixed a bug where
QStaticText would not use the QPainter's pen color for text when other
text colors were also in use. Internally this reserves
QColor(0, 0, 0, 0) for use with QStaticText.

Task-number: QTBUG-45957
Change-Id: If3e180e3083cdac1b4236e738acd15572f19ab69
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-20 09:23:30 +00:00
Lionel CHAZALLON
276ec1ab00 eglfs/kms : implement nativeResourceForScreen
This will return the crtc_id for the given screen.

Change-Id: Ia4510a730e2d98c705f382644e2ab5a432612c02
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-20 07:01:08 +00:00
Lionel CHAZALLON
731651af99 eglfs: Forward nativeRes.ForScreen.() to backends
Change-Id: I928f97483806ee74ca844941eed455ff4f9d9508
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-20 07:00:31 +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
Edward Welbourne
1d2e3a5452 Don't try (Any,Any,Any) before a partially-specified locale
We unconditionally tried Any-ing out various tags of a locale without
checking the remainer weren't Any, which would get us the C locale in
some cases where we might have done better.  So check some retained
tag isn't Any before Any-ing out any tag.

In the process, add a separate variable for the ID with likely tags
filled in, to distinguish it from the supplied localeId (thereby
somewhat clarifying what's afoot) and save duplicating the
construction of this.

Task-number: QTBUG-64940
Change-Id: Ibd9f1aba6862434cf00fbf77ba00288ac9a50a3b
Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-19 13:57:25 +00:00
Liang Qi
739585b2f5 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/io/qprocess_win.cpp

Change-Id: Ib61b74a69922ec1e9eecbba5f75352b4ec167fa9
2018-01-19 09:48:10 +01: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
Allan Sandfeld Jensen
0ffc39806e Fix cast-function-type gcc 8 warning
Gcc 8 now warns against casting functions taking references to
functions taking pointers:

warning: cast between incompatible function types from ‘QVariant (*)(const int&, const int&, double)’ to
‘QVariant (*)(const void*, const void*, double)’ [-Werror=cast-function-type]

Suppressed by casting over void(*)().

Change-Id: I48bee53253b8e87110e8a49efa761fc2add89c5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 18:22:44 +00:00
Christian Ehrlicher
e6fa35ff14 Sync QItemDelegate::doLayout with QCommonStylePrivate::viewItemLayout
QItemDelegate::doLayout added a margin after the checkbox which is not
done within QCommonStylePrivate::viewItemLayout. This created a small
but visual difference between using QItemDelegate or QStyledItemDelegate.
The additional margin was removed from viewItemLayout somehwere between
4.4 and 4.5 so it was intentional.

Change-Id: I2fc3f287fe8b181355edeebec9626c49d85fe74d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-18 18:01:39 +00:00
Martin Storsjö
bfc96c9c0e Only define QT_FASTCALL on x86_32
The __fastcall calling convention is silently ignored on other
architectures. The GNU attribute regparm is allowed but doesn't
make sense on x86_64. On other architectures, the attribute isn't
supported at all.

This fixes building with clang for MinGW/ARM and ARM64.

Change-Id: Ice1c6eadd0e90b2e5e34736542ee49a25dc67fe6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 16:02:07 +00:00
Allan Sandfeld Jensen
0ed471419a Fix gcc 8 string-op-truncation warning
Don't use the full size of dest in strncpy, we override the last byte
anyway afterwards.

Change-Id: I9f1618cc9019e0060f01deed58a726caa1989d3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 16:01: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
Morten Johan Sørvig
4944f4d57c Cocoa: Prevent crash on focusObjectChanged()
Don’t crash on focusObjectChanged to a QWindow with
a null QPlatformWindow.

Change-Id: Ibf426521d6c8f8b2b2e94d5b92020fa510a74133
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-18 12:44:31 +00:00
Anton Kudryavtsev
f0c38af8a7 QFontEngine: use QStringBuilder more
Change-Id: I7dd00080962a245e5fc67ef623d7b3a4dab69c80
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-18 11:33:37 +00:00
Friedemann Kleint
d4079b0797 uic: Support id-based translations
Use Ids from newly introduced id attribute depending
on the global form setting.

Change-Id: I0a5094d5543c0714c88511fa159b60afc9be3c81
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-18 11:31:09 +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
Martin Storsjö
8072c36eeb Skip arm pixman drawhelpers on windows just like on ios
Windows on arm (which uses clang, or msvc, but no gcc is available for
that setup) can't assemble these sources.

(On linux, builds with clang force deferring it to the external
assembler, but for windows on arm, no gas compatible external
assembler is available).

Change-Id: I139572257884cfdc57d3c32061a8c2e28c6e24de
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-18 10:32:57 +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
Martin Smith
1c8f7082f7 doc: Add missing return types to \fn commands, fix mis-specified ones
This update corrects several qdoc warnings about undocumented
parameters, which are actually caused when the return type is not
included in the \fn command, or when the return type is mis-specified
(includes static, or lacks needed template parameters).

Change-Id: Ic49139b88424e93609fbd01bc0836436d13a8f9a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-18 06:32:32 +00:00
Martin Smith
8b9b3e2f29 doc: Fix remaining qdoc warmings for Vulkan stuff
Several uses of #if QT_CONFIG(vulkan) were modified to
for classes QVulkanFunctions and QVulkanDeviceFunctions
was added to qplatformvulkaninstance.h, because the
include file that contains them doesn't exist when
vulkan isn't there.

Change-Id: I392202ab5fe9bb4c558a991870e6ebf79254aec0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:25 +00:00
Martin Smith
20be99dec5 doc: Add missing return types to \fn commands
Added void return type to several \fn commands.
The return type should always be included with
the \fn command in clang-qdoc.

Change-Id: Ie751eb1430eff668f33f8d86e0b1454bd1d2f582
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:16 +00:00
Martin Smith
e65caf92af doc: Remove qdoc marker from inside #if 0 block
clang sees the comments inside #if 0 blocks when they
occur in source files. Therefore qdoc comments can't
appear inside those blocks.

Change-Id: I5c9c7e9e002042710a5c26252bc7029b2d163dcf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:09 +00:00
Martin Smith
706e8a0295 doc: Fix remaining qdoc warnings in qabstractitemmodel.cpp
Some enum values were qualified with the enum name, which is not
required in the \value command. The qualifications were removed.

Change-Id: Ic67003ae04b558f437b331bd3e01af88ace0e888
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:32:01 +00:00
Martin Smith
52d761e60a doc: Fix remaining clang parsing errors in QtTest
This update also corrects all the remaining qdoc warnings
in the mnodule.

Change-Id: I1cea2cb1dd515d075a1e49a52ca78fc407c3a324
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:31:53 +00:00
Martin Smith
0a3061e871 doc: Fix remaining clang parsing errors in QtWidgets
Removed two unnecessary \fn commands. Also documented
a parameter correctly.

Change-Id: Ia2f22a76a18fc42127bd24b132750373675b6853
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-18 06:31:44 +00:00
Martin Storsjö
5eaecaa966 Undef interface in more places, fixing builds with libc++ on windows
After including windows.h, interface is a define that expands to
"struct" (unless WIN32_LEAN_AND_MEAN is defined). This name is
used as a normal identifier in multiple places within Qt.

This has already been worked around in a number of places
(in e.g. 3ba61d9baa and
786d23bb49).

After qrandom.h was included in <QtCore/QtCore>, this header
implicitly includes <random>. In libc++ on windows, this header
then transitively includes windows.h, exposing the clash with
the name "interface" in even more locations than before.

For cases within qtbase internals, it could also alternatively be
handled by defining WIN32_LEAN_AND_MEAN while building QtDbus, but
for occurrences in public headers, the undef trick needs to be
used.

Change-Id: I89754f38f55ae7f2145255a2c8a71b23492be6a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-18 04:44:44 +00:00
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
Albert Astals Cid
e0b769eeda Unix: Fix page size margins when changing page size
Change-Id: I55435cf500c656eeec61e6c61bbf195df356ffeb
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 21:36:47 +00:00
Albert Astals Cid
f56f47bc64 Unix: Fix default printer page size margins
Regressed with ff67dedaaf

Before ff67dedaaf the print dialog
would not let you select less margin than the minimum printer
supported margin, this brings back the old behavior

Change-Id: I22f4e8ebf8ffa7c1653d61b7073a9ee582cf453b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 21:36:41 +00:00
Christian Ehrlicher
ef60435d2f QCommonStylePrivate::viewItemSize: fix text height calculation
QCommonStylePrivate::viewItemSize did not adjust the width when the item
had a decoration or a checkbox. This lead to a too big width used for
the layouting and therefore sometimes the calculated height was too
small.

Task-number: QTBUG-30116
Change-Id: I4468daa9820b9a8aa00fe959ab9b73fec23cc24e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-17 19:08:11 +00:00
Christian Ehrlicher
ec7e870e70 QSortFilterProxyModel: annotate some deprecated functions as deprecated
QSortFilterProxyModel::clear() and filterChanged() are deprecated since
Qt4.3 but not annotated with QT_DEPRECATED.

Change-Id: Ia468203802b6be0596f0a48d51f1da3fa55b724b
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-17 18:16:00 +00:00
Gabriel de Dietrich
6df308c0d7 QMacStyle: Set WA_MacShowFocusRect for checkbox, radio button
This fixes small and mini checkbox and radio button
focus rings since the previous HITheme removal patch
(90c9370d50). But also allows to properly draw
the focus ring outside the widget's boundaries, as
it's common in macOS.

More importantly, we pave the way to use QFocusFrame
for most widgets and, eventually, implement the focus
ring animation.

Finally, we tweak the spacing between the indicators
and their respective label.

Change-Id: I4bf7ac1a06ce924a043f0365e487777d0b20a104
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-17 18:14:59 +00:00
Friedemann Kleint
6e4a330d61 Cups Print Dialog: Change the message box titles to Caps
Amends 608301d4c8.

Task-number: QTBUG-1311
Change-Id: I01cd60f0676f4e0501d411151492b4f867653053
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 12:13:54 +00:00
Christian Ehrlicher
87a929cc9d QPrintDialog/Unix: compile with gcc 4.8
Passing parameters via auto to a lambda function is a c++14 extension
which is not supported by gcc4.8.

Change-Id: I335b2a2f5ba02f5440c2e7ccc81d4156e8b29484
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-17 12:01:44 +00:00
d3fault
1a4cc8d57b Add QIODevice::NewOnly and QIODevice::ExistingOnly OpenMode flags
When QFile::open is called with the NewOnly flag, the call will
fail if the file already exists. As usual, if the file does not exist,
it will be created. Like QTemporaryFile, there is a guarantee from
the operating system that you are not accidentally creating a new file
on top of an older file. When QFile::open is called with the
ExistingOnly flag, the call will fail if the file does not exist. The
ExistingOnly flag only provides new functionality when used with the
WriteOnly flag. For ReadOnly it provides no change in functionality,
as ReadOnly by itself already never creates.

Task-number: QTBUG-52244
Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-17 04:32:47 +00:00
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
Christian Ehrlicher
0aecac1dcf QItemDelegate::doLayout: only call QStyle::pixelMetric() once
QStyle::pixelMetric(QStyle::PM_FocusFrameHMargin) was called three times
in the worst case but it returns a constant value. Therefore cache this
value and call pixelMetric() only once.
Since this code is duplicated from QCommonStylePrivate::viewItemLayout()
also change it there.

Change-Id: I6d5f0a8d2b1373bd36f0520f404e6a3cb0794f12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-16 18:53:38 +00:00
Tor Arne Vestbø
ea7a9d694b logging: Factor out how to determine if a category is the default category
Change-Id: I00a94c8c3ce2c0cba5263e6fbc499794dc7ef38f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-16 18:02:02 +00:00
Andy Shaw
6121c40018 Cocoa: Use the whole geometry when in fullscreen mode for popup menus
When in full screen, then the geometry available is the whole screen
not including the menubar or dock area. This ensures that it does
not leave space for the dock area.

Task-number: QTBUG-39403
Change-Id: I15d7b7764d83282e1ee057628680a338b72711a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-16 17:02:10 +00:00
Renato Araujo Oliveira Filho
03c33a0d85 Move color/grayscale option to cups advanced panel
CUPS has a complex way to configure colors for printers, and this can not
be represented only by radio buttons.
Because of that all colors related options will be available only in
the advanced panel.
The color/grayscale option will still be available when printing to a file.

Change-Id: I1592e779009bd80b6dfc18dde760db4154e46439
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-16 17:01:39 +00:00
Martin Smith
41a6877fe8 doc: Fix remaining qdoc warnings in platformheaders
clang needed to see so type definitions that aren't there
for some platforms, so this update provides defaults when
qdoc is running.

Change-Id: I15e635b31dd651457f828f90c8dd132959c826e6
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-16 16:59:09 +00:00
Allan Sandfeld Jensen
d2bb79be5e Let XFCE use Xft settings
Task-number: QTBUG-56809
Change-Id: Idf6c2fc7b1520547d44d06a40f1f93278ef2d3e6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-16 16:16:44 +00:00
Tor Arne Vestbø
e2a546a18b Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
2018-01-16 11:48:55 +01:00
Erik Verbruggen
99b89d30fa Prevent O(n^2) behavior when calling QObject::deleteLater
When a deleteLater event is queued, a check if done if the same event
for the same receiver is queued before by scanning all pending events.
This leads to quadratic behavior, which is quite noticeable. By using
an unused bit in QObjectData, this can be prevented. Now the duplicate
event scanning in QCoreApplication is only done for the quit event.

Task-number: QTBUG-65712
Change-Id: Ie505acbbec802f91ebd0b94ac067e362c2476113
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-16 08:20:22 +00:00
Takao Fujiwara
53cbc3c5b4 IBus: Delete deprecated DBus APIs
IBus 1.6 will remove the deprecated DBus APIs; GetAddress() GetEngines()
These APIs are replaced with DBus GET properties.

Change-Id: I427494dd0685d523ac07366be528127d98ad7d7c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-16 07:30:00 +00:00
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
Gabriel de Dietrich
90c9370d50 QMacStyle: checkbox, radio button are now HITheme-free
This also fixes focus ring thickness on retina
displays except for radio button, for which we
don't allocate enough space around. Instead of
going down the push button madness we currently
have, we leave it as is (i.e., slightly truncated)
until we can come up with a more sane solution
regarding focus rings.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

to

auto sibling = index.siblingAtColumn(columnOfInterest);

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

Change-Id: Ib203b2cdb16154cbb2680d16fb5c6a7538f33d07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-12 15:12:53 +00:00
Martin Smith
7157d04d6e doc: Add missing template clause in \fn command
The template clause was missing in the \fn command for
a member function of a template class.

Change-Id: Ie1a8f8372d3183f05f02e518b363a7bac735abbb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 14:49:42 +00:00
Martin Smith
56385f0f3d doc: Add missing class qualifier in \fn command
The class qualifier was missing in the \fn command for
the move copy constructor.

Change-Id: Ia3633efde155ed19ac8460d760a5248e52097ea1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 14:49:25 +00:00
Martin Smith
a61c6a7a2e doc: Add template clauses in qhostinfo.cpp
A few \fn commands were missing the template clause now
required by clang-qdoc. This update adds the template
clauses. It also changes an instance of Q_QDOC to
Q_CLANG_QDOC.

Change-Id: I2850d43d98debb80e01c36a524e0c00651a89298
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 14:49:10 +00:00
Albert Astals Cid
c45947aeef CUPS: Don't show choices that conflict with the printer installed options
Some options only make sense if the printer has installed some extensions, e.g.
we should not shown "Staple" options if the Stapler addon is not installed,
so with this change we use ppdInstallableConflict to know whether an option
should be shown to the user or not.

Change-Id: I5733e1ac8b667c26b292aeafc90a10c155b751a4
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-12 12:04:51 +00:00
Albert Astals Cid
e35878bf57 CUPS: Rework set/clearCupsOption API
Previously it was a bit awkward to use, you had to do
    QStringList cupsOptions = QCUPSSupport::cupsOptionsList(printer);
    QCUPSSupport::setCupsOption(cupsOptions, option, value);
    QCUPSSupport::setCupsOptions(printer, cupsOptions);
now you simply have to do
    QCUPSSupport::setCupsOption(printer, option, value);

Change-Id: Id31583f1ec72644791d82776debbae5583a2be54
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-12 12:04:46 +00:00
Albert Astals Cid
608301d4c8 CUPS: Enable printing arbitrary pages and page ranges
Task-number: QTBUG-1311
Change-Id: I8e09def0e0d8c1404d3ee86845d98a30c23b6485
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-12 12:04:42 +00:00
Albert Astals Cid
bf59032d70 cups: Don't show InstallableOptions in the advanced properties
According to CUPS maintainer it is recommended to not show them[1].
GTK and Libreoffice behave like that.

[1] https://lists.cups.org/pipermail/cups/2015-September/027124.html

Change-Id: I82614003490554d41e38a125d44e3a599c2e7342
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-12 12:04:41 +00:00
Albert Astals Cid
d94ccf310a Unix: Fix usability of the print properties dialog
Previous behavior:
 * Open, change setting, cancel, open again, setting was as originally (i.e. unchanged)
 * Open, change setting, accept, open, change setting, cancel, open again, the setting would be as before pressing cancel
 * Open, change setting, accept, open, press cancel without changing anything, print, the initially changed setting is not applied

New behavior:
 * Pressing cancel just cancels the changes since you opened the dialog, everything you accepted previously stays correctly selected

Change-Id: I483647504682f26d3d21c5229cc6530bf14fe519
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-12 12:04:35 +00:00
Tor Arne Vestbø
114f795221 logging: Break out alternative logging sinks into a well defined API
First steps towards a public API for having multiple output sinks is
to allow this internally.

We give all the different log sinks the same signature, with a bool
return value to signify if stderr has been handled.

The logic of not logging to the alternative sinks when the function
qt_logging_to_console() returns true has been moved into each sink,
so that they in the future may choose to log even when also logging
to the console, allowing multi-sink output. They must then make sure
to return true if the native logging sink has also logged to stderr.

The logic of each sink has been kept the same when it comes to the
formatting of the message. Some of these sinks should ideally use
the raw message instead of the formatted one, as they are structured
logging sinks.

Change-Id: I441d3bc1db3e16180704e00d13a40564b6f06a6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-12 11:50:36 +00:00
Tor Arne Vestbø
84e7b64090 logging: Clarify that QT_MESSAGE_PATTERN only applies to unstructured logging
Structured sinks such as systemd should capture each piece of information
individually, not bake it into the message via the message pattern.

Change-Id: I164c043683f123764a5445dc9faad049e25fd738
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-01-12 11:50:35 +00:00
Martin Smith
6b012a30d9 doc: Add template clause to \fn commands in qmenu.cpp
clang-qdoc requires the template clause in \fn commands
for template functions.

Change-Id: I5719f39ebca6064e6480e873a1d4f339f41df436
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:42:39 +00:00
Martin Smith
b426e00ebf doc: Add template clause to \fn commands in qtoolbar.cpp
clang-qdoc requires the template clause in \fn commands
for template functions.

Change-Id: I838bae74102e99b64f04960ad88f192e45d901ba
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:42:25 +00:00
Martin Smith
485c21dcc9 doc: Remove <CR> from \fn commands
clang fails for \fn commands that contain CR.

Change-Id: I4ece5110437cf358e408731f93993bf2d9702381
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:41:51 +00:00
Kai Koehne
42cb74aa81 MinGW: Remove workaround that disabled strict_c++
The workaround was needed in older versions of MinGW-w64 headers that
did disable some common functions for -std=c++1z. Anyhow, this is not
reproducable anymore with any recent MinGW-w64.

Change-Id: I8e34a2e055f8e2356696dd4fe131a757c1527574
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-12 11:41:37 +00:00
Tor Arne Vestbø
2aa9908e24 Warn when ending painting on backingstore while there's still an active painter
There's no way for the backingstore to end painting on the device by itself,
so we warn the user about what's going on. Failing to end painting on
the device will e.g. in the case of QRasterBackingStore result in having to
make a copy of the QImage data during flush.

Change-Id: I3fbac2d7a8a440fdb23197ac2d57d95bfaf9e125
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-01-12 09:41:44 +00:00
Liang Qi
c81966c39e Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-12 08:00:04 +00:00
Martin Smith
e6c089ae28 doc: Remove unneeded \fn commands
Removed unneeded \fn commands from two qdoc comments and
moved one of the comments to the file where its function
definition is located.

Change-Id: I4c4371f0541d2995398b0d32e1df409433061226
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 07:20:36 +00:00
Friedemann Kleint
9031069e12 Add more Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-12 07:10:25 +00:00