Commit Graph

32674 Commits

Author SHA1 Message Date
Thiago Macieira
fb13510681 QFileSystemEngine::fillMetaData: fix apparent use of dangling pointer
It's not dangling only because of QFileSystemMetaData's construction:
the nativeFilePath() function returns a member variable. Since
QByteArray COWs, the pointer that we stored would not be freed.

But this was dangerous, since any change to the "entry" variable could
cause it to invalidate the member variable and the pointer to become
dangling. This line is only as old as this entire file is.

Change-Id: I8d96dea9955d4c749b99fffd14cda4d8e2cc5e5b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-07-05 14:35:20 +00:00
Stephan Binner
f065d0f128 Fix Windows build without features.filesytemiterator
Task-number: QTBUG-61671
Change-Id: I65a96ca51efee303602c836e5b0177b1a63d1a7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-05 14:03:09 +00:00
Stephan Binner
6a1046e176 Fix macOS build for -no-widgets
Task-number: QTBUG-61780
Change-Id: Icb337c4daeb976a6616dc289a5ffd0ec9345834f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-05 14:03:06 +00:00
Michael Winkelmann
7d42293d2f QVariant: Print a warning when deserialized user type is unknown
The deserialized user type is now shown to the user to figure which
QMetaType registration is missing.

Change-Id: I4b7624827e479b1bea67065ce3542183b7355165
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-07-05 13:52:11 +00:00
Timur Pocheptsov
594fe5c463 Convert features.localserver to QT_[REQUIRE_]CONFIG
Move all the logic into socket.pri and clean-up source
code. Build local socket/server only if feature 'localserver'
was enabled.

Task-number: QTBUG-61672
Change-Id: I9f9d1a262df4bb020c8706c7cb5a66b926e0240f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-05 13:44:59 +00:00
Thiago Macieira
d78fd6a1e5 QWinRTFileEngine: Property ItemDate is not the file's last access
The MSDN documentation says that it's a date that reflects the item
type, giving an example the date a photo was taken (probably as stored
in the EXIF metadata).

Change-Id: I8d96dea9955d4c749b99fffd14cd7616cc0da545
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-07-05 13:41:09 +00:00
Olivier Goffart
313c3cabe4 Prevent qmake to run moc on qobjectdefs.h
Change-Id: Ic453c88c36cbeb24f3dc4fa6b6b20aabe5d24e09
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-05 13:22:03 +00:00
Friedemann Kleint
d3d5c22ccb tst_QProcess/tst_QFile: Extend blacklisting to MSVC2017
Extend the blacklisting introduced by
0ebebeb983.

Task-number: QTBUG-48455
Task-number: QTBUG-48504
Change-Id: Idf44948a5ede433435a8d0b61fef6413bb0b69bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-05 12:42:14 +00:00
Allan Sandfeld Jensen
d866617ea6 Fix polygon stroking with cosmetic pen
Fix a number of issues that caused polygons to not always be drawn
fully connected.

Ensures the original lastPixel is set when drawing closed polygons,
ensure we don't round away from the original starting point, and add
handling of edges that need to be rounded half a pixel sideways to line
up with endpoints.

Task-number: QTBUG-27053
Change-Id: Ib51ee5623a629996af51a0967096383f04e91e2f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-07-05 12:35:26 +00:00
Simon Hausmann
03b4838cb5 Extend tst_macgui::nonModalOrder blacklist to include 10.12
Change-Id: I9cfe9e8d79a3223c9cdbb039cc3e243b173f5e9c
Task-number: QTQAINFRA-1333
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-04 20:03:41 +00:00
Timur Pocheptsov
0d97babf2f QSslSocket - fix two memory management issues (Secure Transport)
I noticed we never release 'items' imported by SecPKCS12Import.
But looking at the actual code (SecImportExport.c), it appears
we own these 'items' and must release them. And this leads to a crash
(on over-release) which reveals  another bug: a value from a dictionary
obtained with 'Get' method should follow the 'get rule' - we do not
own it and QCFType RAII object is not needed.

Change-Id: I219015fadedb256c401e50cf7e955f3d7e0a6c5f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-07-04 05:02:11 +00:00
Thiago Macieira
2f8a08f31b Make qt_check_pointer more OOM-safe
First, it can never return, so we can mark it Q_NORETURN and add an
std::termianate at the end. Though if it did, we'd end up in a null-
pointer dereference crash in the caller.

Second, add Q_DECL_NOTHROW to it. It can't throw, but it terminates
execution. This also prevents both puts and fprintf from escaping via
pthread asynchronous cancellation on Linux/glibc.

Third, don't use QMessageLogger, since that allocates memory and
actually uses QString. If we really are in an OOM situation, then
QString's failed allocation would recurse back into qt_check_pointer.
We'd compound the OOM situation with a stack overflow...

