Commit Graph

31204 Commits

Author SHA1 Message Date
Thiago Macieira
dfd7a0e411 Doc: add a note that UniqueConnection does not work for lambdas
Task-number: QTBUG-52438
Change-Id: I3e4e5051937c40319d6efffd1491bef6feb6776e
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-26 07:45:11 +00:00
Thiago Macieira
dcfeeef91e Remove the -no-rtti option from configure
It only applied to Windows (not MSVC, like the help said) and the build
was broken with this option. So remove it, as we clearly never test
this.

[ChangeLog][Windows] The -no-rtti configure option was removed, as Qt
5.8 fails to build under that condition. To disable RTTI on user code,
add to your .pro file: CONFIG += rtti_off.

Change-Id: I2bc52f3c7a574209b213fffd149aae1b8d0cf9df
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-26 07:44:39 +00:00
Thiago Macieira
deef2d4e70 Fix warning about not calling the base class copy constructor
error: base class ‘class QBasicAtomicPointer<void>’ should be explicitly initialized in the copy constructor [-Werror=extra]

Change-Id: I2bc52f3c7a574209b213fffd149b4b71f3006be5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-01-26 07:44:33 +00:00
Thiago Macieira
51dafeda8c linux-icc: always compile applications as position-independent execs
The problem isn't the compiler, but the linker, so we ought to turn this
flag on for all ELF-based systems where we compile Qt with -Bsymbolic,
but so far only the Intel compiler has been affected. We can turn it on
as needed for other systems.

The cause of the problem is the way that ICC materializes the pointer-
to-member-function: it stores the full 2*sizeof(void*) data in an
anonymous variable, so that it can load it in one go, such as one 16-
byte SSE aligned load on 64-bit systems. That relocation in a data
variable gets turned into a fixed-position copy relocation by the
linker, which breaks the signal-identification mechanism.

GCC and Clang are likely to be affected if anyone did:

    static const auto destroyed = &QObject::destroyed;
    QObject::connect(obj, destroyed, [](){});

Task-number: QTBUG-52439
Change-Id: I0d69eaf61af149db9574fffd149d0cfb08459c33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-26 07:42:45 +00:00
Liang Qi
398a7e736c Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev 2017-01-26 00:37:14 +00:00
Liang Qi
a23d705e18 Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts:
	src/plugins/platforms/android/qandroidinputcontext.cpp

Change-Id: I80f35a3d722f1e218ff338b6652e551da45c38e7
2017-01-25 22:39:42 +01:00
Allan Sandfeld Jensen
4d3a35f637 Make wheelScrollLines a QStyleHint
The number of lines to scroll on a wheel click have previously been
a QPlatformTheme hint and QApplication setting, this patch moves it to
QStyleHint so it may be easier read by QGuiApplications.

Change-Id: I80673c7b99d78c6407b1202b3742e1cb5fef0583
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-01-25 19:10:29 +00:00
Liang Qi
318b58562a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	.qmake.conf
	mkspecs/common/msvc-desktop.conf
	mkspecs/common/msvc-version.conf
	mkspecs/common/winrt_winphone/qmake.conf
	mkspecs/features/mac/default_post.prf
	mkspecs/features/mac/sdk.prf
	mkspecs/features/qt.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/winrt/default_pre.prf
	mkspecs/winphone-arm-msvc2013/qmake.conf
	mkspecs/winphone-x86-msvc2013/qmake.conf
	mkspecs/winrt-arm-msvc2013/qmake.conf
	mkspecs/winrt-x64-msvc2013/qmake.conf
	mkspecs/winrt-x86-msvc2013/qmake.conf
	qmake/generators/win32/msvc_vcproj.cpp
	src/gui/kernel/qwindowsysteminterface.cpp
	src/network/kernel/qhostaddress.cpp
	src/plugins/platforms/mirclient/qmirclientplugin.cpp
	src/plugins/platforms/mirclient/qmirclientplugin.h
	src/widgets/util/qsystemtrayicon.cpp
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
	tools/configure/Makefile.mingw
	tools/configure/Makefile.win32

Done-with: Jake Petroules <jake.petroules@qt.io>
Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
2017-01-25 20:06:06 +01:00
Allan Sandfeld Jensen
f823af43f2 QVariant of nullptr should always be null
Implements isNull for QVariants of a nullptr so they always return
true to isNull(), instead of depending on how they were constructed.

Task-number: QTBUG-58296
Change-Id: Ibddec795cdadedef7e17d22c265c29e752d8f99f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-25 17:05:18 +00:00
Allan Sandfeld Jensen
374a173d14 Improve QTest::qWait() precision and switch to QDeadlineTimer
Do not wait up to the timeout ms after already having waited several
times. At the same time upgrade to using the QDeadlineTimer which
is designed for this purpose.

