Commit Graph

26714 Commits

Author SHA1 Message Date
Andre Hartmann
f371b1cc8d QDomNode::replaceChild(): Fix documentation typo
Change-Id: Ib530ebc926aa2c6779b0e02878f92664022b6bcf
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-03-16 06:34:13 +00:00
Gabriel de Dietrich
0c059db57d QMenu: Realign submenu first action with its parent menu action
There was an offset equivalent to all the margins we add to
the action rectangles. We need to subtract it in order for
both menu items, parent and sub-menu, to be aligned. This
amount is given by the sub-menu's first action position
relative to its popup.

Change-Id: I141bbe3cfb81825a25b12e4059b93e61c29df518
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-16 00:13:28 +00:00
Thiago Macieira
2fb706f9a8 QIpAddress: reject IPv6 addresses with more than 4 hex digits
Matches glibc commit 9a0cc8c1bd7645bf3c988890ffb59639c07a5812.

[ChangeLog][QtCore][QUrl] Fixed a bug in parsing IPv6 addresses with
more than 4 hex digits in a component.

[ChangeLog][QtNetwork][QHostAddress] Fixed a bug in parsing IPv6
addresses with more than 4 hex digits in a component.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9a0cc8c1bd7645bf3c988890ffb59639c07a5812

Change-Id: I2701038131d91eb108aebb3bec16278e4efe3de2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-16 00:01:53 +00:00
Alexander Akulich
53f82185e9 QFusionStyle: Fix compilation when qreal is float
Change-Id: I575d348915a7239a40b589012b4e9707bd15d1dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-15 23:51:49 +00:00
Tor Arne Vestbø
f816f2e3c9 Allow log messages to be grouped by activity on Apple OSes
Useful for making sense of the event dispatcher, especially when running
tests.

Change-Id: Iea84bcfb40d4954439c2e31ffc0197c64907e800
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-03-15 23:01:03 +00:00
Qt Forward Merge Bot
8264e495fa Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
2018-03-15 01:00:11 +01:00
Thiago Macieira
8eb3944dac Disable statx(2) and renameat2(2) system calls on Android
Many Android systems come with a locked down system call list, causing
the statx(2) system call to fail with an unexpected error code or by
delivering a signal to the application. Because of the signal, we can't
do runtime detection...

This is not our bug: it's obviously a mistake in the SECCOMP rules in
Android. But we work around the issue.

Unfortunately, because of a few manufacturers who can't configure their
rules properly, everyone will suffer.

Task-number: QTBUG-64490
Change-Id: I39332e0a867442d58082fffd1507a49415917384
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-03-14 19:26:02 +00:00
Alexander Akulich
96ba39b1ee QFlatpakTheme: Cleanup the code
There is no codepath that can result in d->baseTheme being nullptr.
Remove the checks and get rid unneeded and sometimes dangerous fallbacks
(createPlatformMenuBar(), showPlatformMenuBar() and three more methods
could overflow the stack because of infinity recursion).

Change-Id: Ib03adadf56c169286de42671e2da506502df7aea
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-14 19:25:22 +00:00
BogDan Vatra
80f52812f2 Hide cursor handle after ~4s on inactivity
When the VK is hidden keep cursor handle the cursor handle visible for
~4s after user last activity.

Task-number: QTBUG-66806
Change-Id: I8122c5886efaeee86bb691ad971aa7a3e3d7f8e1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-14 18:24:29 +00:00
BogDan Vatra
f6fd8dceea Remove text selection handles when keyboard is hidden
Task-number: QTBUG-58700
Change-Id: I094f31250ec879b0f08f27499794946cac2084e6
Reviewed-by: Corey Pendleton <corey.pendleton@garmin.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-14 18:24:24 +00:00
BogDan Vatra
288a2ada5b Refactor cursor & selection handles
- turn CursorHandleShowMode in a QFlag for better control
- add ScopedValueChangeBack which is useful to control m_blockUpdateSelection
- implement longPress word selection

