Commit Graph

35881 Commits

Author SHA1 Message Date
Lars Knoll
c579f49e2a Fix QML integration of widgets
We need to mark the object as deleted before destroying
it's declarative data, otherwise all sorts of bad things
can happen.

This fixes the qwidgetsinqml autotest in qtdeclarative.

Change-Id: I05a645ebe1ca7a50c8927e3dbd9ebb5aaf369a71
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 3e91625b58)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-23 13:46:55 +00:00
Martin Smith
b458cb312c doc: Make both qEnvironmentVariable() functions visible in the docs
There had been a fake declaration for qEnvironmentVariable() in qglobal.h
thaqt was only visible to QDoc. It was removed in favor of documenting
both the actual declarations of qEnvironmentVariable(), one with a 2nd
parameter for passing a defualt value and one without that parameter.
But the one without the default value parameter was marked internal, so
it didn't appear in the docs.

When both functions were documented with a shared comment, a bug in
QDoc was revealed, because these functions are global, while the shared
comment functionality had only been implemented for class member functions.
Now the shared comment functionality has been implemented for global
functions, so these two functions are now documented with a shared
comment. We can, of course, reintroduce the #ifdef QCLANG_QDOC trick, if
that is pre3ferred.

Change-Id: I41d85def5daa3215a995d7697d064dfae37e8b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-23 13:28:51 +00:00
Friedemann Kleint
994e0e4c36 Windows QPA: Fix Korean IME removing words when using CTRL shortcuts
Ignore the WM_IME_ENDCOMPOSITION message in that case.

Done-with: Tobias Koenig <tobias.koenig@kdab.com>
Task-number: QTBUG-58300
Change-Id: I9506754a149905222a324b85634964fce398d3ac
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-04-23 12:57:43 +00:00
Kari Oikarinen
12559058b0 tst_QFile: Don't expect Windows HANDLE equality in nativeHandleLeaks()
That check is flaky on Windows. It doesn't seem to be testing Qt functionality.
I also don't see CreateFile2() documentation mentioning any guarantees that
opening the same file twice would give the same HANDLE each time.

Change-Id: Ica2e60571ae9fc39bf822803a2a9dd6add8323d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-23 12:45:32 +00:00
Kai Koehne
7b87bdff1a Doc: Mark local functions in qlogging.cpp as internal
This fixes qdoc warnings introduced by 67d5f79fe6.

Change-Id: I4b199e6243d9a7706befe4bc9549c78c11026d9e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-23 06:27:57 +00:00
Kai Koehne
a69a3594e2 Doc: Advocate use of std::initializer_list constructor in Q[String]List
We're relying on C++11 since a while, so lets not advertise creating
lists of strings with operator<<() anymore.

Change-Id: I14a3442ff852ac2c106d90c63504eb9ebb737609
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-23 06:27:40 +00:00
Peng Wu
e555c03a42 Style sheets: Include margin while calculating QHeaderview section size
Align with QCommonstyle QHeaderview section size calculation.

Change-Id: I4c11e1881f48850ace3bdbb3c96f999cc298c91e
Task-number: QTBUG-56457
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-04-22 19:30:20 +00:00
Tor Arne Vestbø
070aec28e6 qmake: Fix prl lookup for suffixed frameworks on Apple platforms
We need to take into account the presence of a possible ',_debug' suffix.

Change-Id: I5655394b78723bbc6cc32e56849acc2366d288e2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-22 17:10:23 +00:00
Mårten Nordheim
2fe80ed203 QSslSocket: Call transmit when encrypted on WinRT
Once connection is established the socket emits 'connected', and then
you can start writing. But it will end up in the write-buffer and won't
get sent until 'transmit' is called. Some code (e.g. QWebSocket) relies
on QSslSocket transmitting once it's encrypted. This is done in the
OpenSSL backend but was not done in the WinRT backend.

Task-number: QTBUG-56558
Change-Id: I8cf5d3257f3597a4bb80f35369490a3816506a34
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-04-21 12:16:16 +00:00
Andre Hartmann
9aced25ab5 QByteArray: Use nullptr for "Safe and portable C string functions"
Change the documentation to use nullptr and modify the related code
also while at it.

Change-Id: I6264a254828159cda54e90393835ea04e131350b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-21 06:07:31 +00:00
Andre Hartmann
bca1d8c382 QByteArray: Add a note regarding overlapping pointers to qstr(n)cpy
Stated e.g. in http://en.cppreference.com/w/c/string/byte/strcpy

Change-Id: I42fd5a5fa6a63b67a7105aa56e93e3d3f2193cf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-21 06:04:22 +00:00
Friedemann Kleint
a38c46ad85 Windows QPA: Fix ambiguous shortcut overload warnings for ALT-keys
Use the match with the least modifiers (prefer Shift+9 over
Alt + Shift + 9) resulting in more missing modifiers.