Change-Id: Iaf5e4f4655605d5143ce91040c6eb6706752e504
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-25 16:40:57 +00:00
Thiago Macieira
d3671555cc Rename "interface" to "iface:" there's a #define in windows.h
Change-Id: Ibe5b1b60c6ea47e19612fffd149cd2d07116584b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-01-25 16:39:03 +00:00
Paul Olav Tvete
195298326f Fix build with -no-feature-whatsthis
Change-Id: I2f31357e91b01f826ef44710f477b80fde1f3fbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:39 +00:00
Paul Olav Tvete
da21d20b85 Fix build with -no-feature-treewidget
Make sure the feature is defined before testing it.

Change-Id: I4d4b555c9f2629c8a3ca58cf52efff279f6a78f5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:34 +00:00
Paul Olav Tvete
08e8a02e51 Compile with -no-feature-tooltip
Change-Id: I6093559dd7b8df578ebd050655fb9bd07e5f6809
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:28 +00:00
Paul Olav Tvete
033fa96b6c Fix build with -no-feature-toolbutton
Change-Id: I16495548fa3ed24409883fadab08ddb8545efd0d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:23 +00:00
Paul Olav Tvete
b0b726f8c7 Fix build with -no-feature-tabbar
Change-Id: I97c5345f2627743876aa05a94ffc03f2a6012b6c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:17 +00:00
Paul Olav Tvete
624b67c6fb Fix build with -no-feature-tabwidget
Change-Id: I0fbabdfec763f1647bf85582afe088a3e5b42e1f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:12 +00:00
Paul Olav Tvete
0f6cfd2217 Fix build with -no-feature-slider
Change-Id: I36e5c850068c2f9ac2ae078a3734ddb88d88c532
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:05 +00:00
Paul Olav Tvete
2bbeebf80c Fix build with -no-feature-textedit
Change-Id: I4a75c134803043180c57287ca352e26e3422204c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:38:00 +00:00
Paul Olav Tvete
2ac7fb78b9 Fix styles compilation with features removed, round 2
Change-Id: I8f09a8844e5edc1ad3e3dfd39eca9f3b42c5c828
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:37:54 +00:00
Paul Olav Tvete
cabf2950f7 Fix build with -no-feature-rubberband
Change-Id: Ida6698c4868507ccbf5b4c5e3eb1d2f5a7109f53
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:37:48 +00:00
Paul Olav Tvete
6bf9f49072 Fix build with -no-feature-menubar
Change-Id: I23b23fcaf6fcc655d38a06495127b108975f4a58
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 14:37:39 +00:00
Alexander Volkov
69e233d2ba Avoid detaching temporary objects
Found with clazy [detaching-temporary]:
- don't call QList::first() on temporary
- don't call QString::operator[]() on temporary
- don't call QByteArray::data() on temporary

Change-Id: I390962ef6020e4fcb0b0e447a63eed1e314d18a4
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-01-25 14:28:34 +00:00
Friedemann Kleint
a8a74fe81a Stabilize tst_QPropertyAnimation::noStartValue()
Remove the qWait() and introduce a QTRY_COMPARE()
checking for the end value first.

Task-number: QTBUG-58402
Change-Id: I2d3758178de5f67881008f28c406076ad27c4a90
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-01-25 11:36:41 +00:00
Paul Olav Tvete
056a35d02f Fix build with -no-feature-menu
Change-Id: I8f9d5ef6b7f7102e56816677f1d3a5b5144b7083
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:34:11 +00:00
Paul Olav Tvete
eae92384b0 Compile with -no-feature-itemviews
Change-Id: I23506f06df35f124f5eb9fcc8426c63b407a0872
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:51 +00:00
Paul Olav Tvete
6d06d4b07c Fix build with -no-feature-graphicsview
Change-Id: I9ae724ddf90efc9e951d475e3332083e6f8207d6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:46 +00:00
Paul Olav Tvete
fcab718666 Fix build with -no-feature-dockwidget
Change-Id: Id484b54fd7191715e61ba6708247357b83159f28
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:41 +00:00
Paul Olav Tvete
27792ea098 Fix style compilation with -no-feature-...
Change-Id: Ic7fadf0622f98d339322a4a1d4d5c36908f4f7f6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:36 +00:00
Paul Olav Tvete
7cafa85a49 Remove reimplementations of removed features
Avoid the "marked ‘override’, but does not override" compile error.

Change-Id: I4b125f1951614045781f3059fbc5cb65dd26775c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:32 +00:00
Paul Olav Tvete
d82e23e775 Make sure features are defined before testing them
Include the file defining the feature before testing whether
the feature exists. Also use the new feature macro to make
sure this bug doesn't happen again.

