Commit Graph

28044 Commits

Author SHA1 Message Date
Andy Shaw
80406d2c25 Correct documentation about the datastream versions
This amends f5fe9fc5a4

Change-Id: I1d21f5b5f4896a11376f37ed0e39f00f2214c67b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-25 19:57:07 +00:00
Anton Kudryavtsev
9941719a8d QWindowsCursor: fix typo and change enum CursorState into enum class
Change-Id: I55b539da99254d3f7318193669c409552e429a6a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-25 19:29:37 +00:00
Topi Reinio
1a9b8715ce Doc: Fix QEasingCurve code snippets
Commit ff2a71e3 accidentally removed a code snippet used in documenting
EasingCurve::EasingFunction. This commit restores it and fixes other
minor issues in QEasingCurve code snippets.

Change-Id: Ib19f602a4abbca3511d3d26c5f6da4910f7104a3
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-09-25 16:39:01 +00:00
Edward Welbourne
35020c2394 Fix some infelicities in the Q(Date|Time)+ docs
Some of the claims made were not strictly acurate.

Change-Id: Ia7c83ce44257acce32814c0bbb3b787bb6b8596b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-09-25 14:35:36 +00:00
Alessandro Portale
8d26f70145 Remove excess "virtual" keyword from destructors in Qt Gui
Destructors whose base class have a virtual destructor are
automatically virtual and do not need to be marked as such.

Change-Id: I84c73ab965077bbb03f4213e53c241569213cae0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-25 14:34:42 +00:00
Sven Pauli
264ad32827 Add const overloads for QColor::getCmyk and QColor::getCmykF
Align the constness of QColor::getCmyk and QColor::getCmykF with the
rest of the family (QColor::getRgb etc.) by adding overloads. The
non-const methods could be removed with the next major release as that
will break binary compatibility.

Task-number: QTBUG-65176
Change-Id: I8579928a43fb59aed3319ff73481994a54b274f8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-09-25 14:23:53 +00:00
Christian Ehrlicher
7fafeb4a34 QTreeView: sync keyboard search behavior with other itemviews
QTreeView has a special implementation of keyboardSearch() which is not
consistent to the base implementation regarding the selection behavior:
 - currentSelectionStartIndex is not set which results in a wrong
   mouse selection behavior afterwards
 - only the current index is set but not the current selection
Sync the behavior by calling setCurrentIndex() directly in QTreeView
too.
One problem remains with this patch - the key handling is still
different between QAbstractItemView and QTreeView for repeating key
presses.

Task-number: QTBUG-18862
Change-Id: Ife79d146cf16d6ecbf9f86540777dae15aa1ffb0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-25 14:23:06 +00:00
Shawn Rutledge
4c631c0bf9 Android: add support for custom buttons in native MessageDialog helper
New API in QMessageDialogOptions and implementation on Android.

Task-number: QTBUG-35545
Change-Id: I59567251199f220862d01ba76979266379eecd86
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-25 14:15:40 +00:00
Alessandro Portale
d0c159c8e3 Fix a few overrides in Qt Core
This change removes redundant 'virtual' from function declarations.

Clang Tidy's modernize-use-override check reports:
  warning: 'virtual' is redundant since the function is already
  declared 'override'

CppCoreGuidelines say:
  C.128: Virtual functions should specify exactly one of virtual,
  override, or final

Change-Id: I9a4bdd6cc041d46ae64b25597ba4f7268ac4c2b7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2018-09-25 13:34:19 +00:00
Eirik Aavitsland
7a6a9dbb7d QImageWriter: Fix default compressionratio
Before asking a image format handler to save an image, QImageWriter
sets the value of all supported options. For options like quality and
gamma, the default value is an illegal value (-1 and 0.0 resp.),
effectively telling the handler that the application has not requested
any particular value. But in the case of compressionratio, the default
was 0, a legal value. Fix by changing it to -1.

Change-Id: Iad6d4c2dbe269b25863e7d4967aa9ed2a7d1247f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-09-25 12:32:34 +00:00
Eirik Aavitsland
b233ce66d3 QPainter cosmetic stroker: Fix painting error for FlatCap lines
Initialize the lastDir properly, to avoid the stroking algorithm doing
direction-change handling for a single line. That could cause a cap to
be painted for a single FlatCap line.

Also fixes a bug in tst_qpainter, revealed by the above fix. The
result drawPolyline was erroneously compared to the result of drawing
the lines individually, for a case where the former correctly paints
the pixel of the join point in the corner, while the latter by
coincidence used to paint the same pixel as a cap because of the bug
above.

Task-number: QTBUG-70101
Change-Id: Ie20eda33214cfe9e7627f17ef4c7a5b3835c9c24
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-25 12:32:24 +00:00
Morten Johan Sørvig
d0528d558e macOS: Use light color for tooltip text in dark mode
Tool tip text is drawn by QLabel using ToolTipText
text role. Give it a system palette entry.

Change-Id: I2e1b4f0b130783efd8d03f53a42c3e64aec32425
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-25 12:15:28 +00:00
Morten Johan Sørvig
02f7444c85 No-thread: prevent double delete of QThreadPrivate
Change-Id: Ie34c06ad798be6bd91f5c356051daaa72800c20a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-25 12:15:19 +00:00
Qt Forward Merge Bot
a607fcb31e Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I4d123c3cdf86524716ba67091e0347309b49c837
2018-09-25 10:56:53 +02:00
Timur Pocheptsov
f99e956d65 Add QT_REQUIRE_CONFIG(ssl) to pre-shared key authenticator
As it's done (albeit in old-style there) in other public QSsl-classes.

Task-number: QTBUG-70604
Change-Id: If3cd9da0e8f8378fd29a80215cd889e459aa7bce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-25 05:51:19 +00:00
Shawn Rutledge
b4b706d454 Ensure that QTabletEvent is not pre-accepted before sending
In QWidget-world it's normal for input events to have the accepted
flag false by default, so that it's obvious after visiting a widget
subclass that does not override a particular handler function that it
did not handle that event type at all.  For tablet events in
particular, the contract (to which we've been paying more attention to
ensure that QTBUG-47007 remains properly fixed) is that if a
QTabletEvent is not accepted, a mouse event will follow.
Tablet-unaware applications need to get the same mouse events from a
Wacom stylus as they would receive from an actual mouse.

In this case the issue was missing hover events (mouse movements
in which no mouse button is pressed).  Without those, the enterEvent
and exitEvent virtuals are also not invoked properly.

Task-number: QTBUG-47007
Task-number: QTBUG-65199
Change-Id: I957005aad9d2bf85a3a41bbdebe3e046e34dee4d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-25 03:57:35 +00:00
Qt Forward Merge Bot
35ec3b49e1 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I65e4457a218f333161e9e72735b62fc821475f45
2018-09-25 01:00:35 +02:00
Christian Ehrlicher
02663718a9 QHeaderView: Don't unhide hidden sections on layoutChanged()
When storing the persistent indexes within _q_sectionsAboutToBeChanged()
there was a limit one how much persistent indexes should be stored due
to performance concerns. This resulted in unhiding hidden rows.
The rationale behind this was that storing persistent indexes is slow
and that hiding a large amount of rows/columns should be done with a
QSortFilterProxyModel.
Fix it by removing the limit since it does not really hurt performance.

Task-number: QTBUG-70633
Change-Id: I2311213c2b63c67e2210aa7f73f07d28dc0e47be
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-09-24 19:25:19 +00:00
Christian Ehrlicher
8bd0e6709f QHeaderView: apply small optimization in recalcSectionStartPos()
The loop in recalcSectionStartPos() calls QVector<>::constEnd() after
every iteration which is not needed since the vector stays constant.
Therefore use the new for loop syntax from c++11 so constEnd() is only
called once which gives a small speedup, noticeable with large section
counts.

Change-Id: If318eec10c9ce234004a9922409fbdbc6409f2f8
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-09-24 19:03:02 +00:00
Christian Ehrlicher
6d648961c6 QItemWidgets: emit layoutChanged with proper sortHint
layout(AboutToBe)Changed gained a sortHint parameter with Qt5.0 but the
itemmodels did not set a proper value where possible.
Since the sorting of the ItemWidgets is only per column, it is
reasonable to pass QAbstractItemModel::VerticalSortHint in the various
layoutChanged calls.

Change-Id: Ia11322bae1a96bc0d7d8422558a11cdfe04c2808
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-24 19:02:55 +00:00
Liang Qi
b26cd68bf6 Modernize the "datestring" feature
Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-24 17:12:29 +00:00
Liang Qi
e226b0f94a Modernize the "textdate" feature
Change-Id: Ic0b6f13e17c301ed66d6a8297c242086c94ac87d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-24 17:12:24 +00:00
Timur Pocheptsov
2e94947c56 qnsview_key/qnsview_mouse make Ctrl+left click work again
A result of typo/incorrect keyboard modifiers extracted +
wrong button sent via QWindowSystemInterface::handleMouseEvent.

Task-number: QTBUG-70512
Change-Id: I809168e363496884312412051e8d435f5794b3be
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-24 17:01:08 +00:00
Dmitry Shachnev
6948bf20a7 QSslContext: Use 0 instead of TLS_MAX_VERSION
According to the SSL_CTX_set_max_proto_version manpage [1]:

> Setting the minimum or maximum version to 0, will enable protocol
> versions down to the lowest version, or up to the highest version
> supported by the library, respectively.

This should make it possible to use Qt Network with older versions of
libssl than it was compiled against. In particular, use with 1.1.0 when
compiled against 1.1.1.

Also, one of OpenSSL developers is suggesting to remove TLS_MAX_VERSION
from the public header in the future [2].

[1] https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_max_proto_version.html#DESCRIPTION
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908567#59

Change-Id: Ie76054b917daa8e54d5c0156e848dbaca7bb8a82
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-09-24 13:40:30 +00:00
Timur Pocheptsov
4b7ff8e98c Protect HSTS code for no-feature-settings build
Under the hood we use QSettings to store HSTS policies.
Qt configured with 'no feature settings' would fail to
build then. For such builds, we fall back to in-memory
only HSTS cache.

Change-Id: I6df551d8c6c96d982080a51ce6b1bdce71d04b9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-24 11:49:05 +00:00
Thiago Macieira
4fc4f7b0ce Export qt_open64 from QtCore
Other libs use qcore_unix_p.h.

qopenglprogrambinarycache.cpp:function QOpenGLProgramBinaryCache::load(QByteArray const&, unsigned int): error: undefined reference to 'qt_open64(char const*, int, unsigned int)'

Change-Id: I44e7d800c68141bdaae0fffd155675d15eded2e4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
2018-09-24 10:59:02 +00:00
Martin Smith
47f815cb26 doc: Fix several miscellaneous qdoc warnings
This update fixes several qdoc warnings for things like incorrect
links to section titles, missing enum \value commands, and incorrect
\fn signatures.

Change-Id: I35ae18810d386a78ffa87d674489c7ad8c5fa215
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-09-24 10:45:30 +00:00
Andy Shaw
8aa9bb6d3f Clarify docs regarding the states of a QFutureWatcher with no future set
Task-number: QTBUG-55554
Change-Id: I49b475a95d8ee65864cfa6d1024cb17cfe648b43
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-09-24 10:32:49 +00:00
Kai Koehne
12c357bebb Document IAccessible2 version
The update to 1.3.0 was done in
b2a7d865b2.

Change-Id: Ie4227d49a1ee0707abff754a5edbcb2b9663ccfe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-24 10:30:56 +00:00
Morten Kristensen
f30bf5fbd5 Fix shortcuts in dock widgets with custom title bar
QWidgetResizeHandler cannot be sure that it will see the MouseReleaseEvent and therefore buttonDown
could be set wrong (and is set wrong in QGraphicsViews). When the mouse is up, the widget should
not think it is moving or re-sizing the dock widget. A similar fix exists in the code a few lines
above.