Task-number: QTBUG-67200
Change-Id: I90463c0dfaadda29dcd24a08ba35c91fac8bd04c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-04-20 21:37:39 +00:00
Friedemann Kleint
a0a22037cd Windows QPA: Fix duplicate/missing native events
Add utility functions to QWindowsContext input messages sent to
native event filters (event dispatcher and window system interface).

Do not send input and similar events to the event dispatcher since
QEventDispatcherWin32::processEvents() also sends them.

Note though that QEventDispatcherWin32 does not receive all windows
messages.

In QWindowsKeyMapper, send the WM_CHAR/WM_IMECHAR events from
where the messages are removed.

Task-number: QTBUG-67095
Change-Id: I5f61294fcb3aee7e0eacd840a2010d128cd02a5d
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-04-20 21:37:27 +00:00
Anton Kudryavtsev
ab6cc41968 QTabWidget: clarify ownership after insertTab() and addTab()
Change-Id: I7cd3aa5c092c99bbafd09c4bea7c6824d0b6740a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-20 10:40:37 +00:00
Mirko Vogt
a8f73a1624 configure: mention -libudev in help output
amends 684a1559f.

Change-Id: I25fd5f096e99937382048e2eb763715b9578a8fb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-20 10:38:03 +00:00
Oswald Buddenhagen
cf204590ea Merge 5.11 into 5.11.0
Change-Id: I11c61dc1259ed66d871ecab2666085ccf37a9342
2018-04-20 12:21:57 +02:00
Andy Shaw
7c532891e0 Send ShortcutOverride event when receiving a non-spontaneous key press
When a key press is received which is not spontaneous then it needs to
be manually sent as a shortcut override event to ensure that any
matching shortcut is triggered first. This enables emulation/playback
of recorded events to still have the same effect.

[ChangeLog][QtWidgets] Sending a key press event with sendEvent() now
sends a ShortCutOverride event first to the widget to trigger any
shortcuts set first.

Task-number: QTBUG-48325
Change-Id: Iafcc2cdb1773bffe89edaeb0abc44cd5a51088e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-20 10:18:49 +00:00
Kai Koehne
c579a77f84 Document libdbus-1 code in Qt D-Bus
[ChangeLog][Third-Party Code] Libdbus-1 code in Qt D-Bus is now properly
documented. The code is licensed under AFL-2.1 OR GPL-2.0-or-later.

Change-Id: I38bd6f38175562fff03ae84fc7a5c435de4cb972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-20 06:45:12 +00:00
Paul Wicking
941db4e0bb Doc: Update QtConcurrent::mapped example snippet
Wrap current example code snippet in std::function as a work-around,
as suggested in comment to QTBUG-61145 (see history tab) with the same
issue.

Task-number: QTBUG-67603
Change-Id: I6875b31d8e983e234b88384c7d76917ac144f953
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-19 15:33:31 +00:00
Allan Sandfeld Jensen
0c51b832f5 Also support reset notification on non-nvidia
In 5.11 robustness was added for nvidia drivers, this patch extends
that to other opengl drivers, and fixes the reported format.

Change-Id: Ia81934c3bcf13e7300fb4e75674ea63317039870
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-19 07:43:54 +00:00
Friedemann Kleint
370cd37cea Manual shortcut test: Arrange in QGridLayout
Change-Id: I93264bec8810f4dd1e2c010cc4dd35df93f31102
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 20:54:03 +00:00
Tim Uy
30874fb2df qmake: fix sdk resolution on macos
the 'info' variable was re-used too early. make a new one 'infoargs'
instead.

Task-number: QTBUG-67286
Change-Id: I77881ecbfce338d653358c5e5edac84e1c0c7de3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-18 19:10:19 +00:00
Andy Shaw
34e34f2209 iOS: Use the non deprecated application:openURL function
In iOS 9.0, the original application:openURL function was deprecated
and replaced with a newer one. As iOS 9.0 is no longer supported we can
safely switch to the new one. This is also required to prevent a crash
when the LSSupportsOpeningDocumentsInPlace and UIFileSharingEnabled keys
are set to true in the Info.plist file.

Change-Id: I59a7ee82e3ddb2777ef78e28b964ef8666c629af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-18 19:44:37 +00:00
Gabriel de Dietrich
84988886a5 QToolTip: Hide tooltip on key event on macOS
This brings back Qt 4 behavior. The difference is that we only
ignore modifier-only key events, as it's done natively.

Task-number: QTBUG-49462
Change-Id: I02f2313e1164ba185336d80ac5cc16ce6d883b79
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:40 +00:00
Gabriel de Dietrich
0c936d7411 QCocoaPlatformTheme: Fix tooltip background color
It use to be yellowish in the past, but modern versions
of macOS show it light gray.