Change-Id: Ieed709644db991e10077d5be5d5a59f16f4fc3a8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-14 18:24:18 +00:00
Tor Arne Vestbø
8899074d72 macOS: Remove 'cocoa' infix in QPA logging categories
Makes the naming of QPA logging categories the same across different
platforms, which makes it easier to debug an unfamiliar platform.

Change-Id: I60ed34892d154e86723c8e4bcff3c28fcab1f7a1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-03-14 17:43:00 +00:00
Oswald Buddenhagen
1718efe8fa QByteArray::setRawData(): don't null-terminate initialization from nullptr
it's antithetical to do that, as raw data is documented to be not null-
terminated. QString doesn't, either.

Change-Id: I7ded83a09f64e747a248f9bdac2a364032aae4c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-14 15:37:00 +00:00
Allan Sandfeld Jensen
a93096a770 Fix performance regression in simple a8 non-gamma corrected
Avoid doing the conversion over QRgba64 when we don't need it.

Change-Id: Ic2f82bef0a80b17ef7803eedcdb0600eeac96489
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-14 15:11:14 +00:00
Tor Arne Vestbø
3b42e098ef testlib: Add Test Anything Protocol (TAP) reporter
The Test Anything Protocol (TAP), was originally Perl's simple text-based
interface between testing modules and test harnesses, but has since been
adopted by a large number of producers and consumers in many different
languages, which allows colorizing and summarizing test results.

The format is very simple:

TAP version 13
ok 1 - test description
not ok 2 - test description
  ---
  message: 'Failure message'
  severity: fail
  expected: 123
  actual: 456
  ...
ok 3 - test description # SKIP
1..3

The specification [1] is very brief, so the implementation has been
based on how typical consumers behave, especially when it comes to
the undefined diagnostics block.

[1] http://testanything.org/tap-version-13-specification.html

Change-Id: I616e802ea380165c678510e940ddc6607d39c92d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-14 14:28:36 +00:00
Tor Arne Vestbø
b202ed3c31 Fix bad xfail test incident mapping in Apple test logger
Change-Id: If0c0204805747b16556cbdedf7c76dbb0a1a2193
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-14 14:28:32 +00:00
BogDan Vatra
b30b957552 Android: Fix possible crash
Change-Id: I3362dffe0f30196a2a1eabcffe6cb3b2d52a7785
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-03-14 13:32:20 +00:00
Martin Smith
91b35011f5 doc: Make fromStdVariant() appear in the QVariant docs
This function was not appearing in the QVariant docs because the \fn command
was wrong and because clang was not seeing the declaration in qvariant.h in
the first place. With this update, the function does appear in the docs, but
it's signature is not correct because clang can't find a definition for
std::variant<Types...>, which probably means it doesn't have the most recent
declarations in the std namespace.

Change-Id: I7912ff333e5d4a8619461dd3ab7ee34bcd8f2289
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-14 12:59:35 +00:00
Błażej Szczygieł
a62f1d0356 xcb: Prevent shared memory allocation on every window resize
Allocate new shared memory only when window size grows or when window
size is 2 times smaller than allocated memory size. This improves
window resizing performance and also allows to free some memory if
window becames much smaller.

Change-Id: I3454cd3c6023eede8242d6b29038f4dd6638f9f1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
2018-03-14 12:47:27 +00:00
Laszlo Agocs
00304eac7b Revert "Set sharedPainter correctly for QGraphicsEffect"
This reverts commit 7257862fb2.

It has been reported that this patch causes widgets with certain effects
become invisible.

Task-number: QTBUG-60231
Task-number: QTBUG-66803
Task-number: QTBUG-66387
Change-Id: I9c3c4cf2f17ac639d1aee5489b665aa1e165af16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-14 12:37:53 +00:00
Friedemann Kleint
39d2a11a86 Item views: Fix 5.11 API review findings
Rename getter QHeaderView::firstSectionMovable()
to QHeaderView::isFirstSectionMovable(), turn into a property
and fix \since.

Change-Id: Ica2ca43d22f3fd78ff63178ba75014807fc9b823
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-14 12:23:27 +00:00
Allan Sandfeld Jensen
b64ec6687e Add generic optimized rectfill methods
Also makes the qt_rectfill_quint16 actually work with any uint16 format

