Commit Graph

26714 Commits

Author SHA1 Message Date
Christian Ehrlicher
bdc36cef67 QItemDelegate: fix text height calculation
QItemDelegate::textRectangle did not adjust the width when the item
had a decoration or a checkbox. This lead to a too big width used for
the layouting and therefore sometimes the calculated height was too
small.
This was already done for QCommonStylePrivate::viewItemSize which is
used by QStyledItemDelegate before.

[ChangeLog][QtWidgets][QItemDelegate] fix text height calculation
when the item has a decoration or checkbox

Task-number: QTBUG-16134
Change-Id: I14c47c3f2d8cc0a0b6ec2b2999e70fda213887ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-08 18:28:11 +00:00
Qt Forward Merge Bot
332ce6734d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
2018-03-08 09:27:38 +01:00
Mitch Curtis
e5a6e9bb80 Doc: improve QScopedPointer::reset() documentation
- Fix grammar
- Mention take()

Change-Id: I3bde229755549230ad3d0962da6eeb164a060fb1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-08 07:40:26 +00:00
Gabriel de Dietrich
e16c6dfb72 QCocoaMenuItem: Make QCocoaNSMenu the item target
Since we made the NSMenu delegate a singleton we could not rely
on it to have enough information to implement worksWhenModal.
At the same time as the delegate change, we derived NSMenu into
QCocoaNSMenu. This allows us to extend the menu functionality
and, in this case, serve as target for the Cocoa menu items.

We also refactor setting the item's target/action.

Manually tested against menurama and bigmenucreator tests, the
test-case for QTBUG-17291, and the richtext/textedit example.

Change-Id: I222241f71db82611711b23d4a8c6122a741370ae
Task-number: QTBUG-66676
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-07 19:14:07 +00:00
Tor Arne Vestbø
0348ee90a8 Make QDir::tempPath() canonical
To have a stable base for creating temporary files it's useful to have
the temporary path be not just cleaned, but also the canonical path, so
that any symlinks are resolved. This is e.g. the case on macOS, where
/tmp is symlinked to /private/tmp.

Fixes tests that compare paths, e.g:

FAIL!  : tst_QDir::current(startup) Compared values are not the same
   Actual   (newCurrent.absolutePath()): "/private/var/folders/51/hhvngbjd36vbn1ncklb73g2h0000gn/T/tst_qdir-FACBOE"
   Expected (currentDir)               : "/var/folders/51/hhvngbjd36vbn1ncklb73g2h0000gn/T/tst_qdir-FACBOE"

[ChangeLog][QtCore] QDir::tempPath() now reports the canonical path
of the temporary directory, with any symlinks removed.

Change-Id: I20df9076c9869227f32740b196fd7ffb8b1b9ced
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-07 19:13:14 +00:00
Christian Ehrlicher
4dee5446be Add missing rvalue overloads of operator+=() and operator<<()
They were forgotten when the overloads for append()/push_back() were
added in Qt 5.6

[ChangeLog][QtCore][QVarLengthArray] Added missing rvalue overload of
operator+=() and operator<<()

[ChangeLog][QtCore][QVector] Added missing rvalue overload of
operator+=() and operator<<()

Change-Id: I20fedfba2bf282773bd1f9cf2c8ec06f05896a7d
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-03-07 18:36:40 +00:00
Christian Ehrlicher
808adeb7bc QSqlField: rearrange QSqlFieldPrivate members
Rearrange QSqlFieldPrivate members to only need 64Byte instead 72 in
an 64bit environment.

Change-Id: I620c18aca06a11b7ab4bd8e99b377b9d823da7f4
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:36:33 +00:00
Christian Ehrlicher
80693f171c QStandardItem: add more sanity checks on insertRow(s)/Column(s)
When QStandardItem::insertRows/Columns is called with an empty list
or an insert count of 0, do not assert but return false.

Task-number: QTBUG-66491
Change-Id: I328598e08584fb9b0a35075458bfeb31c57ebfee
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:15 +00:00
Christian Ehrlicher
b64f3f6ca9 QTabWidget: Do not add tabbar size during sizeHint() when it is hidden
Since Qt 5.4 the QTabBar can be automatically hidden when it has less
then 2 tabs. Therefore the sizeHint should not consider the tabbars
size when the tabbar is hidden.

Task-number: QTBUG-64715
Change-Id: I2f248f88d9070de5354f7344c7628a78442ab499
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:06 +00:00
Christian Ehrlicher
3185b40d5d SQL/Postgres: Fix support for nan, inf and -inf
Postgresql needs a special value for nan and +/- inf. This was
considered during insert but not during select.
Also remove some pre-c++11 inf/nan - handling and replace it with
Qt equivalents.

Change-Id: I044ca58e9cf673f4b100b05a0d8e25c8a9c29ec5
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:35:57 +00:00
Tor Arne Vestbø
67d5f79fe6 logging: Clarify and document how we look for the presence of a console
The privately exported qt_logging_to_console() function has been renamed
to shouldLogToStderr, and exported in the QtPrivate namespace for QtTestLib.

[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] The QT_LOGGING_TO_CONSOLE environment variable has been
deprecated. Use the more specific QT_ASSUME_STDERR_HAS_CONSOLE or
QT_FORCE_STDERR_LOGGING, depending on your usecase.

Change-Id: Ie29228eeac3b700c3de94fee022d5d66d9b5c210
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-07 18:12:09 +00:00
Allan Sandfeld Jensen
9fb73a01dd Use simple scaling for downscaling less than 2x
The simple scaling that only samples every input pixel once, can be
used with downscaling < 2x as well if we just handle the case where the
input can't be in the intermediate buffer.

At the same time the handling of the intermediate buffer has been moved
out of simple scale helper functions so the code can be shared and the
AVX2 optimizations also used for non-argb32pm formats.

Change-Id: I98d225ef8d4f2978480d09110c959b556c563b57
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-07 14:30:01 +00:00
Oliver Wolff
50a095bede qtmain_winrt: Remove unused leftovers from Windows (Phone) 8.1 times
On Windows (Phone) 8.1 __getmainargs was still supported and used
to do the initialization of the application's parameters and
environment. When that functionality was removed together with the
now unsupported OSs,the initial filling of argc, argv, and env part
was forgotten.

Change-Id: I3b788de317b22b4525427faefc3fe974dac5d9ac
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-03-07 13:38:48 +00:00
David Schulz
b33a8cb13d winrt: Add null pointer to the end of the arguments array
Although WinRT doesn't officially support argc/argv, respect C++03
§3.6.1/2 (The value of argv[argc] shall be 0).

Task-number: QTCREATORBUG-19705
Change-Id: I190e2923b8a0665cc8975a800619fd916a4dd244
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-03-07 13:38:44 +00:00
Mitch Curtis
59e9c4956c QUndoStack: add more Q_PROPERTYs
This is the first step in being able to use the undo framework in QML.
The next step would be to separate it out of Qt Widgets so that a pure
Qt Quick application doesn't need to rely on it.

Note that QUndoCommand is not a QObject, so we cannot expose its text
member as a property until Qt 6.

[ChangeLog][QUndoStack] Exposed canUndo, canRedo, undoText, redoText
and clean as Q_PROPERTYs.

Task-number: QTBUG-40040
Change-Id: Ida7ec03f871f0db7fdcc5b90ed200024c5cb348e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-07 12:49:21 +00:00
Ville Voutilainen
f49c55a505 Revert "Make qWaitForWindowActive more robust"
This reverts commit 2eec3272c7.
The change to qWaitForWindowActive causes regressions
in qtdeclarative, so we need a better fix for the problems
we have with window waiting.

Task-number: QTBUG-66866
Change-Id: I8300dabc870d6aeaa9ba6bfcf3d64146b13c1955
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-03-07 07:13:19 +00:00
Friedemann Kleint
8abbb6ec72 Windows QPA: Fix scaling of tablet coordinates for High DPI scaling
Determine the virtual desktop geometry in native pixels from
the QPlatformScreen siblings. Use the platform window to determine
the local position.

Task-number: QTBUG-36937
Change-Id: Ic250f1b41d8e74099558796112dbd70a7e1f6956
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-07 06:04:01 +00:00
Friedemann Kleint
f7b8f2e8b5 Windows QPA: Fix sending of the mouse release in case of a Drop
Use the new API of QWindowSystemInterface to send the release
event which does not depend on the state of
QGuiApplicationPrivate::mouse_buttons.

Amends 1f6bd8bfb2.

Task-number: QTBUG-66447
Change-Id: Iae889ea416b633c9307da9535dfb51ad1dbf288e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-07 06:03:35 +00:00
Lionel CHAZALLON
e97311ad75 eglfs/kms: Share atomic request with nativeRes.ForIntegration
This allows to share the atomic request so that applications can blend content
into overlays within the same renderloop.

atomic request will allow several planes update in the same commit.

Change-Id: I762ea96499765ced573e287dbd52d53c64ec7c74
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-07 05:35:21 +00:00
David Faure
4a04eea4f4 QHeaderView: fix inconsistent saved state, ignored during restore
The code that updates a section size must also update length,
otherwise saveState can end up saving inconsistent state, and
restoreState() goes to an early-return, not doing anything.

The actual bug was fixed meanwhile because _q_sectionsChanged is called
again, which recalculates length. I still see this only as a safety
measure, every other code path that changes section sizes updates length
right away.

Change-Id: I6cc16261692d93b3640afafef600a5bdff8dca0c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-03-07 05:29:16 +00:00
Qt Forward Merge Bot
d7c1c9dd92 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-03-07 00:14:51 +00:00
Qt Forward Merge Bot
cf00c01f68 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I110feec4750bd304975bab4f3f33d3a61a4e08bd
2018-03-07 01:00:10 +01:00
Eric Lemanissier
2869bf9f1e implement non-member operator+ for iterators
all of these iterator classes already have a member operator+, which allows iter+int.
This commits addes non-member operator+, which allows int+iter, and forwards to the member
QList and QArrayData iterators now satisfy RandomAccessIterator concept

Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-06 22:04:37 +00:00
Johan Klokkhammer Helsing
3eb42abab6 Check for WindowActivation capability instead of platform
Before running tests that depend on QWindow::requestActivate

Gets rid of several Wayland platform checks in tst_QWindow.

Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-03-06 20:02:22 +00:00
Kai Uwe Broulik
ada1b61991 qlineedit: Use QIcon::Active for pressed action button
Qt should be using its own API in the way it's meant to be.
If there's an issue with Qt's built-in styles it has to be fixed there.
Otherwise this causes problems with styles, such as KDE's Breeze,
which make use of both Selected and Active states for icons.

However, Qt's built-in styles do not have hover effects for tool bar
buttons and menu items, so there's somewhat of a conflict here which
was probably the reason for the workaround used.

Change-Id: Ieaed580f548caf181b1005b4e82e3f2adc1f9ce5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-06 16:49:12 +00:00
Shawn Rutledge
9e9dc58847 cocoa: add qCDebug in QNSview::scrollWheel
If you enable both qt.qpa.input.touch and qt.qpa.cocoa.mouse you can
see the order and interleaving of the touch and scroll events.

Task-number: QBUG-66329
Change-Id: I8e1a63e2958b85f7964bb597e49cf8529cb3f32e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-06 12:24:34 +00:00
Kari Oikarinen
fe7b63546d testlib: Remove Q_CC_BOR uses
Borland's compiler is no longer supported.

Change-Id: I61e3fa2cfbb244b9ca4d1db734992abb96f64709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-06 10:56:54 +00:00
Jarek Kobus
4b24a61ecc uic: Add the include for QIcon conditionally
Task-number: QTBUG-66753
Change-Id: I31bd821396b59c8e83e19e02634cf1440a271215
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-06 06:49:00 +00:00
Allan Sandfeld Jensen
73be2aab75 Add support for advanced blend equations to our OpenGL QPainter
Mesa and NVidia have been supporting these extensions several years now.
It also means we can get rid of the dead unused code we had for advanced
compositions.

Change-Id: I6a2fcda13490abd977eb4cc3d8b34f186d05ca25
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-05 23:51:16 +00:00
Sven Pauli
5ddaadaa7e QAbstractSpinBox: respond to QEvent::LocaleChange
Add a branch for QEvent::LocaleChange to the QAbstractSpinBox::event()
handler to call updateEdit(). This will update the edit in case the
locale's number features changed (decimal separator etc.).

Task-number: QTBUG-65315
Change-Id: I9015b3a5bbe8e7b80f7bafa13f0f431507bc4cf7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-05 20:22:09 +00:00
Tor Arne Vestbø
8912c2bd9d macOS: Base window collection behavior on the correct window flags
When QCocoaWindow::setWindowFlags is called, the window()'s flags have
not been updated, so re-computing the collection behavior based on those
would not be correct.

Change-Id: I5512da75104483eac7100880c164a9d08fd82984
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-05 19:31:19 +00:00
Tor Arne Vestbø
d2ee858194 macOS: Don't keep window flags around, we can get them from the QWindow
Change-Id: I629a58e699ad39ec429e1e275152434db4abc572
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-05 19:31:14 +00:00
Lionel CHAZALLON
56149c0fbb eglfs/kms: Add DRM/KMS atomic support
This commit adds support for DRM atomic to qtbase eglfs/KMS QPA when
libdrm and device supports it.

Compared To legacy DRM API, atomic API allows to update multiple planes
in one vsync. This is the first part of some work that should follow
and allow:
- DRM framebuffer upscaling for embedded devices that have weaker GPUs
- Sharing the drm atomic request if the KMSDevice so that applications
  in userland can blend content on overlay in the same vsync loop.

One of the application for DRM atomic and Qt is typically videoplayer
integration at high resolutions (UHD) on embedded devices which cannot
use their GPU to render such videos, but are able to render it to a drm
overlay.

Change-Id: I047adf3e3d07a53440d52c2a7073c9ed054adf34
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-05 16:14:36 +00:00
Qt Forward Merge Bot
954fe2c35d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ifce6ddeb4dab8c672732ec6aa6c19a6c4bce447e
2018-03-05 13:15:31 +01:00
Kimmo Ollila
0e85b554ad Add WFD_DEVICE_CLIENT_TYPE attribute for INTEGRITY S820Am ADP
This is needed to be compatible with latest Qualcomm BSP releases.
This patch also makes it possible to select HW layer via
QT_OPENWFD_CLIENT_ID and QT_OPENWFD_PIPELINE_ID environment variables.

Change-Id: Ie795b21afc61a1de7c1d0b52cdb30a754e3f8266
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 00f693d3e5046999270c92731e34a3e7fcd01c6b)
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-05 11:37:38 +00:00
Sergio Martins
6d45c28ed4 Document QFont::PreferNoShaping as being since 5.10
"since format" copied from QEvent's documentation.

Change-Id: Ib11609cd11f9cb9906d947f46c2cd61c7abd853a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-05 10:11:51 +00:00
Simon Hausmann
57b1be158e Fix docs of QTextDocument::find with regards to default case sensitivity
The default value for a default constructed FindFlags QFlag is zero and
FindCaseSensitively is 0x2. Therefore the default behavior for find() is
case insensitive.