Task-number: QTBUG-70596
Change-Id: I52ce487836bc71da8fd7d71f8a89e21b51406d00
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-24 09:57:55 +00:00
Christian Ehrlicher
43ed09fed5 QListView: Speedup handling of hidden items
Instead iterating through all rows to get the number of hidden items,
iterate over the hidden items which are fewer items.
Also don't create a temporary vector with visible flow positions by
remembering the count of hidden items before the working index and
adjusting them appropriately which gives a significant performance
boost when working with a large data set.

[ChangeLog][QtWidgets][QListWidget] Speedup handling of hidden items
when working with large data sets

Task-number: QTBUG-68977
Change-Id: I599b6e97945c245f02229145baad8363ec2bf2f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-17 14:01:31 +00:00
Christian Ehrlicher
2b17731413 QTableView: fix calculating cells to draw
The width of the bitarray which should avoid redraws of already drawn
cells is sometimes calculated with other parameters then the actual
drawing. This can lead to cells which are not drawn.
The reason for the discrepancy is that for the initial calculation the
headers viewport width is taken which can be smaller than the real
width due to a css border. Since all other QHeaderView operations do not
take the border into account the problem arises.
This will not fix the visual glitch (the header separators are not
painted at the same position as the grid) but will at least draw all
needed cells.

Task-number: QTBUG-20316
Change-Id: I4a1e35ee3ea51b1b458ad3497aab0a34af680cb8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-17 14:01:28 +00:00
Liang Qi
23f1be0c67 Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-09-16 14:55:30 +00:00
Sergio Martins
2a9cdd88b0 stylesheets: Don't fail silently with invalid background-images
Print a qWarning, otherwise this is very hard to notice

Change-Id: I882f97583071e786d5aa06f6eeb485da4fc646db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-16 13:26:24 +00:00
Andreas Hartmetz
50315cc56e Fix return value of GLib event dispatcher socketNotifierSourceCheck
The wrong return value didn't seem to result in observable bugs.

Change-Id: Iaba74d0acd4352af9be70498a7d5556bb1e02f5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-16 12:31:06 +00:00
Andreas Hartmetz
37df81b788 GLib event dispatcher: fix iteration in source check in error case
It was accessing the deleted current element in a potentially
reallocated container.

Change-Id: I81d86410907b7b0c20c2edc62ad256315606bc96
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-16 12:31:00 +00:00
Gatis Paeglis
232fe3ab6a doc: add note about QAbstractEventDispatcher::wakeUp() for {Unix,Glib}
Task-number: QTBUG-70229
Change-Id: I3efc20baf0cfeb79834f3f2b7aa5a4cb049542f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-16 11:22:48 +00:00
Qt Forward Merge Bot
4e0fcc6ffc Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ic3ffc44d61448a44353c004b9f6703786cc1b213
2018-09-16 01:00:13 +02:00
Thiago Macieira
cb5c24fa26 Fix integer overflow in very long sections in ELF objects
The source is an ElfXX_Off, which is an unsigned 32- or 64-bit. That
means any section bigger than 2 GB would cause an overflow when we
assigned in

    m_stringTableFileOffset = strtab.offset;

Change-Id: Ib47c56818178458a88b4fffd15546bd47a89894e
Fixes: QTBUG-70560
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-09-15 19:46:40 +00:00
Olivier Goffart
6ff862a682 Fix binary compatibility with old generated moc files
Commit 1c623bc6d1 introduced a new
QMetaObject revision, which change the size of the QMetaEnum data.
When looking up QMetaEnum in a QMetaObject, this size need to be
checked for every different QMEtaObject from the hierarchy, not just
the first one.

Change-Id: I6f0d3982329822e15e284aef9b141d4c9ab351b9
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-09-15 15:06:38 +00:00
Mikhail Svetkin
6723155bc7 QOffsetStringArray: fix compilation error with ICC18
error: expression must have a constant value
  static constexpr const auto messages = qOffsetStringArray(

Change-Id: I80a6bf5b83f99a8325511ac8a14e0c9819e3d2b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-14 20:08:15 +00:00
Allan Sandfeld Jensen
1511bfef52 Disable RGB64 backend for ARGB32 when it will be very slow
Fixes a speed regression on ARGB32 painting on low end hardware
introduced when it was switched to using the RGB64 raster routines.
It turns out several of our embedded QPA targets use ARGB32 as native
format.

Task-number: QTBUG-69724
Change-Id: I6d7993c12da46a85b8354eb905930dae9602b5e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-14 16:57:02 +00:00
Romain Pokrzywka
5728a9d8a7 Windows QPA: Dispatch skipped touch/pen events if compression is off
If the hardware produces events faster than the app can consume between
two updates, Windows automatically coalesces them into a single message
with the latest touch/pen pointer state and coordinates, effectively
compressing those events. But the pointer API also supports querying
and retrieving the skipped individual touch and pen frames.

There are cases where keeping all the events generated by the hardware
is desired, especially for pen events where having the most sampled
points available is critical to precisely rendering curves.

Qt already defines application attributes to control event compression
for general high frequency events and for tablet events in particular.
Use them on Windows also to control whether to retrieve skipped frames.

[ChangeLog][Windows] The application attributes AA_CompressTabletEvents
and AA_CompressHighFrequencyEvents are now supported on Windows 8 and
above for touch/pen input, with the same defaults as on X11 (compress
touch events, don't compress tablet events)

Task-number: QTBUG-44964
Task-number: QTBUG-60437
Change-Id: I1b11a043e2d71ee502895971fafb3a46306a89d8
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-14 15:41:28 +00:00
Paul Wicking
74700493c3 Doc: Remove extra \a command causing QDoc macro expansion error
Change-Id: I453a68a579e4fd519616cd1a9f934501b01ef44c
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-09-14 03:56:09 +00:00
Qt Forward Merge Bot
42f84de26a Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
2018-09-14 01:00:08 +02:00
Florian Bruhin
49efea26a5 sqlite: Fix QSqlError handling when opening/closing database
Both sqlite3_open_v2 and sqlite3_close are documented to return an error code:
https://www.sqlite.org/c3ref/open.html https://sqlite.org/c3ref/close.html

However, those were ignored (other than checking whether the operation
succeeded), causing QSqlError::nativeErrorCode() to always be "-1" when there
was an error while opening/closing the database.

Additionally, the error string needs to be read (via sqlite3_errmsg16) in
qMakeError *before* d->access is set to 0, or the databaseText() will always be
"out of memory" no matter what error actually happened.

Task-number: QTBUG-70506
Change-Id: I75cbf178c9711442e640afd26c4502214d20c598
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-13 18:18:47 +00:00
Andy Shaw
c9f316c8b9 ODBC: Correctly check if the field is within the fieldCache range
This was found while running the ODBC tests. tst_QSqlQuery::isNull()
accounts for this already.

Change-Id: Idf99a85396d7aa4e69b89467f873b105ef946f7f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-13 17:07:57 +00:00
Tor Arne Vestbø
704a3989d1 Fix spelling mistake in qimage.h
Change-Id: I2138318894587cc0b5f03af14a57b2a39509f0da
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-13 15:53:18 +00:00
Tor Arne Vestbø
2c649856d5 macOS: Clarify what static mutex in QCocoaGLContext is used for
Change-Id: I4af0b78dbecad40b2a73cdbdb09a8eb60efdb013
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-13 15:53:17 +00:00
Andy Shaw
45c1473847 Detect when we are at the sentence boundary
On Samsung devices this would cause it to always to captalize each word
even if it was not a new sentence. Therefore we use QTextBoundaryFinder
to determine if it is a new sentence or not.

Task-number: QTBUG-69398
Task-number: QTBUG-66531
Change-Id: I24bf36f09a2570acfefd4343551cb1720ddc6279
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-09-13 15:36:34 +00:00
Qt Forward Merge Bot
f5bf8ca9c3 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Icd201bf6b634e44e0e2ab05eaf91a7d8588d7f05
2018-09-13 01:00:39 +02:00
Allan Sandfeld Jensen
bff307ab93 Fix XCB on endian mismatched client and server with SHM off
If SHM is disabled, that code path already does its own bswaping.

Change-Id: I6c17f6c5c5502c8f89098d38d931b6b8f50b2640
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-09-12 11:56:38 +00:00
Christian Ehrlicher
0d1481b4d2 SQL PostgreSQL/SQlite: Properly decode default varchar parameter
The default values for varchar columns were not decoded properly.

Task-number: QTBUG-46968
Change-Id: Ie13d48c316cd694240f7e287010b97afc8c6c341
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-12 09:11:04 +00:00
Eirik Aavitsland
9d1c881f49 Texture file support: add mipmap reading to ktx handler
Change-Id: Ic2c10b3e64d63d2272a8a3922d2b3f99dfd45bdb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-12 08:41:38 +00:00
Laszlo Agocs
2d82cb7d77 QVulkanWindow: Fix some load/store ops in the default renderpass
Stencil is - very likely - cleared just like depth. Also, switch to
STORE_OP_STORE for the multisample buffer, for correctness.

Change-Id: I31b56658286205af8551018115ca2abbe541be67
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:20 +00:00
Laszlo Agocs
d6c7089e6c QVulkanWindow: Fix bogus stage masks in readback
Change-Id: I08882a02204c95272b100647923c9903f825912c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:17 +00:00
Laszlo Agocs
1c6bd414dd Fix device local alloc in hellovulkantexture
Running with QT_VK_FORCE_STAGE_TEX does not work at all with recent
NVIDIA drivers due to QVulkanWindow's and the example's naive way of
picking the memory index. Enhance this and add a warning note to the
QVulkanWindow docs as well.

Change-Id: I7f200e11d982b56e3da3b71ee3915bd7bfca5cc1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:15 +00:00
Allan Sandfeld Jensen
73af8e7553 Add optimized fetch ARGB32 routines for NEON
After convert and fetch were split, only convert was still NEON
vectorized, while fetch is the more commonly used version.

Change-Id: Iea2af7ccee6589b3d6e9908afeaae2d1ad2753be
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-12 07:26:55 +00:00
Paul Wicking
cfb8d70888 Doc: Fix typo and add precision to method description
As transform() returns worldTransform(), point out that it is an alias
in its description.

Fixes: QTBUG-18117
Change-Id: I0eb1f78c6955b499906024105f9969cdccf13303
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-09-12 06:42:40 +00:00
Andy Shaw
a3e8b92d97 ODBC: Remove the trailing \0 in the case of a non unicode string
Some ODBC drivers, such as old Informix ODBC drivers will incorrectly
include a trailing \0 in a string when this should not exist. For
unicode strings this was already accounted for, but for non-unicode ones
this was not covered.

The change also fixes up the comments a bit to make this clearer and
also added one for the unicode case.

Task-number: QTBUG-62406
Change-Id: Id932a58d9e5fdff2f4d1aacf8cc9fdaeb34f95f4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-11 16:39:03 +00:00
Tor Arne Vestbø
d8c210d7f5 macOS: Prevent flickering when resizing window rendered to by separate thread
When a window is resized AppKit groups all updates to the view frames and
corresponding layer bounds, so that the result of the resize is visually
atomic, but this only works for the main thread.

http://openradar.appspot.com/radar?id=4990815088672768

When a separate thread renders to one of the views in the window, it may
result in the view and its layer updating its bounds visually before the
resize has been visually reflected for the window itself and its border.

To ensure visually atomic updates, we disable all screen updates for the
process during resizing. This is the same workaround used by e.g. the
NSOpenPanel class, which renders the content of the view out of process,
and by Chromium for a similar use-case:

https://chromium-review.googlesource.com/c/chromium/src/+/798774

Ideally we'd do this only for the window that is being resized, but there's
no known API to do that. The deprecated [NSWindow disableScreenUpdatesUntilFlush]
is a no-op these days, and used NSDisableScreenUpdates internally anyways).

Fixes: QTBUG-69321
Change-Id: I84de714782278f2e0b2b2e1eb245c30810cb3023
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-11 16:36:50 +00:00
Friedemann Kleint
dff9bb2f9b Windows: Disable shader disk cache for Intel HD Graphics 620
Set Qt::AA_DisableShaderDiskCache when the feature "disable_program_cache"
(modeled after the Chromium driver bug list) is present and set it for the
Intel HD Graphics 620 card.

Task-number: QTBUG-64697
Change-Id: Ibba588d2ab296b5c959ab8ee9712b47ec7cc906e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-11 13:42:40 +00:00
Edward Welbourne
d5891036de Make updateSystemPrivate() local to qlocale.cpp
It's not thread-safe so should only be used within systemData()'s
locked code.  This eliminates the last callers of it by making it a
local function of the compilation unit, exposing a method from
QSystemLocale() to get round its use of private parts.  Make the
constructor for QSystemLocale only stomp its _systemLocale global if
previously unset, but let instantiation still clear
globalLocaleData.m_language_id, so that it can be used as a way to
trigger an update to system locale data.

Change-Id: I908dca9fd30bbf20f42321ab8f9094f2fa37b7b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-11 08:22:59 +00:00
Eirik Aavitsland
621ab8ab59 bmp image handler: check for out of range image size
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.

Change-Id: I874e04f3b43122d73f8e58c7a5bcc4a741b68264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-11 06:36:34 +00:00
Qt Forward Merge Bot
5d92f1793a Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I1df9adea124326ef7c7802839eb93efc4302b287
2018-09-11 01:00:36 +02:00
Morten Johan Sørvig
405e297756 macOS: Use dark gradients for title and status bar in dark mode
These were hardcoded to light colors, which made the
QMainWindow status bar look out of place and made the
(light) text hard to read.

Hardcode to dark colors for DarkAqua which more or less
match the native look. Keep the optimization where the
Gradients are stored in static variabless.

Change-Id: I3e75b42c41d3e2d18e4bc0f17d950a702ccad662
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich (DO NOT ADD TO REVIEWS) <gabriel.dedietrich@gmail.com>
2018-09-10 19:28:41 +00:00
David Faure
5175824f15 QStringList: restore binary compatibility with Qt 5.11
Commit 8b6100d512 removed
bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, ...)
(in favor of a QStringView overload). However this was used inline in
qstringlist.h, so apps were referencing that symbol directly.