Change-Id: Ibb3deed54ee1a0a86b14d5349c95f106ced057f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-13 23:03:53 +00:00
Edward Welbourne
c0272f98df Expand Config to Configuration in method names
Commit f55c73ede2 added various backendConfig methods;
API review for 5.11 pointed out that Config should not be abbreviated.

Change-Id: I3b294b44a030b2a6e4cdd034fa27583c228dfe42
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-13 14:10:50 +00:00
Timur Pocheptsov
f9131b0e17 Fix Darwin OS (but not macOS) build - mark unusued parameter
... with Q_UNUSED.

Change-Id: I3736c179381deb08cec9c2c399aaf8a24d8d7f0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-13 13:20:54 +00:00
Edward Welbourne
4d4c63acba Remove needless #include <sys/random.h> from qrandom.cpp
Tripped over by Alexei Fedotov and brought to light on the developer
list; Thiago says it's a left-over from before reworking to actually
use getentropy() instead of getrandom(); it should no longer be
needed.

Change-Id: Id09b0628e58fa62170a0f0da35b2b121f3fb0172
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-13 12:54:18 +00:00
Laszlo Agocs
a060ee2802 QWindowWindow: Avoid resize events from the ctor
When calling showFullScreen(), the setwindowStates call in the
QWindowsWindow constructor led to generating a resize event. This is
pretty bad for example when QOpenGLWindow is involved since the QWindow's
platformWindow member is not even set yet (handle() == nullptr) so
everything related to OpenGL contexts starts failing (as there is no
underlying platform window yet as far as the QWindow is concerned).

In short, generating geometry changes from the platformwindow ctor is a
bad idea. Use initialize() instead for that.

Task-number: QTBUG-67027
Change-Id: I35d11949213eb21f81b2ff2d4f2282cb36510210
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-13 12:49:54 +00:00
Mikhail Svetkin
aaace8fbdb widgets: Add a QT_CONFIG(messagebox) guard
for initResources in QApplication

Change-Id: Id083edbcba4b348ef78e55c788ea94f85b6f572b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-13 12:33:13 +00:00
Nico Vertriest
e9dc2f1783 Doc: Add doc to Graphics View Flow Layout example
Change-Id: Id3965d099222607cee4252bbb33c6a1e9c17765a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-13 12:07:55 +00:00
Friedemann Kleint
43918feb4a Windows QPA: Fix QWindowsWindowFunctions::SetHasBorderInFullScreen() to work in all cases
- Directly apply the flag in case the platform window exists and
  is in full screen.
- Store as a dynamic property in case the platform window is not
  created yet.

Amends 69839e55c1.

Task-number: QTBUG-41309
Task-number: QTBUG-66557
Change-Id: I162baecfae4d07a5d5b59c5401bdb605faa7ab68
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-13 12:04:11 +00:00
Friedemann Kleint
910cc08f6b Windows QPA: Improve the event logging
Add more message codes and fix the whitespaces in the output:

 EVENT: hwd= 0x280484 WM_WINDOWPOSCHANGED msg=0x 47 et=0x 21e wp= 0 at -2208 -31887 handled= false
->
 EVENT: hwd=0x2204d6 WM_WINDOWPOSCHANGED msg=0x47 et=0x21e wp=0 at -3280,-19633 handled=false

Change-Id: I89a7b3bd328748ef39fe2dcd789497f43e9d4a2a
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-13 12:03:50 +00:00
Allan Sandfeld Jensen
21435e7d04 Remove RGB16 specific bilinear transform
The generic one is better optimized and faster at this point.

Change-Id: Ie7eef2402265183ef4d27a7f0eab5dc801beba7a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-13 10:32:16 +00:00
Tim Angus
5c7f6ee51f QSFPM: Faster row removes
When the source model of a QSortFilterProxyModel has rows removed, a
mapping is performed in order to figure out which corresponding rows in
the sorted and filtered view of the model are affected. In doing so it
constructs a vector of removal intervals which are subsequently used to
emit rowsRemoved signals. In the case where many rows are removed (e.g.
all of them), many removal intervals are identified that are often
adjacent and could be simplified, which is what this patch does. i.e.
instead of emitting 3 rowsRemoved for 0-3, 4-6, 7-12, now a single
rowsRemoved is emitted for 0-12.