Change-Id: Id3419c3562fc6170fdb281098a22dd8205603847
Task-number: QTBUG-62660
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-05 08:57:03 +00:00
André Klitzing
2203bb580d Remove unused variable
Found by spotbugs.

Change-Id: I0aa81e45ced0a995adb5e4a45be925e5ef219a77
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-05 08:49:36 +00:00
Eskil Abrahamsen Blomfeldt
70057dfc0e Android: Don't kill app when SIM card or density changes
This adds subscription to additional config changes on Android to
avoid the application automatically restarting when the SIM card is
replaced or the logical density of the screen is changed (as a result
of the user changing it in settings).

These restarts are especially problematic when using Qt in a
home screen application due to the way they are launched.

[ChangeLog][Android] Avoid the system restarting application when
user replaces SIM card or changes the logical density of the screen.

Task-number: QTBUG-63735
Change-Id: Iba85fe6239b2d29b543b3c4e2f953efb9b54f713
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-03-05 07:55:15 +00:00
Anton Kudryavtsev
d8b15f9f1e QTextEngine: use const (and const APIs) more
To avoid needless detach()ing:
- don't make copy of tabArray unconditionally.
- use qAsConst to avoid detatch in for loop.
- For CoW types, prefer const methods.

Change-Id: I3273316bdd862fee4c66bad8291898a9ed913c60
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-05 07:55:00 +00:00
Andy Shaw
0da3ebd994 moc: Don't error our when parsing "using namespace __identifier(...)"
This follows on from a232251992 which
covered a similar instance of this. As with that change, we should not
abort the compilation, just ignore it.

Task-number: QTBUG-63772
Change-Id: Ide958080a90f43ed19edd8a320e7d45de1c96821
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-05 06:54:06 +00:00
Christian Ehrlicher
8f2bacea41 QTableView: Fix drawing grid for spanned cells
QTableView draws its gridlines at width/height of the cells. This
means that there is no gridline at x=0 and/or y=0. This is fine when
there is a header. But when the header is invisible, an additional
line at 0 must be drawn to have a boundary to the neighbor widget.
When a span is drawn, the clip rect has to be adjusted in this case
because x/y=0 belongs to the cell (and therefore would be clipped
out).
Also fix the drawing of the grid lines in RTL mode and with
ScrollPerPixel.

Task-number: QTBUG-22972
Change-Id: I1829770e3d5bf65421b590f7bb7354cbf222e3fb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-04 10:51:54 +00:00
Christian Ehrlicher
174a1e9635 QHeaderView: make use of LayoutChangeHint in _q_sectionsChanged()
When _q_sectionsChanged() is called from e.g. QSortFilterProxyModel
the LayoutChangeHint is set which can be used to avoid useless work
in this function.

Change-Id: I034db3fcc7a5f9ea7ebc0fa3ffd7429edb154eb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-04 10:51:51 +00:00
Thiago Macieira
fd207c06b8 Port QWaitCondition to QDeadlineTimer
Since pthread_cond_timedwait takes absolute time instead of relative
time like most POSIX API, there's a small gain in performance here: we
avoid an extra system call to get the current time.

Task-number: QTBUG-64266
Change-Id: I25d85d86649448d5b2b3fffd1451138568091f50
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-03 20:53:26 +00:00
Christian Ehrlicher
1f920b779e QHeaderView: fix indentation in setModel() and clear()
The indentation of large code blocks in setModel() and clear() are not
correct. Needed for another change to avoid whitespace changeds in there.

Change-Id: I620c8c5e83e98747f5c17469738722cf976fb467
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-03-03 19:02:26 +00:00
André Klitzing
7fda40effa Avoid infinite recursive loop
Looks like this should be "super." instead of "super_"
Found by spotbugs.

Change-Id: I83d096eee332361d62e783581bfa15017536081d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-03-03 08:53:41 +00:00
Qt Forward Merge Bot
8c04a5e964 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I967eca8f34584fca3a1e5696978e70f620582a2a
2018-03-02 14:40:07 +01:00
Albert Astals Cid
78e92997ed QLocale: Update the system private on QLocale default constructor if needed
When first starting an Android app we have invocation order issue, to
load the platform plugin we create the default QLocale (needed by the
resource locator code to see if :/qt/etc/qt.conf exists) so when the
android platform plugin loads and creates its own QSystemLocale, the
QLocale defaultLocalePrivate is already created and pointing to
globalLocaleData which means that systemData won't be called and thus
the code that triggers the call to QLocalePrivate::updateSystemPrivate
won't be called when calling QLocale().

I thought of two ways of fixing this, one was calling
QLocalePrivate::updateSystemPrivatea() from the QAndroidSystemLocale
constructor, but giving the responsibility to not break things to the
plugin seems a little fragile, so making the check on QLocale()
seems better.

Without this patch an Android app doing
  QApplication app(argc, argv);
  qDebug() << QLocale().name();
  qDebug() << QLocale().name();
  qDebug() << QLocale::system().name();
  qDebug() << QLocale().name();
would print
  ""
  ""
  "ca_ES"
  "ca_ES"
now it correctly prints "ca_ES" the four times.

Task-number: QTBUG-41385
Change-Id: I2cf419f59aa008fa3aca11295fe7d42c40bcc32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-02 09:52:14 +00:00
Andy Shaw
ccdcf8c4f2 Android: Close the DataOutputStream when we are finished with it
Task-number: QTBUG-66769
Change-Id: I93c49baa0ccab4f853402d9be675af1c50b2e0c1
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-03-02 08:12:37 +00:00
Shawn Rutledge
310daae539 preserve HTML heading level in QTextBlockFormat; demonstrate in example
When reading an HTML file with <H1> for example, we still set the font
size as before (that's how it always was done),
but now it remembers that it came from an H1 tag, so it writes
<h1 ...><span font-size:xx-large ...> ...  rather than
<p ...><span ...> ...  This will help with the upcoming Markdown
format, where heading level is saved but the font is not.

Now the style combobox in examples/widgets/richtext/textedit can set
list item type, heading type or "standard" formatting, and also shows the
current formatting of the line that has the cursor.  It was always a
shortcoming in this example that it only allowed setting the current line's
block format but had no feedback to show the current format.

Change-Id: I0a7849b74f23fea84d3375c487c3a6b9f43240c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-02 08:05:00 +00:00
Thiago Macieira
4e02c8d5b8 JSON: remove braces from UUID text representations
[ChangeLog][QtCore][QJsonValue] fromVariant() conversion now converts
from QUrl and QUuid using special encoding forms to ensure best JSON
compatibility.

Change-Id: I56b444f9d6274221a3b7fffd150cdc5ca1f87ff1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-02 04:06:33 +00:00
Thiago Macieira
a2ffb35ac2 QJsonValue: use the fully-encoded form of a URL in fromVariant()
For compatibility with other parsers that may expect it to be so.

Change-Id: I56b444f9d6274221a3b7fffd150cd66390f98fd5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-02 04:06:24 +00:00
Qt Forward Merge Bot
afe2a79689 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-03-02 00:00:35 +00:00
Qt Forward Merge Bot
6cf3428a43 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I42ec9e6aafc203465cbeb88af70c7af26b7df8ed
2018-03-02 01:00:10 +01:00
Steve Mokris
aa1bc47942 Show the checkmark when rendering a QAction in a QMenu using QSS
Task-number: QTBUG-66380
Change-Id: If7376430cfa021cb6eca1cbbcea6b6d0e01802bf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-01 23:58:05 +00:00
Herman van Hazendonk
1c2499cbf1 Add needsWorkaround for additional Adreno targets
Seems this issue is still there with Adreno 5xx and 6xx is suspected to
have it as well (no device to test though), so added both 5xx and 6xx
to cover these. Updated 30x to 3xx in order to cover Adreno 320 and 330
as per https://en.wikipedia.org/wiki/Adreno.

Amends 9ae028f507

Task-number: QTBUG-66702
Change-Id: I6ce3f6499d3ff9da884be45039e5f5e0990f7e1f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-01 21:39:43 +00:00
Steve Mokris
529cb7217c When cloning QWheelEvent, also propagate the event's timestamp
Task-number: QTBUG-63681
Change-Id: I686ea831287ac9023a3364768b6345c1e8806439
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-01 20:51:13 +00:00
Gatis Paeglis
b3e91b66b9 qtestlib: fix support for pressing multiple mouse buttons
After a37785ec76 went in, it become
apparent that multi mouse button state handling in qtestlib is
non-existent, for details see QTBUG-64030 and QTBUG-63786. What
happened behind the scenes often was not what one would expect based
on the provided QTest::mouse* input sequence - events went missing,
incorrect events were generated, each subsequent test function
started with a state set from the function that run earlier. It is
easy to see how a minor change in one test could easily affect outcome
of other tests.

With a37785ec76, Qt platform plugins
are now responsible for sending explicit mouse button type and state
information; qtestlib should take full responsibility now as well.
But using the new API from a37785ec7 alone in qtestlib is not sufficient.
We need to reset mouse state between each new test function run (we do
this at function scope as that fits with the current qtestlib API user
expectations). This patch implements the necessary reseting logic.

Updated tst_qwindow.cpp::generatedMouseMove() to use QTest::mouse* APIs.
That test requires pressing multiple buttons, it was not possible with
QTest::mouse* APIs before this patch.

Added an auto test for multiple mouse button pressing/release in
tests/auto/testlib/selftests/mouse/. And few other tests which are
currently QSKIP-ed, but should be considered when re-designing qtestlib
APIs.

Task-number: QTBUG-64030
Change-Id: I39fdcbc73a467a7463ce2aed622bf22484095635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-01 19:41:10 +00:00
Allan Sandfeld Jensen
635b5115c4 Fix QXcbScreen::format() when rgb-swap is needed
QXcbScreen::format() was producing console warning and returning invalid
format if rgb-swap was necessary. Let it match possibly reversed formats
since the backing-store will swizzle it anyway.

Change-Id: I6a53cb8ceda029e9d708d25ad635832f1163ffe7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-01 10:15:05 +00:00
Friedemann Kleint
daa39f8499 ToolTip/Windows: Fix wrong size when font is modified by widget stylesheet
Factor out a function to calculate the size and update the size when a
style sheet parent is set.

Task-number: QTBUG-64550
Change-Id: I3afe997085eae3cd48b7fe0a4c98582a8f572260
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-03-01 09:56:14 +00:00
Friedemann Kleint
9f77854d28 Windows QPA: Fix setting the separator property on native menus
Apply the setting in QWindowsMenuItem::setIsSeparator().

Task-number: QTBUG-66642
Change-Id: I023fe88bd85ad82cfb4a80418a892dcf21853ba5
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-03-01 09:55:58 +00:00
R.J.V. Bertin
cb2a6f6a9f Find PCRE2 via pkgconfig
This avoids issues when using dependencies installed in a custom or
dedicated $prefix, when PCRE2 is configured to install its headers
in their own directory under instead of directly in $prefix/include.

Task-number: QTBUG-66355
Change-Id: Ia99464820600282d61237e5bcff38101d2c9684b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-01 09:08:48 +00:00
Thorbjørn Lund Martsum
e8425f9e52 QHeaderView: Fix crash in layout about to change
Before there was a risk looking up e.g index -1 if there
were no visible sections in layoutAboutToChange.

Change-Id: Ic911e4292e8e8c4892fef1c0f34cf7dccaad2bac
Task-number: QTBUG-65478
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-01 05:26:12 +00:00
Martin Storsjö
db6d14318d windowsuiautomation: Lowercase windows header includes
This fixes cross compilation with mingw from a case
sensitive filesystem.

Change-Id: I0f5ba708b7138cae325ff564559d3e40eba4e714
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-01 01:51:29 +00:00
David Faure
8a678c3464 QHeaderView: skip dividing by 1, rather pointless
Change-Id: I9a63810475d1f17d65e91c1f4d805a7e564ba686
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-28 22:20:51 +00:00
David Faure
f2eb7b0204 QMimeDatabase: fix regression in alias resolving
The refactoring to support multiple providers broke alias resolving
(e.g. "text/directory" would be an invalid mimetype, instead of being
resolved to "text/vcard"). The unittest didn't catch it because most of
it was running with a single mime directory (and therefore a single provider,
in the new model). Fixed by re-running a number of test methods once we
have a second mime directory.

Change-Id: Ib5da89ba79c11ed41813b2aff4bc71c30afcde7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-28 22:17:58 +00:00
Sergio Martins
2b540ac741 stylesheets cleanup to prepare for a bigger patch
No behavior was changed, just cleanup so the upcoming feature
can land safely, with an elegant diff.

- Removed all naked qobject_casts<QStyleSheetStyle*>(), replaced
them with qt_styleSheet() (which does the same, for now).

- Removed a bunch of #ifdefed'out "metal hack" code. The code is disabled
and enough time has passed without nobody needing it.

- Removed a few "extra ? extra->style" by assigning it to a variable first.

- Misc

Change-Id: Ia45c38b06e2b5d2426635f730b4cb42c7ac1251d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-28 19:42:22 +00:00
Qt Forward Merge Bot
699a263b29 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ib21e6b9030b4d5363f440d082ce3df28098d1b95
2018-02-28 20:38:47 +01:00
Lars Knoll
7f504283ef Update the Unicode BiDi algorithm to be compliant with Unicode 10
The UBA in Qt was out of date, implementing the spec from pre
Unicode 6.3 days. It missed handling of directional isolates and
paired brackets.

This adds a completely new implementation of the UBA, that is
compliant with Unicode 10.

Added the test data from Unicode 10 to the qcomplextext auto
test and ensure that we pass the test suite.

Task-number: QTBUG-57743
Change-Id: Ie2d957bc9775d82f0a51d1c78dc6bd154f22847c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-28 17:11:43 +00:00
Lars Knoll
4804d42ab8 Fix ligature handling in QTextLine::cursorToX()
If the script item is rtl, we need to subtract the offset inside the
ligature again, as the full width of the ligature would have already
been added in the loop before.

Change-Id: I544ac6fa19484b35335767e1ba1befc3dfa07693
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-28 17:11:37 +00:00
Tor Arne Vestbø
5d365b96b9 macOS: Warn the user when KVO-observing QCocoaNSWindow
We recreate the window of our QNSView in various situation such as changing
the styleMask, which results in either a new QNSwindow or QNSpanel being
set as the window of the view. KVO-observing the window property of the
view will fail we then have a new window instance, and will crash when
trying to remove the observer from the new window.

Unfortunately catching the NSRangeException that happens when removing
an observer from a 'switched' window is not possible, so the user is
left with:

  Terminating app due to uncaught exception 'NSRangeException', reason:
    Cannot remove an observer <Foo 0xabc> for the key path "bar"
    from <QNSPanel 0xdef> because it is not registered as an observer.

Change-Id: Ib2adbb99f19303a054fb1eb65e959aecd32b1162
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-28 17:06:41 +00:00
Nico Vertriest
df3da2c1d1 Doc: Add doc for QSKIP
Change-Id: Ib8cd1b4926652984b41b5a05bf4dbf3214f2856f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-28 12:51:37 +00:00
Qt Forward Merge Bot
96ffe48add Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I1ce43c8a214a869c5c4ac4245bb92c88c6bc6999
2018-02-28 10:32:56 +01:00
Ville Voutilainen
71cdc95006 Silence a GCC 8 warning in qpainter
qtbase/src/gui/painting/qpainter.cpp:5625:68: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QFixed’; use assignment or value-initialization instead [-Werror=class-memaccess]
         memset(advances.data(), 0, advances.size() * sizeof(QFixed));

Change-Id: I563b1b0c5dfaf381a9521bc9a4dc3197f0f38d11
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-28 07:18:35 +00:00
Ville Voutilainen
ea1137ff5e Silence a GCC 8 warning in qoutlinemapper
qtbase/src/gui/painting/qoutlinemapper.cpp: In member function ‘QT_FT_Outline* QOutlineMapper::convertPath(const QVectorPath&)’:
qtbase/src/gui/painting/qoutlinemapper.cpp:182:76: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QPointF’ from an array of ‘const qreal’ {aka ‘const double’} [-Werror=class-memaccess]
             memcpy(m_elements.data(), path.points(), count* sizeof(QPointF));

Change-Id: Ieca99f0262c57e58adbcf48ac923ae11bd428b00
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-28 07:18:24 +00:00
Ville Voutilainen
d62d51c7e6 Silence a GCC 8 warning in qringbuffer
qtbase/src/corelib/tools/qvector.h:782:16: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class QRingChunk’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
         memmove(b + 1, b, (d->size - offset) * sizeof(T));
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../include/QtCore/5.11.0/QtCore/private/qringbuffer_p.h:1,

Change-Id: I6583241223fe3fc76c0b792779993a34aa9485fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-28 07:18:14 +00:00
Friedemann Kleint
a8aa3dc5c7 QDate/Time,QTimeZone: Fix empty documentation section titles
Change-Id: I674c4bb1805a7f7bc95512b07b0278446ebe7772
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-02-27 15:18:17 +00:00
Ville Voutilainen
1b72d3e645 Silence a GCC 8 warning in qxcbnativeinterface
qtbase/src/plugins/platforms/xcb/qxcbnativeinterface.cpp:309:65: error: cast between incompatible function types from ‘void (*)(const char*)’ to ‘QPlatformNativeInterface::NativeResourceForIntegrationFunction’ {aka ‘void* (*)()’} [-Werror=cast-function-type]
         return NativeResourceForIntegrationFunction(setStartupId);

Change-Id: I83409b3a6cc67ccb4c9e91e592e6a01bb6ce45ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-27 14:57:14 +00:00
Ville Voutilainen
7eac2e7350 Silence a GCC 8 warning in evdevtablet
qtbase/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp:85:36: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QEvdevTabletData::<unnamed>’; use assignment or value-initialization instead [-Werror=class-memaccess]
     memset(&state, 0, sizeof(state));

Change-Id: I3b18ffa7fdf9c7aa1bd4977f12858fd1f176c020
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-27 14:57:04 +00:00
Alexander Volkov
37217c57fa Introduce QImage{Reader,Writer}::imageFormatsForMimeType()
It can be used if, for example, you get an image MIME type
from the user, and you want to find the appropriate format
for loading or saving this image.

Task-number: QTBUG-49714
Change-Id: Iae5a7e9d658d6c3d1cd750a8bbc279f1812f99df
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-02-27 12:49:40 +00:00
Ville Voutilainen
2eec3272c7 Make qWaitForWindowActive more robust
Based on the information we got from Unity developers, we need
to check for window's frame geometry to be set, not just window's
position to be set. On various window managers, a window is
'ready' once the frame geometry is set. This fixes autotest
flakiness of tests that use qWaitForWindowActive.

Task-number: QTBUG-66216
Change-Id: Icb664e7b802b474919f3b058c00681574522ccbe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-27 08:53:09 +00:00
Friedemann Kleint
1f6bd8bfb2 Windows QPA: Ensure a mouse release event is sent after DnD
Windows does not send a mouse release by itself, which can
leave Quick controls believing the mouse is still pressed.
Synthesize an event.

Task-number: QTBUG-66447
Change-Id: Ia865edddc0c77a1b42b9ad2c38323379e74b6704
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-02-26 20:35:02 +00:00
Qt Forward Merge Bot
32da9ae389 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I5a919ac999c4c5a3ca2024b63a78c094a44a1191
2018-02-26 20:55:01 +01:00
BogDan Vatra
b2d2b655e5 Fix compile with sanitize address & undefined
On Debian 9, the sanitize library exports only dlopen symbol, but
it doesn't export the other ones.
We need to check all dl symbols that we use, otherwise "-ldl" will
not be added to the libs list.

Task-number: QTBUG-64864
Change-Id: I3e62b82985348c40b8b61302ba589d5564598e18
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-26 08:58:34 +00:00
Morten Johan Sørvig
8bb33c2509 Cocoa: Fix incorrect QSystemTrayIcon::geometry()
The coordinate conversion was wrong. Use
QCocoaScreen::mapFromNative() instead.

Task-number: QTBUG-53184
Change-Id: I50f18d68ba5d7e1cb5046523a608bfa2e076d7ea
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-26 07:00:29 +00:00
Gatis Paeglis
669070c404 xcb: simplify handling of keymap updates
The old code was somewhat too scattered.

Change-Id: Ib0445c66653f757ccac28778f34f4bcb5df49a70
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-25 13:18:41 +00:00
Gatis Paeglis
1a341d8333 xcb: cleanup TODOs for KeyboardLayoutChange
Change-Id: I5d2207fdb21cbabb04460faf73c35275bc76b7b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-25 13:18:34 +00:00
Gatis Paeglis
50865aeeef xcb: minor refactoring in QXcbKeyboard::checkForLatinLayout()
We don't need xkb state APIs to check for keys on first level.

Change-Id: I728e6bfe09bce127ad8eae78ecee7cefd620f52e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-25 13:18:27 +00:00
Gatis Paeglis
6c88dc0c16 xcb: remove X11 deps from QXcbKeyboard::checkForLatinLayout/lookupLatinKeysym()
This will allow us to reuse these functions on systems that
do not rely on X11, but use libxkbcommon for handling keyboard
input.

Task-number: QTBUG-65503
Change-Id: I78034238771be96fbb38e8187801fefbee1a5fed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-25 09:50:07 +00:00
Gatis Paeglis
7c01c759ae xcb: have a proper detection of key events originating from SendEvent
This is a more correct fix for QTBUG-48795. The original fix
was unnecessarily using non-XKB code path for updating state
for all incoming key events. This would result in losing some
valuable bits from xkb state.

Task-number: QTBUG-48795
Change-Id: Ic4fb28b2d834272f1db2cbf5888cafb209707847
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-25 09:49:58 +00:00
Gatis Paeglis
1219fc26a0 xcb: use keysym defs from xkbcommon, instead of X11 headers
xkbcommon-keysyms.h is generated from X11 header files, so it
contains all the same values.

Removed all of #ifndef XK_* as those keysyms are present in
xkbcommon-keysyms.h (checked the header from 0.4.1, the minimal
required version). The same for XF86XK_* defines.

This will allow to reuse some of this code on platforms that
don't depend on X11, for details see QTBUG-65503.

Task-number: QTBUG-65503
Change-Id: I68083e11cea1f29d775a6ed46503a06b04b9a05c
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-25 09:49:49 +00:00
Qt Forward Merge Bot
8a9f77ead1 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icddf8720dae2cf594e16bcddab4d1cafc9d094c0
2018-02-24 21:29:47 +01:00
Gatis Paeglis
9df6f3367e xcb: minor cleanup in QXcbKeyboard::handleKeyEvent()
- Use smart pointer for handling xkb state.

- Make it more clear (in the code and the comment) when a latin
  keysym is used.

Change-Id: Iee8106c72177c22b1a8fe875027b1dda82196b36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-24 18:52:47 +00:00
Gatis Paeglis
7878bb685f xcb: refactor QXcbKeyboard::keysymToQtKey() and fix bug
Now also digits from other alphabets e.g ۲ (arabic two) are mapped
to Qt::Key_* digit keys.

Re-factored logic:

- All known dead keys have direct mappings since
1d86e5f84a. Don't special treat them
in "unicode mapping" code path.

- Removed the ISO8859-1 legacy logic, which is leftover from Qt4
where keysym to Qt decoding was done from raw data. In Qt5 we always
get a utf8 string from xkb_state_key_get_utf8(). Furthermore,
ISO8859-1 and utf8 encode ASCII exactly the same way.

- Set Qt::KeypadModifier from key input handler methods. This logic
does not belong in keysymToQtKey().

Note:

KeyTbl[] and keysymToQtKey() have been duplicated in several places
in Qt. That stuff will be cleaned up as part of QTBUG-65503. This
change will make those cleanups easier.

Task-number: QTBUG-58865
Task-number: QTBUG-65503
Change-Id: Iaf10205a26804f7fc03eb8a16a0879f1bd7bf332
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-24 18:52:39 +00:00
Gatis Paeglis
d5abf54597 xcb: re-factor QXcbKeyboard::updateKeymap() to remove various fallbacks
3edcd9420e added more robust support
for keyboard input on XKeyboard-less X servers. The various fallbacks
that we had did not work that well in practice. We can remove them now.

The xkb_keymap_new_from_names() function relies on reading XKB config
files from a file system. Since we don't use this function anymore, we
can also simplify xkb context creation (see XKB_CONTEXT_NO_DEFAULT_INCLUDES),
as we don't care about DFLT_XKB_CONFIG_ROOT (which we previously set
via -xkb-config-root for the bundled libxkbcommon).

