Commit Graph

894 Commits

Author SHA1 Message Date
Marc Mutz
38bbd8fbac Add some missing breaks in switch statements
Found by GCC 7.

Change-Id: I90267617a038558e5b5213c598a949baf8d4d9be
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-10 16:09:42 +00:00
Marc Mutz
b92267cd4c Remove some more register keywords
They're deprecated since C++11 and removed in C++17.

Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-06 16:59:18 +00:00
Peter Seiderer
18d49808db examples: fix compile without gui module
With disabled gui module qmake in the directory examples/gui and
examples/widgets failes with:

  Project ERROR: Could not find feature opengl.

Fix this by protecting 'qtConfig(opengl)' by 'qtHaveModule(gui)' as
already done in examples/examples.pro.

Task-number: QTBUG-60488
Change-Id: Ia842124e818e8c81d41d2b8e3b8905bf1dee58ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-05 06:54:15 +00:00
Tor Arne Vestbø
9cad7b6eac Update rasterwindow example to not create() in the constructor
QBackingStore should be able to handle a non-created QWindow just fine.

Change-Id: I42299aa0e985422e1fe4279c1385b9979d267a47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-21 15:12:55 +00:00
Liang Qi
18934bcb0c Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/corelib/global/qglobal.cpp

Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
2017-04-18 10:46:22 +02:00
Samuel Gaist
98e0cb0a28 Doc: updated QSyntaxHighlighter documentation and use QRegularExpression
The documentation of QSyntaxHighlighter still uses the deprecated
QRegExp class. This patch updates the code samples as well as cleanup
some typos.

Change-Id: I87b525fddb560b7c5bb38f96d9aaceadb594f76c
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-04-12 22:09:43 +00:00
Marc Mutz
25d1bbb849 examples: remove some unneeded QStringRef::toString() calls
- when appending to another string
- when just comparing
- when just calling toInt()

Change-Id: I6960784569b83bfd3e3640a8c04f2f909c293449
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-07 14:35:04 +00:00
Liang Qi
7702fe8602 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
2017-03-27 10:42:08 +02:00
Ulf Hermann
329385a5d5 Build examples and tests only if their requirements are met
If the respective modules aren't available we cannot build the tests
and examples. We drop the qtConfig(opengl) requirement for the opengl
examples as
a, we would need to make the QtGui configuration available for that to
   work, and
b, we should not add too much detail to the tests and examples build
   configurations. Checking each test and example for every feature it
   uses would be too much.

Task-number: QTBUG-57255
Change-Id: Ifb043c81ec9e5c487765297bd65704812cd281fc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-22 15:55:55 +00:00
Liang Qi
d51c3ecf8e Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	examples/network/network.pro
	mkspecs/features/mac/default_post.prf
	src/corelib/io/qfilesystemengine_win.cpp
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess.h
	src/corelib/io/qprocess_p.h
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/thread/qmutex.cpp
	src/platformsupport/fontdatabases/windows/windows.pri
	src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
	tests/auto/corelib/io/io.pro

Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
2017-03-13 15:55:44 +01:00
Paolo Angelelli
40ace7a2a0 Fix computegles31 example
This patch fixes the example that contained problems showing up
with mesa/nouveau drivers.

Change-Id: Ic90f6028e394138781f00bcc00c145c56134f441
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-03-08 09:19:39 +00:00
Samuel Gaist
2d81968c3b Example: migrate treemodelcompleter example to use QRegularExpression
Update the treemodelcompleter example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I9fa91ca6e847603de37019e4ca86fc69a51a3772
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-03-07 23:11:31 +00:00
Samuel Gaist
9e933de7f2 Example: fix memory leak in relationnaltablemodel example
The example creates a view on the heap but doesn't delete it on
application end. This patch uses a QScopedPointer to fix that.

Change-Id: I3b0c8589999d243c193bd02e1470c03eabfabe40
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-03-07 23:11:20 +00:00
Ulf Hermann
a170c974a5 Fix building of various examples and tools with -no-feature-process
We should not check for platforms, but rather for features. Also, if
dbus is available it doesn't automatically mean that QProcess is.

Change-Id: I27ef5863fcb107cca1aa47abba95b734962adc33
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-06 14:16:13 +00:00
Kai Koehne
4460b9c843 Replace outdated BSD license text
For examples and documentation, use new BSD license text that
includes the commercial licenses.