As a result, upgrading to Qt 5.12 gave errors like
libKF5ConfigCore.so.5.50.0: undefined reference to `QtPrivate::QStringList_contains(QStringList const*, QString const&, Qt::CaseSensitivity)@Qt_5'
collect2: error: ld returned 1 exit status

Change-Id: I862263a9b06157052df894a201dfd86df8c3f4fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-09-10 19:20:15 +00:00
Liang Qi
d09d99af22 Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-09-10 17:16:54 +00:00
Liang Qi
683e144efb Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	mkspecs/common/macx.conf

Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
2018-09-10 12:12:46 +02:00
Tor Arne Vestbø
1398f4f828 macOS: Release surfaces straight away when reconfiguring QCocoaGLContext
Calling setView or update on NSOpenGLContext results in recreating the
internal GL surfaces of the view. Unfortunately there seems to be a
fixed amount of these surfaces available, so if we spin a loop where
we for some reason end up recreating them, we'll easily run out, and
lock up the whole window system:

  thread #6, name = 'SwapThread'
    frame #0: 0x00007fff7b45220a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff7b451724 libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00007fff751c1675 SkyLight`SLSBindSurface + 247
    frame #3: 0x00007fff5d9c4328 OpenGL`___lldb_unnamed_symbol29$$OpenGL + 255
    frame #4: 0x00007fff6bf42c33 libGPUSupportMercury.dylib`gldAttachDrawable + 364
    frame #5: 0x00007fff5d9e61e7 GLEngine`gliAttachDrawableWithOptions + 257
    frame #6: 0x00007fff5d9c4bb0 OpenGL`___lldb_unnamed_symbol38$$OpenGL + 969
    frame #7: 0x00007fff5d9c8b0e OpenGL`___lldb_unnamed_symbol57$$OpenGL + 82
    frame #8: 0x00007fff5d9c8e55 OpenGL`CGLSetSurface + 330
    frame #9: 0x00007fff50d0eb2c AppKit`NSOpenGLContextAttachOffScreenViewSurface + 352

This can happen e.g. when resizing the application, where AppKit itself spins
a loop where we don't end up back in QCocoaEventDispatcher::processEvents()
for each pass (where we do have a local pool). Or it can happen in the
render-loop of a render-thread that doesn't use the event dispatcher.

Change-Id: Iaf2f879dd01e3d807d0f35705ccc978dbc89036b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-10 09:03:36 +00:00
Timur Pocheptsov
33b79ddc80 QDtls and QDtlsClientVerifier - add destructors
While these destructors are essentially trivial and contain no code,
the classes inherit QObject and thus have virtual tables. For such
classes -Wweak-vtable generates a warning: "'Class' has no out-of-line
virtual method definitions; its vtable will be emitted in every translation
unit." Noticed this after updating QtCreator to the latest version.

Change-Id: Iacb5d0cd49353bd35260aff736652542bb1ef197
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-09-10 04:37:24 +00:00
Thiago Macieira
b66357e3eb moc: Fix compilation of text strings containing non-ASCII
On platforms where char is signed, like x86, the following is an error
(narrowing conversion):

 unsigned char x[] = { '\xc3' };

Change-Id: I495bc19409f348069f5bfffd15518f9ef4e43faf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-10 04:17:03 +00:00
Qt Forward Merge Bot
3d2832790a Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: If1baf48f0f396fb223672d14f0e1847ac42ca1a6
2018-09-10 01:00:42 +02:00
Tor Arne Vestbø
c0e94fa0cd macOS: Use NSOpenGLContext's drawable directly to track active drawable
We don't need a separate QWindow pointer to keep track of the active
window, it's recorded already by the NSOpenGLContext's drawable.

And we don't need to juggle the drawable when the window is hidden,
the drawable is still valid after the window is re-shown, and we
call update on every frame (for now) anyways, which will reconfigure
the drawable if needed.

Change-Id: I199b6c027226dd239c13ecc4aba86986ca09a1eb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-09 22:13:28 +00:00
Christian Ehrlicher
ef40cad3a9 QTableView: Fix PageUp not getting to top when first row is hidden
When the first row(s) of a QTableView is hidden, PageUp could not reach
the first visible row because logicalRow(0) is taken without checking
if the row is visible.

Task-number: QTBUG-70215
Change-Id: Ic7820352b8988accb685ea7d16908d3fa8bf2847
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:03:55 +00:00
Christian Ehrlicher
cd499b7297 QLayout: Better document QLayout(QWidget *parent) behavior
QLayout(QWidget *parent) directly calls parent->setLayout(this) which
can lead to a runtime warning later on when someone tries to set the
layout on the parent again.

Task-number: QTBUG-69761
Change-Id: I21ef8895fd65f3e23e57527a6d38936e45417b63
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-09-09 12:03:51 +00:00
Tor Arne Vestbø
8b3a6cfbfb Update QOpenGLContext::currentContext after QPlatformOpenGLContext::makeCurrent
Instead of doing it up front and then restoring the current context
if the makeCurrent call failed.

By delaying the update, QPlatformOpenGLContext::makeCurrent has the option
to check which context was current before the call.

Change-Id: I458f5c00d7c820acbe2f8552b0513fce99b9b683
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-09 11:10:38 +00:00
David Faure
c82ab86cea New proxy model: QConcatenateTablesProxyModel
It takes multiple source models and concatenates their rows into a single model.

With full unit tests.

[ChangeLog][QtCore] New class QConcatenateTablesProxyModel, to
concatenate the rows from multiple source models.

Change-Id: Iaf4f325473adef106f423677fdc5ee0e35e87d35
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2018-09-09 10:13:06 +00:00
Qt Forward Merge Bot
1f1e2aa57b Merge remote-tracking branch 'origin/5.11.2' into 5.11
Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
2018-09-09 12:13:02 +02:00
Thiago Macieira
1205f4a229 Moc: use QVector more often
It's more optimised and it vectorizes better, due to one level of
indirection fewer.

Change-Id: I495bc19409f348069f5bfffd1551e85092ed8dc2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-09-09 05:23:08 +00:00
Thiago Macieira
2dca4ef19c CBOR: Add missing clear() methods to the two container classes
Change-Id: Id59bdd8f1a804b809e22fffd153fd5174b58014d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-09 05:22:59 +00:00
Qt Forward Merge Bot
be27bf02f4 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I36cda712b4cf960de70e497aef52fbc491099f1c
2018-09-09 01:00:10 +02:00
Richard Moe Gustavsen
8d3b9841e1 Cocoa: change background color of selected menu items
Change 582d221b29 caused a regression when drawing menu items in
e.g a QComboBox. After that change, QCocoaSystemSettings would set the
QPalette::Highlight color to [NSColor selectedMenuItemTextColor]. But
the Highlight color is the background color, not the text color. And we
also use [NSColor selectedMenuItemTextColor] as the QPalette::HighlightedText
color. The result is that highlighed menu items end up with the same
foreground and background color (white), which means that they "disappear".

The color that we used before the patch, alternateSelectedControlColor, could
be used, but has the downside that it doesn't follow the appearance color in
system settings (like it should, compared to native apps). And it's also slightly
to blue. But using keyboardFocusIndicatorColor seems like a perfect match.

Fixes: QTBUG-69500
Change-Id: I07f091a5130a7308525743948d2a435226658a6f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-08 19:41:17 +00:00
Juan Jose Casafranca
5474f28c42 Graph loader can load prototypes stored in the graph
Change-Id: Ib0bbfe5b0257bf355e83cc5287fa52b1e0cc3ed6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-09-08 17:11:06 +00:00
Tor Arne Vestbø
be60b541ad Make QOpenGLContext::makeCurrent use early exit for all its flow
The case of the platform context failing makeCurrent is the exception.

Change-Id: I606e6fb379f84e886bff9e27355dda9b31ff9ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-08 14:04:51 +00:00
Mikhail Svetkin
59fc64cfc5 QOffsetStringArray/msvc: fix compilation warnings C4100
C4100 - identifier' : unreferenced formal parameter
It happens when we call StaticStringBuilder::concatenate(StaticString<N>, StaticString<0>).
StaticString<0> is ignored.

Change-Id: Ic687bc865aa5d5e7425cbddbd614bde7dbb801df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-07 08:29:22 +00:00
Tor Arne Vestbø
3baa9aa3cd macOS: Clear NSOpenGLContex's drawable when using offscreen surfaces
Otherwise the user might accidentally render to the previously active
window, if not explicitly using an FBO.

This will have an performance impact if doing makeCurrent on a real
window and an offscreen window back and forth with the same context,
but that's not really a common or recommended use of QOffscreenSurface,
as you can create FBOs with a normal window current as well. The use
case of QOffscreenSurface is when a real window is not available.

Change-Id: If93d04f82564523e15d5970429afea34c5cd31fe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-07 07:25:37 +00:00
Qt Forward Merge Bot
f21330b749 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I799e2ca2fefa140c8b73b73aa959c6ed8da6eae6
2018-09-07 01:00:48 +02:00
Qt Forward Merge Bot
295cd87c6d Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
2018-09-07 01:00:21 +02:00
Friedemann Kleint
35ebdeb83e QTreeView: Fix expanding of spanning items
When using HeaderView::ResizeToContents and
QTreeWidgetItem::setFirstColumnSpanned(), it happens that the position
of the branch icon is no longer in the first column and thus trying to
expand the item results in a selection change. Check for spanning when
determining the position.

Task-number: QTBUG-41793
Change-Id: I14353127436fb0ebaafb0d50a31b920b8da67333
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 20:28:40 +00:00
Laszlo Agocs
2105f80169 cocoa: Fix build with MoltenVK
Change-Id: If92afa2d30d55e1dd2968f582350ba2cf16fe27b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 17:10:06 +00:00
Mikhail Svetkin
e8dacba47a QOffsetStringArray: fix compilation error with MSVC15/17
MSVC 2015/2017 has a bug with constexpr.
It is internal compiler error when we are using QtPrivate::IndexSequence
with more than 1024 items.

Example:

template<int ... I>
void foo(QtPrivate::IndexSequence<I...>) { }