This patch also changes the code to use smart pointers for managing
the global xkb context, keymap and state.

[ChangeLog][X11] The -xkb-config-root command line switch has been
removed as it it no longer needed when configuring with -qt-xkbcommon-x11.

Change-Id: I80eecf83adae90af5cd20df434c1fba0358a12fd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-24 12:15:08 +00:00
Gatis Paeglis
9280a04afe xcb: remove xlib dependency from core keymap assembling
Remove the Xlib dependency by extracting XConvertCase
from libxkbcommon sources (xkbcommon/src/keysym.c).

libxkbcommon >= 0.8.0 exposes case conversion APIs, but
we should prefer using the slightly adjusted version (see
the patch for more details).

This change also is necessary for follow-up cleanups.

Change-Id: Icf1716e0ad26f46a7aefb23722cfc57957754d5e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-24 12:15:00 +00:00
Liang Qi
ab28ef132e Reapply 1514b4e853 on 5.11
This change amends 305dd1b61f, which lost
1514b4e8 and brought src/corelib/json/qjsonarray.cpp back, which got
removed in c9c9adeef9. In
a6b697ca13, it was moved to
src/corelib/serialization/qjsonarray.cpp in 5.11.

Change-Id: Ic6134a78d75a9c245934cf70a67a54c80a3e7c85
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-23 11:28:30 +00:00
Liang Qi
3fcedcbabb Reapply 403343039d on 5.11
This change amends 305dd1b61f, which lost
40334303 and brought src/corelib/xml/qxmlstream_p.h back. In
a6b697ca13, it was moved to
src/corelib/serialization/qxmlstream_p.h in 5.11.

Change-Id: Ia1e9841b866ff49f7274b1b13fd224c0a20a017e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-23 11:28:24 +00:00
Qt Forward Merge Bot
efb46ea7cc Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I01dfc41e18333ac55954296cef8f01475adab27e
2018-02-23 09:27:52 +01:00
Gatis Paeglis
d98f17d434 doc: improve QPlatformIntegration::possibleKeys() documentation
- There is no need to mention qkeymapper, which is an internal
implementation detail.

- Describe the encoding of int.

- Add a note that calling possibleKeys() outside key event
handler context is not valid.

Change-Id: Ife9b7d1496f04b5a433ed2d56f29c4f01f174441
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-22 21:38:07 +00:00
Gatis Paeglis
1aec1a2d8d xcb: remove fragile and unnecessary missing-latin-keymap workaround
... which was trying to fix a rarely occurring situation where system
settings from a desktop environment does not set any latin keymap on
X. This is a DE bug and it has a simple workaround (details in the patch).

Ubuntu has fixed this issue sometime between 12.10 -> 14.04. Gnome 3
always appends 'us' layout, even if you have only e.g. 'gr' listed in
keyboard layouts (can be checked via setxkbmap -query). In KDE, the
global system shorcuts seem to stop working as soon as latin keymap
is not the first in the list, which means that KDE users won't be
affected as they will likely always have a latin keymap present in
the list.

This patch removes parts of 2b666d9576,
the parts that in the commit message I was referring to by this quote:

"lookupLatinKeysym() also handles the cases that did not work in Qt4
with XLookupString".

Since finding a latin key is not working by XLookupString() in this
rare case, then it would not work pretty much across the whole desktop.
And users would be more interested at finding a solution that works
across the desktop. We should not workaround this issue. Desktops that
are doing it wrong should learn about this and not repeat the same mistakes
on Wayland systems, where XKB keymap is assembled by compositor and passed
to clients. Clients should work with the provided keymap as is.

The missing-latin-keymap workaround is considered fragile for several
reasons - it might not work with legacy or enterprise X server key codes
and it relies on global _XKB_RULES_NAMES (there might be several connected
keyboards). And theoretical limitation: client might be running in a
restricted environment where we don't have access to keymaps on the
file system.

Change-Id: Ib445b2ea46174248cfa0e5da0eb642cd2a5cf2f6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-22 21:37:50 +00:00
Marco Trevisan (Treviño)
ff169e8859 dbustray: add NewMenu signal and emit it when menu changed
This is a signal that is not actually supported by the
StatusNotificationIcon standard, but it comes to be important
for the Qt implementation of it, in fact qt apps might
not have a menu, when exporting the Menu path as /NO_DBUSMENU
or they could add this later in the execution.
So, currently there's no way for the StatusNotificationWatcher
to know when a menu has been added (or changed).

Adding a NewMenu signal won't cause any troubles, but will
allow watchers to be notified properly on menu addition.

Change-Id: I9a8b00213f5023950811af1d62cd91bc51744b78
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-22 21:05:43 +00:00
Jan Arve Sæther
2dc578a8f2 un-crash QPlainTestLogger::printMessage()
Commit cf4a611115 refactored out test
identifier buildup into a standalone function, but it returned the
QTestCharBuffer as a value type, which ultimately caused it to crash:

Unfortunately QTestCharBuffer is not copied correctly: Since it uses the
default copy ctor it will copy the buf pointer and create a deep copy of
the staticBuf pointer. When the dtor was later called it would then end up
calling free(buf) (where buf pointed to the staticBuf of the original
QTestCharBuffer).

Task-number: QTBUG-66607
Change-Id: Ifa290658be6f077a0d6613451c26aeeffc8df41c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6ffb358822)
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-22 19:29:26 +00:00
J-P Nurmi
9c2783c6c7 QGtk3Menu: take GTK's scale factor into account
GTK's scale factor, which can differ from Qt's scale factor, must
be taken into account in the native GTK menu positioning function
qt_gtk_menu_position_func().