Change-Id: Ia53158e207a94bf49489fffd14c81c47971f4e82
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 16:01:14 +00:00
Thiago Macieira
2b991efc47 Use QMessageLogger context properly in qglobal.cpp redirects
qt_assert and qt_check_pointer get the function name and line number
from the caller (the functions are called from the Q_ASSERT and
Q_CHECK_PTR macros, respectively), so we don't need to capture the
context from those two functions. Instead, pass the context to
QMessageLogger for proper logging.

I've left the file name and line number in the assertions, for users who
did not add them to their message log pattern, but I've removed from the
almost never used qt_check_pointer function.

Note: how useful is it that we allocate memory in response to failing to
allocate memory?

Change-Id: Ia53158e207a94bf49489fffd14c81b359c5b6537
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-07-03 16:01:10 +00:00
Thiago Macieira
fb046c932f Fix build with MSVC 2015 Update 2 if constexpr is enabled
This compiler seems to require explicit initialization of all member
variables in a constexpr constructor, even if they have an implicit
default constructor of their own. We probably fixed the rest of Qt a
couple of years ago, but not these two places because they were arrays
and those require the C++11 syntax for uniform initialization.

All compilers that support constexpr do support uniform initialization.
MSVC 2015 fixed our issues with it on the same update.

Change-Id: Ibc1eb23e3ae093f5c6928ded3a041be35eb9baae
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 16:01:07 +00:00
Thiago Macieira
d3590d32a5 Disable the -Wstringop-overflow warning from GCC 7
It prints the warning even if we surround the affected code with
QT_WARNING_DISABLE_GCC("-Wstringop-overflow") (see e4eaa62943),
so we have no alternative other than to disable the warning completely.

Change-Id: Ia3e896da908f42939148fffd14c488c4006040e6
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 16:01:04 +00:00
Thiago Macieira
8616b2112c Fix parsing of 0E+1 and 0E-1 (capital 'E')
Since the result is an actual zero, this section of code looking for
underflows kicks in. But we forgot to take the capital letter into
account when parsing the number.

Task-number: QTBUG-61350
Change-Id: Ia53158e207a94bf49489fffd14c6abbd21f0bac0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-07-03 16:01:01 +00:00
Friedemann Kleint
c854fc5a6b Windows QPA: Correctly check for fixed sized windows in WM_DPICHANGED
Use Qt's flags instead of WS_DLGFRAME which matches WS_CAPTION as
well (WS_BORDER | WS_DLGFRAME).

Amends 886ce572d6.

Task-number: QTBUG-58959
Change-Id: Ifdc106667d67cc6f5d3611806aae1035742fb882
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-07-03 14:46:15 +00:00
Christian Strømme
50a7da53a4 Android: Replace QMutex with QBasicMutex in androidjnimain
QBasicMutex is sufficient and provides reduced initialization cost.

Change-Id: I79ae61daaed4f5edd9b21d913f78e78e7ba14c94
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-07-03 14:38:08 +00:00
Christian Stromme
5dcd949145 Android: Add lock to protect access to the platform interface
Fixes dubious lock protecting the platform interface handle, and makes
sure that we lock and hold a valid reference to the platform
interface before accessing it. Since the platform interface is exposed
we also need to expose the mutex protecting it.

Change-Id: I1ec1219a75c589bc793676369b11fb403de20102
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-07-03 14:38:01 +00:00
Dmitry Shachnev
5c144a72d5 Fix capitalization of x11-xcb pkg-config module name
$ pkg-config --exists X11-xcb && echo True
$ pkg-config --exists x11-xcb && echo True
True

See https://cgit.freedesktop.org/xorg/lib/libX11/tree/x11-xcb.pc.in.

Change-Id: I1485f124e2926bb1c6a2b5eb83c4963c095d0f12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-03 13:33:30 +00:00
David Faure
df06926b8a QMimeDatabase::mimeTypeForUrl: skip content check for remote URLs
The code was trying to open a local file with the same path
as the remote URL, which is unnecessary and wrong in the unlikely
case where such a file would exist.

Spotted by Christoph Feck when reading the code.

Change-Id: I1d77e5781cf606b025d2877f48a9914dd1e36b1d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-07-03 13:18:03 +00:00
Friedemann Kleint
f2df5c64bd QFileSystemEntry: Export static helper function checking for the root path
This provides a helper function which does the check on the string.
QFileInfo::isRoot() in addition checks for the existence of
the directory, which can cause hangs with network drives.
Use the new function in appropriate places in QtWidgets.

Task-number: QTBUG-6039
Change-Id: I54d0d860713e82b28fa4069a5345b042337f9c52
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-07-03 12:44:00 +00:00
Daniel Teske
00b8050d68 QLineEdit: Document that []{} are reserved in Input Masks
They don't have any meaning, seems like they were meant for a future
extension. Documenting them, documents that they need to be escaped.