Change-Id: I1cd74bd8e9c8f2746d8702df00780ee100cbebac
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:11 +00:00
Liang Qi
de49839df8 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	mkspecs/features/moc.prf

Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
2017-02-24 20:01:42 +01:00
Shawn Rutledge
6aaf853222 make TabletMove hover events conditional on QWidget::tabletTracking
This adds the tabletTracking property in the same way that mouseTracking already
existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event
to notify when it changes.  So for widget applications it's an opt-in feature.
QtQuick applications don't yet make use of tablet events, but when they do
in the future, we don't yet have a mechanism to turn the move events off;
it remains to be seen whether that will be necessary.

[ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous
to mouseTracking, which will enable TabletMove events while the stylus is
hovering, even if no button is pressed.  This allows applications to show
feedback based on the other tablet event properties such as rotation and tilt.

Task-number: QTBUG-26116
Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-23 10:42:42 +00:00
Oswald Buddenhagen
5e2367aaa5 use regular configure mechanism for openssl library references
don't attempt to hand-craft a library export any more. instead, use the
configure system's built-in mechanism, and refer to it via QMAKE_USE.
this also allows us to rely on transitive dependencies in the autotest.

as a side effect, this makes the openssl-linked feature imply the
openssl one.

Change-Id: I5dd209b63bc8fbbc62852f6ffc472d4452ea2e68
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-22 07:45:59 +00:00
Liang Qi
c577f6edaf Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/corelib/plugin/qlibrary_unix.cpp
	src/plugins/platforms/xcb/qxcbconnection.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp

Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
2017-02-16 21:51:11 +01:00
Samuel Gaist
7dff4b921b Example: migrate flightinfo to QRegularExpression
Update the flightinfo example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: I2395b37170565e922500e675210c400e90ae0f73
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:58 +00:00
Samuel Gaist
6864374f05 Example: migrate grabber to use QRegularExpression
Update the legacy grabber example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I1d1871b7e82cdb214fdd8ad55a606d5e7682fab1
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:51 +00:00
Samuel Gaist
beb98bdafc Example: migrate the arthur code sample to use QRegularExpression
Update the arthur code sample to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: Ic7efd4466b4c0fa50170b80ebb22fcb3624399ce
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:45 +00:00
Samuel Gaist
d2e713f3fd Example: migrate the codecs example to use QRegularExpression
Update the codecs example to use the new QRegularExpression class in
place of the deprecated QRegExp.

Change-Id: Ibd60b7256071f8166c4bf38e6a40935494c3cf3f
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:40 +00:00
Samuel Gaist
57a710467b Example: migrate settingseditor example to use QRegularExpression
Update the settingseditor example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I07e34bf916bdde161c4253fca70b853061cd589b
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:36 +00:00
Samuel Gaist
a1cf6e5281 Example: migrate stylesheet example to use QRegularExpression
Update the stylesheet example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: I7061b8fd462ff012cb67bfdade656b3bfe442dd8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:29 +00:00
Tor Arne Vestbø
7efd024b92 macOS: Make QMacNativeWidget example more usable
Change-Id: I3948c998dfbc2982a79d597c7ea3bc226df9c125
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-02-12 12:29:55 +00:00
Friedemann Kleint
ee8b61bcf5 QRegularExpression example: Handle empty patterns
Previously, when clearing the pattern by clicking the clear
button, the result match list would display a list of empty
matches since apparently an empty pattern matches as many
times as the subject is long. This is confusing when using the
tool.

Restructure RegularExpressionDialog::refresh() so that it bails
out if the pattern is empty or invalid.

Change-Id: I8119a75db50cead3f64394016e3390a9bf7d0bf7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-02-09 08:16:43 +00:00
Liang Qi
dd756011da Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	configure.json
	mkspecs/win32-icc/qmake.conf

Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
2017-02-08 15:49:18 +01:00
Oswald Buddenhagen
dcd5cb9736 Merge remote-tracking branch 'gerrit/dev' into HEAD 2017-02-01 21:00:55 +01:00
Thiago Macieira
bba4abd35f QXmlStream{Reader,Writer} don't need QtXml
They're in QtCore.

Change-Id: I63e21df51c7448bc8b5ffffd148f03c5e80b6fea
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-01-31 17:54:35 +00:00
Liang Qi
246799d8a7 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	examples/network/network-chat/peermanager.cpp
	src/widgets/util/qsystemtrayicon.cpp
	src/widgets/util/qsystemtrayicon_qpa.cpp
	src/widgets/util/qsystemtrayicon_win.cpp
	src/widgets/util/qsystemtrayicon_x11.cpp

Change-Id: I1c026df83818c0ccaf956980370e7522960627db
2017-01-30 12:46:20 +01:00
Jake Petroules
9c9edaa6f5 Use qtConfig where appropriate
Change-Id: Ib865f074b930eab89c7552d0677bf2beb020f3ae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-27 10:38:46 +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
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
74819c4ed9 Tutorial: migrate addressbook tutorial to use QRegularExpression
Update the addressbook tutorial to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: Ibea9252ab8fe1d12e6fc862fa70229ca6efe0804
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-01-24 07:24:13 +00:00
Samuel Gaist
00bbb4d273 Example: migrate network-chat to use QRegularExpression
Update the network-chat example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: Idcd3dc5b3e9b520b2eeef9565d50195cc8dffd06
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-01-23 22:53:03 +00:00
Alexander Volkov
e7b8df6349 examples: Use lambdas instead of functor classes
Change-Id: Iee2cc22a9239ab5a351cb5ecb2c8ce10ed019b2c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-01-09 15:42:13 +00:00
Ulf Hermann
2ed9a52ebf Fix compilation without sharedmemory
We have to enable qt_safe_ftok with either sharedmemory or
systemsemaphore. In order to make the resulting QT_CONFIG work with the
bootstrap library we switch the features off for bootstrapping. Some
tests and examples have to be excluded when sharedmemory is not
available.

Change-Id: I3fc3926d160202b378be2293fba40201a4bf50c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-05 08:38:33 +00:00
Oswald Buddenhagen
fe2f8146d4 prune vestiges of DEPLOYMENT_PLUGIN
the code was broken since 5.0, as it still hardcoded the version number
4 for the plugin basenames.
wince is not supported any more, so there is no point in trying to
restore the code to function.

at a later point, we'll make QTPLUGIN universal enough to cover both
static and dynamic deployment.

Change-Id: I0911ce4aff7a799dd471d6218e046f13dca6d49e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-12-23 13:25:41 +00:00
Alexander Volkov
fb7bfbf18d examples: Use QOverload to select overloaded signals and slots
We can use QOverload since Qt 5.7 (it depends on Q_COMPILER_VARIADIC_TEMPLATES
which is required since Qt 5.7).
Use it in the examples to show the best practice.
qOverload currently can't be used because it requires c++14.

Change-Id: I94a3c0db9d551fe169fa3d19c07ec0b329d5946c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-12-22 14:54:55 +00:00
Liang Qi
b131503361 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure
	configure.pri
	examples/widgets/painting/fontsampler/mainwindow.cpp
	examples/widgets/painting/fontsampler/mainwindow.h
	mkspecs/features/moc.prf
	src/corelib/global/qglobal.h
	src/gui/text/qtextdocument.cpp

Change-Id: Ica65512e00871695190a14ccea5c275b0165f787
2016-12-16 16:38:33 +01:00
Jake Petroules
510e699d15 Make network-chat example use QProcessEnvironment
This removes an unnecessary dependency on QProcess, which allows
the example to work on platforms where process support is not
available (such as iOS and tvOS).

Change-Id: I5d75fe8373b5f8c3744ab8fb3b1fd1b37eea35f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-16 09:14:31 +00:00
Liang Qi
9bfe3ab71e Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts:
	doc/global/qt-cpp-defines.qdocconf
	src/plugins/platforms/android/qandroidplatformopenglcontext.h
	src/plugins/platforms/android/qandroidplatformtheme.h

Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
2016-12-16 09:45:16 +01:00
Liang Qi
6755ec891a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure
	qmake/Makefile.unix.macos
	qmake/Makefile.unix.win32
	qmake/generators/win32/msvc_vcproj.cpp
	src/3rdparty/pcre/qt_attribution.json
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qdeadlinetimer.cpp
	src/platformsupport/kmsconvenience/qkmsdevice.cpp
	src/platformsupport/kmsconvenience/qkmsdevice_p.h
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
	tests/manual/qstorageinfo/printvolumes.cpp
	tools/configure/configureapp.cpp

Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
2016-12-13 09:39:20 +01:00
Nico Vertriest
c131a83f42 Doc: update Qt Widgets examples
- \image --> \borderedimage
- update screenshot if required

Change-Id: I0318b1df67154b70c061da7cbd509b8d5337b311
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-12-12 14:43:02 +00:00
Lars Knoll
f4a33e345e Fix compilation on platforms that don't support printing
Task-number: QTBUG-56259
Change-Id: Ice1d7601494b01b387e787da412cd94b6717ebde
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-01 13:02:24 +00:00
Alexander Volkov
c050a1bdea Examples: Remove more redundant virtual specifiers for overriders
Change-Id: I3e378c656a2651fb7031b6cf6a6939dfc5576519
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-29 10:06:02 +00:00
Alexander Volkov
011aeb131e Examples: Remove a redundant virtual specifier for overriders
It's a good practice to use override without virtual:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override

Change-Id: I5c2d73600e6c706424589c0487133c03a4ef3629
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-25 22:36:21 +00:00