Task-number: QTBUG-55251
Change-Id: I4ad460baab54facd25564ad85ded383c9321d597
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-22 19:08:11 +00:00
Christian Ehrlicher
a924b4d58f psql: do not try to get table name when PQftable returns InvalidOid
When the table for a selected column can't be determined (e.g. because
there is no table for it), PQftable returns InvalidOid. This was not
covered and a query to determine the table name was executed every
time which slowed down calls to QSqlQuery::value(QString).

Task-number: QTBUG-65226
Change-Id: Idd8fbaaef7b01ca4151439f46cad2cce6f1c93e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-22 19:00:08 +00:00
Alex Trotsenko
cdc30acbde Simplify QRingBuffer::peek()
Use a range-based for loop instead of index-based access.

Change-Id: Ie43aee540062eec4800f39915ebd42d5a3cae4b3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-22 18:34:30 +00:00
Pablo Marcos Oltra
17b73b0d2b Cocoa: fix grabWindow when mixing highDPI and non-highDPI screens
CGDisplayCreateImageForRect seems to have a weird behavior when mixing
highDPI and non-highDPI screens since it may take part of the
non-highDPI screen when the highDPI display is at the left or at the
top of the main monitor.

To workaround this issue, we capture the whole screen and then crop the
image to the desired size.

Task-number: QTBUG-47643
Change-Id: Ib2a3850a0a549964c7fe272abb563bd23518c234
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-22 10:28:08 +00:00
Kai Koehne
a7f3d1c6c5 Add Linux-syscall-note exception to 3rdparty testlib documentation
Change-Id: Ib2e0ee2b7397e65ebd79a92fc83c9e08780d626e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-22 09:32:43 +00:00
Qt Forward Merge Bot
9f33b84b09 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Iec636692e8b7d1fe1bc0476e49c5054a5892d639
2018-02-22 09:19:56 +01:00
Martin Storsjö
b97765efd4 moc: Only use the init_priority attribute when targeting windows
While both GCC and the GCC compatible clang support this attribute in
general, GCC doesn't support it when targeting macOS, ending up with
errors like these:
error: 'init_priority' attribute is not supported on this platform

This error isn't a property of the platform itself though, since
clang supports the attribute just fine on macOS.

The attribute is only used to work around an issue with dllimport
on windows, so limit its use to that platform, to avoid issues
with it potentially being unsupported on platforms other than
macOS as well.

This fixes compiling with GCC for macOS.

Change-Id: I0235e6365635d73233951566c10ad869b26a0fc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-22 05:14:36 +00:00
Pasi Petäjäjärvi
02eb264aa2 Fix build when ftp feature is disabled
Configuring Qt with -no-feature-ftp cause build to fail.

Change-Id: I47f1cdc400702d0211a9f620c8606983f08fa70c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-21 18:54:52 +00:00
Thiago Macieira
604e5e340e Revert "JSON doc: update the RFC we link to"
This reverts commit 71090f0950. Changing
the link was wrong because we do not actually comply with the new RFC.

Task-number: QTBUG-66470
Change-Id: I940917d6763842499b18fffd15147cb93c27b7f4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-21 18:51:40 +00:00
Morten Johan Sørvig
4cbc7f7980 Support synchronous handleCloseEvent()
Use QT_DEFINE_QPA_EVENT_HANDLER to define
QWindowSystemInterface::handleCloseEvent().

Change-Id: I4f1105f7aa78bdebddfe9062b388eb616e325e31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-21 18:43:16 +00:00
Morten Johan Sørvig
2f9bdeba17 Add QPlatformWindow::close()
Platforms can reimplement this function to control
how non-spontaneous window close is handled.

Make QWindow::close() call this function.

Change-Id: I3da13e6c8519de2af7e54334d8a1e833ce98cba1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-21 18:43:13 +00:00
Antonio Larrosa
fa09164013 opengl: Bail if cached shader fails to load
QOpenGLProgramBinaryCache::setProgramBinary() should check
GL_LINK_STATUS after glProgramBinary(), but doesn't.

In practice, this means that SDDM is a white screen, and KDE is just
a gray task bar.

So far, Qt tries to check this using its internal ::link() function.
But in case the cached binary fails to load, Qt currently attempts to
link the inexistent program, resulting in a zero-length, fixed
pipeline shader.

Checking this already in ::setProgramBinary() makes the call to
::link() superfluous, so we remove that as well.

Done-with: Max Staudt <mstaudt@suse.com>
Done-with: Michal Srb <msrb@suse.com>
Done-with: Fabian Vogt <fvogt@suse.de>
Task-number: QTBUG-66420
Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-21 17:03:58 +00:00
Tor Arne Vestbø
2acfc48de5 testlib: Pass on log message context to loggers
Change-Id: I1e0bb09d4f96b45f1e9757ea25ae3aba1ae42447
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-21 16:27:37 +00:00
Christian Ehrlicher
9395f35cb1 QHeaderView: Preserve settings on layoutChange with empty model
Do not clear the settings of QHeaderView during layoutChange when the
model is empty and the section count did not change. This will not work
when a section is moved or a section is replaced with a new one during
layoutChange. But since layoutChanged is also called on sorting, this
patch ensures that the settings are not cleared in this case.
This restores the behavior to the same as before 5.9.4.

Task-number: QTBUG-66444
Task-number: QTBUG-65478
Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-21 16:23:25 +00:00
Christian Ehrlicher
c0e45ae851 QHeaderView: properly restore hidden section size on layoutChanged()
During (re)storing the sections within layoutChanged handling, the
hidden section size was not properly stored which lead to a section
size of 0 when the section was unhided afterwards.

Task-number: QTBUG-66413
Task-number: QTBUG-65478
Change-Id: I0b714c7e0530a1eae82b3bb0e0dc80ed576522d0
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-21 16:23:15 +00:00
Friedemann Kleint
c9c9adeef9 Remove left over json/qjsonarray.cpp
Complements a6b697ca13.

Change-Id: I96697624aa65a5a45ce91ceaf0e156fd112a8ed0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-21 16:10:46 +00:00
Friedemann Kleint
1d6d1e680e Fix some qdoc-warnings for 5.11
Rename example savegame and its snippets following
a6b697ca13.

Fix:
/qtbase/examples/corelib/serialization/savegame/doc/src/savegame.qdoc:28: warning: Cannot find file 'json/savegame/savegame.pro' or 'json/savegame/savegame.qmlproject'
qtbase/examples/corelib/serialization/savegame/doc/src/savegame.qdoc:98: (qdoc) warning: Cannot find file to quote from: 'json/savegame/level.cpp'
json
qtbase/src/network/ssl/qsslconfiguration.cpp:889: warning: Undocumented parameter 'name' in QSslConfiguration::setBackendConfigOption()
qtbase/src/corelib/tools/qbitarray.cpp:314: warning: No such parameter 'len' in QBitArray::fromBits()

Change-Id: If59512873ca2116b89490927fdbf9ea1d8b237a8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-02-21 16:10:26 +00:00
Friedemann Kleint
27b8e97e4f Windows QPA: Fix accessibility being triggered by IME
Add missing break.

Change-Id: Ib17e348e64379abded41f6c044de59f9ee1dd8fc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-02-21 09:42:07 +00:00
Qt Forward Merge Bot
b949c44783 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9c90d71fde002544fd97df7e8a2690953cf9f817
2018-02-21 09:41:47 +01:00
Jani Heikkinen
89053e224f Bump copyright year
Task-number: QTBUG-65810
Change-Id: Ib6f87a126f64c2e4b2e924b97af4c2b2d10dd29e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-21 08:23:20 +00:00
Christian Ehrlicher
8dbd245979 QtConcurrent::MedianDouble: do not access uninitialzed values
Properly initialize MedianDouble::values in ctor.
This fixes the following valgrind warnings in the unit test:

Conditional jump or move depends on uninitialised value(s)
  at 0x40771E4: addValue (qtconcurrentmedian.h:161)
  by 0x40771E4: QtConcurrent::BlockSizeManagerV2::timeAfterUser() (qtconcurrentiteratekernel.cpp:195)

Change-Id: I8c8e297a52caca38cd6191ae2653f2765d387077
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-20 20:19:36 +00:00
Oswald Buddenhagen
24ccb402e5 Bump version
Change-Id: I930e3fdd98f6a32a130ddcf671cf68f61d0c225d
2018-02-20 19:53:08 +01:00
Mårten Nordheim
a4ff863403 Add missing "We mean it." warnings
Private headers not only need the _p suffix, but we also need to mean it
:)

Change-Id: I6028200a872661af34cbf90c77974cc1a22c09c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-20 14:53:31 +00:00
Friedemann Kleint
ed3ed0b9db Fix touch point positions of non-transformable QGraphicsItems
TouchEvent::TouchPoint::pos was not updated in
QGraphicsScenePrivate::updateTouchPointsForItem().

To prevent the transformation being calculated repeatedly for each touch
point member, extract a function genericMapFromSceneTransform()
from genericMapFromScene() returning the transformation and use
that whereever multiple points are transformed.

Add a test, extracting helper functionality from
tst_QGraphicsItem::touchEventPropagation().
In addition, fold tst_QGraphicsScene::checkTouchPointsEllipseDiameters() from
c48f4bde00 into this test, so that
it is testing all transformations.

Task-number: QTBUG-66192
Change-Id: If71886d2c14c4e216f7781ea2f22f1adc444e6cf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-20 13:54:34 +00:00
Robert Loehning
16e4d017e4 QTreeView: Remove unused variable
Change-Id: I1efab0cf5554485de8d14f803b165223784c313b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-02-20 11:09:57 +00:00
Jake Petroules
ba871065e0 Clean up our Objective-C usage
- Move ivars into @implementation
- Use instancetype where applicable
- Use dot notation for property access
- Use subscript operator for dictionaries and arrays
- Format selectors consistently
- Use proper style for init methods
- Use generics instead of void pointers where possible
- Use "range for" loops instead of indexing
- Replace or replace IBAction/IBOutlet with void

Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-20 10:02:12 +00:00
Johan Klokkhammer Helsing
ddf6f57f21 xcb: Fix -geometry argument for platformName with arguments or fallbacks
-geometry, -title and -icon for xcb did not work if the platform string had
arguments or there were fallback platforms.

Only accept the arguments if xcb is the default platform. I.e. ignore the
arguments if xcb is a fallback.

This now works:

./application -platform "xcb:someArg=value" -title specialXcbTitle
./application -platform "xcb;wayland" -title specialXcbTitle
./application -platform "xcb:someArg=value;wayland" -title specialXcbTitle

But this does not:

./application -platform "wayland;xcb:someArg=value" -title specialXcbTitle

Change-Id: I4ee20b1ed722bc98417a5e75db7d8c98ffcdfcfe
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-20 09:22:51 +00:00
Johan Klokkhammer Helsing
093d85393f Support multiple entries in the Qt platform plugin string
[ChangeLog][QtGui] QT_QPA_PLATFORM and the -platform argument now support a
list of platform plugins in prioritized order. Platforms are separated by
semicolons.

The plugins are tried in the order they are specified as long as all preceding
platforms fail gracefully by returning nullptr in the implementation of
QPlatformIntegrationPlugin::create()

This is useful on Linux distributions where the Wayland plugin may be
installed, but is not supported by the current session. i.e. if X11 is running
or if the compositor does not provide a compatible shell extension.

Example usage:

QT_QPA_PLATFORM="wayland;xcb" ./application

or

./application -platform "wayland;xcb"

Task-number: QTBUG-59762
Change-Id: Ia3f034ec522ed6729d71acf971d172da9e68a5a0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-20 09:21:53 +00:00
Ulf Hermann
34017a8c5a Sql: Add a feature for the SQL item models
... and make sure we can build if it's switched off.

Change-Id: I9565a2ce632a861a99e1276f3edf4f0d094b5451
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-20 09:09:01 +00:00
Albert Astals Cid
d945e11837 Move duplex member from QPdfPrintEnginePrivate to QCupsPrintEnginePrivate
Duplex doesn't really make sense in the context of printing to pdf,
and the variable was only being used in QCupsPrintEnginePrivate anyway

Change-Id: I801634c56759572825b5c9549d7a1dc92e5697a0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-20 07:56:19 +00:00
Albert Astals Cid
d145d291cd Fix QPlatformPrintDevice::supportedPageSizeMatch
First check if the pagesize is one of the known ones before
comparing the page sizes. It's veeeery similar but without
it when running the qprinter tests i get a failure since we
set "Index Card 3x5in" but get back "Photo 3x5in"

Change-Id: I72671231c2abec39e036de829d226784f06e1b41
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-20 07:56:05 +00:00
Tony Sarajärvi
3190edb077 Merge "Merge remote-tracking branch 'origin/5.10.1' into 5.11" into refs/staging/5.11 2018-02-20 04:18:00 +00:00
Liang Qi
48577b2e7f Merge remote-tracking branch 'origin/5.10.1' into 5.11
Conflicts:
	src/plugins/sqldrivers/psql/qsql_psql.cpp

Change-Id: I070b455078b41e75c46562fcea5676d6218cd00c
2018-02-19 16:02:52 +01:00
Tor Arne Vestbø
95eeaec36f macOS: Remove qDebug silencer in qthread_unix.cpp
It was added by Sam back in 2007, and we've removed other instances of
the same pattern since then. It doesn't make any sense today.

Change-Id: I0f3cb299e312648fd9dc96c639dab4c77fcb48c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-19 13:16:42 +00:00
Tor Arne Vestbø
29ae5cbaf8 macOS: Don't assume m_view is QNSView when calling requestUpdate
Change-Id: I98833c5ecc5816a0926045e10ef0442a39be6b2e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-19 12:39:31 +00:00
Tor Arne Vestbø
8e098f87bb macOS: Remove unused variable
Change-Id: I7e016db57cbf347529b6aa003d84585eeab0767d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-19 12:39:29 +00:00
Friedemann Kleint
fa0906bc56 xcb: Fix developer build
Add Q_UNUSED, fixing:
qxcbbackingstore.cpp:344:45: error: unused parameter 'segmentSize' [-Werror=unused-parameter]
on Kubuntu 17.10.

Amends 24adaa9a74.

Task-number: QTBUG-46017
Change-Id: I64f21d8f1d1ac21340cfbba66b97768140ce23a8
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-19 09:01:27 +00:00
Johan Klokkhammer Helsing
acbed6802e Add Wayland in the documentation for QGuiApplication::platformName
Change-Id: Ie19dbeeba6cd9664ad546dd2b2ae0bf6cbd199a0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-19 08:56:36 +00:00
Johan Klokkhammer Helsing
feba2a68b1 Fix incorrect documentation for -platform, QT_QPA_PLATFORM and friends
This makes the documentation match the implementation.

-platform overrides QT_QPA_PLATFORM, not the other way around. Similarly
for the other arguments.