Change-Id: I8cca5cbb37c73a6dfc79e633a746b9a7d7bced05
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:29 +00:00
Gabriel de Dietrich
e991fd4802 QMacStyle: Fix SC_ComboBoxEditField rect
Change-Id: I851e4bb1e0177ef5c594328c717e58ec7c9494e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:20 +00:00
Gabriel de Dietrich
85cb183488 QMacStyle: Fix appearance of selected inactive tab bar button
Because we use toggle NSButton for selected tabs, the inactive
appearance doesn't follow what NSSegmentedControl would have
shown. Therefore, we fall back to our good old habits, i.e.,
render on a pixmap and do some pixel transformations.

Change-Id: I838a2f23abee5846219ba67328c79fa8cc359a9b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:13 +00:00
Gabriel de Dietrich
48900145a4 QMacStyle: Clean up code, remove dead bits
Change QMacStylePrivate::drawNSViewInRect() signature
to remove all the unused parameters.

Reuse recent tab direction functions where appropriate.

Includes the infamous outter -> outer fix.

Change-Id: I8f92d79d8a6c3b5903bfbb13293afb6f72a5340b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:21:54 +00:00
Jan Arve Saether
be4eaca053 Do not ignore MenuItem on macOS
The idea was probably to ignore it since macOS already provides
accessibility for a menu item in its native system menu. However, a Qt
Quick Controls2 Menu will instead show a non-native menu, which should
not be ignored.

Task-number: QTBUG-63522
Change-Id: Ib5ae16ad991ebd7a18fa73b8f576f20b1c14d4c8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-04-18 13:28:44 +00:00
Kari Oikarinen
c6ee1899ea Blacklist tst_QWindow::isActive on Ubuntu
Task-number: QTBUG-67768
Change-Id: Ie1e0b406c152c854ef3629fa4d469dd73452f128
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 13:23:18 +00:00
Andy Shaw
8caf9e6b18 iOS: Allow building QML based test cases
In order to be able to build and test a testcase on an iOS device it
needs to be a bundle. So the app_bundle config should only be removed if
the testcase_no_bundle is set. This is already done by testcase.prf.

Task-number: QTBUG-45211
Change-Id: I4f16ea832ccff2a5db5fed0050fa0344b4ac9ad6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-18 12:19:31 +00:00
Mitch Curtis
3520329937 Doc: link to QEnableSharedFromThis from QSharedPointer docs
Change-Id: I1c4a168c0581b6273b99a7ea8faa29114bda39e2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-04-18 11:42:40 +00:00
Tor Arne Vestbø
e0e1c7ec2d iOS: Trigger manual layout of root view controller when coming out of background
When rotating the device when the application is in the background iOS will
ask the root view controller to layout its views when then foregrounding the
application, but at that point the application state is still in the suspended
state, meaning we block any view resizing or rendering.

To ensure the views are resized correctly, we trigger a manual layout after
the application comes out of the suspended state.

Task-number: QTBUG-67719
Change-Id: I1ef0a4133d4b94edaac7b0f3cb4e49e367eb76d4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 11:32:11 +00:00
Tor Arne Vestbø
a75f25a43f Fix runtime platform detection on Apple platforms
The watchOS and tvOS platforms also define __IPHONE_OS_VERSION_MIN_REQUIRED
for compatibility, so we need account for that in the ordering of the ifdefs.

Task-number: QTBUG-67534
Change-Id: Id86e684137550533470370ef29c3563d677d5865
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-18 11:32:10 +00:00
Anton Kudryavtsev
3697366642 QSplitter: fix doc for widget() and handle()
Change-Id: I7b8a0ba9f6b99eae22c2230c761d7a14045256db
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-18 11:21:00 +00:00
Andy Shaw
99e52d89fe Compile when using -no-feature-networkinterface
Change-Id: I12a808599dd1fecaebc2e85a96da27a044666009
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-04-18 11:20:22 +00:00
Andy Shaw
9899c29daf Don't ignore the shortcut when the QMenuBar is parentless
With Cocoa it is possible to have a parentless QMenuBar so that the same
one can be used for multiple windows. Therefore if the top level window
is the QMenuBar when checking for the context then we can let it carry
on as if the top level window is the same as the active window.

Task-number: QTBUG-45453
Change-Id: Ifacf2111d5f9973afe8af30c6338918f130e51a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 11:20:09 +00:00
Kai Koehne
2b5587d901 Use placeholder for year in header.* files
It would be tedious to bump them every year, but we don't want
people to copy completely outdated year numbers either ...

Also consistently use https:// in contact address.

