Commit Graph

1278 Commits

Author SHA1 Message Date
Laszlo Agocs
1c6bd414dd Fix device local alloc in hellovulkantexture
Running with QT_VK_FORCE_STAGE_TEX does not work at all with recent
NVIDIA drivers due to QVulkanWindow's and the example's naive way of
picking the memory index. Enhance this and add a warning note to the
QVulkanWindow docs as well.

Change-Id: I7f200e11d982b56e3da3b71ee3915bd7bfca5cc1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:15 +00:00
Laszlo Agocs
48897f97e7 Fix src access with staging buffer in hellovulkantexture
Change-Id: Iafcd94ec812a61dcfae6da43b1ca9f5771e05e56
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:11 +00:00
Mitch Curtis
e04b85b026 Doc: improve Mandelbrot example
Change-Id: Iac6c3e681f3d5b195d08513ac5fe4b661c3d0f59
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-11 08:09:32 +00:00
Paul Wicking
b13e3b0eb6 Example: Close popup on mouse click without assigning new lens position
Clicking in the main renderer window passes a new position to the lens,
disregarding the "What's This" (documentation) overlay window.
This change checks if the documentation window is open on click, and if
it is, closes the documentation window and returns without further
handling of the mouse event.

Fixes: QTBUG-7205
Change-Id: I821245ec6c78be00d80af461baf8e4d59e0f351f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-10 10:04:08 +00:00
Qt Forward Merge Bot
295cd87c6d Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
2018-09-07 01:00:21 +02:00
Laszlo Agocs
85f127cb04 Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.

While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).

Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-09-06 09:17:53 +00:00
Paul Wicking
7f0cc35d9c Examples: Fix minor bug in Tree Model Completer Example
Minor bug that caused highlighter to not work properly.

Task-number: QTBUG-66084
Change-Id: I7860d7a13c402e3236f4c844020e35e11f6e53e5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 13:14:01 +00:00
Shawn Rutledge
d2c05b0c85 Tablet example: paint only the changed areas of the canvas
This improves performance significantly.

Change-Id: I9a8782148ce03a2bc85759c4e8c1eecb37467cf6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-30 04:12:01 +00:00
Shawn Rutledge
e498a1d09d Tablet example: add a menu item to clear the canvas
It's annoying to have to kill the app and start over when it gets too
cluttered.

Change-Id: Ic72e372e5742de4e7c6bb818a3150283498a517b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 12:57:01 +00:00
Qt Forward Merge Bot
8842d9d1e6 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
2018-08-17 09:08:06 +02:00
Paul Wicking
9b59a2ef97 Doc: Update out-of-date screenshots in example docs
Task-number: QTBUG-63248
Change-Id: I4cd47977ae020b43ca92b1781ac8b038e6ef851c
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-16 10:12:21 +00:00
Timur Pocheptsov
26a6afd472 DTLS server - use the proper TLS configuration
The one we had before was invalid and we ended up with
defaultDtlsConfiguration which has peerVerifyMode == AutoVerify.

Change-Id: I5b9ceb027e90189325c1d8fd0db37d1b212ebbc8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-08-10 03:46:45 +00:00
Timur Pocheptsov
5b8d5c7493 Document DTLS examples
Task-number: QTBUG-68070
Change-Id: I2b08322049005b02f1ed680bee21992ade16813a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-09 03:52:13 +00:00
Timur Pocheptsov
4c089601d7 Document the DTLS API
Task-number: QTBUG-68070
Change-Id: Ifd08ecb7c2c1a6dc352952a10ad56259bd1ecf10
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-09 03:52:02 +00:00
Qt Forward Merge Bot
053e7cce79 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/doc/src/objectmodel/signalsandslots.qdoc
	src/plugins/platforms/cocoa/qcocoamenuloader.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	tests/auto/gui/image/qimage/tst_qimage.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
2018-08-07 17:44:51 +02:00
Paul Wicking
0dfdf23d05 Doc: Synchronize documentation with code snippet
* The plugin IID with version number was removed in transition to new
  plugin system, see efde205586.
* This change re-adds the version number, so that we deliver on the best
  practices as mentioned in the documentation for the example.

Task-number: QTBUG-59487
Change-Id: I88596e71cf18be88d0b1d28d56b6d3bb72fe756b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-01 14:48:38 +00:00
Edward Welbourne
cf2d59bfe8 Merge "Merge branch '5.11' into dev" into refs/staging/dev 2018-07-31 11:34:23 +00:00
Edward Welbourne
23c9d4c98f Merge branch '5.11' into dev
Conflicts:
	qmake/library/qmakebuiltins.cpp
	src/plugins/platforms/windows/qwindowstabletsupport.h
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
2018-07-31 13:33:14 +02:00
Andre Hartmann
503920ac9e Examples: Revamp Loopback
* order and sort includes
* use functor connect
* use nullptr
* use member init
* added sanity check for nextPendingConnection()
* small cleanup here and there

Change-Id: I72c6758b5fedea0937a1f2cb9031cb7203f5d955
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-30 18:47:17 +00:00
Timur Pocheptsov
8948491eda QDtls - use conventional names
More Qt-style and more natural, also, shorter names.