Change-Id: Iffaf8bb1134bc57e5b682f37b9cc1a713872ede1
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-02-19 08:56:24 +00:00
Ryan Chu
4629a6b238 ftp backend: Dynamically resolving resource path with URL prefix
The code used to retrieve FTP resource with the path of QUrl as an
absolute URL starting from the root directory. It is not always working
with a relative URL because the root directory and working directory may
be different. Depending on the implementation of FTP server, the
reference directory of a relative URL could be either the root directory
or the working directory.

To resolve it, a new state “ResolvingPath” is added to resolve resource
paths before retrieving. For both GET and PUT operations supported by
QNetworkAccessFtpBackendFactory, the resource will be retrieved via its
URL path. Depending on the prefix of the URL path, the path of working
directory is prepended to the resource path as an absolute path starting
with the working directory.

If a URL path starts with “//” or “/%2F” user-input prefix, the resource
will be retrieved by an absolute path starting with the root
directory. If a path starts with /~/ or the working directory prefix,
its resource will be retrieved from the working directory.

Task-number: QTBUG-25034
Change-Id: I26198af1c0077f51565afd3f96050235c661f063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-19 08:31:26 +00:00
Ulf Hermann
a1211c69d5 Use QT_CONFIG(stringlistmodel) rather than QT_NO_STRINGLISTMODEL
Change-Id: Iac5b2cb63d05f1746ca1bf9eba07562d76aa7ba3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-19 08:16:13 +00:00
Ulf Hermann
89a19935d4 Use QT_CONFIG(proxymodel) instead of QT_NO_PROXYMODEL
Change-Id: Ie01a118b2aa11fcbeaf073ee2d28ceaeffc8a6ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-19 08:16:09 +00:00
Qt Forward Merge Bot
30306d8c93 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I95d8a4ba3d8cedfdda63b99127abb7c57a4265e6
2018-02-18 21:41:41 +01:00
J-P Nurmi
0d465f5ccb Register QPlatformDialogHelper::ButtonLayout
This allows QML DialogButtonBox in Qt Quick Controls 2 to use the same
enum without having to duplicate it.

Change-Id: Ib3a89acd18f9e584a203ee44621ca2e3fc0ceaba
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-17 13:27:40 +00:00
Andre Hartmann
ee55b37070 QByteArray: Add functions isUpper() and isLower() for Latin1 byte arrays
[ChangeLog][QtCore][QByteArray] Added QByteArray::isUpper() and
QByteArray::isLower() to check if a byte array contains only uppercase
or only lowercase Latin1 letters.

Change-Id: I7ab3c775bc714138d4be259ac6fa2cfc70467ed4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-17 12:23:24 +00:00
Marcel Krems
8a66924ca0 Fix compilation with QT_DISABLE_DEPRECATED_BEFORE=0x060000
Regression introduced in b254b03dc3

Change-Id: I77e8718cc6be79d4fbea5510e8d7cc7808a609c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-16 22:45:48 +00:00
Friedemann Kleint
9760f881c5 QTestlib: Add formatting for QFlags<>
Add formatting for registered enumerations based on QMetaEnum
and unregistered enumerations as hex values.

[ChangeLog][QtTest] QtTest now prints values of QFlags that failed to
compare with QCOMPARE.

Task-number: QTBUG-65845
Change-Id: I3eae6d20d3c0d72441ca6c4037d9a8dafa4b6357
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-16 17:27:55 +00:00
Jan Murawski
5d3ce3a640 Handle unset $DISPLAY variable when using the offscreen platform
Skip the initialization of a QOffscreenX11GLXContext and thereby fix
a null pointer dereference if the environment variable $DISPLAY is
unset or contains invalid information.

Task-number: QTBUG-66423
Change-Id: Ideea510d1c63a4f6700839955d833cd10e3b0bbe
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-16 13:57:05 +00:00
Timur Pocheptsov
f805be5382 Fix configure.json (OpenSSL 1.1 on Windows)
Since 1.1 lib names are similar to what they have on other
platforms, that is: libssl and libcrypto.

Task-number: QTBUG-62733
Change-Id: I477899433719fe36104491601d8cb71004b265ae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-16 13:56:01 +00:00
Albert Astals Cid
21e5da2fe0 QPagedPainterDevicePrivate: Remove m_pageLayout
Having it there is awkward since all the subclasses of QPagedPaintDevice,
that is QPdfWriter and QPrinter, have their own m_pageLayout via
their private engine classes so we ended up with code like
   pd->engine->setPageMargins(margins, units);
   // Set QPagedPaintDevice layout to match the current paint engine layout
   m_pageLayout = pd->engine->pageLayout();

Now we just use the subclass for it's page layout and all is simpler
since we don't need to make sure the two variables are updated to
have the same contents.

Unfortunately this means that we have to implement a dummy subclass
for QPagedPaintDevice(). That constructor doesn't make any sense since
QPagedPaintDevice is not really a leaf you want to instantiate, it's
there to provide common api for the subclasses and the
QPagedPaintDevice(QPagedPaintDevicePrivate *dd) constructor should be used.

Since it's a public class we can't remove that constructor and that's why
we have that QDummyPagedPaintDevicePrivate.

QPageLayout &QPagedPaintDevice::devicePageLayout() is also deprecated now
since there's no "device" page layout anymore. Those functions were
marked internal and as far as I can see unused outside
QPdfWriter/QPrinter so it should be fine.

[ChangeLog][QtGui] QPagedPaintDevice constructor has been deprecated
since that class is not meant to be used standalone, its two public
but internal devicePageLayout() methods are now deprecated.

Change-Id: I054601b66afcb7dd662db6247c5ed7820fbee212
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-16 08:10:49 +00:00
Liang Qi
048d8dee52 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-02-16 22:31:50 +00:00
Jan Arve Sæther
6ffb358822 un-crash QPlainTestLogger::printMessage()
Commit cf4a611115 refactored out test
identifier buildup into a standalone function, but it returned the
QTestCharBuffer as a value type, which ultimately caused it to crash:

Unfortunately QTestCharBuffer is not copied correctly: Since it uses the
default copy ctor it will copy the buf pointer and create a deep copy of
the staticBuf pointer. When the dtor was later called it would then end up
calling free(buf) (where buf pointed to the staticBuf of the original
QTestCharBuffer).

Change-Id: Ifa290658be6f077a0d6613451c26aeeffc8df41c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-16 07:56:08 +00:00
Liang Qi
942ab49072 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/tools/tools.pri

Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
2018-02-16 08:54:58 +01:00
Alexander Volkov
24adaa9a74 xcb: Fix access to shm for X server running from another user
Use ShmCreateSegment call, that was added in MIT-SHM 1.2, to
create shared memory segments on the server side. It returns
a POSIX shared memory object that is used to mmap memory.
It's in effect a file descriptor that is passed through the
X server socket and thus avoids permission checks.
On the other hand this scheme is more secure, because the
file descriptor, and thus the shared memory, are accessible
only by the X server and the application.

Task-number: QTBUG-46017
Change-Id: I202eead9d01aee2ab5b65f4f74f4c13da7cb2239
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-15 22:15:02 +00:00
Alexander Volkov
8db9e33997 xcb: Enhance SHM management code
- extract the creation of a shared memory segment into a separate
  function
- do extra checks for errors
- check that MIT-SHM extension is present once in QXcbConnection

Change-Id: I956bdf76b879ec5c95a7ed219a59ae722dc5afba
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-15 22:14:52 +00:00
Alexander Shevchenko
ad648ff293 fix missing __builtin_mul_overflow for Windows ICC
Complete 43c44d05ca to cover builds
using Windows ICC.

Change-Id: I5f4d62f17b54835a58f3002744574c514cce5e39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 22:02:13 +00:00
Liang Qi
1ef03f69e8 Merge "Merge remote-tracking branch 'origin/5.10' into 5.11" into refs/staging/5.11 2018-02-15 21:19:50 +00:00
Christian Ehrlicher
23eab78f51 QToolBar: Fix QToolbar extension button icon after LayoutDirectionChange
When the layout direction is changed after the QToolButton is created,
the extension button icon was not updated.

Task-number: QTBUG-66344
Change-Id: I8690b2c42c4f485a39490f16b15b8ee58e6f4ace
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-15 20:00:23 +00:00
Anton Kudryavtsev
0fb8271a46 QTextEngine: micro optimize insertionPointsForLine
Don't use out param, use return by value instead.
Also since we don't need CoW replace QVector with std::vector

Change-Id: I5b6ea286b83e2ab959b5734cc1af31cc63c06553
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-15 18:00:11 +00:00
Christoph Cullmann
47904bb08a fix selection rendering issues if rounding leads to left-out pixels
instead of manual qFloor, use the toAlignedRect() function to get the minimal enclosing rectangle
this will in some cases over-paint one-pixel, which is preferable to under-paint which
leaves gaps inside painting text lines that can not be fixed by the user of the painting routines

Task-number: QTBUG-66036
Change-Id: I8d6c2f7370e55bd544e1ff93d5c07b554b20ffeb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-15 17:13:19 +00:00
Kai Koehne
dc334b60d9 Update documented sqlite version
Augments 3d35501591

Change-Id: I074f966206bcfd1b2b7b55bb2ed910219bb7726d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-15 15:26:58 +00:00
Johan Klokkhammer Helsing
5f96432ea9 eglfs_kms_vsp2: Recover if queuing input buffers fails
Clear all queued buffers, and reinitialize the Qt layer so we can try again
next time.

Change-Id: I921f6f457666206be92aadf2fe40b855e6ebff62
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-15 15:17:20 +00:00
Tor Arne Vestbø
6c4f5ecef0 Share event dispatcher creation between QThreadPrivate and QCoreApplication
A step towards having the application do its event dispatching though the
thread data's dispatcher, like QEventLoop, instead of keeping two references
to the same dispatcher, one in QCoreApplicationPrivate and one in QThreadData.

Change-Id: I7b215e7e99869d25638ec67f0666f632a508cc0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 14:00:21 +00:00
Yulong Bai
ea21b36836 QFusionStyle: fix the checkbox rendering in low DPI settings
Fixed some regression of checkbox's size brought in by c9f68a5.

Using qreal and QRectF to avoid the round error accumulation
of sizes in low dpi situations.

Tweaked the look of the check mark.

Task-number: QTBUG-66343
Change-Id: I8f68144f60437907701021bb43ee736dfcb7241f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-15 13:38:08 +00:00
Simon Hausmann
2a80c04d3b Fix crash when reading window titles with XCB
This is a regression introduced with commit
cb142954c5 that changed the code from
using QString:fromUtf8(name, propertyLength) to QString::fromUtf8(name),
assuming that the property name is a zero-terminated string. That
however is not correct.

ASAN trace:

==4039==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400001e0b4 at pc 0x7f3383c7d66e bp 0x7ffdc8e3d9b0 sp 0x7ffdc8e3d158
READ of size 5 at 0x60400001e0b4 thread T0
    #0 0x7f3383c7d66d  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5166d)
    #1 0x7f337602f32a in QString::fromUtf8(char const*, int) ../../../../include/QtCore/../../src/corelib/tools/qstring.h:569
    #2 0x7f337602f32a in QXcbWindow::windowTitle(QXcbConnection const*, unsigned int) /home/simon/dev/qt-5.11/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:2861
[...]

0x60400001e0b4 is located 0 bytes to the right of 36-byte region [0x60400001e090,0x60400001e0b4)
allocated by thread T1 (QXcbEventReader) here:
    #0 0x7f3383d0ab50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f337b397e2b  (/usr/lib/x86_64-linux-gnu/libxcb.so.1+0xde2b)

Change-Id: Ia5024602d3aacb924b5dcd3956672da2a8f10feb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-15 13:34:50 +00:00
Liang Qi
bb0fec8057 Merge remote-tracking branch 'origin/5.10' into 5.11
Conflicts:
	src/corelib/corelib.pro
	src/corelib/global/qrandom.cpp
	src/network/access/qhttpnetworkrequest_p.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoansmenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/offscreen/qoffscreenintegration.h
	src/widgets/kernel/qaction.cpp
	src/widgets/widgets.pro

Done-with: Andy Shaw <andy.shaw@qt.io>
Change-Id: Ib01547cf4184023f19858ccf0ce7fb824fed2a8d
2018-02-15 10:14:11 +01:00
Kai Koehne
f93d732dd1 Update Unicode CLDR third party documentation
[ChangeLog][Third-Party Code] Clarified use of "Unicode
Common Local Data Repository (CLDR)" in the documentation.
Also updated SPDX license name / ID.

Change-Id: I7261c675251dcca118f2661061a09b9c9200486e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-15 08:02:48 +00:00
Kai Koehne
2442328393 Document use of Unicode Character Database
[ChangeLog][Third-Party Code] Documented use of
"Unicode Character Database (UCD)" in Qt Core.

Change-Id: Id66877d04b4bbe6967d366bc631942e466a861ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 08:02:41 +00:00
Andy Shaw
d0dffdfc01 Make sure the parent view will have focus when activation is given back
When the focus is lost on an editor due to the application no longer
being the active one then we have to ensure the parent view is going to
get the focus when it is returned. Since the editor does not have focus
when this check is done we need to manually account for this case by
setting it on the parent view as if it would if the editor did have
focus.

Task-number: QTBUG-62253
Change-Id: I14ac347e9e3a2bfaa8715a45811b17c1c7cf15f8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-15 07:45:26 +00:00
Friedemann Kleint
09e212eec0 Add debug operators for QGraphicsSceneEvent-based classes
Modeled on the QtGui's debug operator for its events.

Change-Id: I2c92aa017178cb8bde2d2b1eaba7cb130e874c13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-15 07:28:35 +00:00
Liang Qi
8920bf32ee Reapply 0d9208cecb on 5.11
This change amends 305dd1b61f, which lost
0d9208ce and brought src/plugins/styles/mac/qmacstyle_mac.mm back. In
4f3249f32d, it was moved to
src/plugins/styles/mac in 5.10.

Task-number: QTBUG-65773
Change-Id: I721268caf12067ed798f5846234cd2fdf3e493dc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-14 22:10:26 +00:00
Gabriel de Dietrich
c4e41fa534 QStyleHelper: Remove unused function setWidgetSizePolicy()
This used to be public back when QMacStyle had public API.
Long replaced by the WA_Mac*Size attributes.

Change-Id: Ifd948e648ec90ff29b6b3652bc9d5cb1dc9c6a09
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-14 18:46:28 +00:00
Friedemann Kleint
4589440891 Windows QPA: Use new mouse/wheel API of QWindowSystemInterface
Complements a37785ec76.

Task-number: QTBUG-59277
Change-Id: I7aa2e648e21693c93ce512ca08ec22e843944186
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-14 16:07:57 +00:00
Friedemann Kleint
a468a0541a QtGui: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: I841f1880371db79723747fb9686ba466fd66c26f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-14 16:07:40 +00:00
Allan Sandfeld Jensen
e843e3bb00 Fix compiling qfloat16_f16c.c with C89 compiler
Needed by gcc 4.8