Change-Id: I9654417a3037fc18c6b9a0551c4883f5fc960084
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2018-04-16 11:02:22 +00:00
Kai Koehne
18ea6a6d3c Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt
Commit 71404b0be1 added new header templates and LICENSE.GPL2,
LICENSE.GPL3, LICENSE.GPL3-EXCEPT, LICENSE.LGPL3 files already in 2016.
So it's finally time to remove some of the old licnse files.

LICENSE.LGPLv21 and LGPL_EXCEPTION.txt is not referenced anywhere
anymore. LICENSE.GPLv3 is referenced only in LICENSE.LGPLv3.
We unfortunately still have to keep LICENSE.LPGLv3 because it is up
to this day used in the standard header templates, but we can just
change the reference in there to LICENSE.GPL3.

Change-Id: Ia88b4de8a395757a39ca63d474b2214e3b1063fb
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2018-04-16 11:02:14 +00:00
Oliver Wolff
215e0f35d0 tst_qdir: Fix absoluteFilePath for winrt
The drive has to be defined for every Windows configuration (also
including winrt).

Change-Id: I94a3131b8aec20cda97dc78f55b1d87aa10240e4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-16 05:23:17 +00:00
Timur Pocheptsov
8d7edf18eb QSslCertificate (OpenSSL) use the correct *_free function
When releasing a STACK_OF(GENERAL_NAME). Actually, GENERAL_NAME_free is
a special function, not the same as OPENSSL_sk_free.

Task-number: QTBUG-57679
Change-Id: I3ed300bb95e8be35bd9cd06b6dbc6e59c7c6a4ee
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-15 04:46:04 +00:00
Allan Sandfeld Jensen
9f54745362 Use optimize_size instead of duplicating similar logic
The android mkspecs had their own way of doing the same as optimize_size

Change-Id: Id05822df6bdeb8b3aafada2901bd61530c490fe9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-04-14 17:23:25 +00:00
Gatis Paeglis
d5ac11891d xcb: prevent crash with pixmap cursors on XRender-less X servers
We were using xcb_render_* APIs without checking if the server even
supports this extension. Attempting to use an extension which is
not present will always result in a crash. This patch adds the required
guards and refactors how we detect presence of XRender extension.

Also instead of falling back to some odd-looking bitmapped version
just leave the current cursor unchanged. That is how we did it in
Qt4 AFAICT.

Task-number: QTBUG-66935
Change-Id: I4f27f1d65a77563ec34f3e0e94492c9236d7f9a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:03:10 +00:00
Gatis Paeglis
7286d9d8dd xcb: fix bitmap cursor loading performance regression
... introduced by 422838685c.
Instead of completely droping caching for bitmap cursors we can do
the same what is done in libXcursor - have a fixed size cache, with
oldest entries eventually being replaced with new bitmaps. This
fixes the original issue, where the hash was growing indefinitely
until running out of file descriptors and won't have the performance
penalty as in 422838685c.

Task-number: QTBUG-66897
Change-Id: I14f80b46f97fd0e2c920e17a31ffbc0441cd9d22
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:03:01 +00:00
Gatis Paeglis
cba414a26b xcb: cleanup the code for detecting when to create/destroy SHM segment
- removed the check for "m_segmentSize > 0" as according to the code it
will never be <= 0.

- wrap the entire logic in connection()->hasShm() { .. } as that is when
the logic becomes relevant. This makes the code more readable.

Change-Id: I572420df8e29cc46593f8a13c250f8c05c6a9108
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:02:53 +00:00
Kari Oikarinen
0dd3e02aac tests/auto/widgets/util: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I795e564b051bbabd1fc2d2fca8171da6072f99eb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 12:32:52 +00:00
Lars Knoll
07f1c96658 Improve performance of QResource::load()
Avoid creating a QDateTime in the resource that will almost
never get used. Constructing the date time is expensive as we
convert the time stamp to local time.

Task-number: QTBUG-65713
Change-Id: I3638e108a8fbd237cd93e98aa2adc0ca2127822c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
2018-04-13 12:17:33 +00:00
Oliver Wolff
a8906e3510 winrt: QWinRTEGLContext: add isValid functionality
QPlatformOpenGLContext::isValid always returns true
but it is possible that creation of the context fails
in QWinRTEGLContext. This case should be reflected in
isValid because other places (like QOpenGLContext::isValid())
rely on it and not having proper information about the
validity of the context might lead to crashes.

Task-number: QTBUG-67568
Change-Id: If989ca47cdf7b27c44961beee5d97a4647184b0a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-13 12:16:54 +00:00
Akihito Izawa
26355be54d QStyleHints: emit correct signal when calling setMouseQuickSelectionThreshold
Change-Id: Ieb76ecc406c25ca11a108775ebd46a8e597401b5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-04-13 06:33:35 +00:00
Kari Oikarinen
66cc08961f tst_QWidget: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I1696ccbdf0523ece694f2dac52c015443c8b19fb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 05:43:45 +00:00