Change-Id: Ia503091cc4928378c88257cd8b431582e9ff454e
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-13 09:42:36 +00:00
Johan Klokkhammer Helsing
c6ea77f59d Use QWindow::windowStates() for WindowStateChangedEvent::oldState
WindowStateChangedEvent::oldState is of type Qt::WindowStates and should
therefore be set to QWindow::windowStates() instead of QWindow::windowState()

Change-Id: I6710624dd303642a31bfbb25bc07bf05b921d84c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-13 07:47:45 +00:00
Edward Welbourne
54190595ef Make sure QDir::absoluteFilePath("/dir") includes a drive on MS
QDir::isAbsolutePath(name) thinks any path starting with a slash is
absolute; however, to return a valid absolute path, we need to put a
drive prefix onto such a name. So use QFileSystemEntry::isAbsolute()
for that check (it believes in the need for a drive, or UNC prefix)
and handle the absolute-but-for-drive case when it arises.

Add a regression test and make related changes to existing tests.

Task-number: QTBUG-50839
Change-Id: Id5d2b2586bb1423fa2d9375a298a4bb5241cffe0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-12 18:11:33 +00:00
Allan Sandfeld Jensen
5473535344 Fix scaling precision with large zooms
Avoid using the two fast-scaling paths, while they might not overflow
in this case, they do not have enough precision in their fixed point
math to render accurately.

Task-number: QTBUG-53582
Change-Id: I2e063ee90defbecd79a12a6ce02a74c60d1805df
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-12 11:16:09 +00:00
Qt Forward Merge Bot
6dc1a52b4a Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ic193ccc3e9e3a86e15a002d599c13f35940e1eab
2018-03-12 01:00:09 +01:00
Sergio Martins
f1d2c20a27 Fix ambiguous shortcut warning message
This is done in QAction::event(), not eventFilter().

Change-Id: Idc5d7864d259dcf035543c40c8e7b6acd86bde9b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-11 19:45:37 +00:00
Sergio Martins
99f93cca27 document that QueryWhatsThis is a QHelpEvent
Change-Id: I4240c32287530df6162c07a27b865fb4176103db
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-03-11 19:45:35 +00:00
Christian Ehrlicher
41db3140a9 QRasterPaintEngine: properly initialize flags
QRasterPaintEngineState::flags.non_complex_pen was not initialized in
the ctor which leads to valgrind warnings. Initialize it to false - the
correct value is set within update/ensurePen() before it is really used.

Task-number: QTBUG-66615
Change-Id: If154873ad89903c243662ab1f140f74434a6f88c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-11 18:43:53 +00:00
Friedemann Kleint
52fede55b8 Windows QPA: Output more information when initializing tablets
Add a debug operator for the LOGCONTEXT.

Change-Id: I93d567692f35c69687709800d80bc93487c8f906
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-10 20:36:09 +00:00
Friedemann Kleint
ac6590e0fc Windows QPA: GL: Fix setting the color depths for the GDI fallback
Set the color buffer depths on the PIXELFORMATDESCRIPTOR for
the fallback code path (-platform windows:gl=gdi).

Task-number: QTBUG-66797
Change-Id: Idccd94fdf121803af1c19e34cc86b6f06ca88d90
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-10 20:35:46 +00:00
Friedemann Kleint
88a48192aa Fix 5.11 API review findings in QtNetwork
Rename
QNetworkInterface::maxTransmissionUnit()
to
QNetworkInterface::maximumTransmissionUnit()

Change-Id: I24a80b1317363e8d5da5f251ec908da9a51a6b0a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-10 20:35:16 +00:00
Qt Forward Merge Bot
ffdacff6b0 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia2441257c23169f8ca6a3933b2371255e1ba64e6
2018-03-10 09:22:39 +01:00
Nils Jeisecke
fee8944cbe Allow use of template class instances inheriting from a Q_GADGET in Qml
The Q_GADGET macro cannot be used in templates. It can however be useful
to derive a template class from a Q_GADGET enabled base class to benefit
from type safety features in C++ (e.g. the class could represent an id
or handle for some C++ type).