void bar() {
    foo(QtPrivate::makeIndexSequence<1024>()); // works
    foo(QtPrivate::makeIndexSequence<1025>()); // error: C1202: recursive type or function dependency context too complex
}

Workaround:

template<typename>
struct Foo;

template<int ... I>
struct Foo<QtPrivate::IndexSequence<I...>>{
    static constexpr void call() { }
};

void bar() {
    Foo<QtPrivate::makeIndexSequence<1025>>::call(); // works
}

Change-Id: Iedbf5291ac4a9f51f8b5f6b76b83baba920c092d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 13:20:28 +00:00
Friedemann Kleint
deab54f84f Fix crash when setting Qt::WA_StaticContents on a transient child
Bail out of QWidgetBackingStore::updateLists() when a
top level transient child is encountered, preventing from
adding children of other top level windows to its list.

Task-number: QTBUG-70085
Change-Id: Ibd748ab959af9bfe7fe0622494936b0c109ab25a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-06 12:54:54 +00:00
Tor Arne Vestbø
d115196010 macOS: Use single call site for timer processing in event dispatcher
Makes it easier to add shared logic later on.

The call to maybeCancelWaitForMoreEvents() has been left out as it was
not called from all call sites.

Change-Id: Ibcb10ab4d788de80850b0e5a4286b4d49091cddb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:42:17 +00:00
Tor Arne Vestbø
367adc10de macOS: Rename QCocoaGLContext::setActiveWindow to setDrawable
Change-Id: I0be5125b434418c005f45f05c54b22f0418b46e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:30:13 +00:00
Christian Ehrlicher
6c088af0f9 QHeaderView: honor qss padding attribute
QStyleSheetStyle did not check if a border (which includes the padding)
is given and therefore the padding attribute given by css was ignored.
Only when another attribute was additionally set, the padding was used.

Task-number: QTBUG-59501
Change-Id: If3e691a23266ef6d0fb942a43053b29d65e40047
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-06 12:19:03 +00:00
Christian Ehrlicher
20be62da8c QHeaderView: remove dead code
The special handling when a font for a headerview is set became useless
after a4e6117c53 since it is now included
in branch four lines above.

Change-Id: I73bec48913ebca5f278128a124b58d1b6172e334
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-06 12:19:00 +00:00
Christian Ehrlicher
fbd21e1024 QHeaderView: Take padding/margin into account when eliding text
When QHeaderView has an elide mode set, the available width passed to
QFontMetrics::elidedText() was not adjusted when padding or margin was
set. This lead to a too long text displayed in the header.
Now QStyle::subElementRect(SE_HeaderLabel) is used to get the correct
rect.

Task-number: QTBUG-23203
Change-Id: I12fc646092470272bb91b3ffb7c7a51e239c7a35
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 12:18:56 +00:00
Kai Koehne
3bac18da8e Document SLJIT part of pcre2
src/sljit features the BSD-2-Clause license, not the BSD-3-Clause one.

[ChangeLog][Third-Party Components] Added documentation for the SLJIT
part of pcre2, which is available under the BSD-2-Clause license.

Change-Id: Ie1e981ef6eab2c8d2960919b66ac85b29450f919
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 12:09:31 +00:00
Friedemann Kleint
550d2a0a15 uic: Fix pixmap functions for QIcon
Task-number: QTBUG-8563
Change-Id: I69b16ac2327fee6dd6f26845bdda60ad4dde56fa
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-09-06 11:58:40 +00:00
Luca Beldi
dc73a691bf Fix QSIM::itemData returning role 255
Before this fix, QStandardItemModel::itemData returns
a map containing role 255 which is used internally to store the flags.
This role is an undocumented implementation detail so it should
not be returned to the user.

[ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255

Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 11:51:28 +00:00
Luca Beldi
37a1c6dc4c Reimplement QStringListModel::setItemData
Before this patch QStringListModel::setItemData emitted dataChanged
twice if the roles map contained both DisplayRole and EditRole.
This fixes the duplication.

Increased efficiency of QStringListModel::itemData

Task-number: QTBUG-67511
Change-Id: Ibaea17530f15627a3cb8003e5284e54001731ded
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:27:09 +00:00
Luca Beldi
fcdb459c06 Implement QListModel::moveRows
Implemented the virtual method moveRows to allow row movement.

[ChangeLog][QtWidgets][QListWidget] Implemented moveRows in model

Task-number: QTBUG-69807
Change-Id: I212b560b8778306a0315d9d5e4710efcc7dbbe44
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:58 +00:00
Luca Beldi
551e11c286 Implement clearItemData in common models
A virtual method clearItemData was added to QAIM for Qt6.
This patch implements that method to all Qt concrete models for which
it makes sense.

Task-number: QTBUG-69616
Change-Id: If980fcfc36f723128bc56ec4587c5c3a338dbbcc
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:51 +00:00
Laszlo Agocs
85f127cb04 Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.

While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).

Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-09-06 09:17:53 +00:00
Andre Hartmann
689a1e186b QString: Fix snippet explaining "non-spaced numbered place markers"
The snippet tries to explain the advantage of

 str.arg("Hello", QString::number(20), QString::number(50));

over

 str.arg("Hello").arg(20).arg(50);

which only makes sense, if str contains the same formating sequence,
namely "%1%3%2". That also matches the belonging comment.

Amends 8481500f63

Task-number: QTBUG-44044
Change-Id: Ic2595107bc599c6d244ebf88184a5cc5569ed4f1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 09:07:01 +00:00
Qt Forward Merge Bot
e5d0289413 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2f6e1c0f649c5098723b776c774a8a689bb60582
2018-09-06 01:00:33 +02:00
Mikhail Svetkin
40cd0f35ef Remove QConditional in favor of std::conditional/std::is_unsigned
Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-05 14:11:15 +00:00
Erik Verbruggen
028727c20c ASAN: Disable SSE4.1 code in qstricmp because of heap-buffer-overflow
Although it is safe to slightly overread a string (provided it doesn't
cross page boundaries), ASAN is extremely picky about this kind of
behavior. So, do not run with this vectorized code when ASAN is
enabled.

Task-number: QTBUG-70269
Change-Id: I2b59b524d608afec8985227285feab55158d7247
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-05 13:14:47 +00:00
Andre de la Rocha
20ac20bcea Windows QPA: Fix missing accessibility info with WebEngineView
It seems when a WebEngineView is parented by a window its accessible
interface will not know its parent, which prevented the root of an
UI Automation fragment from being found, causing missing accessibility
info. This change adds a workaround to avoid this issue.

Task-number: QTBUG-70199
Change-Id: Ia7cfc9f410c4f0ef3b5f9d1700748a9a3e29b7c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-09-04 19:48:01 +00:00
Ulf Hermann
dd944136a2 QObject: Document order of events on destruction
Weak pointers are zeroed before destroyed() is emitted. This makes sense
because the signal is called "destroyed()", not "aboutToBeDestroyed()",
and the code has been like this for a long time.

Change-Id: Ic852fe354405e328d1922a75931e7eb7bf651b26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-04 07:05:00 +00:00
Venugopal Shivashankar
ff2a71e310 Doc: Move the literal code blocks to a separate file
It's easier to override the code blocks this way.

Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-09-03 12:31:07 +00:00
Rolf Eike Beer
a3ee0b94da QWindowsStyle: respect rectangle when drawing PE_IndicatorViewItemCheck
This is a follow-up on commit 6553921dd5,
which fixed the drawing of the surrounding rectangle when used in item
views. This one now fixes the drawing of the check mark itself, for both
item views and standalone items.

Change-Id: I14f359e9d2ef33652cc68494b7d114e61110e5e0
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-03 10:51:14 +00:00
Andy Shaw
69a2bc7a2a Doc: Explicitly state that QSqlTableModel only handles EditRole
Fixes: 5.12.0
Task-number: QTBUG-70234
Change-Id: I65c6aa60048182c5408dca2aa20098af363b10ec
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-09-03 10:24:09 +00:00
Samuel Gaist
fe463dd422 QSFPM: cleanup QRegularExpression includes
Add feature guard around the include in the header and remove the one
from the implementation file.

Change-Id: I8dc133cce786ead6059cc66b40a0ffb6c420096f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-09-03 09:42:58 +00:00
Albert Astals Cid
8b6100d512 QStringList: add contains(QStringView) overload
Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:52 +00:00
Albert Astals Cid
64fe66e7be Add QString::compare(QStringView, CaseSensitivity)
There was a QStringView::compare(QString, CaseSensitivity) but it's
good that the symmetric also exists

Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:45 +00:00
Edward Welbourne
5cc5b43d0f Remove some misplaced sizeof() scalings on array sizes for new[]
Noticed during review of clang-tidy warnings.  I have searched the
source tree (using grep) and only this one file contains examples of
this mistake.

Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-03 08:53:46 +00:00
Sergio Martins
179c88a1a9 Rename QTimer::connectTo() to QTimer::callOnTimeout()
Some people suggested the later, so let's have a second look at it
before it's too late.

Although I was in favor of the former I'm now having second thoughts.
connectTo() is meant to only be used in classes which have a clear dominant signal,
but there are rare classes that have two (example: QAbstractButton::toggled, QAbstractButton::clicked).
QAbstractButton::connectTo() would be ambiguous if we ever wanted to add these shorthand connects
to QtWidgets

Change-Id: I198ad3326d31dcf89b9c47a299124572ee7b11b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-03 08:43:39 +00:00
Allan Sandfeld Jensen
5d0ee89132 Fix reading 16bpc grayscale PNGs
They were incorrectly attempted to be read as Indexed8, instead use
the RGBA64 formats to read them with full accuracy.

Task-number: QTBUG-45858
Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-03 08:24:10 +00:00
BogDan Vatra
e0213d1939 Android: Fix crash
Android doesn't like nor use RTLD_NODELETE

Tasnk-number: QTBUG-64654
Change-Id: I2d884bbf22a681cca592942eba84ba97327ba974
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-09-03 08:21:47 +00:00
Rolf Eike Beer
b3f9b2f148 remove internal use of SE_ViewItemCheckIndicator
This is marked to be removed in Qt6, so switch to
SE_ItemViewItemCheckIndicator internally and define the old value as
copy of the new one instead of the other way round.

Change-Id: I9e9804a7ff0e9b2ae1e24698d45b2cbd44423420
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-03 07:15:22 +00:00
Alex Blasche
c82d043de1 Bump copyright year of code generated by dbus tools
Change-Id: Ic5e2ecf672ea86e8ef70a9fa73c0535262d2e928
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-03 05:23:40 +00:00
Morten Johan Sørvig
9da5b6f743 Revert "macOS: Force light theme on macOS 10.14+"
This does not really work: as soon as you build with
the 10.14 SDK you opt-in to having updated palette
management, which the Qt 5.11 series does not have.

This leaves app developers with two ways to opt-out
of dark mode:
 - Build with the 10.13 (or earlier) SDK.
 - Set NSRequiresAquaSystemAppearance in Info.plist

This reverts commit 04671a80db.

Change-Id: I5c01b9965da45de914f699526ba0723837f36e1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-09-03 04:45:04 +00:00
Qt Forward Merge Bot
441ac7084c Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I8303ca41d0ca9ce1fdb27259db4f9f8448c74bcb
2018-09-03 01:00:10 +02:00
Morten Johan Sørvig
d615fb39d5 Make QMacCocoaViewContainer work again
The widget visibility state was set to explicitly hidden,
which was preventing it from working correctly when
its parent widget was shown.

This regression was introduced by commit d7a9e08,
which made QWindow::setVisible() call QWidget::setVisible().

QWindow::destroy() calls QWindow::setVisible(false),
which means that the destroy() call in setCocoaView()
would set the CoocaViewContainer to be explicitly hidden.

Clear WA_WState_Hidden to work around this behavior.