Change-Id: I97bd68a8614126d518a3853027661435dc4e080d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-27 11:53:28 +00:00
Timur Pocheptsov
056fbf03a5 QDtls - refactor
This patch renames rather awkward 'remote' into more conventional
'peer' (similar to what we have in QAbstractSocket).

Change-Id: Ifc45e538b8adf9cc076bd7aee693277829fd94dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-26 15:13:57 +00:00
Eirik Aavitsland
bafa5a14dd Add demo of the new QGradient presets to the gradients example
In the gradients example, allow the user to select and show
QGradient's named presets.

Change-Id: I40bc6cbe3a0316ce49d67d63511881b6f6112574
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-24 16:45:41 +00:00
Paul Wicking
f17d33bebb Doc: Update Tetrix example
Use new connect syntax throughout the example.

Task-number: QTBUG-69503
Change-Id: I5ab1453318e60586a9655ecb58263778c02aba4f
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-07-19 18:22:12 +00:00
Jüri Valdmann
97e88dcb92 cbordump: Fix build with linux-clang-libc++
../cbordump/main.cpp:716:15: error: use of undeclared identifier 'LC_ALL'
    setlocale(LC_ALL, "C");
              ^

Change-Id: Ibff2345ffa99894cdcd48323f8c365d01ebd6300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-12 09:42:28 +00:00
Timur Pocheptsov
ced0bd8068 DTLS client - improve the example
- Remove redundant pingTimer.start() call (timer is not a single
shot timer and already started before this point in code).
- Use connected UDP sockets to show that it can work with QDtls.
- Replace (translated) string concatenations with formatted strings
  and 'arg' where needed.

Change-Id: I8dba54f43464a718062cd897d24f89b75b99f2a4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-10 04:55:48 +00:00
Thiago Macieira
6c64a9b2d2 Metatype: make the Qt CBOR value-like types built-in meta types
This change only adds them to the registry and reserves the IDs. The
next commit will handle conversions.

Change-Id: I56b444f9d6274221a3b7fffd150d2d49f40940c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-04 03:04:15 +00:00
Thiago Macieira
71e41d7230 CBOR: Add QDebug operators for the Qt CBOR value-like types
I added a function that returns the string identifiers for
QCborKnownTags and QCborSimpleType, in order to facilitate writing a
QTest::toString for those types, as neither enum is part of a Q_OBJECT
or Q_GADGET class.

Change-Id: I56b444f9d6274221a3b7fffd150d2d26a1925c19
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-04 03:04:09 +00:00
Thiago Macieira
9be00330af Examples: add an example that converts between different file formats
This example converts to and from:
 - Binary JSON
 - CBOR
 - CBOR Diagnostic notation (output only)
 - JSON
 - Null (output only)
 - QDataStream
 - QVariant dump (output only)
 - Text
 - XML

Change-Id: Ibab69e0efefb40bdbf94fffd150b59f8c0da3174
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-04 03:03:47 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Paul Wicking
7f7ceb567f Doc: Add references to QDBusAbstractAdaptor implementation example
Adding references where applicable, as removed by
023a818738 when removing stale example.

Add example run snippet to the example landing page.
Remove stale example qdoc file that is superceded by current example.

Task-number: QTBUG-69191
Change-Id: I62dc66edc86da5efb4c79fd124edb2fa619aeb6b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-29 05:16:04 +00:00
Paul Wicking
4d326555ab Doc: Add Hello GLES3 example
Task-number: QTBUG-67109
Change-Id: I55135264a63b78502b300de723a25b3f363af58b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-26 07:58:39 +00:00
Topi Reinio
6601939713 Notepad example: Wrap clipboard functions with QT_CONFIG(clipboard)
And disable menu actions for functionality that's not available.

Task-number: QTBUG-68168
Change-Id: I153487860e8dda8271ae04e9cd2ad8b26a4b130f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-06-22 14:37:48 +00:00
Timur Pocheptsov
033a1a2793 Add a secure UDP client example
A simple application that establishes DTLS connection(s) and
sends/receives datagrams. Class DtlsAssociation is
essentially a QUdpSocket|QDtls pair: it initiates a handshake,
handles timeouts and errors. After establishing an encrypted
connection it sends messages to the server and processes responses.

Task-number: QTBUG-67596
Change-Id: I92d481b7dfd2459e6a93c754b338a2e897a7feaf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-22 13:09:42 +00:00
Timur Pocheptsov
ed775e794c Add a secure UDP server example
It's a simple DTLS server, implemented with QUdpSocket,
QDtlsClientVerifier and QDtls. The server is configured
to use PSK only (it has no certificate/key).

The server uses a single QUdpSocket socket and
de-multiplexes UDP datagrams internally (thus
it can work with several clients simultaneously).

Future update will probably add more options (like
configuring with certificate/key, etc). For now -
it's as minimalistic and simple as possible.

Task-number: QTBUG-67596
Change-Id: Ic7d18dbab6dbcc9ed44c82e69a2b364df24aa256
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-21 17:01:03 +00:00
Paul Wicking
8476271eda Doc: Fix typo in Scribble example
Task-number: QTBUG-68549
Change-Id: Ib83d3297e2ebefe6f42799a14dde35411a8ec120
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-06-21 14:35:01 +00:00
Paul Wicking
8bd73ad989 Doc: Add missing full stops in briefs
Task-number: QTBUG-68933
Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-21 14:23:30 +00:00
Paul Wicking
f415f50619 Doc: Add menu bar to Books example
Add menu bar with Help->About that contains a short description of the
example application.
Remove redundant title string between menu and application content.