For proper wrapping of a QVariant with a gadget value in a QJSValue, the
QMetaType::IsGadget flag must be set for the registered template
instance type - which does not happen prior to the fix because
IsGadgetHelper requires qt_check_for_QGADGET_macro to be defined in the
registered class but not in an ancestor class - in other words: The
class must declare Q_GADGET.

To overcome this, IsGadgetHelper/IsPointerToGadgetHelper can now
differentiate between a Q_GADGET flagged class (allowing
automatic registration) and a derived class, e.g. a template class
(forcing Q_DECLARE_METATYPE to be used explicitly).

[ChangeLog][QtCore][QMetaObject] It is now possible to use template
class instances inheriting from a Q_GADGET in Qml

Task-number: QTBUG-66744
Change-Id: I7632ad45cff79fa422b3f852ca0b963f35fab155
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-10 06:12:24 +00:00
Tor Arne Vestbø
73b2dd49c2 testlib: Feed test log messages to Apple Unified Logging
QtTestLib uses its own message handler for plain text logging, so it doesn't
go though the logic in qDefaultMessageHandler that dispatches logging to
alternate logging sinks.

Building on the approach of Android and Windows, we log to AUL from the
plain text logger. A future improvement in this area would be to make
QtTestLib make more use of the infrastructure in qlogging.cpp, but this
is a bigger task and requires a better overview of the requirements.

The AUL code has been isolated into a wrapper, to allow logging both
to AUl and to e.g. the QPlainTextLogger. This is needed so that we
short circuit the plain text logger in case AUL already has handled
printing to stderr.

Change-Id: Iee0c3902190bd081b7ffbaf77c41b3118ce7f6da
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-09 16:31:53 +00:00
David Faure
b767c7363f qxcbconnection_xi2.cpp: fix debug check to avoid confusing debug output
The check on line 972 says lcQpaXInputEvents().isDebugEnabled() so
that debug output was always showing "from 0,0" due to
lastScrollPosition not being set.

Change-Id: I345732e36db05108f70474261c47e78333b57d30
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-09 10:55:38 +00:00
Alexander Volkov
9b7809a43e xcb: Fix FP1616 to int conversion
Divide the whole FP1616 value by 0x10000 instead of dividing
the integer part by 0x10000 and the fractional part by 0xFFFF.
It also makes fixed1616ToInt() consistent with fixed1616ToReal(),
see 7d3f353a5b.

Change-Id: Id76025028c926872b002ef0a1ca8a8bdc2de3e1e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-09 10:45:26 +00:00
Filipe Azevedo
7a1d77b6e4 Make QToolTip always wrap text
This fix issues where long plain text where not wrapping and being
unreadable.

Change-Id: I64d4ce94f7460d00d1722647893bd8f70e5ea8d6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-09 08:03:53 +00:00
Sergio Martins
c082d84d5d Fix QLabel crash if buddy's lifetime is too short
If buddy is deleted then QLabel will still try to deliver the
shortcut event to it, in QLabel::event(), and cras.

Besides connecting to destroyed() which alone fixes the crash,
also hardened it and guarded against dereferencing null buddy,
in the unlikely event of someone adding features to QLabel.

The second part is suitable for backporting to the LTS branches.

Task-Id: QTBUG-66841
Change-Id: Ib6a36a9f99cee31afe1f88eb77f5b6cafb8b1086
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-08 22:36:49 +00:00
Christian Ehrlicher
442c47e132 QTreeView: speedup isFirstColumnSpanned/setFirstColumnSpanned
Change container of spanningIndexes from QVector to QSet to speedup
the isFirstColumnSpanned/setFirstColumnSpanned. The order of the indexes
in the container is not needed and therefore QSet can be used here.
This also simplifies the code a little bit.

Task-number: QTBUG-66714
Change-Id: I1692ca1df751b2b8d26b607faf60ff2b94f6f964
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-08 18:28:19 +00:00
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