Change-Id: I90079766ffd45fab8c4676f7a9212ff6dec4a732
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 12:28:35 +00:00
Nico Vertriest
db6e357d48 Doc: Add list with widgets examples using layouts
Change-Id: I585cd63f68220467de1beed3346cdaa12af2b34b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 11:51:23 +00:00
Alexander Volkov
46312b611b xcb: Use QT_CONFIG macro to check for xcb-sm, xcb-render, and xcb-glx
And remove the corresponding defines.
Note that XCB_USE_GLX and XCB_HAS_XCB_GLX were used as synonyms
because QGLXBufferSwapComplete was wrapped in #if defined(XCB_USE_GLX)
and at the same time it was used only when XCB_HAS_XCB_GLX
was defined.

Change-Id: I6c04b0ccfd5369b78b3e8af2ec39d38ae5c311dc
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-07-03 11:40:35 +00:00
Simon Hausmann
5ac03a14bf Blacklist tst_QWindow::positioning on macOS 10.12
Change-Id: I41f46e8387519a691d3df9a4fdcc577916e6d247
Task-number: QTQAINFRA-1332
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-07-03 11:29:30 +00:00
Nico Vertriest
3fe032ad91 Doc: minor correction in list
Removed unnecessary periods in list

Change-Id: Ic6e029a3271bf34db2e0b77005f58dd8b2337537
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 11:18:04 +00:00
Nico Vertriest
b7c33df724 Doc: add tutorials to overview page Qt Widgets
Change-Id: I62037ce2190689b2e9c8d62a9d67e1d477e1be42
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 10:35:44 +00:00
Gatis Paeglis
ce9a806336 doc: cleanup raster window example
Documentation does not match the sample code. There is no explicit
call to QWindow::create(). It is called implicitly by QWindow::show().

Furthermore, QWindow::create() documentation states: "Note that it is
not usually necessary to call this function directly, as it will be
implicitly called by show(), setVisible(), and other functions that
require access to the platform resources.".

Change-Id: I632da86438f7f88c1fd8359b9fd6d52f329291cb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 10:20:37 +00:00
Kai Koehne
87229adca8 Change MinGW link to MinGW-w64
We're only supporting builds with MinGW-w64 these days.

Change-Id: I1198551ba85132c3f0f81e32f11aa149126ca61f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 10:16:44 +00:00
Eike Ziller
2a9f678f59 Fix navigation with offline style
When the switching to the non-simple offline style is done after
document load, the navigation to anchors completely breaks. So, do
the switch without the additional delay.

Task-number: QTCREATORBUG-18448
Change-Id: I5abbc3bbe1c743d2a5e493bb9e0916c5d092942a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 10:08:33 +00:00
Andy Shaw
3e8ebea95b Cocoa: Reset the target + action for a menuitem after showing a dialog
To make it more reliable and efficient we now do the reverse of what we
are doing when redirecting the items. This will ensure that the actions
are correctly reset to the original target and action. The original
approach of updateMenubarImmediately() was not always doing this and it
also does other unnecessary things as a result when all we need is to
just reset the things we changed.

Change-Id: Icefa38d47ec9434894f05caeed75fbf8bdfecb93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-03 09:42:13 +00:00
Daniel Teske
9b91784987 QLineEdit: Tweak selectionStart() documentation
Change-Id: I55defa5ed182373f435b06c92770da5b05c01459
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-03 09:41:25 +00:00
Edward Welbourne
f881120fd0 Fix offset calculation to be valid at the correct time
tst_QLocale::macDefaultLocale() was determining local-time's current
offset from UTC and using it when working out what to expect the
offset at 1:2:3 today to be.  When a transition happens after 1:2:3 on
its day (which is usual for DST changes in Europe), this lead to using
the new offset to test a time before the transition; the test was thus
wrong and failed.

Use the time to be tested (and current date) to compute the offset to
use, instead of using the current date-time.

Change-Id: I1c02a5579bca859e1d1aeb4f45b24871a08287af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 09:03:28 +00:00
Leena Miettinen
d52fa3efe5 Doc: Remove obsolete screenshots
References to these screenshots have been removed from the
docs in other commits.

Change-Id: I1af72f0160382f1fe98740c664258a9b35ca0e64
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-03 08:58:57 +00:00
Friedemann Kleint
22aa919b76 macOS: Blacklist tst_QToolButton::task176137_autoRepeatOfAction()
The test is apparently flaky.

Change-Id: I4d7b5ad653c46a432d79c9090b9f5d4cc98e5b6e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-03 07:50:41 +00:00
Bernhard Rosenkränzer
386af91c57 Fix detection of AT-SPI
Building qtbase 5.9.1 on Linux always results in a build with
accessibility support disabled.