Task-number: QTBUG-68652
Change-Id: I31fb386ab9c01eff86b8ed3ef274ba8cfdb0148b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-21 14:23:27 +00:00
Tor Arne Vestbø
384e72bdb3 Spice up QOpenGLWindow example
By drawing the same gradient for the triangle as in the rasterwindow example.
We also set a default geometry and show the window without forcing it to become
maximized.

Change-Id: I05f9138d08f9c5d3e30eec362a3a1cd63d72753e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-15 09:35:03 +00:00
Michal Klocek
16b0c48aca Fix typo in contextinfo example
Change-Id: I4d788c9880ca4d52aab58a5abc13b8b91838b66e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-06-15 07:30:38 +00:00
Nico Vertriest
26ff9aac8e Doc: Update Extension example
-language review
-rewrite some paragraphs

Task-number: QTBUG-60635
Change-Id: I96154cd5d78b9517409ac67ec416c53031dcb909
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-13 11:41:10 +00:00
Paul Wicking
dbad7bd234 Doc: Sql example Books lock rating column width
Lock the width of the rating column to prohibit the contents to escape
the bounds of the column upon resize.

Task-number: QTBUG-68652
Change-Id: I5c744833b19a8e5bcf88ef1b9ab657ac81f5aa50
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-08 13:03:10 +00:00
Liang Qi
096e37910d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/kernel/qeventdispatcher_cf.mm
	src/gui/kernel/qguiapplication_p.h
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/qioseventdispatcher.mm
	src/plugins/platforms/windows/qwindowsdrag.h
	src/plugins/platforms/windows/qwindowsinternalmimedata.h
	src/plugins/platforms/windows/qwindowsmime.cpp
	src/plugins/platforms/winrt/qwinrtscreen.cpp

Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
2018-06-07 19:10:53 +02:00
Nico Vertriest
9551d62d97 Doc: Update Factorial Example
Updated connect syntax

Task-number: QTBUG-60635
Change-Id: Ib5280326c158221129c1817a4853bfd79bbcd895
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-07 14:29:50 +00:00
Nico Vertriest
c118f642c3 Doc: Update Elided Label example
Updated connect syntax

Task-number: QTBUG-60635
Change-Id: I8d770f62557d5056375d72d778c4e2079511b848
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-07 14:29:41 +00:00
Andre Hartmann
a14a943f9a Examples: Cleanup and modernize Plug&Paint
* Use C++11 member init
* Use auto where appropriate
* Replace foreach with range-for
* Replace last Qt4-style connects
* Sort includes to common style
* Fix some Clang warnings

Task-number: QTBUG-60635
Change-Id: I61c98b34b954e416dd175b56ca589125217083de
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-06 11:55:44 +00:00
Paul Wicking
afdb675ada Doc: Clean up SQL Example: Books - whitespace edition
Remove whitespace for consistency.

Task-number: QTBUG-68652
Change-Id: I1ca1f449db2352cb96c88535936f2c44392693cf
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-06 09:47:21 +00:00
Paul Wicking
fcbfa534fa Doc: Clean up SQL example: Books (part 2)
Improve readability, enforce consistent code formatting.

Task-number: QTBUG-68652
Change-Id: I7bbe0b2baa6273e0133df84d7c3cc2aa6a0b6ff2
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-06 09:47:11 +00:00
Paul Wicking
ce7cbcc3b6 Doc: Clean up and modernize SQL example: Books
* Replace Qt4-style connects.
* Reformat code to adhere to 80 column width.
* Touch comments to make location and style consistent.
* Rename a label in the UI form.

Task-number: QTBUG-68652
Change-Id: Icc592f7b5a013d1806bc36c45057b35472b6efbb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-06 09:46:49 +00:00
Nico Vertriest
7b74b4fbec Doc: Update connect syntax Plugandpaint Example
Task-number: QTBUG-60635
Change-Id: I354a0886b22c63be57bd927308163abd3246be77
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-05 15:02:05 +00:00
Thiago Macieira
9998654eac Examples: use CBOR in the network-chat broadcast message
Instead of sending one @-separated message, send one CBOR message. The
message structure is, using the CBOR Data Definition Language:

  broadcast = [
    username: tstr,
    port: 0..65535
  ]

Change-Id: Ic38ec929fc3f4bb795dafffd150ac2614d18c6bf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-02 03:11:33 +00:00
Thiago Macieira
bfcb8c6dca Examples: change the main network-chat protocol to CBOR
This complements the previous commit, which changed the broadcast
datagram to CBOR. This commit changes the TCP protocol too. The protocol
is an infinite array of commands, each of which is a map from an integer
(the DataType enum) to either a string or null.

The entire state machine for the connection is rewritten, relying on
QCborStreamReader's ability to deal with incomplete data.