Change-Id: I204836fee59b143a7ce7d256a7aed223c4d0ceb1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:27 +00:00
Paul Olav Tvete
447ca99191 Fix printsupport compilation with -no-feature...
Change-Id: I881e736aefd4068965edb2a57f4436ee43d2bb93
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-25 10:33:23 +00:00
Friedemann Kleint
0c415793b9 Windows QPA: More fine-grained suppression of geometry/state change events
When switching windows from fullscreen to maximized, move and resize events are
triggered when changing the window decorations, ending up in
QWindowsWindow::handleResized(), QWindowsWindow::handleMoved() which then may
call handleGeometryChange().

Change 917ef57874 blocks the emission of events
depending on flag WithinSetStyle from handleGeometryChange() for Windows CE.
This has issues which become visible when switching from fullscreen to
maximized repeatedly:

- State change events are still sent from QWindowsWindow::handleResized(),
  QWindowsWindow::handleMoved() when changing the window style programmatically
  causing the maximized state to be lost after a few cycles(QTBUG-53368).
- Geometry change events are actually needed on the desktop for proper redrawing
  (QTBUG-53577).

Make this more fine-grained by suppressing all state changed events while
WithinSetStyle is set and allowing geometry changes.
Amends 917ef57874.

Task-number: QTBUG-53368
Task-number: QTBUG-53577
Change-Id: Icc8dc935cfc29b314aab2d6fac02c97174c79c3e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-01-25 09:44:12 +00:00
Jake Petroules
dfa8894bd3 Add missing documentation for QOperatingSystemVersion::segmentCount
Change-Id: I6d24fbbaf60e07377a463ea1f72588812caaf4a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-25 07:19:45 +00:00
Tasuku Suzuki
64e977cfac Fix build without features.temporaryfile
Change-Id: I3f26f122a20aa8e59baaf3f33b89cc776865ff8b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-25 04:54:58 +00:00
Friedemann Kleint
fec5405f4d Fix some qdoc-warnings for 5.9
qtbase/src/corelib/global/qoperatingsystemversion.cpp:119: warning: Cannot find 'QOperatingSystemVersion(...)' in '\fn' QOperatingSystemVersion::QOperatingSystemVersion(int maj, int min, int mic)
qtbase/src/corelib/io/qdir.cpp:1852: warning: Unknown command '\p'
qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:482: warning: Cannot find 'registerEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::registerEventNotifier(QWinEventNotifier *notifier);
qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:495: warning: Cannot find 'unregisterEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::unregisterEventNotifier(QWinEventNotifier *notifier);
qtbase/src/corelib/global/qoperatingsystemversion.cpp:268: warning: Can't link to 'macro()'
qtbase/src/corelib/global/qoperatingsystemversion.cpp:296: warning: Can't link to 'typeName()'
qtbase/src/corelib/io/qdir.cpp:1845: warning: Undocumented parameter 'filters' in QDir::isEmpty()
qtbase/src/corelib/kernel/qobject.cpp:1636: warning: No such parameter 'interval' in QObject::startTimer()
qtbase/src/network/bearer/qnetworkconfiguration.cpp:343: warning: Undocumented parameter 'timeout' in QNetworkConfiguration::setConnectTimeout()
qtbase/src/gui/kernel/qoffscreensurface.cpp:337: warning: Undocumented parameter 'handle' in QOffscreenSurface::setNativeHandle()
qtbase/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc:109: warning: Unknown command '\role'
qtbase/src/widgets/util/qundostack.cpp:727: warning: Command '\li' outside of '\list' and '\table' ...

Change-Id: I57bff895a8e1afd94b582a6a72a06771514ee27e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-01-25 04:50:16 +00:00
Jesus Fernandez
ad5eb297e1 Add QHostInfo::lookupHost overload with modern connect syntax
Task-number: QTBUG-56424
Change-Id: I49053ac2859e6c6c07e4a704b8b5f0d6a2d0b8a4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-01-24 20:54:07 +00:00
Allan Sandfeld Jensen
21f27c9a4d Enable gamma-correction on a face-by-face basis
Changes how we control if gamma-correction is done, and enables it for
the freetype CFF engine when stem-darkening is available.

The new code replaces existing hacks to force gamma-correction off
when using Freetype on X11 and Windows.

Change-Id: Ic703ca6965a3d81b204349e10f406c991b292edd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-01-24 20:42:32 +00:00
Timur Pocheptsov
d2758b2f1d Refactor HSTS cache implementation
The original monstrosity is not needed at all. It was born only to implement
RFC6797's description of the host matching algorithm (starting from superdomains
and moving to subdomains). Actually, it does not really matter how we find
known host - it can be a congruent match first instead, and then we proceed
with superdomains. This way I can use QMap and my tests so far show it actually
works faster (both insertion and lookup), also the code is cleaner now.