The problem is that the config option for accessibility-atspi-bridge
checks for config.atspi, which isn't defined anywhere - it should
check for libs.atspi (which is set if pkg-config finds atspi-2) instead.

[ChangeLog][QtGui][Platform Specific Changes][Linux/XCB]
Fixed detection of AT-SPI, allowing accessibility support to be built
again.

Task-number: QTBUG-61731
Change-Id: If3bd5dfccda40158c566f8507e34b6877b59b6fb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Bernhard Rosenkränzer <bero@lindev.ch>
2017-07-03 07:44:31 +00:00
Allan Sandfeld Jensen
989b9da300 Fix BMP ImageFormat for semi-transparent files
Reads the v4 and v5 info-header together with the rest of the info-
headers, and use that to report the correct image format before
decoding.

Change-Id: I69e2bcc54367b7f14820815ae2ae1fa2d8d5dc8c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-07-03 07:41:56 +00:00
Oswald Buddenhagen
ed1373124a Bump version
Change-Id: I0d72a8a59926039bb58be51daa4e4b5a6284083f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-03 07:22:45 +00:00
Friedemann Kleint
88c68f4d9e tst_QPrinter: Run in temporary directory
Change-Id: I299b740a43926e4af31c70aadda882f87ba9c362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 06:49:10 +00:00
Oliver Wolff
6b58d3fb98 Require printer config for printsupport auto tests
Change-Id: I171c5d642e41480b4feec102dc0095af5f500098
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-07-03 06:41:35 +00:00
Oliver Wolff
d6adb194af ANGLE: Fix flickering on resize when D3D9 is used
By reverting ANGLE change d3b84ab51db09de238459b0dff2e8420c09aabf3
we get rid of the flickering that happens on resize when D3D9 is
used. The issue that was fixed there is not relevant in Qt's
context so it is safe to revert the change.

Task-number: QTBUG-59893
Change-Id: I9306314b892612fbd1f7a058a2e606aedc0367bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-03 06:41:01 +00:00
Joerg Bornemann
0512c3e257 Add _UNICODE define to MSVC and MinGW mkspecs
System headers like tchar.h need the _UNICODE define, not UNICODE.
While qplatformdefs.h already provides _UNICODE when UNICODE is
defined, users might want to include tchar.h without Qt includes.

This is consistent with Visual Studio's default defines.

Task-number: QTBUG-61411
Change-Id: I2f604368080270d840f0dbb2cf273805d2ba5239
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-03 06:02:24 +00:00
Joerg Bornemann
b446275ac7 Make Qt's VersionInformation resource strings consistent
The strings in Windows VersionInformation resources should be
capitalized by convention, and the entries are usually not terminated
by a dot. However, "Ltd." is an abbreviation and should be
dot-terminated.

Change-Id: Ibea3443ac38846e29a3e77ab3e8d5d77b9370272
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-03 06:02:03 +00:00
Joerg Bornemann
f046ed395a Set VERSION for Qt tools
This creates a VersionInfo resource on Windows for Qt's tool
executables similar to what Qt's DLLs contain.

Task-number: QTBUG-55755
Change-Id: I9e5d7bedaec9d14f29a9eeeb6697b07241f860d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-03 06:01:49 +00:00
Maurice Kalinowski
798c526919 winrt: remove legacy checks
Any version prior to 2015 is not supported anymore.

Change-Id: I9ccc87fc506521b560fda1b4c88f9c3aebd7a485
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-07-03 05:32:54 +00:00
Maurice Kalinowski
f74098d683 winrt: Update capability management
Introduce uap3 namespace which is used for newly introduced
capabilities. In addition, the autodetection of namespaces for
capabilities within the uap namespace is disabled in Visual Studio
lately. Hence, the output needs to be more verbose including the
namespace for a capability.

Task-number: QTBUG-60899
Change-Id: Ia1ccf825d4c257d2661e34c195c45fd37e0b6413
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-07-03 05:32:53 +00:00
Friedemann Kleint
9656e972d1 Remove remains of wince in .pro files
Task-number: QTBUG-52590
Change-Id: I444fc9eedc8a8e4ad2ede224d66e7c410bedbb48
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-03 05:32:51 +00:00
Allan Sandfeld Jensen
eaee1209f0 Switch QSemaphore::tryAcquire to using QDeadlineTimer
A deadline timer is more correct for timeouts.

Also starts the timer before trying to acquire the mutex for more
precise timeouts.

Task-number: QTBUG-58745
Change-Id: I230266a3a5d7b7af33981efed4e6882e5727a41c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-02 20:08:36 +00:00
Liang Qi
ab2c1f9509 Merge "Merge remote-tracking branch 'origin/5.9.1' into 5.9" into refs/staging/5.9 2017-07-02 16:24:12 +00:00