Change-Id: Ic38ec929fc3f4bb795dafffd150ac674c32fac87
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-02 03:11:30 +00:00
Nico Vertriest
28738d2d8d Doc: Add formatting features to Notepad example
- bold, italic, underline
- About button

Change-Id: I8ece7d2bfca0b148b681a2fccb4a439ce179848a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-01 09:54:56 +00:00
Edward Welbourne
2d3bbd7f17 glextensions.h: simplify #if-ery to avoid conflict
The prior #if-ery was needlessly confusing; and most of it was
redundant anyway.

Change-Id: I82da1b38c08b93b9dc2220dd7b15ecb7dcc002af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-31 15:51:55 +00:00
Tor Arne Vestbø
c4a21708ed Provide presets for QGradient
Similar to Qt::GlobalColor, the presets allow the user to create
brushes based on predefined gradients, quickly getting pretty pixels
on screen.

The presets are based on the linear gradients from WebGradients, a
free collection of gradients, hosted at https://webgradients.com/.
The few radial and blended gradient presets have been excluded.

Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:50:50 +00:00
Joerg Bornemann
9f27bfb31a Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.

Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-29 18:31:35 +00:00
Qt Forward Merge Bot
875731368a Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8d8b03ea46c537b091b72dc7b68aa6aa3a627ba6
2018-05-29 01:00:09 +02:00
Nico Vertriest
42e4a6531d Doc: Update Echoplugin Example
- screenshot
- connect syntax

Task-number: QTBUG-60635
Change-Id: I18c3e1fef5c623565bbf6cf33bf88e9d8135d8be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 12:38:07 +00:00
Thiago Macieira
2457b1381b Example: add a simple CBOR dumper tool
This is useful as well when trying to figure out what a CBOR file
contains or how it may fail to parse.

Change-Id: Ic38ec929fc3f4bb795dafffd150ad7c0bd8e9887
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-28 11:36:54 +00:00
Nico Vertriest
35e31149c2 Doc: Update Fetchmore example
- minor edit
- updated screenshot

Task-number: QTBUG-60635
Change-Id: I988ad28723131127eee0a93671b0562d8f446139
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 10:19:06 +00:00
Liang Qi
f82e508516 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	mkspecs/features/qt_common.prf
	src/corelib/tools/qstring.cpp
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/widgets/widgets/qmainwindowlayout_p.h

Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
2018-05-24 16:29:14 +02:00
Paul Wicking
0e666d1875 Doc: Update image, icon and screenshot for SQL example application
Replace image and icon in the SQL Master Detail example application,
as well as the screenshot of the application on the landing page.

Task-number: QTBUG-60633
Change-Id: Ic739908b569ea7f974b9dac48f673e14f6557550
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-22 12:06:22 +00:00
Nico Vertriest
d9c430cfd9 Doc: Update connect syntax Order Form Example
Task-number: QTBUG-60635
Change-Id: Ia474a23db7c32e68cb23ffa6ec14b9c6376cadec
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-16 12:00:00 +00:00
Nico Vertriest
57fae860fd Doc: Modify connect statements Echoplugin Example
Task-number: QTBUG-60635
Change-Id: I4313ff65875d20b768d7ad6e9c8322bd5cf7f1ab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-16 11:59:27 +00:00
Nico Vertriest
3b28e3d871 Doc: update connect syntax digitalclock example
Task-number: QTBUG-60635
Change-Id: I9d8411b639e5cf74c9cb03de4b5f6081bb549151
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-16 11:57:51 +00:00
Liang Qi
7e1b504f31 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	mkspecs/features/qt_module_headers.prf
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qwidget/BLACKLIST

Change-Id: I2a08952d28d1d0e3d73f521a3d44700ce79ff16c
2018-05-14 14:51:46 +02:00
Christian Ehrlicher
fae53562ae QLineEdit example: fix link to QLineEdit::setInputMask
Fix a typo to properly link to setInputMask instead setMask.

Task-number: QTBUG-61775
Change-Id: I0cb00de8dcaece613467e25b41e93661d6e98308
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-09 17:45:29 +00:00
Andre de la Rocha
e0a6409ba7 Rename the tablet example to avoid triggering a bug in tablet drivers
It seems there is a subtle bug in the Wacom tablet drivers for Windows that is
triggered in the very particular case where the running executable is named
"tablet.exe", regardless of its installation path. It causes WM_POINTER*
messages not to be delivered to the application, initially, but only after the
application's window is reselected, after another application's window had
been selected. It happens at least on Windows 10 systems with Wacom Bamboo
tablets and drivers, and was reproduced with non-Qt-based applications also.
It looks like a bad compatibility setting that makes "tablet" a cursed target
name for applications using tablet functionality. It seems older versions of
the drivers used to contain an executable with this name, although it seems to
be absent in newer versions. Unfortunately, the Qt tablet example uses this
name, which breaks it when used with upcoming WM_POINTER* messages support.

Change-Id: I931cc725b9117b4604267f7b0172110ae61700de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-05-09 15:34:18 +00:00
Thiago Macieira
2f9d49630d Examples: fix network-chat in the presence of an IPv6 stack
Since we bind to QHostAddress::Any, the incoming packets are actually
IPv4-mapped IPv6 addresses and the operator== strict comparison was
failing. Instead, use isEqual(), which defaults to TolerantComparison.