Task-number: QTBUG-67504
Change-Id: I77438fcd01f165f058eea178c214838bd4f27084
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-02 20:14:40 +00:00
Friedemann Kleint
e646ab2ab5 Windows code: Fix to prefer ranged-for, as clang-tidy advises
Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 16:05:39 +00:00
Jan Grulich
101cb8e5d9 Make flatpak portal support to be used also by Snap applications
Snap now uses xdg-desktop-portal for portal support. Add check for apps
running in Snap and make them use portals by default. We also should be
using different name for the platform theme used by sandboxed apps.

Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 14:15:38 +00:00
Friedemann Kleint
7c0884f2a2 Windows code: Fix clang-tidy warnings about else after jumps
Replace by switch() where appropriate, remove else and unindent code
or simplify the return value.

Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:41:07 +00:00
Friedemann Kleint
30756f4626 qelapsedtimer_win.cpp: Fix clang-tidy warning about else after return
Remove else in nelper nanosecondsToTicks()

Change-Id: I6c5291deaeb6651f702a9c118cabcb5a7edd179e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:39:36 +00:00
Friedemann Kleint
9a15ac356c Windows code: Fix clang-tidy warnings about (private) class definitions
Add override, disable copies where appropriate and use = default
for trivial functions.

Change-Id: Ia5bc7419b1aa053c5503ea7dfaf11cb6dfafd2e2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:39:12 +00:00
Qt Forward Merge Bot
ae868dfbdc Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
2018-09-02 01:00:15 +02:00
Andre de la Rocha
4c4a5f8c86 Windows: Check Pointer messages in MessageDebugEntry
Some Pointer Input messages are defined only for Windows 10 and new
versions of the Windows SDK and could break compilation with older
SDKs. Currently, they are not used anywhere outside of the
MessageDebugEntry debug function. Checking if they are defined before
using.

Change-Id: I5fc7bb8e52ab8aca66bb21084289ab8938938063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-09-01 22:51:07 +00:00
Thiago Macieira
7bd79b3cff Plugins: Save some architectural requirement flags
...not just the debug flag. The information is saved outside of the CBOR
map for two reasons:

 1) removing the hack that depended on how QCborStreamWriter and
 TinyCBOR internally work, allowing for the extra parameter to be
 written directly. We wouldn't be able to use that hack anyway and would
 have needed a further, uglier hack to encode a byte whose value we
 don't know.

 2) outside the map, this information can be parsed more quickly and
 then we can discard any plugins we shouldn't actually load.

Since we're doing this for a flag, I decided to move the Qt version
there too for reason #2.

Change-Id: I61ecce6b1324410bbab4fffd153d4e5fc696d19e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-09-01 15:19:46 +00:00
Thiago Macieira
d9766ddc3d Plugins: store the metadata in CBOR instead of binary JSON
In preparation for Qt 6 deprecating the binary JSON format. Also reduces
the size of the metadata a little: for the xcb platform plugin, it went
down from 264 bytes to 138; for the jpeg image plugin, it went from 320
to 135.

I've had to change the signature so older versions of Qt won't try to
parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument
could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to
allocate memory and that causes crashes with Qt < 5.11.2.

Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-01 15:19:39 +00:00
Thiago Macieira
7391662f80 Update TinyCBOR
Updated to https://github.com/thiagomacieira/tinycbor commit
1286d99bdc664de6acf7c5274702325f5a095a0f

Change-Id: I0d3cc366baaa49f3ad28fffd15428e886333bb38
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-09-01 15:19:34 +00:00
Andre de la Rocha
8ada0633cd Windows QPA: Stop synthesizing mouse events from tablet/touch
These fake mouse events should be synthesized by QtGui, not the QPA plugin,
when the tablet/touch events are not handled by the application and the
Qt::AA_SynthesizeMouseForUnhandledTouchEvents or
Qt::AA_SynthesizeMouseForUnhandledTabletEvents flags are set.

Task-number: QTBUG-47007
Task-number: QTBUG-60437
Change-Id: I4d6d5e6667d245c45a4eb4f3a94db05cf9772f52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-01 14:42:49 +00:00
Lorn Potter
e59b323628 wasm: disable RasterGlSurface
QOpenGlWidget and QuickQidget do not work at this time anyway.
This also causes gl to be initialized for widget apps, so disabling this
will optimize widget apps.

We could use Qt::AA_ForceRasterWidgets as well.

Task-number: QTBUG-67797
Change-Id: I8f86a9f72e6f3d437a818b4fbe3d6f3658e17d04
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 19:33:17 +00:00
Tor Arne Vestbø
2664e84322 macOS: Remove support for QSurfaceFormat::StereoBuffers
The NSOpenGLPFAStereo attribute was deprecated in macOS 10.12, without
any replacement, and adding the attribute to the pixel format results
in context creation failure, so we're assuming the feature is no longer
supported an disable it wholesale on macOS.

Change-Id: I27d9f300fdaff9abe90781e3160b97f8b66121ad
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-08-31 12:35:47 +00:00
Tor Arne Vestbø
556beea4c3 macOS: Update all deprecated enums to their 10.12+ equivalents
Change-Id: I3034258da95c9c70eb6758db92967f438617f6e9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:35:45 +00:00
Tor Arne Vestbø
b02fe1bfe7 Remove codepaths and checks for unsupported Apple platforms
We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3.

Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:35:45 +00:00
Kai Koehne
a381ba4220 Document version number of pixman
The files match the ones in pixman 0.17.12

Task-number: QTBUG-69276
Change-Id: Idd03c6979456ad2cf4dcc2aee6986ebc95140937
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-31 12:06:34 +00:00
Allan Sandfeld Jensen
244c7bd193 Avoid conversion over RGBA64 for RGB32 LCD text blending
Short-cuts the case where there is no gamma correction to avoid a
conversion over RGBA64 and back.

Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-30 18:39:32 +00:00
Venugopal Shivashankar
059b10f295 Doc: Check before including the \snippet from a .pro file
Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 09:23:42 +00:00
Morten Johan Sørvig
29c0377f07 WebAssembly for QtBase
This is the squashed diff from wip/webassembly to dev.

Done-with: Peng Wu <peng.wu@intopalo.com>
Done-with: Sami Enne <sami.enne@intopalo.com>
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Started-by: Andrew Knight <andrew.knight@intopalo.com>
Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-30 06:48:33 +00:00
Eskil Abrahamsen Blomfeldt
707ae5b667 Silence warning in gcc 4.9 for Android
When building with warnings are errors for Android with gcc 4.9,
it wrongfully fails on use of uninitialized variable.

Change-Id: I39c5e8413c30567fba60cbba6a8b26d537c5836e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-08-30 06:46:33 +00:00
Friedemann Kleint
64e6441d9c Windows code: Fix clang-tidy warnings about C-style casts
Replace by reinterpret_cast or const_cast, respectively.
Use auto when initializing a variable to fix Clang warnings
about repeating the type name, do minor tidying along the way,
and a few conversions of 0 or NULL to nullptr.

Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 06:26:44 +00:00
BogDan Vatra
19b12ac9c2 Update QMetaObjectBuilder::MetaObjectFlag enum
Synced QMetaObjectBuilder::MetaObjectFlag with the MetaObjectFlags enum
from qmetaobject_p.h. Also added a few comments for Qt 6.

Change-Id: Ieccd5cf8d512a6bf7256b2f4db88d45662774536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-30 05:12:01 +00:00
BogDan Vatra
c2165f891c Allow registering constructor for a set of dynamic types
This feature is needed to register complex types (e.g. Q_GADGETS) at
runtime, using a single constructor method and added type parameter.
Without having the type id available to the Constructor it is impossible
to specialize behavior, thus requiring separate constructors for each
type. Generating these separate constructors at compile time is easy,
but not at runtime.

[ChangeLog][QMetaType] QMetaType can now register constructor for a set
of dynamic types.

Change-Id: I6071271d0e157864594dd07b4bc3a0abbeb15a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 05:11:38 +00:00
Romain Pokrzywka
d02f888417 Windows QPA: Fix duplicate Pointer Touch events and missing TouchCancel
translateTouchEvent needs to filter events based on the message type
passed in msg, as Windows sends more than just down/up/update events,
it also sends enter/leave for each touch and occasionally a few more.

One of them is WM_POINTERCAPTURECHANGED which indicates a general loss
of touch input, which needs to be translated to a touch cancel event.

Ignore WM_POINTERENTER/WM_POINTERLEAVE events as they result in sending
duplicate Qt::TouchPointPressed/Qt::TouchPointReleased events otherwise.

Also avoid sending duplicate events for each additional touchpoint:
Windows already bundles all available touchpoints for a touch event
when calling GetPointerFrameTouchInfo, so we get all points at once,
but we'll still receive other events for each additional touchpoint,
resulting in reading the same bundled data again for each one and
sending duplicate events to QWindowSystemInterface.
Use SkipPointerFrameMessages() to avoid receiving the additional
events for the frame we just processed.

Finally, add raw event logging when the platform verbose level is >1.

Change-Id: I55d840285f642a00f6ffcda4a3efd7ae3985310b
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-08-30 04:47:04 +00:00
Christian Ehrlicher
81e298a51d QWidget: fix setTabOrder for compound widgets
When adjusting the tab order for compound widgets, it can happen that
the order is already correct. The check for this case forgot one case
which lead to a garbled focus chain.

Task-number: QTBUG-68393
Task-number: QTBUG-69619
Task-number: QTBUG-10907
Change-Id: Ic3242746bdcf3a4db6ea8daa1498381500ca116d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-30 04:25:22 +00:00
Christian Ehrlicher
9a3bdbf40a QSS/QTabBar: properly handle QTabBar::scroller
PM_TabBarScrollButtonWidth used the size of the ::scroller subcontrol
without considering that there are two QToolButtons and therefore
returned the wrong size for a single QToolButton.
QStyleSheetStyle::subElementRect() had no handling for
SE_TabBarScrollLeft/RightButton and therefore the values for the
scroller toolbuttons set via the stylesheet were never used.
Fix it by dividing the scroller width by two and add the code path to
handle SE_TabBarScrollLeft/RightButton in
QStyleSheetStyle::subElementRect

Task-number: QTBUG-69653
Change-Id: I1adfe6333f3183bba621bbbb4d10969920c6cd46
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-30 04:25:19 +00:00
Allan Sandfeld Jensen
384fc28b90 Fix out of buffer access in qt_qimageScaleRgba64_up_xy
Avoid reading a pixel outside the image even if we multiply the result
by 0. This mirrors a similar old fix in the the 32bit scaling path.

Change-Id: I7860bc808dc46dbc94918672e99c81b56d4a1d27
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-29 23:18:07 +00:00
Qt Forward Merge Bot
e1c2183374 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ifb032dc19053481e1b0ede5c5c72540110d62567
2018-08-29 01:00:40 +02:00
Christian Ehrlicher
ee5573c6fb QSqlQuery: Specify documentation of named placeholders
Named placeholders can only contain characters in the range of
[a-zA-Z0-9_] but this was not documented anywhere.

Task-number: QTBUG-69775
Change-Id: I5c4eff7674b1fc04cef60e7d7f44cd87414ffbe9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-28 16:10:47 +00:00
Christian Ehrlicher
d18444fbff Handle device pixel ratio in QHeaderView::setupSectionIndicator
The device pixel ratio was not applied to the section indicator pixmap
which made it look blurry on HighDPI screens.

Task-number: QTBUG-70084
Change-Id: I8b07b2ffc51781c2d2d89484b8618173f0692fe4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-28 16:10:43 +00:00
Andy Shaw
28702cb239 Initialize the QSqlQuery to be invalid when creating a sql model
When QSqlQueryModel or QSqlTableModel is created it will create a
QSqlQuery which defaults to using the default QSqlDatabase connection.

If this connection belongs to another thread then it will throw a
warning as this is not safe to use. Since the QSqlQuery is always
recreated when a query is set, the instance which is a member of
the class can effectively be invalid until a new one is set.

Task-number: QTBUG-69213
Change-Id: I68a5dd59fe62788f531d59a0680da11b118ee383
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-28 16:10:30 +00:00
Mikhail Svetkin
6b4e603c62 corelib/tools: Fix auto detection of QOffsetStringArray::m_offset type
The previous implementation wrongly calculated the necessary data type
to hold the offset indexes. It looked at the amount of elements,
but instead we should look at value for the last element in the offset
array