Change-Id: I2daa5728761599255cf3912d37e7b9dd60ccb60c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-02-14 15:49:14 +00:00
Liang Qi
7bc1d6effa Merge "Merge remote-tracking branch 'origin/5.9' into 5.11" into refs/staging/5.11 2018-02-14 15:49:08 +00:00
Tor Arne Vestbø
54d57cbd6f Make QThreadPrivate::createEventDispatcher do exactly what it says
Leaving the logic of starting up the event dispatcher to the call site,
unified both the case of a custom event dispatcher and the default
event dispatcher.

The data argument is left in due to the static nature of the function.

Change-Id: Ia2020e39ccc67cd5a583d4e614dd978b2ec44dba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-14 14:18:09 +00:00
Liang Qi
305dd1b61f Merge remote-tracking branch 'origin/5.9' into 5.11
Conflicts:
	.qmake.conf
	src/corelib/animation/qvariantanimation.cpp
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/json/qjsonarray.cpp
	src/corelib/tools/qsimd_p.h
	src/corelib/tools/qtimezoneprivate_p.h
	src/corelib/xml/qxmlstream_p.h
	src/gui/kernel/qsimpledrag.cpp
	src/gui/kernel/qsimpledrag_p.h
	src/plugins/generic/generic.pro
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/widgets/styles/qmacstyle_mac.mm
	tests/auto/concurrent/qtconcurrentmap/BLACKLIST
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/dialogs/qmessagebox/BLACKLIST

Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
2018-02-14 12:51:24 +01:00
Friedemann Kleint
fe5edcee60 Windows/QSaveFile: Fix locking issues on Dropbox drives
Add a flag to QTemporaryFileEngine causing the file to be opened in
non-shared mode, preventing renaming failures caused by the Dropbox
driver accessing it.

Task-number: QTBUG-57299
Change-Id: Id7afc3559fd15784d4166efbbd057d592b5e0ab2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-14 11:48:03 +00:00
Friedemann Kleint
2bfafb673c Fix typo in code handling Qt::AA_DontShowShortcutsInContextMenus
Use Qt::AA_DontShowShortcutsInContextMenus instead of
Qt::AA_DontShowIconsInMenus in the getters and helpers for
formatting the action text. Streamline the code and use
static method invocation.

Amends c2c3452ba5.

Task-number: QTBUG-49435
Change-Id: I8827c2dc757e5899e5a26ffbf2d0b5018aa7544a
Reviewed-by: David Faure <david.faure@kdab.com>
2018-02-14 11:47:46 +00:00
Friedemann Kleint
7b72810801 QWindowsNativeImage: Output parameters when CreateDIBSection() fails
This helps to identify bugs in the backing store.

Change-Id: Ib15946c8dbdc6f0a5bebe9ca9e6fea5668eb499b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-02-14 11:47:44 +00:00
Tor Arne Vestbø
550b8c342b Don't expect QCoreApplictionPrivate::eventDispatcher to be set
QCoreApplication::setEventDispatcher sets the dispatcher on the current
thread, not on QCoreApplictionPrivate, so when running init() we don't
have an event dispatcher set.

Change-Id: Ia008e68b70777779ab14f1f7b9eeadac9adbcf7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-14 10:34:03 +00:00
Tor Arne Vestbø
4266c54128 Use explicit QThreadData::hasEventDispatcher() where possible
Change-Id: Ibce1a82dabb4e1381486211dbfb14eee9572e0ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-14 10:33:37 +00:00
David Crémoux
08f9dc1d32 Fix creation of RGB texture with QOpenGLTexture/Qt3D on OpenGL ES 2.0
Modification of the function pixelFormatCompatibleWithInternalFormat to
not change RGB pixel format to RGBA one, allowing the creation of valid
RGB textures with Qt3D.

Task-number: QTBUG-66365
Change-Id: I5c3187a3fefaedf85140f80fbb7145e1a762805b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-14 09:02:26 +00:00
Qt Forward Merge Bot
318f728283 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-02-14 08:31:10 +00:00
Allan Sandfeld Jensen
666d7745eb Fix missing override warning
Change-Id: Ib0616b203f3cf2934b7a0fd18b95111423001bab
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-14 08:26:17 +00:00
Kai Koehne
e0a1bbc1d3 Remove third-party attribution for qtemporaryfile
The code got dropped already in commit 9a3ce25f98.

[ChangeLog][Third-Party Code] Removed attribution for QTemporaryFile:
The original code got rewritten.

Change-Id: Ib8977f88d3bd649def136e5842d013e9952ab5dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-14 07:36:06 +00:00
Kari Oikarinen
a344758640 Remove superfluous call from qWaitFor
The remaining time will be fetched again after checking the predicate, so the
read value was never used.

Change-Id: I627152116ea579577e490ecefbaee02fec4aabdc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-14 07:20:38 +00:00
Friedemann Kleint
bb45b75f3d Windows QPA: Discard spurious mouse move events
Windows sends a mouse move with no buttons pressed to signal "Enter"
when a window is shown over the cursor. Discard the event and only
use it for generating QEvent::Enter as not to confuse tests.
This is preparing for the use of the new QPA API for mouse events.

Change-Id: I3eb7f3dad82d27d0b425c7eaf34b1eee11592074
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-14 07:13:39 +00:00
Ville Voutilainen
517daa6e73 Fix GCC 8 warning in qvariantanimation
qtbase/src/corelib/animation/qvariantanimation.cpp:451:13: error: cast between incompatible function types from ‘QVariant (*)(const QRectF&, const QRectF&, qreal)’ {aka ‘QVariant (*)(const QRectF&, const QRectF&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]

Change-Id: I5398316adaa0f12fbbdfdb200fd796de284821ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-14 05:43:55 +00:00
Ville Voutilainen
c97632385e Fix GCC 8 warning in qurlrecode
qtbase/src/corelib/io/qurlrecode.cpp:514:86: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QChar’ from an array of ‘const ushort’ {aka ‘const short unsigned int’} [-Werror=class-memaccess]
             memcpy(appendTo.begin() + origSize, begin, (end - begin) * sizeof(ushort));

Change-Id: Ide78a4144d6bc63342c3c4334cc97fe73c5167bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-14 05:43:46 +00:00
Ville Voutilainen
77582f1f10 Silence GCC 8 warnings in QString
qtbase/src/corelib/tools/qstring.cpp:3539:67: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QChar’ from an array of ‘short unsigned int’ [-Werror=class-memaccess]
             memcpy(uc, d->data() + copystart, size * sizeof(QChar));

Change-Id: Ic601bed1a1f9e1b6f0ac1f9e58f1dcadb50ad724
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-14 05:43:37 +00:00
Ville Voutilainen
b34942710c Silence a GCC 8 warning in QIODevice
qtbase/src/corelib/io/qiodevice.cpp:688:60:   required from here
../../../include/QtCore/../../../../qtbase/src/corelib/tools/qvector.h:727:20: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class QRingBuffer’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
             memmove(i, b, (d->size - offset) * sizeof(T));
             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I9dc9a17c281b71bf2eb3e89116600ec3ba345d74
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-14 05:43:27 +00:00
Qt Forward Merge Bot
9c055e8e47 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Iaec2e57d6bf33355ddfa61d25133580a8740335f
2018-02-13 22:56:03 +01:00
Tor Arne Vestbø
76010f4af8 macOS: Add more granular logging categories for window events
Change-Id: I202e2cecfb5438ba9edc82efaf80b6ecebafb835
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-13 18:04:56 +00:00
Tor Arne Vestbø
cf4a611115 testlib: Split out test identifier buildup into standalone function
Change-Id: I99aa106d5aab8f299e61835680709e4fd856defe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-13 16:20:28 +00:00
Jarek Kobus
c6de55a0bb Fix typos
Change-Id: Id625efea998f2b4dce9970b903830dc3b3efcd3d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-02-13 15:51:10 +00:00
Frederik Gladhorn
d08e0e861a Improve testlib example a bit
Assuming this is someone's first contact with testlib, we want to
mention QCOMPARE. Make the whole thing a bit more readable instead of
squeezing everything into single lines and add a bit more code.

Change-Id: I76908003427277670d1199774083a3ee01b8747c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-13 14:52:01 +00:00
Pasi Petäjäjärvi
af18215a95 Fix build failure when QtNetwork module is not build
Affected plugins: tuiotouch, vnc

Change-Id: Iabf72e3da0a25de0de2a861c69a29b3887ca81c3
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-02-13 08:38:36 +00:00
Aaron Linville
64b8ddb755 Doc: Fix links to QFontMetrics::width() overloads
Links to width(QChar) are incorrectly linking to QChar rather than to
the intended QFontMetrics::width method.

Task-number: QTBUG-65141
Change-Id: I1647885c735011ec3d99c535fdb8b7fc1bf57f99
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-02-13 02:59:44 +00:00
Tor Arne Vestbø
211791d01c Add support for Apple Unified Logging
If the OS supports it, we will now log to the Apple unified logging
system in addition to the normal stderr output. These logs can be
inspected via the Console application, or the 'log' command line
tool.

See https://developer.apple.com/documentation/os/logging

[ChangeLog][QtCore] Apple Unified Logging is now supported on Apple platforms.

Task-number: QTBUG-38156
Done-with: Jake Petroules <jake.petroules@qt.io>
Change-Id: I2ab92bd192d5b98aaf77e41501ea7b1ca6ef2425
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-12 23:35:13 +00:00
Benjamin Terrier
357822818d Ensure textEdited() is emitted if the input is changed by a validator
[ChangeLog][QtWidgets][QLineEdit] The textEdited() signal is now emitted even if the
QValidator has changed the user input.

Task-number: QTBUG-44046
Change-Id: Ife287269c7dcbb644cb03a291bf96f7db384ed56
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-12 21:52:07 +00:00
Konstantin Tokarev
da1ca1be51 Remove QLibrary code path specific to HP-UX on PA-RISC
The only mkspecs that enabled QT_HPUX_LD were removed in ab44ac021d.

Change-Id: I9f27f0b487b69c11d19ba76801e3926b7894e6e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-12 19:43:52 +00:00
Liang Qi
3d31afe1e4 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-02-12 11:15:20 +00:00
Oliver Wolff
c168838f7d winrt: Correctly check if mouse button was clicked
The idea behind this code was to check, whether no
button was pressed. !isPressed only checks, whether
XButton2 was pressed though.

Change-Id: I358816fa62d230abf82116f0da7bc3a5e43fbaf6
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-02-12 07:39:58 +00:00
Oliver Wolff
c4f0908f78 winrt: Keep track of affected window for mouse events
With the previous implementation mouseLeave events were
broken as we did not remember, which window was initially
affected by events and naturally there was no window under
the mouse for these events.

Now we save the currently affected window and use this
information for leave events.

Change-Id: I4036ce5e6621b507232d258dbb54c7f40a345899
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-02-12 07:39:57 +00:00
Oliver Wolff
4ea4279875 winrt: Fix mouse releases that happen outside a window
If the mouse button is released outside of a window,
we did not trigger a mouse release event.

Task-number: QTBUG-66088
Change-Id: I3ef6234cc922c8c59ac3aa6350783fae4ba36bda
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-02-12 07:39:56 +00:00
Oliver Wolff
675603a853 winrt: mouse handling: Fix detection of affected window
With the previous implementation the detection of the
affected window (windowAt which uses QWindow::geometry)
only worked for the upper left quarter of the window,
when used on a High DPI screen. As QWindow does not use
native positions, the mouse cursor's position has to be
mapped before checking the window under the mouse.

Change-Id: I1a30b9669ec3e4c573cf83aed57c20d65675ff16
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-02-12 07:39:56 +00:00
Christian Strømme
72918d196c Android: Don't rely on QDir::homePath() to get the application directory
If the QLoggingRegistry gets called as part of the static initialization
phase, it would call into Android's QStandarPaths implementation, which
assumed that the HOME env. variable was already set. Since the variable
isn't set before main is called, QDir::homePath() returns the root path,
which would be cached and always returned.

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

Task-number: QTBUG-65820
Change-Id: If45f3d5f0e87b808a62118ae95c31b492885646a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit eadf9e542f)
2018-02-12 00:16:17 +00:00
Alexander Volkov
9d293e24a0 Windows QPA: Implement QPlatformWindow::startSystemMove()
Task-number: QTBUG-58044
Change-Id: I15639d505683159b4cc31d762cb0bebbfc57e594
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-11 19:53:14 +00:00
Thiago Macieira
fcad1c762b QVariant: Add missing conversion from QJsonValue to double & float
Change-Id: I56b444f9d6274221a3b7fffd150d2ff1df5228bc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-11 17:59:28 +00:00
Thiago Macieira
abc891ee7c Documentation: don't suggest abort() in qInstallMessageHandler()
The backend will do the aborting. The handler doesn't need to do it.

Task-number: QTBUG-66295
Change-Id: I3debfc11127e4516b505fffd151166d4a8e9ec53
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-11 17:59:20 +00:00
Jake Petroules
138a65e0cf Remove code paths for macOS < 10.11
Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-02-11 17:02:26 +00:00
Alexander Volkov
f104d52737 Avoid code duplication in QImage{Reader,Writer}
Extract code related to supportedImageFormats() and
supportedMimeTypes() into QImageReaderWriterHelpers
namespace.

Change-Id: If0f56682072859be1b6f07afd7737431325827fc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-02-11 13:26:15 +00:00
Andre Hartmann
bcd6de15ac QString: Add functions isUpper and isLower
[ChangeLog][QtCore][QString] Added the functions QString::isUpper
and QString::isLower to check if a string contains only uppercase
or only lowercase letters.

Change-Id: I12d3a47d4605eb4514842071e80a9ba0723d4e01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-11 13:06:43 +00:00
BogDan Vatra
2c9dcfa004 Load Qt libs from Qt thread
[ChangeLog][Android] The application and dependent Qt libraries are
now loaded on the same thread as main() is run on, ensuring that global
static initializers, constructor functions, and main() are all run on the
same thread. The same applies during application shutdown, for destructors
of global objects, and destructor functions.

Change-Id: Id4bfece1ed2a0532ed2e8fb7d8ffd6e55d5a10dc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-11 12:35:29 +00:00
Liang Qi
8dd22d9255 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
2018-02-11 09:13:21 +01:00
Thiago Macieira
4ba535616b QSaveFile: Check for EINTR in fsync()/fdatasync()
[ChangeLog][QtCore][QSaveFile] Fixed an issue that would cause
QSaveFile::commit() to fail if Unix signals were delivered at the same
time.

Task-number: QTBUG-66268
Change-Id: I3debfc11127e4516b505fffd151148e70662cd5e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-02-11 04:31:00 +00:00
Tor Arne Vestbø
9b800b55c1 logging: Break out stderr logging sink into separate function
Change-Id: I4bc476376d2b84297c1798b016017db496532d27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-11 03:32:25 +00:00
Tor Arne Vestbø
a29e1fc708 logging: Don't build alternate logging sinks for QT_BOOTSTRAPPED
This means willLogToConsole does not need to consider the boostrapped
case anymore.

Change-Id: I088245362cd46c582a2a08225d22e4d2e4645c06
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-11 03:32:25 +00:00
Tor Arne Vestbø
3cee4308dc logging: Break out QMessagePattern error reporting into standalone function
Makes for a less awkward logic without any if (0) etc.