Change-Id: Ic38ec929fc3f4bb795dafffd150ac6b3a0a7e3b2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-05-05 06:20:01 +00:00
Liang Qi
60fefff22f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
	examples/widgets/graphicsview/elasticnodes/node.cpp
	examples/widgets/graphicsview/elasticnodes/node.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_drawing.mm
	src/widgets/kernel/qmacgesturerecognizer_p.h

Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
2018-05-03 14:50:22 +02:00
Friedemann Kleint
3e4b7223f1 Examples: Fix unused variable warnings by Clang
mainwindow.cpp(59,11):  warning: unused variable 'ROWS' [-Wunused-const-variable]
const int ROWS = 2;
mainwindow.cpp(60,11):  warning: unused variable 'COLUMNS' [-Wunused-const-variable]
const int COLUMNS = 3;
mainwindow.cpp(76,19):  warning: unused variable 'message' [-Wunused-const-variable]

Task-number: QTBUG-60635
Change-Id: I97c31462ffa826da9baa32c33c0ff0140bf46dfc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-02 13:05:55 +00:00
Qt Forward Merge Bot
7de400052f Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
2018-05-02 13:15:15 +02:00
Friedemann Kleint
9b8fc8dd13 Examples: Fix Clang warning about hiding QGraphicsItem:::advance()
In file included from edge.cpp:52:
./node.h(76,10):  warning: 'Node::advance' hides overloaded virtual function [-Woverloaded-virtual]
    bool advance();