Change-Id: I84c6985dc3c329df3bbc5a14f9789170877b65bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-28 14:42:46 +00:00
Tor Arne Vestbø
2ef5362011 QMacStyle: Make helper-NSViews layer-backed
This prevents the view from triggering display of its superview when
being temporarily added, which is both inefficient and causes issues
when those dirty-rects are wrong due to the wrong frame position of
the added view.

The additional drawRect: calls and corresponding expose events
resulting from the needsDisplay calls also caused repaint issues
in Qt Widgets. QWidgetBackingStore doesn't seem to take the exposed
region into account for an expose event, and will try to flush all
dirty regions. Some of those may be outside the exposed region,
and will be clipped away by the window system, never ending up on
the screen, but with Widgets still thinking it has flushed all
dirty regions.

This is a separate issue, possibly solvable by setting the
wantsDefaultClipping property on NSView to NO, but this needs
further testing, so applying this commit as workaround makes
sense, even if it's just hiding the real bug.

Task-number: QTBUG-67998
Task-number: QTBUG-68023
Task-number: QTBUG-69990
Task-number: QTBUG-69740
Task-number: QTBUG-69292
Task-number: QTBUG-69332
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 38979332d0)
Change-Id: I4ef3fef29f749daa4f3a11fe9186ae77b359f966
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-28 10:28:47 +00:00
Friedemann Kleint
fbb4befa33 Remove dead code in QWin32PrintEngine
The functions checks for _glyphs.isEmpty() and returns
in that case, so, there is no point in having
another code branch for _glyphs.size() == 0 below.
Unindent branch for _glyphs.size() > 0 and brush
it up  a bit to silence clang-tidy (warnings about using
isEmpty(), nullptr).

Change-Id: I78e86583bb30c7bea1357e7a45f61b07d5a4d139
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-28 10:19:36 +00:00
Friedemann Kleint
14bbb18571 Windows Font databases: Rename struct FontNames to QFontNames
Prefix by Q to unclutter the namespace in static builds.
Amends 9204b8c31e

Task-number: QTBUG-53458
Change-Id: I1448cd944b6a3262b9cfa9f5c3fbab17c1c5c71c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-28 10:19:25 +00:00
Paul Wicking
ac5e617596 Doc: Fix typos in QRectF documentation
Add missing 's'.

Fixes: QTWEBSITE-823

Change-Id: I1acd3b7ae18982248bf3402fa5943ee95c1efdbe
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-08-27 17:48:18 +00:00
Romain Pokrzywka
226d196ab0 Windows QPA: Improve Pointer Pen events translation
Compute QPointF hi-res screen coordinates based on the HIMETRIC values
contained in the native message. This gives the same high-precision
screen coordinates as what the old WinTab handler supported.

Add the possibility to not synthesize mouse events if the platform
plugin option DontPassOsMouseEventsSynthesizedFromTouch is set,
just like we do for finger touches. This makes it possible to have
clean Pen events without mouse duplicates for an application that
handles both input types in parallel.

Add raw event logging when the platform verbose level is >1.

Change-Id: Ibf68b6275400388a76f8d5c573eed8f4b9bf4e9d
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-27 15:14:01 +00:00
Edward Welbourne
1a20f9f561 Add Since markers for QLocale enum members added in 5.1 and 5.2
The early additions don't make clear that they weren't present in 5.0

Change-Id: Ibb233c17701c7598b90f2bb53ee507f86856f66a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-08-27 14:39:14 +00:00
Edward Welbourne
47e3369f77 Sort QLocale enum entries in documentation
They were previously in blocks, each alphabetic, partly partitioned by
the version in which they were added, but not fully so.  Since markers
indicate that mre clearly.

Change-Id: If227b37dae45dac546d3f24674cc6bbecb50152a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-08-27 14:39:05 +00:00
Edward Welbourne
89451f5428 Add some missing language codes to our locale data
We were missing a few languages CLDR knew about; so add them to the
list in enumdata.py (and add trailing commas to lists to make future
additions not need to change the prior last line; python is perfectly
happy with this).

[ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido,
Lojban, Sicilian and Souther Kurdish.

Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-27 14:38:44 +00:00
Paul Wicking
9652711a07 Doc: Remove non-reentrant from QDomDocument::setContent
Following QTBUG-40015, QDomDocument::setContent is reentrant.
This change updates the documentation accordingly.

Fixes: QTBUG-69920

Change-Id: Id09e3541156f52d1a976afd02b410c263d3b3352
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-27 13:49:40 +00:00
Frederik Gladhorn
900ce73b6f Merge 5.11 into 5.11.2
Change-Id: I672bc167de3801c944315d92120c5e03da69e9c7
2018-08-27 15:49:03 +02:00
Ulf Hermann
231273b130 JSON: Add qHash functions for JSON and CBOR types
This way we can easily use them as keys in QHash and QSet.

Change-Id: Ie744c3b5ad1176ba2ab035c7e650af483757a0c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-27 13:06:19 +00:00
JiDe Zhang
e31febb024 QSysInfo(linux): Use UTF-8 format read file
...Of the "readEtcFile" function

According to
https://www.freedesktop.org/software/systemd/man/os-release.html
it says "All strings should be in UTF-8 format".

Change-Id: Icd2d75eca2ac7273c7f587a1e3c0430cc6d2c31d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-27 11:29:14 +00:00
Mikhail Svetkin
f0066cae8f corelib/tools: Add QOffsetStringArray API
This function allows to generate an array of offsets of substrings in
a string at compile time. This produces less verbose and easier to maintain
source code.

Change-Id: I5774b8b91906f6191f2b1244a676c07e7eb15b47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-27 10:33:46 +00:00
Qt Forward Merge Bot
2cdbe29ef0 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I9c2a18f5110adf3d8f630718238866aef47bb782
2018-08-26 01:00:16 +02:00
Alessandro Ambrosano
5a707272a0 Tracepoints: fix ETW generator for pointers
Fixes compilation failure on Windows, due to TraceLoggingValue not
correctly casting pointer arguments to a known type.

Change-Id: I6027debe4ea3440588dd8677209d6d47048b6b0f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-08-25 19:07:05 +00:00
Tor Arne Vestbø
ce267bbe37 Weak-import global objects used for logging on Apple platforms
Otherwise the dynamic loader will complain about missing symbols when
the binary is run on platforms below our supported deployment target:

dyld: Symbol not found: __os_activity_current
  Referenced from: QtCore.framework/Versions/5/QtCore (which was built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/torarne/build/qt/5.12/qtbase/lib/QtCore.framework/Versions/5/QtCore
Trace/BPT trap: 5

We want this to trigger our own logic in qt_apple_check_os_version(),
where we tell the user in more friendly terms what's going on.

An alternative to the targeted weak imports would be do import the
whole library as weak, using  -weak-lSystem.B. This doesn't seem
to cause any performance issues at startup, but since we only need
the two global symbols we stick to the more targeted solution just
to be on the safe side.

Change-Id: I87c1f185f6dcf9df26c700d31bb5071ddf7685be
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-25 15:06:26 +00:00
Tor Arne Vestbø
42588a8487 Improve detection and handling of unsupported Apple platforms
The application name wasn't always printed, so we try try a few
more possibilities before falling back to the process name.

We also run the check as early as possible, instead of relying
on a QCoreApplication.

We do not have to provide a dialog to the user, as macOS will do
this for us if the application is launched from Finder.

Change-Id: Ifbec86946d60294806364e08964852fd4b74ff56
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-25 09:34:36 +00:00
Qt Forward Merge Bot
1d077120f4 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I5f1567c792992fc00f0256f39b76cfbe017e6a3a
2018-08-24 23:59:46 +02:00
Tor Arne Vestbø
7af0ea5b0f Disable warnings about deprecated QRegularExpression::PatternOptions
We still want to have these in the debug output for completeness,
so disable the warning instead of removing the lines.

Change-Id: I4291adddff486e4ea963be36ac0ebda089a66045
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-24 16:58:49 +00:00
Tor Arne Vestbø
0de4b76b9c macOS: Take application appearance into account when drawing glyphs
macOS 10.14 uses a new font smoothing algorithm that takes the fill color into
account. This means our default approach of drawing white on black to produce
the alpha map will result in non-native looking text when then drawn as black
on white during the final blit. As a workaround we use the application's current
appearance to decide whether to draw with white or black fill, and then invert
the glyph image in the latter case, producing an alpha map. This covers the
most common use-cases, but longer term we should propagate the fill color all
the way from the paint engine, and include it in the key for the glyph cache.

At the moment we do not react to changes in the application appearance,
as that seems to be buggy in general in Qt (palette/style, e.g.), and those
bugs need to be weeded before we can react to the theme change with confidence.

Task-number: QTBUG-68824
Change-Id: Ibbfd49fcf3a091e454009c08159f46b3499e2bd0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-24 13:42:59 +00:00
Mikhail Svetkin
48f0996449 macOS: minor refactoring QSendSuperHelper
Replace local implementation of index_sequence with QtPrivate::IndexesList

Change-Id: I193b9183ec6832294687e979576a2e3ec56d550b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-24 13:36:36 +00:00
Mårten Nordheim
dcf476503e QNetworkCookieJar: reduce #if-#else branching
Add a definition for qIsEffectiveTLD for when Qt is configured with
-no-feature-topleveldomain. Then we can merge the #if-#else branch.

Change-Id: I91bc329ab95744a2e10dcc4168cd8b84f8fee9f6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-24 12:25:43 +00:00
Mårten Nordheim
8a1baaf336 QAuthenticator: remove leftovers
At some point we stopped supporting "Plain", "CramMd5" and "Login" but
their entries in the enum and a few lines of code related to them were
left behind.

Change-Id: Id8186c9a0760b3b2382544579aa1148ff8125ac4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-08-24 12:25:41 +00:00
Friedemann Kleint
9dd9c6cae4 qthreadstorage.h: Fix syncqt warning about include path for qscopedpointer.h
Add QtCore, fixing:
qthreadstorage.h includes qscopedpointer.h when it should include QtCore/qscopedpointer.h

Amends 815153d4a4.

Change-Id: I8424bc4d0b0d666dbd04d63530af4fbd27987628
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-24 12:00:23 +00:00
Eskil Abrahamsen Blomfeldt
f71048a531 Fix crash when combining QOpenGLWidget, QStaticText and Qt Quick
Under certain circumstances, if you had a widget with a QOpenGLPaintEngine,
and drew QStaticText into this, and then later had Qt Quick access the same
cache and try to resize it, we would get a crash because the resize function
would have a pointer to the paint engine and try to access its shader manager
(which would now be null, since this is outside the begin()/end() phase of the
paint engine.

The solution is to reset the paint engine pointer to null on the cache once it
has been populated and it is no longer needed.

[ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application.

Task-number: QTBUG-70096
Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-24 08:30:28 +00:00
Qt Forward Merge Bot
b73f1cc045 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I1114f90a2ed04a784a66505960b0f2460778726d
2018-08-23 23:01:15 +02:00
Allan Sandfeld Jensen
ed557c0378 Handle uploading of faked sub-images
One trick that is possible to do with QImage is to make it be sub image
of its imagedata by manipulating the data start and bytes-per-line,
we can not upload that directly and need to detect the case and create
a clean copy to upload.

Task-number: QTBUG-70105
Change-Id: I7ce184a0892fb4071b6dcc1a1fd3881a4e0703cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-23 17:32:20 +00:00
Friedemann Kleint
2ab804c452 clangcl: Fix QtGui link error (missing fetchPixelsBPP24_ssse3)
Do not try using SSSE3 if the compiler do not support it.
(see 648ee7aa02).

Task-number: QTBUG-50804
Change-Id: I489b0bbacfde0c647c9d5b71ca3de992d7dc8878
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 14:04:55 +00:00
Mårten Nordheim
4f6fa5b2ae configure: add sources matching names from vcpkg
It's possible to use vcpkg using the -I and -L arguments, but
some of their libraries have different names than what we look for
during configure, so add in those variations.

Change-Id: Iee37197228cc0f15442ecd7ec4fc761f4d526e1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 14:03:28 +00:00
Tamas Zakor
5ded4e35db cups: Add a QT_CONFIG(dialogbuttonbox) guard
This fixes build with -no-feature-action configuration.
The corresponding dialog is added by:
6c5c1a562c cups: Show a dialog when asked for password

Change-Id: Ic88bdd62c756749959e66252427b5edc2c3ce7cc
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 09:48:03 +00:00
Mitch Curtis
972dd1c544 Doc: fix typo in QNativeGestureEvent docs
Change-Id: I83ac3463752488d7dbb758ea767ba186ddd3fa2a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 09:36:21 +00:00
Andre de la Rocha
38cb72b6fd Windows QPA: Force windows to the main screen in certain AMD GPU setups
A multi-screen setup with an AMD adapter set as the 'main display' leads
to using the AMD drivers for OpenGL. This then causes a crash when calling
SetPixelFormat and similar for windows located on another adapter's
screen. This workaround detects the conditions leading to the crash and moves
the window to the main display.

Task-number: QTBUG-50371
Change-Id: I4007c490bdcdc13d6e8bce82983b150aa4930338
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 09:32:32 +00:00
Luca Beldi
da9aeb3e4e Implement QStringListModel::moveRows
Implemented the virtual method moveRows to allow row movement

[ChangeLog][QtCore][QStringListModel] Implemented moveRows

Task-number: QTBUG-69807
Change-Id: I518f48a321bd755ab56f2fe84883d27324cc42ec
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-23 05:51:55 +00:00
Allan Sandfeld Jensen
991b251e39 Fix big-endian build of qopengltextureuploader
Badly placed endif and lacking a break statement.

Change-Id: Id6a3fb13b40e8ae8029e74f7668bafb6e0b9dd06
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-22 14:32:45 +00:00
David Faure
5a1861399b QFileDialog: make QFileDialog::selectFile resolve remote dirs correctly
The code was assuming local files, and broke with remote dirs.
Testcase: `kwrite sftp://localhost/tmp/file.txt` and then Ctrl+O,
the initial directory was $PWD instead of the remote dir.

Change-Id: Ie24d4c1b2b3278dce44274af0066105bd1bf9b34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-22 11:26:12 +00:00
Liang Qi
9be1256e0c Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-22 10:31:09 +00:00
Allan Sandfeld Jensen
dc82a0f4f3 Smooth image scaling for 64bit images
Adds support for smooth scaling 64bit images.

Task-number: QTBUG-45858
Change-Id: If46030fb8e7d684159f852a3b8266a74e5e6700c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-22 10:03:15 +00:00
Mikhail Svetkin
bbed8013cc Mark qBound/qMin/qMax as constexpr
On MSVC2015 Q_DECL_CONSTEXPR is defined as empty.

Change-Id: I8beb919f75cf2066ffc7ac10d5abfaa1712fc1bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-22 08:55:06 +00:00
Luca Beldi
02b3d43fd4 _q_interpolate<T> is unsafe with unsigned template arguments
_q_interpolate<T> subtracts 2 arguments of type T,
for unsigned types this can cause wrapping around

Task-number: QTBUG-57925
Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-08-22 08:38:44 +00:00
Liang Qi
7533156b68 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/gui/text/qtextengine.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h

Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
2018-08-22 10:35:12 +02:00
Thiago Macieira
330290e049 QPluginLoader: pave the way for Qt 6 plugin meta data
We want to store the metadata size and get it from the plugin in Qt 6.

Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bebc2914d9a3c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-21 23:59:44 +00:00
Mitch Curtis
76c328b2b3 Fix spacing in << operator for QEvent
Turns

     QNativeGestureEvent(ZoomNativeGesturelocalPos=686.855,312.836,
         value=0.0259857)

into

     QNativeGestureEvent(ZoomNativeGesture, localPos=686.855,312.836,
         value=0.0259857)

Change-Id: Id30860a3c7a1b6da583369126a31934ddb32d4b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-21 14:45:58 +00:00
Allan Sandfeld Jensen
07eda676e4 Fix big-endian build
Declare rbSwap<QImage::Format_RGBA8888>, so we don't end up in a
fallback definition not used by little-endian.

Task-number: QTBUG-69951
Change-Id: I8512bba76da7d59a27593d37c70283d881c3e8fc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-21 13:31:44 +00:00
Friedemann Kleint
cf0ea18ac4 QWidgetWindow: Ensure Qt::WA_Mapped is set on obscured parent widgets
Frameless obscured windows do not receive WM_PAINT/expose events on
Windows. Qt::WA_Mapped needs to be set on them to ensure updating works.

Task-number: QTBUG-39220
Task-number: QTBUG-52039
Task-number: QTBUG-58575
Task-number: QTBUG-63927
Change-Id: Ic6c11f2be96378b6a6b61296f1f3e13cd49b50a6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-21 13:18:07 +00:00
Christian Kandeler
5be5b798b2 androiddeployqt: Add auxiliary mode
In this mode, library and other dependencies are copied into the build
directory, and the XML templates in the build directory are updated
accordingly, but the project is not built or installed.
Needed by qbs.
No existing code has been touched.

Change-Id: Ib8015f7c2315b39dfb21750fecc8618bce03cb8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-21 08:24:53 +00:00
Friedemann Kleint
81d6cf71cc Windows QPA: Add option to detect AltGr key presses
According to MSDN, AltGr key presses are sent as a
sequence of SYS left Ctrl + right Alt.

Add an option to detect AltGr as modifier key.

Task-number: QTBUG-69317
Change-Id: I30ce169d2e6dbbae194ff714abfbc732b53652ce
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-21 06:30:53 +00:00
Oswald Buddenhagen
5a03b75c50 Merge dev into 5.12
Change-Id: I63f632b595f66d2fc93e9aa713500e3799e3df2a
2018-08-21 02:32:50 +02:00
Albert Astals Cid
0e7724079f Allow setting the QIcon fallback theme
This allows apps that know their icons are
in a given icon theme to set that theme as
fallback, so in case the user theme does
not include them, the icons can still be found.

This solves the problem of missing icons
that often happens when running KDE applications
on a GNOME desktop.

Change-Id: I4e5543d598012352a29ff79dab0357506d986b6d
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-20 21:42:58 +00:00
Friedemann Kleint
67cc8fea10 XCB: Do not create instance of QPlatformIntegration for invalid displays
Extract a static factory for QXcbConnection objects and pass
potential connection errors to qxcbmain.cpp, which will then return 0.

Task-number: QTBUG-68859
Change-Id: I9c0faf82462a78a576360c19bef251ad1d034d84
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-08-20 16:52:29 +00:00
Rolf Eike Beer
6553921dd5 QWindowsStyle: respect rectangle when drawing PE_IndicatorViewItemCheck
The hardcoded value is based on the values set in qcommonstyle.cpp, but
in case this is changed using a proxy style the actual values are not
respected. They would even be wrong if nothing is changed but
QStyleHelper::dpiScaled(13.) does not return 13.

Change-Id: Ib451d07800b3b4e8cafd1f4fef84cd9bf02f9bba
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-20 13:02:41 +00:00
Kai Koehne
2a9223830c Doc: Remove duplicate thread-safe documentation from logging macros
qdoc now handles \threadsafe also for macros, so we can remove the
explicit \note.

Change-Id: Iabeb7f69d237e7024a4f584adc516951b06d752b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-08-20 10:43:45 +00:00
Edward Welbourne
1acafb1207 Use std::partition_point for faster searches among transitions
QTzTimeZonePrivate's methods were iterating transitions from first to
last, or last to first, to find where .atMSecsSinceEpoch crossed some
threshold; but the transitions are sorted in order of increasing
.atMSecsSinceEpoch, so binary chop would be more efficient than such
linear searches.  So use std::partition_point() instead.

Change-Id: I65c43cb20fca6685a22ea52a4ca2f1089c128ebf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:27:27 +00:00
Edward Welbourne
98b030fc95 Scale a correction by a factor of a thousand that it was missing
The difference between two transitions' offsets is measured in
seconds, but we add it to a time in milliseconds; so it needs to be
scaled to fit.  Fortunately rarely enough applied that it hadn't
caused any reported problems.

Change-Id: I11f9f9e46d43d748220e072ad7504d4c8c5bf192
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:26:33 +00:00
Edward Welbourne
e4cee4bd57 Add some local const variables to save some repeated computation
QTimeZonePrivate::dataForLocalTime() makes repeated use of the times
sixteen hours before and after the target local time, so compute those
up front once instead of each time they're needed, giving them
expressive names and making code terser.

Change-Id: I4b682cc6de2adb98c3ee5489eec4b63ac1090961
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:26:10 +00:00
Edward Welbourne
4932cef5b8 Cast away -Wclass-memaccess warnings in QVarLengthArray methods
With g++ 8.2.0, I get warnings when a QVarLengthArray<QString> calls
remove() or prepend(), as some tests in tst_QVarLengthArray do, as
they call memmove() "writing to an object of type ‘class QString’ with
no trivial copy-assignment; use copy-assignment or copy-initialization
instead"; which may indeed be a good argument for not using
QVarLengthArray<QString>, but its own tests do.

Change-Id: I4f8a64948b32a54e67a285df4ec7788f60739ffb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:08:50 +00:00
Kai Koehne
54d062160d Document version of copied valgrind, kernel headers
Task-number: QTBUG-69276
Change-Id: If2d5d796fd9d414a41036187a178d88c2e93b5ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 07:50:04 +00:00
Eike Ziller
67984b265a QMimeDatabase: Fix MIME detection issues with magics in MIME hierarchies
Assume two MIME types A and B are registered, both with the same glob
pattern, A being parent of B, A with some magic rule, and B with another
magic rule. Given a file that matches the glob pattern and the magic rule
of A, the resulting MIME type depended on the order of registration of A
and B, because it would just check if some glob matching MIME type was
also a subclass of the magic matching MIME type.

The patch prefers the the MIME type that matches by magic if that
matches by glob pattern as well (i.e. A in our example).

The "recommended checking order" of the spec does handle that case.

Task-number: QTBUG-44846
Change-Id: I2af43f6199faf9a42cd9c35d3a045441afbd6217
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-20 07:32:58 +00:00
Edward Welbourne
fe9a37ac48 QTimeZonePrivate::dataForLocalTime(): cope with negative DST offsets
The tz database's latest update now records the cases where summer
time is deemed standard and winter-time is deemed DST.  (This doesn't
change what the offsets are, just how they're described.)  The
resulting negative DST offsets mess up the algorithm for converting
local time to UTC, causing tst_QTimeZone::transitionEachZone() to fail
for Europe/Dublin in the hour before its transition; so refine the
algorithm to cope with the new case.

Task-number: QTBUG-69980
Change-Id: I24003872fffb03b2903161859158d0ce998b3073
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 06:04:25 +00:00
Samuel Gaist
346c15102b Add support for QRegularExpression to QSortFilterProxyModel
This patch implements the support for QRegularExpression in
QSortFilterProxyModel.

[ChangeLog][QtCore][QSFPM] QSortFilterProxyModel now supports
QRegularExpression.

Task-number: QTBUG-46810
Change-Id: If932d55f98f9b8bcf3a72c03ffd51da52cb50ad1
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-19 11:38:42 +00:00
Samuel Gaist
bcd80eebf9 Implement exact match expression builder for QRegularExpression
QRegularExpression doesn't offer a direct equivalent of QRegExp's exact
match.

There are several places in the Qt sources that use this feature. This
patch implements a small helper function that builds the expression as
recommended in the documentation and updates the related code.

[ChangeLog][Core][Tools] QRegularExpression now provides
anchoredPattern() which is a helper function to build regular
expressions used for exact matching.

Change-Id: Idbbf142c4c5cb9b62abf8229f4ce85fd4409e5d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-19 11:38:26 +00:00
Thiago Macieira
6228c0528c QGraphicsAnchorLayout: move some private classes to a namespace with Q
Avoids polluting the global namespace

Change-Id: Ie01831ddac5446fdbdeefffd15468b5ca22d5e7b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-19 08:48:36 +00:00
Samuel Gaist
5dd9616f6d Replace QRegExp by QRegularExpression in QFileSystemModel
[ChangeLog][Widgets][Dialogs] QFileSystemModel now uses
QRegularExpression internally for wildcard matching. Note
that QRegularExpression might not give the exact same
result as QRegExp as its implementation follows strictly
the glob patterns definition for wildcard expressions.

Change-Id: I6ca893833ff7b5b7f678221bb9bc623fd17c1cfa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-19 04:03:49 +00:00
Samuel Gaist
a2c85bffbe Migrate QDir to use QRegularExpression
The match method still uses QRegExp. This patch updates the code to use
QRegularExpression and translates the wildcard patterns to a suitable
form for QRegularExpression.

[ChangeLog][Core][QDir] QDir now uses QRegularExpression internally for
wildcard matching. Note that QRegularExpression might not give the
exact same result as QRegExp as its implementation follows strictly the
glob patterns definition for wildcard expressions. Nevertheless, the
tests for QDir return the same results as before.

Change-Id: I095959443ac7362f7534e35454eff038061fca82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-08-19 04:03:29 +00:00
Samuel Gaist
3746eb8412 QRegularExpression: refactor wildcard translation
This patch refactors the wildcardToRegularExpression method to generate
a simpler regular expression. It also fixes some shortcomings of the
previous implementation.

Tests have been updated to ensure all cases are properly supported.

Change-Id: I454e3fe8fe0bb663b2f319d6fa2fa8aec626c50d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-18 21:59:38 +00:00
Jesus Fernandez
cfcfc96d8f Use nullptr instead of 0
Change-Id: I8d18dfbc3451fd8748127415fcb1da54b0870b9a
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-18 21:58:45 +00:00
Jesus Fernandez
6b65be5554 Improve Q_ASSERT readability
Change-Id: I231ecafe1eb48d74f787083e86a85536a90ed69b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-17 15:07:09 +00:00
Jesus Fernandez
7a649d2596 Fix -Winconsistent-missing-destructor-override
Change-Id: I7a33d6b0cf0bd775567235e0efc858796d8ad852
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 15:06:23 +00:00
Tor Arne Vestbø
e09f5b1786 macOS: Teach QWheelEvent to handle a new ScrollMomentum phase
We detect if there's an upcoming momentum phase using the same trick
used by e.g. Mozilla in their event handling: https://tinyurl.com/yd8lcs4l,
and as recommended by an Apple engineer: https://tinyurl.com/y8yytlgv

The event is not guaranteed to be in the queue, but in practice it seems
to be. If this assumption fails we can add a wait timeout to the event
search instead of using [NSDate distantPast] as a timeout (which only
looks at queued events).

When the momentum phase is detected, QWheelEvent::phase will have the
new ScrollMomentum value, and the phase transitions will be
ScrollBegin -> ScrollUpdate -> ScrollMomentum -> ScrollEnd.

We no longer send ScrollEnd to signify that the user's fingers have
been lifted off the trackpad; rather, the first event with ScrollMomentum
phase means that the fingers have been lifted and macOS is now sending
simulated-momentum events.

This means ScrollEnd is a reliable indicator that the entire scroll
gesture (both the user interaction and the momentum) has ended.

If the ScrollMomentum phase is skipped, it means the user's fingers
came to rest before being lifted, so there is no momentum. In that case
the transitions will be ScrollBegin -> ScrollUpdate -> ScrollEnd.

Task-number: QTBUG-63026
Task-number: QTBUG-65160
Change-Id: I80191a472f6fa892387004c199166a6350124274
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-17 15:01:38 +00:00
Ales Erjavec
a4a730f4cb QComboBox: Start blockMouseReleaseTimer after showPopup call
The layout/size hinting done in showPopup should not count towards the
mouse release blocking timeout as it might take more then the double click
interval itself, causing the popup to hide immediately on button release.

Task-number: QTBUG-67583
Change-Id: I37ac77ac331a4f865a9242581232b85606f883c5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-17 12:02:38 +00:00
Andre de la Rocha
df91fd1198 WinRT QPA: Fix mapping of static text accessibility role
QAccessible::StaticText should be mapped to AutomationControlType_Text
instead of AutomationControlType_Edit.

Change-Id: If8c840f0dea553c1a750225586778a7d24cf424a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-17 11:34:24 +00:00
Erik Verbruggen
d26289ffb4 Add ++/--/min/max to QSpecialInteger
Add both prefix and postfix versions of the increment/decrement
operators, and a static constexpr min/max which returns the
minimum/maximumm values that can be stored in the QSpecialInteger. These
latter functions are useful to define constants, e.g.:

    typedef quint8_be IPv4_TTL;
    static constexpr TTL_TO_DROP = IPv4_TTL::min();

Change-Id: I825a279feb68b93572765a9fdb5aa7b06d1be35b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-17 11:31:28 +00:00
Allan Sandfeld Jensen
d7fbc9ea88 Add displayName getters to QSslCertificate
Provides two convenient getter for a display name of the subject and
issuer. This simplifies cases where you just want a simple string
describing either of the two.

Change-Id: Ia5d0e058f14dae067b13ac7360e7fec4edd9ec53
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-08-17 11:03:52 +00:00
Edward Welbourne
23d73ae46d Eliminate QLocale's system_data in favor of globalLocaleData
This is simpler than initializing a pointer to its address and
accessing it via that pointer; it saves the initialization and a few
checks that it's happened.

Change-Id: I3d82ee1cb02981654ec769632d3a055e11737113
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-17 10:56:11 +00:00
Liang Qi
ae5476eadc Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-17 12:22:55 +00:00
Gatis Paeglis
52d4a2976f xcb: replace tiny helper function with an inline code
Having these 2 lines in a function does not add much value and
requires scrolling that could be avoided.

Change-Id: Ife814be6478521cd64b0048d1b6ee447afea55de
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-17 09:59:39 +00:00
Gatis Paeglis
0e63111416 xcb: avoid unnecessary InternAtom requests
QXcbConnection::internAtom() creates the atom if it does not exist. The
lifetime of an atom is not tied to the interning client. Atoms remain
defined until server reset (lost connection, restart).

So create the atom once via QXcbConnection::initializeAllAtoms(), and
later fetch the atom value from local array, instead of repeating
InternAtom requests.

Change-Id: I3cae21895febad6e5daf8c32e72612202baaad64
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-08-17 09:59:31 +00:00
Martin Smith
b9a0276a79 qdoc: Fix remaining qdoc warnings for QCborxxx classes
Several \fn commands are added for functions and operators that
were not documented. A few qdoc warnings remain in qcborstream.cpp,
but these are because an enum class was used, and qdoc doesn't yet
handle those correctly all the time.

Change-Id: I02a740c595e36c1b383af242c2a6419d1f37b135
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-17 09:54:59 +00:00
Andre de la Rocha
981b16d9ba Windows QPA: Fix mapping of static text accessibility role
QAccessible::StaticText should be mapped to UIA_TextControlTypeId instead
of UIA_EditControlTypeId.

Task-number: QTBUG-69894
Change-Id: If2f8f55d2be492c02a3af5b1813ca12cf774a33a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-17 08:53:20 +00:00
Lars Knoll
055ff7a8a4 Don't reset the bidi level on spaces
Fixes a regression introduced with the update to the bidi
algorithm.

Task-number: QTBUG-69633
Change-Id: I7eac45ed3ffb41f89ea3f793eedcfb6fcdace871
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:26 +00:00
Lars Knoll
1702ae24b3 Only show the bidi cursor mark if we actually have bidirectional text
Don't show the mark simply because we have unicode code points
larger than 0x590.

Task-number: QTBUG-69665
Change-Id: I9af97383f3bcd52277a5288e7ad06ec240c7e51c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:20 +00:00
Luca Beldi
70ba75519d QSortFilterProxyModel inserting at bottom of source model
Before this change, if you try to insert a row at the bottom of QSortFilterProxyModel
the row will be inserted in the source model at position proxy->rowCount rather
than at the bottom. This causes insert at apparently random positions in the source.

[ChangeLog][QtCore][QSortFilterProxyModel]
QSortFilterProxyModel::insertRows(row,count,parent) with
row == QSortFilterProxyModel::rowCount will insert at the bottom of the source model
rather than at the row QSortFilterProxyModel::rowCount of the source model

Task-number: QTBUG-58499
Task-number: QTBUG-69158
Change-Id: Ie78416c8fbc429303b8c9c98375630e3e4d85f6d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 08:10:11 +00:00
Luca Beldi
d0069ff8c9 Add a method to clear the data to QStandardItemModel
After the behavior of setItemData has been changed following QTBUG-45114,
QStandardItemModel was lacking an interface to clear all the data from a single index.

Task-number: QTBUG-69616
Change-Id: Ide0b5bb6358439fc42c474df8b044fbace6def8d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 07:17:12 +00:00
Qt Forward Merge Bot
8842d9d1e6 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
2018-08-17 09:08:06 +02:00
Morten Johan Sørvig
67352c9276 Merge QThread class definitions
We can reuse the main QThread definition for the no-thread
configuration and avoid having to keep them in sync.
Add stub definitions for member functions where needed.

Change-Id: I128db11684a6040d09c4a4ce114f1399cba523f8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2018-08-17 00:35:03 +00:00
Ulf Hermann
0a06e1baf9 Modernize the "thread" feature
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.

Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 00:34:36 +00:00
Morten Johan Sørvig
815153d4a4 Add QThreadStorage stub implementation
Add implementation for the no-thread configuration:
Assume access will only happen from one thread and
use a QScopedPointer to hold the data.

Unlike the real implementation this version will
delete the stored data on destruction, as opposed
to on QApplication destruction.

Change-Id: I9d8e89e7da18f967f463e2db7b50549c962acc84
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2018-08-17 00:34:33 +00:00
Morten Johan Sørvig
07f6eff58d Correctly initialize adopted threads in stub implementation
Set data->threadId, which makes the thread detection
used by Qt::AutoConnection work: it will now actually
select Qt::DirectConnection.

Change-Id: I9369e47eb7ed3ec88dba25f2d41e92139958bcd7
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2018-08-17 00:34:30 +00:00
David Edmundson
29778037f8 Don't block on lost context
When glGetError returns GL_CONTEXT_LOST, on XCB + Nvidia at least, the
error does not get cleared until the next successful
glGetGraphicsResetStatus.

We can't handle this properly until the start of the next frame where we
will hopefully have a valid context, but in the meantime we should avoid
locking up completely.

Change-Id: Id438d44d83b926e1f3e4281ca3704231bf1a23cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-08-16 22:04:10 +00:00
Thiago Macieira
b0479aab29 QUrl: Make sure we do reject URLs for which IDNA nameprep failed
qt_nameprep() already reset the string to its original length to
indicate failure, but we didn't handle that in qt_ACE_do(). So make it
have a return value whcih makes it easier to handle that case and do
handle it.

[ChangeLog][QtCore][QUrl] Fixed a bug that caused URLs whose hostnames
contained unassigned or prohibited Unicode codepoints to report
isValid() = true, despite clearing the hostname.

Change-Id: I41e7b3bced5944239f41fffd1545b7274c4b419d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-16 19:34:52 +00:00
Mikhail Svetkin
d9d35b9fb6 Optimize implementation of Indexes generator
... which is Qt's version of std::make_index_sequence / C++14.

The current Indexes generator is recursing O(N) times which is reaching
recursion limits level for long IndexesList.
This implementation has only O(log N) recursion.

Change-Id: I423ef05152d77b18f1f5a64c49b273f49aa958bb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-16 17:56:40 +00:00
Liang Qi
d98106d1d5 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-16 18:59:13 +00:00
Liang Qi
8559bf934d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/plugins/platforms/xcb/qxcbbackingstore.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I4af138ffb2f5306373244523768209e8873b2798
2018-08-16 18:48:59 +02:00