Change-Id: I3db0984c5a0bbf1615c2feb2ebef59b4ec16e9ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-11 03:32:25 +00:00
Sergio Martins
7a342372bb Introduce QLayout::indexOf(QLayoutItem *)
This was the missing counter-part to indexOf(QWidget *), which is
sometimes implemented in user code.

Not sure why the original code doesn't use a for-loop and instead accesses
an out-of-bounds element, but I'll preserve the behavior of very old working code.

Change-Id: I7d7fa56b56a4626789774c15c23fdfef41d723e7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-02-10 21:14:55 +00:00
Jani Heikkinen
095dbc494c Merge "Merge remote-tracking branch 'origin/dev' into 5.11" into refs/staging/5.11 2018-02-10 20:39:02 +00:00
Liang Qi
32b506d1db Merge remote-tracking branch 'origin/dev' into 5.11
Conflicts:
	src/corelib/tools/qvarlengtharray.qdoc
	src/corelib/tools/qvector.qdoc

Resolved documentation changes in favor of 017569f702,
which keeps the move overloads along with its const-ref sibling.

Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79
2018-02-10 15:55:52 +01:00
Christian Ehrlicher
dc9ce275be QStyledItemDelegate: fix drawing elided multi-line texts
QCommonStylePrivate::viewItemDrawText did not handle multi-line text
correct when one of the lines must be elided. All text after the first
elided line was not drawn at all.

Task-number: QTBUG-14949
Task-number: QTBUG-57891
Change-Id: I2b7137f8f09001c1e0cdbdb10f784c4be433d0d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-10 13:19:06 +00:00
Christian Ehrlicher
7ab7f97881 QList/Table/TreeWidget: remove vc6 workaround
There was a typedef used for comparisons of the items which was for
VC6 according to the comment. Replaced the typedef with auto and did
a testcompile with MSVC2015 - worked fine.

Change-Id: Ibdbc2332d49d2dd533ab35180f49c9dcd143c627
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-10 13:19:03 +00:00
Christian Ehrlicher
85f6dd8325 QTreeWidgetItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTreeWidgetItem setData() function

Change-Id: Ife87e9e046621b464ad340bd9eb451355730e93c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-10 13:18:57 +00:00
Tor Arne Vestbø
0b48fcee70 testlib: Don't set QT_LOGGING_TO_CONSOLE
QtTestLib has its own message handler installed via qInstallMessageHandler,
so there is no need to set QT_LOGGING_TO_CONSOLE to force stderr output,
as that's what QPlainTestLogger::outputMessage uses anyways.

And in the case of using other testlib outputs such as XML, we're not going
to hit any of the code paths that would check QT_LOGGING_TO_CONSOLE.

The only relevant exception is Windows, which checks stderrHasConsoleAttached(),
which is affected by QT_LOGGING_TO_CONSOLE, but Qt Creator actually has an
explicit inversion of this existing code, to prevent it from setting
QT_LOGGING_TO_CONSOLE, so that output ends up in OutputDebugStringA
and can be read and distinguished from the debugger's output.
See QTCREATORBUG-16161.

Change-Id: Ia8a9b00b221ec5691b52485586f172c9261bf299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-10 12:54:52 +00:00
Anton Kudryavtsev
f9fa3e2553 QImage: use rvalue overloads more
Change-Id: I4e5e1199d1bf460c58a75fbc06b91ec5a71c49f9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-10 10:45:20 +00:00
Tor Arne Vestbø
24a93798b8 logging: Use !QT_BOOTSTRAPPED instead of QT_BUILD_CORE_LIB
The former is the preferred way in Qt to exclude code that shouldn't
be built for bootstrap tools. For qlogging.cpp this includes the
bootstrap library, and qmake, both of which have QT_BOOTSTRAPPED
defined.

Change-Id: I94b669aae308786eded92b30b5e3f63add069756
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-10 02:49:30 +00:00
Gabriel de Dietrich
bd80f00f84 QMacStyle: Fix crash when using Freetype font engine
This amends cf7a4016a1.

Change-Id: I8bb3e934d10b2f522539b73ceaa80a9a4608ef12
Task-number: QTBUG-66248
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-09 19:49:44 +00:00
Tor Arne Vestbø
ad8a3e3530 logging: Group alternate logging sink implementations
Change-Id: Iac703559658edf16c56f4c54cf71cd6188d1db4e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-09 19:45:46 +00:00
Tor Arne Vestbø
4962b0bee9 macOS: Don't log missing forwarding target during notification forwarding
The missing targets are coming from NSViews that we haven't created, such
as the _NSThemeCloseWidget, and are just noise in the debug output.

Change-Id: I71ae1267460739969511bf4de946bcc7ca897e7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-09 13:30:17 +00:00
Alexander Volkov
5a868fe0bb xcb: Drop _QT_SETTINGS_TIMESTAMP_ atom
It was used in Qt 4 to make applications reload Trolltech.conf,
which is not supported by Qt 5.

Change-Id: Ic75c117f22a23a8f26b3f19ce57322878613f5b0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-08 21:35:39 +00:00
Andy Shaw
c48f4bde00 Set the ellipseDiameters back to the original size in QGraphicsView
When calling setSceneRect() on a QTouchPoint it will cause the
ellipseDiameters to be changed, whereas this should not be affected by
the scene rectangle as it should be in logical pixels.

Also add a manual test for visually checking the ellipse diameters on
various devices.

Change-Id: I1ee9207cb1a63cfef33fe904594c73aba221af5c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-08 21:25:01 +00:00
Andy Shaw
83b0abf928 Use the right attribute when checking if shortcuts are shown
Change-Id: I784965dda64551e6093af817881aa6472d2cc226
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-08 21:24:50 +00:00
Andy Shaw
6c6ace9d23 psql: Improve performance of record()
In order to save having to always run a query to get the tablename for
a known oid then we cache the result on the driver side. The oid stays
the same while the table exists, so only on dropping it would it change.
Recreating the table causes it to get a new oid, so there is no risk of
the old one being associated with the wrong table when this happens, if
the driver is still open at that point.

The benchmark added shows the improvement from the previous code, before
the results for PostgreSQL was:

RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
     259 msecs per iteration (total: 259, iterations: 1)

whereas now it is:

RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
     0.000014 msecs per iteration (total: 59, iterations: 4194304)

Task-number: QTBUG-65226
Change-Id: Ic290cff719102743da84e2044cd23e540f20c96c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-08 18:24:48 +00:00
Anton Kudryavtsev
a36031ace3 QPixmap: use rvalue overloads more
Change-Id: Icf19d20bf46f575ba020e308e0822164ed9924cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-08 17:40:38 +00:00
Tor Arne Vestbø
fe5ba70e55 Prevent duplicated log output when using alternate logging sinks
3d02e75c07 was too quick, and didn't account for the fact that the
old code had early returns for each alternate logging sink, so when
removing the qt_logging_to_console() check, we would end up writing
debug output twice.

This is due to e.g. Qt Creator running the application without a
console, so qt_logging_to_console() returns false, so we end up
in e.g. the win_message_handler(), calling OutputDebugString,
but then we unconditionally print to stderr, which Creator
also reads, so we end up with duplicated log messages.

Change-Id: I91573828576608643477ae27d36d7e819f92985d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-08 16:59:17 +00:00
Tor Arne Vestbø
7ec9813490 Fix inverted logic in slog2 log handler for when to disable logging
If we are logging to the console, we should _not_ log to slog2, like
the other log backends.

Change-Id: I6d16704c0f0923f54b3dc030d374af9805c2af06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-08 16:59:16 +00:00
Adam Treat
36171af399 Make use of our egl convenience code for QNX QPA
This fixes various problems that occur because the current egl context
assumes OpenGL ES 2.0 and does not support newer versions of ES.

Task-number: QTBUG-64306
Change-Id: I81466ba5cf028b47ca5a2ebcdc702167aff655a2
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2018-02-08 01:28:41 +00:00
Johan Klokkhammer Helsing
96bf3b7a74 eglfs_kms_vsp2: Try to recover when failing in the middle of a blend
Blending can fail if one of the input buffers is destroyed in the middle of the
streaming operation. In that case, turn streaming off so blending can be
attempted again after disabling the input.

Change-Id: Id5c82b22a2ed0858ab20902395830efa0e64177d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-07 20:29:34 +00:00
Jake Petroules
ae273bcf42 libjpeg: silence warnings with clang as well as gcc
The check was broken anyways since the compiler filename is not
guaranteed to be "gcc" in all cases when using GCC.

Change-Id: I9f242ef26c6fea6d2fedda0391f8c7bef264f1ef
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:34 +00:00
Jake Petroules
2af3cb4436 Add missing override keywords
Change-Id: Id4fe5ffb27dbd3e96add0e87c1679b5b1ff76545
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:28 +00:00
Richard Moe Gustavsen
75c22d4598 QCocoaWindow: be more careful when flushing events
Flushing the QPA event queue is problematic since we can then end up
delivering several events to Qt (or the app) at the same time on the
call stack. This again can easily leave objects in an inconsistent
state if they receive callbacks from subsequent events while being
occupied processing the first.

This is also what happens in the listed report. A QMenu shows
a sub menu when the mouse enters a menu item. The show leads to
QPA flushing events, which in some cases also includes flushing
another pending move event. The move event is delivered to the
same QMenu, which will clear a private variable (currentAction).
When the show returns, the state of QMenu has unexpectedly
changed, which causes a crash to happen since currentAction is
null.

This patch will fix the root cause of the problem by
stopping QCocoaWindow from flushing user input events when
the call location does a flush to deliver geometry events.

Task-number: QTBUG-66093
Change-Id: Id277550b0a080ad98c81e8c30dc7098dc73723d5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-07 16:12:53 +00:00
Morten Johan Sørvig
f5c3d48c99 Cocoa: Support DnD to the Trash
Map Qt:MoveAction to NSDragOperationDelete, in addition
to the existing NSDragOperationMove mapping.

From the point of view of the source there is no difference
between Move and Delete; the source copy should be
deleted.

Task-number: QTBUG-63794
Change-Id: Iea5abe31efe0320dad150d243544f25167b3d18c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-07 13:49:11 +00:00
Morten Johan Sørvig
c223fdd917 Cocoa: move setting of drag accepted state
performDragOperation:sender is called when an application
window receives a drop, either from an application
sourced drag or from a foreign drag.

draggingSession:endedAtPoint:operation is called when
an application sourced drag ends, either on an application
window or on a foreign window.

Update the drag accepted state when the session ends
in order to handle DnD from the application to a
non-application window.

Task-number: QTBUG-63794
Change-Id: If3e16ed6a086c5d051e7390e3ecf16ea210221ad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-07 13:48:35 +00:00
Liang Qi
3061730c2a Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/cocoa/qcocoamenu.mm

Change-Id: I11c5f8466c5b51e13e5ef6a8fc6e3f2dd79122a7
2018-02-07 14:45:46 +01:00
Andy Shaw
3d35501591 Update bundled sqlite to 3.22.0
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.22.0

Change-Id: I341c1cabfdd43fac45406c00c33c193ef4bcf402
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-07 12:23:18 +00:00
Edward Welbourne
6d3e5ac6d2 Prefer ICU over system info on MS-Win
The ICU data is more complete; and its APIs allow it to tell the whole
story, which MS-Win's APIs can't (e.g. Morocco's otherwise-normal DST
has a hole in it for Ramadan; when this makes four transitions in a
year, the MS-APIs can't report more than two, so ignore the Ramadan
gap); and their design obliges us to use heuristics to kludge round
mis-description of simple changes to standard time in non-DST zones,
which can't be distinguished from certain (more) obscure cases of
changes to DST coinciding with a change to standard offset (causing a
DST transition to hide, leaving its other end *looking like* a non-DST
change to standard offset).  Using ICU, when available, reduces how
many end users shall be mislead by such kludges.

[ChangeLog][Windows][QTimeZone] Changed MS-Win to use ICU for
time-zone data, when available, in preference to MS's TZ APIs.  The
choice is made when building Qt.  This will give reliable results when
non-DST transitions arise, or when a zone's DST is not simple
(e.g. interrupted by Ramadan).

Task-number: QTBUG-42021
Change-Id: I9cdd65713ecdaf8cce52dd924fbc7371630977c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-07 12:21:00 +00:00
Anton Kudryavtsev
aec6fae60b Add overloaded QBitmap::fromImage that takes QImage rvalue
... and use it.

[ChangeLog][QtGui][QBitmap] Add overloaded QBitmap::fromImage that takes QImage rvalue

Change-Id: Idb6e6bb1645371996700349714041cc54bb3d005
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-07 12:10:32 +00:00
Frederik Gladhorn
806c6abadd Mention Qt Creator is compatible with testlib
Change-Id: Iea32858a7ae5d7450682a18247a76830b42a4ae4
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-02-07 12:01:52 +00:00
Tor Arne Vestbø
ce8e72d040 Android: Defer initialization of logging rules until qApp construction
On Android, we load the application library, and its dependencies (Qt),
on Android's main thread (thread 0), and then spin up a secondary
thread (thread 1), that we call main() on.

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

 QApplication was not created in the main() thread

This situation can easily lead to a crash as well.

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

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

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

Task-number: QTBUG-65863
Change-Id: I95675731d233244530d0a2a1c82a9578d5599775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 538b1b5076)
2018-02-07 11:19:44 +00:00
Tor Arne Vestbø
efd5d7a837 CoreText: Make sure to keep reference to data when cloning raw font engine
QFontEngine::cloneWithSize() is used by QRawFont internally when switching
a raw-font from one size to another using setPixelSize. For CoreText, we
use a subclass of QCoreTextFontEngine to keep track of the QByteArray data
of a raw-font, but failed to overload cloneWithSize, so we would lose the
data whenever setPixelSize was called, resulting in missing text rendering
in QtWebKit. We now retain the data as we should.

Task-number: QTBUG-65923
Change-Id: I7d4186a3c32a61d48d1e9388e43f2792e8e46081
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-02-07 10:41:12 +00:00
J-P Nurmi
fef6b31b99 GTK: fix menu positioning on high-DPI
The target position is passed in physical native pixels, so call
QPlatformWindow::mapToGlobal() instead of QWindow::mapToGlobal().
The latter operates on logical pixels.

Task-number: QTBUG-55251
Change-Id: I789128a0a345d4113fced82ed1b215fe14044634
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-07 05:59:52 +00:00
Oliver Wolff
0307bfea31 ANGLE: Remove workaround for files having the same name (Debug.h/.cpp)
With object_parallel_to_source the workaround of making copies of the
files and using these is no longer needed.

Debug2.h and .cpp were added to the repository by mistake and should not
have been there in the first place.

Task-number: QTBUG-66059
Change-Id: Ib9dbd15be1dee1cb5190762fe06bad56dd40dd47
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-02-06 06:17:39 +00:00
Allan Sandfeld Jensen
fd80b8aaeb Unalias some core drawhelper loops
Some compilers will assume src and buffer are different and only
vectorize the unaliased case and take a slow path when they are equal.
In our case they are as often equal, so we need to manually unalias the
variables to make sure both cases are fully optimized.