Change-Id: I9d437059362c367e452b1b4f16077d4e0abd18de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-02 09:35:49 +00:00
Friedemann Kleint
2677ad78e6 Vulkan Examples: Fix Clang warnings about initialization of VkClearColorValue
hellovulkanwindow.cpp(97,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.0f, m_green, 0.0f, 1.0f };
hellovulkantexture.cpp(771,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
..\shared\trianglerenderer.cpp(455,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
renderer.cpp(896,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.67f, 0.84f, 0.9f, 1.0f };

Change-Id: I3c2403699059dac2f88541f2a2102b774db0c887
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-30 08:35:15 +00:00
Liang Qi
866b47916d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
2018-04-26 09:55:10 +02:00
Nico Vertriest
b1bbce2609 Doc: Update doc for Dir View Example
Task-number: QTBUG-60635
Change-Id: I4a23f4866c76b9f5c29653ca30e44c3b844a9aa8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-25 09:02:02 +00:00
Nico Vertriest
5155942a0d Doc: Update Gradients Example
modify to latest syntax for connect statements

Task-number: QTBUG-60635
Change-Id: Ie0f8f6bdbd5aec7379f7572e978adf65b9a96bdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-25 09:01:47 +00:00
Christian Ehrlicher
b3bbba7b87 Examples: fix wrong QRegExp in Custom Sort/Filter Model Example
Fix wrong QRegExp in Custom Sort/Filter Model Example and replace it
with QRegularExpression.

Task-number: QTBUG-61129
Change-Id: I515474ee6985d36195d90dcd93876ba28a83bccc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-22 12:46:45 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Friedemann Kleint
a5e2ec5cdb Fix documentation of the Event Transitions Example
Fix warning:
eventtransitions.qdoc:50: (qdoc) warning: Unknown command '\s1'

Amends 3b2d2ada5b1b66ad65eda10d70b5b48d32ef9c5.

Task-number: QTBUG-60635
Change-Id: I4002c9769d30d9b8cb2a7255aa2258f6251ea39f
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-04-11 07:32:28 +00:00
Gabriel de Dietrich
a6c7eeacdc textedit example: Fix disabled Cut/Copy menu items
This amends commit fe1ea010b9.

Change-Id: Ia1f9fa4a6dd4481b5295df986f882f1120c3d8b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-10 16:27:14 +00:00
Qt Forward Merge Bot
e027c7241f Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
2018-04-10 01:00:26 +02:00
Nico Vertriest
5ffd47b764 Doc: Update connect syntax in I18n Widgets Example
Task-number: QTBUG-60635
Change-Id: Icfa0d09ac6c9ad4396fbe1138277bb1dd866a803
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-09 06:51:23 +00:00
Nico Vertriest
5c240f380a Doc: Add brief statements to Address Book Example chapters
Task-number: QTBUG-60635
Change-Id: Ice6d2b6a475ba4352a87bb46366826334aed2af2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-09 06:51:07 +00:00
Nico Vertriest
cb57700456 Doc: Update Find Files example
- review text
- update screenshot

Task-number: QTBUG-60635
Change-Id: I596ce0e08be9ed9aea7834eeda1c3c2c19c28d7a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-09 06:50:52 +00:00
Nico Vertriest
23b2d2ada5 Doc: Update Event Transitions Example
- added screenshot
- some modifications to the text

Task-number QTBUG-60635

Change-Id: I57b269f93cdba696b424b5ba008d0f46ac612cda
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-04-09 06:50:21 +00:00
Qt Forward Merge Bot
ffb2c2ac6c Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I33b47095efdfe0ba698c6a88ca41ec911f432208
2018-03-31 01:00:13 +02:00
Samuel Gaist
1c4cae6277 Improve the Frozen Column example
This patch updates the frozen column example to use QTextStream which
offers a more convenient way to read text files and also takes care of
converting the 8-bit data stored on disk into a 16-bit Unicode QString.

Change-Id: Ifd03903ac14b48b026d8770cda726f8ed2756ab4
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-03-29 19:12:03 +00:00
Liang Qi
794781e7cf Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_mouse.mm
	src/testlib/testlib.pro

Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
2018-03-28 08:12:21 +02:00
Christian Ehrlicher
acc629c1e8 Examples: replace QDesktopWidget::availableGeometry()/screenGeometry()
QDesktopWidget::availableGeometry()/screenGeometry() was deprecated in
5.11 and replaced with QScreen::availableGeometry()/screenGeometry()

Change-Id: I912a133971c41196f8f49754c28ce92711ff42bb
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-27 16:50:05 +00:00
Christian Ehrlicher
10db31f933 Examples: replace QDate::longMonthName()/longDayName()
QDate::longMonthName()/longDayName was deprecated in 5.10 and replaced
by QLocale::system().monthName()/dayName() in this case

Change-Id: I666cccfa1b8a437cc830804bbe3504511265ea9b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-27 16:50:01 +00:00
Christian Ehrlicher
1c33e8945d Examples: replace deprecated QQuaternion::conjugate()
QQuaternion::conjugate() was deprecated with 5.5 and replaced by
QQuaternion::conjugated().

Change-Id: I0176e3db82e9ad793f60e1034a22b11832c8c44d
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2018-03-27 16:49:58 +00:00
Kai Pastor
4c0e27ae6f Add Qt::SvgMiterJoin option to pathstroke example
Qt::SvgMiterJoin is more important than the name suggests: It is used
not only by SVG but also by PDF. It differs from Qt::MiterJoin in the
miter limit behavior.

Task-number: QTBUG-52640
Change-Id: I8ad04b1231958628caab18a233d54d42ea6449e7
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-03-21 06:24:41 +00:00
Tor Arne Vestbø
9c17b8adb9 Update rasterwindow example to not render in resizeEvent
The resize event should not be used to draw, as there will be a follow-up
exposeEvent delivered just after, and we don't want to draw twice.

This is how QRasterWindow operates too, except it defers the backingstore
resize to beginPaint() instead of resizing in the reizeEvent.

It's also how QOpenGLWindow operates, which also has a note for the
virtual resizeGL method saying: "Scheduling updates from here is not
necessary. The windowing systems will send expose events that trigger
an update automatically."

Change-Id: I2a9740018508c2eb129149f53237ee8e378c03b1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-20 16:00:31 +00:00
Qt Forward Merge Bot
d58f3c4878 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icf3b9346117ce7149d8687e4cfa182e7586713f3
2018-03-18 01:00:11 +01:00
Friedemann Kleint
f6f40014c4 regularexpression example: Add raw string literal display
Factor out the line edit displaying the code to a class and add
another instance for displaying raw string literals.

Task-number: QTBUG-60635
Change-Id: I4614e4a56e355bad5158523c58edf784868dbf4d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-03-17 18:15:15 +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
Friedemann Kleint
59343eef7d sub-attaq example: Fix crash with software Open GL
Check whether an Open GL context could be created, else
fall back to raster.

Task-number: QTBUG-64797
Change-Id: I91bba41b0efca85293a1a4af054842b9f309b126
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-14 13:27:08 +00:00
Nico Vertriest
421cfd9492 Doc: Complete Dynamic Layouts Example
- add doc to code
- replace old signal/slot syntax
- more up-to-date screenshot

Task-number: QTBUG-60635
Change-Id: Iec3d2c3d0d8b9c07ccd4446d74d5eca2d88e7e08
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-14 12:44:20 +00:00
Nico Vertriest
0daa14e191 Doc: complete Dir View Example
- add updated screenshot
- add basic doc to example code

Change-Id: Iad616b285ee1470571adc38b868fcf8a0ed64840
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-13 12:08: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
Christian Ehrlicher
1c98cb2b04 Examples: fix superfluous ';' in undo example
There was a superfluous ';' at the end of main. No compiler will
complain I guess but the examples should be syntactically correct.

Task-number: QTBUG-55128
Change-Id: I2ddc3041ed05106d04fb4f4ad74735c72c9ddb26
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-03-12 20:38:18 +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
Nico Vertriest
1504dda578 Doc: Update example Embedded Dialogs
Changed old signal/slot syntax to new version

Task-number: QTBUG-60635
Change-Id: I7cbe8851d321b7632a08c098b69a96cc346d5f83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-05 14:52:27 +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
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
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
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
Nico Vertriest
0d4ce766ae Doc: review language and spelling in Editable Tree Model Example
Task-number: QTBUG-60635
Change-Id: If82e3e36e5f6d1044028dc4454f2db13f84754d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-19 14:22:15 +00:00
Nico Vertriest
195b2321d2 Doc: complete Border Layout Example
Task-number: QTBUG-60635
Change-Id: Icc605e5bad96aaad0233d4b05ab1ed46972bd725
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-19 12:28:46 +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
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
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
Nico Vertriest
2908a13a78 Doc: Remove Validators example from highlighted widgets examples
Contains several bugs.

Task-number: QTBUG-60635
Change-Id: I64d7431ebab2e3f7776e7d2a94e301d677c1bb1e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-15 09:05:29 +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
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
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
Liang Qi
8dd22d9255 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
2018-02-11 09:13:21 +01:00
Liang Qi
32b506d1db Merge remote-tracking branch 'origin/dev' into 5.11
Conflicts:
	src/corelib/tools/qvarlengtharray.qdoc
	src/corelib/tools/qvector.qdoc

Resolved documentation changes in favor of 017569f702,
which keeps the move overloads along with its const-ref sibling.

Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79
2018-02-10 15:55:52 +01:00
Jake Petroules
3343295d80 Fix a bunch of compiler warnings in the qtbase examples
Change-Id: Id0c615aa72d4f4c5941cfa5ca258c3114694ef67
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:22 +00:00
Martin Smith
e177fc4d39 doc: Change \l StyleSheetEditor to \c StyleSheetEditor
A \l was changed to \c to be consistent with all the other references
to the class name..

Change-Id: Ic7449a06e0a1f1d6d7087e11cc85258e81a0dfab
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:27 +00:00
Liang Qi
27e8612fa4 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I6b40ecee4db13e6329e7a0433b57c5bca473c63f
2018-01-29 20:49:24 +01:00
Tor Arne Vestbø
11f6c64696 rasterwindow: End painting on device before ending on backingstore
Change-Id: Ib42de1d7ad0d14e2e2d2ff75606e6cfd7e584c2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-29 11:15:24 +00:00
Frank Richter
5a05348fb6 examples: Add localserver feature check for localfortune examples
Change-Id: I536645ddf0a5ead31a2658d03984c1226a7c39c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-27 11:19:06 +00:00
Thiago Macieira
a6b697ca13 Create corelib/serialization and move existing file formats into it
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.

Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-26 20:59:50 +00:00
Friedemann Kleint
b0310ddd16 hellogles3 example: Fix start-up crash when using dynamic GL
Move the instantiation of QGuiApplication to the top since it is
required by QOpenGLContext::openGLModuleType().

Task-number: QTBUG-55671
Change-Id: I506cee193fe2ba48400851588a8ef079848bc2f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-01-26 09:47:45 +00:00
Oliver Wolff
6c3f864ec0 examples: Fix notepad example for configurations without printsupport
Task-number: QTBUG-65735
Change-Id: I7e0d19de4ac92603f2fd033007343f20a408618a
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-01-22 08:27:26 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
2018-01-20 22:36:19 +01:00
Nico Vertriest
8688f2d4ab Doc: add doc to Anchor Layout Example
Task-number: QTBUG-60635
Change-Id: Iec6cae8c3caeac4bfabddae79b6ed2b47c5f2edf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-18 09:24:39 +00:00
Nico Vertriest
b4aaf3abe0 Doc: revamp Animated Tiles example
Task-number: QTBUG-60635
Change-Id: Iceb53e7c0df88bb51589a1cc86e905dbc60a856e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-01-16 15:21:12 +00:00
Nico Vertriest
a24b4c7c8a Doc: add documentation to Blur Picker example
Task-number: QTBUG-60630
Change-Id: I228b8257839115c561529184faa75275c69bb8a8
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-01-16 15:21:02 +00:00
Rainer Keller
f13b0b2cf2 qtlite: Skip building examples when configured with no-feature-itemviews
Compiling the default examples should be possible without compile errors.

Task-number: QTBUG-53141
Change-Id: I73d8787241291ae6230861a89b38e91d900fede0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-01-12 07:58:20 +00:00
Liang Qi
f4d8cafc1b Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/3rdparty/harfbuzz-ng/src/hb-private.hh
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/sql/doc/src/sql-driver.qdoc

Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
2018-01-11 18:10:41 +01:00
Rainer Keller
b03133231b qtlite: Skip building examples when configured with no-feature-udpsocket
Compiling the default examples should be possible without compile errors.

Task-number: QTBUG-46857
Change-Id: Ie323798df09cdbebc67eb617a7e0ec4c66cb2357
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-11 12:37:50 +00:00
Christian Ehrlicher
e954951423 Fix QAbstractItemModel::beginRemoveRows in examples
QAbstractItemModel::beginRemoveRows() must not take a negative value
for first or last. It will assert so we should make sure the examples
are correct.
The assertion was added in 00c09e752f

Change-Id: I539175c0597ed6f0ae76b7493fd3dca40638714e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-03 07:53:33 +00:00
Liang Qi
9de26a630f Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-02 09:32:37 +00:00
David Faure
739611221c Add QHeaderView::setFirstSectionMovable(), useful for flat treeviews
QTreeView makes columns movable except for the first one
(since Qt 5.0, see commit e0fc088c0c). This is indeed best
for actual trees, but not when using QTreeView as a flat
multi-column list (with no "root decoration"). Then it should
be possible to move the first column.

[ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow
the user to move the first column (like in Qt 4.x) using the new
method QHeaderView::setFirstSectionMovable().

Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-02 09:31:11 +00:00
Lars Knoll
0f315adf91 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	.qmake.conf
	sc/corelib/io/qfsfileengine_p.h
	src/corelib/io/qstorageinfo_unix.cpp
	src/platformsupport/eglconvenience/qeglpbuffer_p.h
	src/platformsupport/input/libinput/qlibinputkeyboard.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/ios/qiosscreen.h
	src/plugins/platforms/ios/qioswindow.h
	src/plugins/platforms/ios/quiview.mm
	src/printsupport/dialogs/qpagesetupdialog_unix_p.h
	src/printsupport/dialogs/qprintpreviewdialog.cpp
	src/printsupport/widgets/qcupsjobwidget_p.h
	src/widgets/widgets/qmenu.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
2018-01-02 09:58:44 +01:00
Christian Ehrlicher
a779d68256 MimeTypeBrowser: avoid memleaks
In MainWindow ctor some member values were allocated without a parent
and not cleaned up in dtor. Fixed it by give them a valid parent so they
get automatically cleaned up. Also m_treeView was initialized twice.

Task-number: QTBUG-61862
Change-Id: I5590b87bb517c55db6eb58e700a5d419c0acdba2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-27 18:21:28 +00:00
Nico Vertriest
0fd5fe28ab Doc: remove Config Dialog Example
Task-number: QTBUG-60635
Change-Id: I089f14a92f1b9c53b26200c93cac7ee3c9f26d65
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-12-27 14:41:18 +00:00
Shawn Rutledge
0c4d31d8c9 Improve the findfiles example: use QDirIterator, etc
It hasn't been necessary for a long time now to write the recursive
file-find function manually.  It has just been an obscurely documented
feature of QDirIterator for far too long.

Demonstrate the new QLocale::formattedDataSize() function.

Also sync up the qdoc description of this example with the recent changes.

Change-Id: I9c2bb15bb5ec353d38181b160f0be198774cbea2
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-12-27 08:40:22 +00:00
Thiago Macieira
f9c07da7b6 Examples: Update multicast sender and receiver examples for IPv6
It's the right thing to do, as we're in 2017, not 1997. Also, this takes
care to indicate that QAbstractSocket::MulticastTtlOption makes sense
mostly for IPv4, even though it's implemented for both families. In
IPv4, it's used to indicatae the scope, whereas in IPv6 it's stored in
bits 12-15 of the address.

Task-number: QTBUG-46046
Change-Id: I9741f017961b410c910dfffd14ffaabe0a2024d8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-24 02:04:07 +00:00
Andre de la Rocha
ac8011c161 Make the Main Window example use high-DPI toolbar icons
The Main Window example generates icons programmatically for its
toolbars. However, these icons are shown with low resolution in a
high-DPI display because the application is not enabling high-DPI
pixmap support.

Change-Id: Id763b707105d02f63162fff2efeb607eb5b59ed1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-12-19 17:57:08 +00:00
Nico Vertriest
ca181d3740 Doc: complete Draggable Text example
Task-number: QTBUG-60635
Change-Id: Ib901c677ad78a663c3f3e0dd689b8d65be10be83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-19 13:43:15 +00:00
Nico Vertriest
7f5a314011 Doc: complete Easing Curve Example
- updated logo
- updated screenshot
- add link to easing.qdoc

Task-number: QTBUG-60635
Change-Id: I9389dfbbe66cfa5f4e8641bee2f8fd63f5c95f99
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-18 14:07:51 +00:00
Nico Vertriest
51a956366f Doc: move notepad example to qtbase and improve it
- Edited gettingstartedqt.qdoc
- update .pro files
- replaced snippet statements by \quotefromfile
- removed second version of notepad.h and notepad.cpp
  that were made only for quoting snippets
  (\quotefromfile reads from the program code)
- show current filename in header of window
- added checking routine on filename in Save method

Task-number: QTBUG-63984
Change-Id: I5298d761763a4dfeb705a1d9b77354be853ada88
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-18 13:39:28 +00:00
Eskil Abrahamsen Blomfeldt
4d88d79aa5 Update usage of QFontMetrics::width() to new API
QFontMetrics(F)::width() has been deprecated and is replaced by
horizontalAdvance(). This updates all usage of it in tests and
documentation.

It is worth noting that many or most of the usages of
QFontMetrics::width() probably intended to use boundingRect().width(),
but since it currently works, I have not looked into that, just
replaced the function name mechanically.

Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-08 15:06:32 +00:00
Allan Sandfeld Jensen
2c25a431d0 Use dependencies instead of CONFIG+=ordered
Also drops a few instances where the dependency was purely runtime,
especially for examples.

Change-Id: I2a0476f79928143596bdb3b8f01193af90574ae8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-02 11:09:15 +00:00
Nico Vertriest
8d75c6765d Doc: Complete Simple Anchor Layout Example
Task-number: QTBUG-60635
Change-Id: I1351df7c514c57ed04ff6e640d7338d62c8f91ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-11-30 14:15:08 +00:00
Liang Qi
87204c856a Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/corelib/thread/qsemaphore.cpp
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
2017-11-30 09:16:58 +01:00
Nico Vertriest
d0812cbdab Doc: modify connect statement to new syntax
Task-number: QTBUG-60635
Change-Id: I776bdc49ae42e2d0c11dc33d58d9ce91b9f5e753
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-29 14:09:31 +00:00