Also, introduce the new class QHstsPolicy that essentially allows to mark
a host as known host and conveniently encapsulates host name/expiration date/
subdomains policy.

Add a public API providing access to HSTS policies, so that client code
can pre-set or read back discovered known hosts (to implement persistent
HSTS storage, for example).

We support server-driven HSTS - this means client code is allowed to provide
policies as hints to QNetworkAccessManager, but these policies can be
overridden by HTTP responses with 'Strict-Transport-Security' headers.

Change-Id: I64d250b6dc78bcb01003fadeded5302471d1389e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-24 20:33:20 +00:00
Samuel Gaist
0a96d8fb38 Example: migrate the classwizard example to use QRegularExpression
Update the classwizard example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: I125664549e249c4156f8c664fac7648f1c41f9d5
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-01-24 20:28:41 +00:00
Samuel Gaist
bb42a6741f Example: migrate licensewizard example to use QRegularExpression
Update the licensewizard example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: Ib6e0ee9ec802e83540b1c37846b99378395fe0ec
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-01-24 20:28:37 +00:00
Samuel Gaist
992bffdba5 Doc: Fixed old text still mentioning QRegExp
The example has already been ported to QRegularExpression however part
of the documentation still referred to the QRegExp class. This patch
updates the documentation to match the new version of the code.

Change-Id: Id433d0b28deae0c4f702c0c54d2704174f8c7689
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-01-24 20:28:22 +00:00
Samuel Gaist
9170cf9f1d Remove use of deprecated QRegExp from QLibraryInfo
This patch replaces QRegExp by QString search and replace.

Change-Id: I11165afa45f8f9a856e6fb9b64929e4bdacb913d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 20:27:58 +00:00
Jake Petroules
bd78f57463 Apple: always use the system time zone instead of the default time zone
This corrects an issue converting dates and times to strings which would
use the "default" time zone (CFTimeZoneCopyDefault) in contrast to the
rest of Qt which uses the system time zone in such contexts.

[ChangeLog][QtCore][QLocale] Qt functions now always use the system
time zone on Apple platforms, the same that low-level C APIs like
localtime() does. Previously, converting dates and times to strings
would use the "default" time zone (which is almost always the same as
the "system" time zone but could be changed with the Apple API).

Change-Id: I2942c3c1c8aa01a0130f1b7280371a72bdb01b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-24 19:40:45 +00:00
Jake Petroules
c1cece8e54 Fix deprecated API usage
Change-Id: I62448507f80daf6be72994ee99f0fb1aa107eb78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-01-24 19:40:40 +00:00
Jake Petroules
ffc9d27d7e Remove useless DARWIN_NO_CARBON define from uikit mkspecs
This was used solely for building freetype. It was made obsolete as of
2eaf0cf8fd which upgraded freetype to a
newer version which does not rely on that define, first included in 5.5.

Change-Id: Iaaea8d6783032d784f0a370f8404972967fa7a06
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 19:40:29 +00:00
Laszlo Agocs
4178ac2c8f Align blob start in program binary disk cache
Make INTEGRITY happy.

While we are at it, clean up the way the data is composed and accessed
and avoid unaligned uint32* accesses on our side as well.

Task-number: QTBUG-58183
Change-Id: I357be4b6844e5e8b8d27261a3676e135faea6250
Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-01-24 16:23:26 +00:00
Laszlo Agocs
962130c66c Add manual test for the QtGui triangulator
Have a widget-based application that uses qTriangulate for fills
and QTriangulatingStroker (and optionally the dash stroke processor)
for strokes.

The resulting triangle (strip) set is visualized on a simple QPainter
canvas, offering the ability to zoom in and examine how the triangulator
behaves on a number of example shapes. It is also possible to step through
and only have the first N set of triangles drawn.

Change-Id: I3a27d86d4ea13a63dd4be0fe81dd4b5ed6e4fa75
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-01-24 16:23:20 +00:00
Laszlo Agocs
e0f0850cd4 Use context as glyph cache key in GL paint engine
Switch from ctx->shareGroup() to ctx. The original intention to use the
same cache instance for sharing GL contexts is reasonable, but can only
work when there are only shareable resources involved. The FBO used by
QOpenGLTextureGlyphCache is not one of these.

Text rendering in Qt Quick already uses the same approach and uses
per-context glyph caches.

Change-Id: Ie7e521769f28b4902ca714eb029acfbf52814309
Task-number: QTBUG-58276
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-01-24 15:14:38 +00:00
Jesus Fernandez
6a3e728e9b Fix possible loss of data warning
warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
while compiling class template member function 'QVarLengthArray<T,Prealloc>::QVarLengthArray(std::initializer_list<T>)'

Change-Id: I36f5ef65ec1f511eac7f3ad1a4717d18f7dc9ce4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-24 15:10:21 +00:00