Change-Id: I6ec86171dd179844facdf45376253c55980d9e36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-06 01:28:16 +00:00
J-P Nurmi
1cc15c4b6d QComboBoxPrivate::showNativePopup(): Scale target rectangle
The QPlatform* classes operate in native pixels.

Task-number: QTBUG-55251
Change-Id: I80490fa802fbc77a1e02c176528cc047630f9a7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-05 21:35:21 +00:00
J-P Nurmi
1ffc6ba402 macOS: fix menu positioning on high-DPI
The target position is passed in physical native pixels, so call
QPlatformScreen::availableGeometry() and QPlatformWindow::mapToGlobal()
instead of QScreen::availableSize() and QWindow::mapToGlobal(). The
latter two operate on logical pixels.

Task-number: QTBUG-55251
Change-Id: I281f47baee727bc0f4738fd6d6cdf12c9f462b0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 21:35:15 +00:00
Gabriel de Dietrich
2cb1db6437 Document several WA_Mac attributes as obsolete
All of these had already no effect.

Cleaned up a bit of code around old Qt 4 #ifdefs and
documentation mentioning Carbon.

Change-Id: Id2858c56a5785f82c47e20e1e760743fb4d08189
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:24 +00:00
Gabriel de Dietrich
4a55eb0e3a QMacStyle: Remove call to HIThemeDrawSeparator
It looked inverted for some reason. A single line looks
better than before.

Change-Id: Icb214b44ddcc6e9e57fe12e7b4c3f512a5f66452
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:15 +00:00
Gabriel de Dietrich
14c4fe8037 QMacStyle: CE_DockWidgetTitle is now HITheme-free
Change-Id: Id2e23d37e9b87f89fc40e0d774c628eec91a986e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:08 +00:00
Gabriel de Dietrich
3de8e74d77 QDockWidget: Use theme font for title
While the QPA theme provides support for dock widgets
title font we never use it.

This is a very similar solution to what we do in
QMdiSubWindow, setting the platform theme font at
few specific points.

This patch also fixes the dock window title font on
macOS, as queried in QCoreTextFontDatabase.

Change-Id: Ie264e4e83e0d3d1e8f78bd378359f3063cc1d525
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:03 +00:00
Gabriel de Dietrich
347cfa00a2 QMdiSubWindow: Hide "system" menu icons on macOS
Not only they should not appear (icons in menus is a special
thing on macOS), they don't match the look on the window frame
buttons. So, it's better to hide them completely.

Change-Id: I8814ed3e128480abff4f53fdd40a0bb13f1796ef
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:44:57 +00:00
Gabriel de Dietrich
8633e1a7b4 QMacStyle: QMdiSubWindow is now HITheme-free
There are a couple issues. Because the actual class for
the buttons returned by +[NSWindow standardWindowButton:
forStyleMask:] is private, we can't fully configure them
as we could with HITheme. Therefore, we don't get the
mouse hovered state and the zoom button will show the
fullscreen arrow instead of the '+' icon.

Hopefully, QMdiArea will go the way of the dodo soon
enough. It is not a thing on macOS and it has been
replaced by tabbed windows UI on most desktop apps.

Change-Id: Ia581f72611ad0224f42657afbc4d9f94bf5e5a3a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:44:50 +00:00
Gabriel de Dietrich
80515c811a Introducing SH_SpinBox_ButtonsInsideFrame
This is currently only used in QMacStyle since,
on macOS, the spin-box buttons are always beside
the line-edit. Hence, there is no need to tamper
with the line-edit frame.

Change-Id: I8ccfbab547fccae89a8ddeaeb7005cb17d5951e6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:44:35 +00:00
Gabriel de Dietrich
3d29a0dd74 QMacStyle: CC_SpinBox is now HITheme-free
Bonus changes in this edition:

    * The focus frame shows only around the spin-box's
      line-edit, as it should. This requires getting
      access to the spin-box's line-edit, which we do
      by setting a property on the former. Notice that
      the stepper doesn't get focus. On this point,
      macOS is inconsistent (partly because there's no
      such thing as an NSSpinBox, and partly because
      spin-box buttons are a separate control), so we
      copy the same focus behavior as NSDatePicker.

    * We clean some QFocusFrame related dead code in
      QMacStyle::event().

Change-Id: I204ca2093d9db343c78f0420811dda35c463bbcd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:43:49 +00:00
Tor Arne Vestbø
3d02e75c07 Unconditionally log to stderr, regardless of qt_logging_to_console()
Regression after 114f795221, which incorrectly assumed that checking
qt_logging_to_console() was a safe behavior change to include.

Unfortunately that broke debug output in Qt Creator, as Creator doesn't
seem to run applications with a controlling TTY unless it itself was
started with one, and doesn't set QT_LOGGING_TO_CONSOLE to force log
console output either.

Task-number: QTBUG-66153
Change-Id: I775cb06953122a3f20c16bfe21e19de2d1aa5b52
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 19:30:09 +00:00
Thiago Macieira
64a3bba7b8 QVariant: convert QDateTime and QTime to string with milliseconds
This way, it's lossless.

This commit is a cherry-pick of ab1e507574,
which was reverted.

[ChangeLog][QtCore][QVariant] Conversions of QDateTime to strings now
contain the millisecond components.

Change-Id: I5e421e32396d44e4b39efffd150b744e40fff3a1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-02-05 18:48:59 +00:00
J-P Nurmi
57f4521c99 Fix QXcbWindow::mapFrom/ToGlobal()
Call the base class implementations to avoid returning an unmapped
values for non-embedded windows.

Task-number: QTBUG-55251
Change-Id: Ib05fd530498dd4d72d3d4ef37caf4e2f0ebcd2e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-05 18:21:21 +00:00
J-P Nurmi
756ebcd93a QGtk3Menu::showPopup(): fix off by one error in the y-coordinate
QRect::bottom() != QRect::y() + QRect::height()

Change-Id: I83ae19ab588fb9651354999679f5d3c9e294a97e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-05 18:21:13 +00:00
Christian Ehrlicher
076087717e Documentation: Update CommonTableModel/StringListModel snippets
Update CommonTableModel/StringListModel snippets:
  - 0 -> nullptr
  - use 'override'
  - replace "" with QString()
  - use QStringLiteral instead QString
  - pass role to dataChanged() signal

Change-Id: I5949d1bd6fee3186f12191f1f6235ae18908096e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-05 17:06:43 +00:00
Tor Arne Vestbø
28cf5ae000 macOS: Share view update code between layered and non-layered mode
Change-Id: I8eaf0607c1ede18ed20180fd43cc93744c99962d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 16:27:59 +00:00
Tor Arne Vestbø
35f6f530bf iOS: Simplify logging of QUIView/QIOSWindow
Automatically printing the relationship between the view, platform
window, and window, makes it easier to track each object across
events.

Change-Id: I9fbfaa5c304849ed99dba3b5cd8e7449105d0307
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 16:27:57 +00:00
José Millán Soto
a0717c60b3 Handle coordinates related to component window
AtSpiAdaptor::componentInterface was not checking the coordinate type in
GetAccessibleAtPoint.

Now, if the coordinate type is ATSPI_COORD_TYPE_WINDOW the coordinates of the
window will be added to the specified coordinates.

Change-Id: Iba571109a8da300f4141d616a94ef4ac87918f98
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 16:13:01 +00:00
Sergio Martins
cf1b732e21 Introduce QT6_VIRTUAL and QT6_NOT_VIRTUAL macros
To avoid QT_VERSION_CHECK ifdefs

Change-Id: I364903964c72f4df19b8b7c10c19b82d24f63600
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-05 15:54:34 +00:00
José Millán Soto
2e0849e79c Use placeholder text for accessible description of QLineEdit
If the accessible description of a QLineEdit is requested and none has been
set, the placeholder text will be provided if one is available.

Change-Id: I4c0dad1d06fd3d8a6e00c963402d380c59bd7f05
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 15:41:29 +00:00
Albert Astals Cid
10b9ff0a4d Remove QCupsPrintEnginePrivate::setupDefaultPrinter
it was declared but never used

Change-Id: Iededb2943759cd2d66de95bcc1758dbcc4283ee3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 13:53:33 +00:00
Albert Astals Cid
fadaf7053d Remove QPlatformPrinterSupport::createDefaultPrintDevice
no one uses it

Change-Id: I03d0350a44a19545d57b47d1b21d85f1a2059f4d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 13:53:24 +00:00
Tor Arne Vestbø
f4765ff5f6 Modernize logging in CoreFoundation and iOS event dispatchers
Instead of manually handling logging enablement, we use Qt's categorized
logging system.

Change-Id: I8d942601f76876030084c9fb130b7215ff6cc404
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 13:31:06 +00:00
Tor Arne Vestbø
b1fe198d87 Simplify how we set thread name for UNIX threads
Passing on the thread ID is confusing, as it's not really what the
function does. The QNX code path can resolve the thread ID by itself.

Change-Id: I5f0d54621058576cdcf3707d36a11762fe2383c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 13:30:53 +00:00
Johan Klokkhammer Helsing
3058e21af0 eglfs_kms_vsp2: Add support for setting layer alpha
Exposed through QEglFSFunctions::vsp2SetLayerAlpha.

Change-Id: I2a600971d5a2aa56d4bf7cde03df3323f17249cd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-05 13:12:01 +00:00
Andre Hartmann
6197df32ec QString: Add whitespace handling note to number conversion functions
Copied from QLocale::toFloat and companions.

Change-Id: Ic3a13a87cfc1ce34de9dd7d7e7b303ef103c384a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 08:55:13 +00:00
Andre Hartmann
9a74cbf473 QString: Wrap extra-long comment line
Change-Id: I77c95e99fd23eb914d7e86ee003d7f487c57f0f0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-02-05 08:55:07 +00:00
Anton Kudryavtsev
74045f8b9a Use new QString::remove(QLatin1String)
Change-Id: I5b3560709a8fb230a177511c701fd0bf25938f0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 08:21:22 +00:00
BogDan Vatra
38c6d10bc8 Say hello to ImhNoEditMenu & ImhNoTextHandles
The actual implementation for Android will come later.

Change-Id: Ia68fcb03ea5d769d302ec6f77e5666292b567ffa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-02-05 06:59:40 +00:00
Thiago Macieira
ea6675374f QString: fix comparisons to null strings in ucstricmp
Commit 8f52ad9fe0 ("ucstricmp: compare
null and empty strings equal") made sure empties and nulls would compare
equally, but may have broken the null vs non-empty comparison (which was
not tested). The commit message also said that it expected all callers
to handle null before calling into those functions, but that's not the
case for QStringView created from a null QString: the incoming "a"
pointer was null.

So just remove the checks for null pointers and rely on the size checks
doing the right thing.

[ChangeLog][QtCore][QString] Fixed a regression from 5.9 that caused
comparing default-constructed QStrings to be sorted after non-empty
strings.

Task-number: QTBUG-65939
Change-Id: I56b444f9d6274221a3b7fffd150c83ad46c599b6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-04 17:24:59 +00:00
Liang Qi
599b708f12 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-02-04 14:30:16 +00:00
Thiago Macieira
403343039d Suppress GCC 8 warning about realloc() non-trivially-copyable types
But they are movable.

qxmlstream_p.h:654:32: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘struct QXmlStreamPrivateTagStack::Tag’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess]

Change-Id: I41d006aac5bc48529845fffd150e8115eb852034
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:34:03 +00:00
Thiago Macieira
c26c5b7d0d Silence GCC 8 warning on memcpy of movable types
This is similar to commit 342bb5b03a.

From GCC 8:

qarraydataops.h:84:17: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QStringRef’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
[etc.]

Change-Id: I41d006aac5bc48529845fffd150e817e64973bec
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:33:59 +00:00
Thiago Macieira
1514b4e853 Silence GCC 8 warning on memcpy of class Value to to class offset
From GCC 8:

error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of type ‘QJsonPrivate::offset’ {aka ‘class QSpecialInteger<QLittleEndianStorageType<unsigned int> >’} with ‘private’ member ‘QSpecialInteger<QLittleEndianStorageType<unsigned int> >::val’
from an array of ‘const value_type’ {aka ‘const class QJsonPrivate::Value’}; use assignment or copy-initialization instead [-Werror=class-memaccess]

Both types are standard layout and have the same initial sequence (one uint
member), so this is a valid copy. The only difference between the two is that
QSpecialInteger has a private member, whereas in the bitfield it's public.

Change-Id: I41d006aac5bc48529845fffd150e80585fd24db7
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:33:56 +00:00
Alexander Volkov
6f03740a19 QPlatformWindow: add startSystemMove()
It can be used by custom widgets or for example by
the Breeze style from KDE, which allows to drag windows
by some widgets.

It's important on X11 because _NET_WM_MOVERESIZE requests
induced by touch sequences require support from Qt.

Task-number: QTBUG-58044
Change-Id: I31c37534555a9050cf361cad85bdef13c2808572
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-04 08:25:19 +00:00
Thiago Macieira
a16d0074b9 QUtf8: Add some UTF-8 text operation functions
The first, isValidUtf8(), as the name says, returns true if the string
is valid UTF-8. As a bonus, it also returns whether it's valid US-ASCII.

The other two are meant to compare an UTF-8 string to either a Latin1
one or an UTF-8 one, without memory allocation.

Change-Id: Ic38ec929fc3f4bb795dafffd150ad0d63e28cd32
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-03 21:31:57 +00:00
Thiago Macieira
687dc7fac7 QUuid: add a way to get the string form without the braces
While we're at it, add a way to get it without the dashes too. I'm
calling it "id128", as in "128-bit ID", as seen in journald's sd_id128_t
type and the sd_id128_xxx() API.

[ChangeLog][QtCore][QUuid] Added a parameter to both toString() and
toByteArray() to allow controlling the use or not of the braces and
dashes in the string form.

Change-Id: I56b444f9d6274221a3b7fffd150cde706cfc5098
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-02-03 21:30:37 +00:00
Martin Smith
017569f702 doc: Add missing \fn commands for new members
New members were added to QVarLengthArray and QVector,
but the engineer didn't document them. Since they are
only slightly different versions of existing functions,
their \fn commands were added to the eisting qdoc comments.

Some defined(Q_CLANG_QDOC) uses were also added.

Change-Id: I8a5505ca27efc9205b1387ed0be310e4b74ec490
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:26:07 +00:00
Martin Smith
f1eb4c4463 doc: Add tests of Q_CLANG_QDOC
Some defined(Q_CLANG_QDOC) uses were added.

Change-Id: I5688fee0d0d8f00bb97e3e63bd02a68ddbfdda11
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:52 +00:00
Martin Smith
edc6d4f914 doc: Add qtlinguist to depends for QtWidgets
QtWidgets has one link to the linguist manual, so it needs
to see the3 index file for qtlinguist.

Change-Id: I2bbbc4cc9e6d43fed1b6cdee556bc9c4d5f01299
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:38 +00:00