Commit Graph

1526 Commits

Author SHA1 Message Date
Alexandru Croitor
f4b4c4f79b Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
2019-10-11 16:23:19 +02:00
Christian Ehrlicher
4af00753fa Cleanup QtWidgets examples
Cleanup QtWidgets examples:
 - use nullptr (clang-tidy)
 - use member-initialization
 - adjust the style
 - fix includes

Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-10-11 06:32:30 +02:00
Shawn Rutledge
f1dd6addda Make QTextBlockFormat::MarkerType an enum class
This came up during API review.

Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-10 21:08:08 +02:00
Frederik Gladhorn
d8c3375dbd cmake: add examples/opengl
Fixes: QTBUG-78164
Change-Id: Iccc8bb1354d2362c950de17a6c00e00f95272967
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-07 07:22:17 +00:00
Frederik Gladhorn
331d1cf9fd cmake: add examples/vulkan
Fixes: QTBUG-78216
Change-Id: Id7d936ab0b3febc6b7ad3170ec2ea67836484217
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-07 07:22:09 +00:00
Lars Knoll
7e2016de5e Fix compilation
Change-Id: I2f160bf47eb39c9f15fdf6ec0097495f526a6b91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-04 17:53:43 +02:00
Qt Forward Merge Bot
3a1613c227 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I43393cf47675fd6c14972df1221986335c6f493c
2019-10-04 01:01:48 +02:00
Christian Ehrlicher
26d626436b Widgets flowlayout example: Fix crash on startup
The flowlayout example crashes on startup because the last change
removed a c-style cast which converted -1 to ~0U ...

Fixes: QTBUG-78861
Change-Id: I0dbed4472b4f68a92b3f92763d00d28baa186f9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-03 13:15:47 +02:00
Christian Ehrlicher
5d3e6ef909 Examples/OpenGLWindow: do not use hardcoded indices
Don't use the hardcoded indices 0 and 1 but the ones returned from
QOpenGLShaderProgram::attributeLocation(). Also change them from GLuint
to GLint.

Fixes: QTBUG-43566
Change-Id: I582bcf899f20d90f4ec1cd61326a177aabb69992
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-02 08:36:36 +02:00
Qt Forward Merge Bot
8791a8398a Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-10-01 11:47:42 +02:00
Qt Forward Merge Bot
4e40c54a3c Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
2019-10-01 01:01:20 +02:00
Christian Ehrlicher
b0042601ed Cleanup QtOpenGL examples
Cleanup the OpenGL examples
 - use nullptr (clang-tidy)
 - use member-initialization
 - avoid redundant checks for != nullptr when deleting a pointer

Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-30 22:16:27 +02:00
Liang Qi
99cdd5fc67 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/global/qrandom.cpp
	src/corelib/io/qfileinfo.cpp
	src/corelib/kernel/qeventdispatcher_win.cpp
	src/corelib/kernel/qeventdispatcher_win_p.h
	src/gui/text/qfontdatabase.cpp
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	src/plugins/platforms/windows/qwindowsglcontext.cpp
	src/testlib/qtestcase.cpp

Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
2019-09-30 14:43:02 +02:00
Albert Astals Cid
d12bf4eb83 Port two examples from QTime to QElapsedTimer
Change-Id: I23d13bf1e909801797a8fc2785c46f341ef5ee77
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-09-27 18:01:58 +02:00
Leena Miettinen
f92a7c1288 I18N: Load qtbase_ translation catalogs in examples
...instead of the qt_ meta catalogs. The qt_ catalogs
are needed for backwards compatibility and depend on
translations for now deprecated modules, such as qtscript,
that might not be installed in the system. This causes
loading the translation to fail.

Instead of the qt_ catalogs, the examples should use the
translation files for the Qt modules used, here qtbase_.

Task-number: QTBUG-69203
Change-Id: I13f5a3d6653cef8379a712fbc02ec320eea4e51a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-27 13:48:53 +00:00
Qt Forward Merge Bot
15dc8b1d8e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I46ec05ade1c84e61f7f45562a218aa9ff55e2975
2019-09-19 21:54:53 +02:00
Christian Ehrlicher
cb54c16584 Cleanup QtWidgets (widgets) examples
Cleanup QtWidgets widgets examples:
 - use member-init (clang-tidy)
 - fix includes/don't include QtWidgets globally
 - include own header first
 - use nullptr (clang-tidy)
 - avoid c-style casts
 - use QVector instead QList

Change-Id: Ib56bb507eb2ef885f1ddc664050d3c7af92adb70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-17 23:05:23 +02:00
Qt Forward Merge Bot
1cfa636fe2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ie24be82ee70bf103c2664de1a42741979262b10c
2019-09-16 01:00:07 +02:00
Christian Ehrlicher
3fede6cb54 Cleanup QtWidgets (tools) examples
Cleanup QtWidgets tools examples:
 - use member-init (clang-tidy)
 - fix includes/don't include QtWidgets globally
 - include own header first
 - use nullptr (clang-tidy)
 - avoid c-style casts
 - use QVector instead QList
 - use QItemDelegate instead QStyledItemDelegate

Change-Id: Ibe9440cdf711e5cc2138c054864edebe1fc95731
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-11 20:36:17 +02:00
Qt Forward Merge Bot
2eead078c8 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: If8e9d88771243fd9e221b49f53d7d8b111a8ce2a
2019-09-09 09:21:48 +02:00
Christian Ehrlicher
6f4bc3942d Widgets/GraphicsView examples: cleanup
Cleanup GraphicsView examples with the help of clang-tidy
 - modernize-use-nullptr
 - modernize-use-default-member-init
 - modernize-use-override.IgnoreDestructors
 - Some QList -> QVector changes
 - use nullptr
 - use normalized includes, remove unused includes
 - fix style

Change-Id: I79347e55bfde52f6ae7749cc7093fbd442044020
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-05 17:40:36 +02:00
Friedemann Kleint
72106832e4 QtWidgets/D&D/dropsite example: Add copy functionality
Add a slot copying the QMimeData contents as text.

Task-number: QTBUG-60635
Change-Id: Ided14fccd8a49029ff1aff64969454ed2232dbeb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-05 10:50:49 +02:00
Friedemann Kleint
60bea1c85a QFileSystemModel: Fix naming of Option enumeration
Fix an API review finding in 5.14, amending
6b9d319b26.

Change-Id: I6c67ebde91021b87a43a86ff831b724f098019aa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-02 13:21:57 +02:00
Liang Qi
0f1f7fb97f Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetrepaintmanager.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
2019-08-27 09:45:52 +02:00
Sona Kurazyan
1b7ce85a60 Remove usages of deprecated APIs of QWheelEvent
- Replaced the usages of deprecated QWheelEvent::delta() and
  QWheelEvent::orientation() with QWheelEvent::angleDelta().
  In most of the examples it is acceptable to use only the vertical
  component of angle delta.

- Made the docs APIs to build conditionally, based on the
  deprecation version.

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Change-Id: Id4230d483f724af49e4b6349b44881c3944de2a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-23 21:51:43 +02:00
Leander Beernaert
bf298499a0 Update public CMake macros' version
Update all public Qt macros to use qt6/QT6 instead of qt5/QT6.

Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 10:04:30 +00:00
Tor Arne Vestbø
ce73b4db62 Remove dead code from Qt 4 times
The benefit of keeping this code around was to inspire or inform
changes in the areas to take into account possibly missing features
in Qt 5, but at this point that benefit is questionable. We can
always use the history to learn about missing pieces if needed.

Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-20 22:27:46 +00:00
Christian Ehrlicher
13426aff24 Cleanup QtWidgets animation examples
Cleanup the QtWidgets animation examples:
 - use nullptr
 - use normalized includes, remove unused includes
 - fix style
 - fix crash of sub-attaq when the game ended (error during range-based
   for loop porting)
 - don't use keyword 'final' for a variable name

Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-17 09:51:32 +02:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Friedemann Kleint
6b9d319b26 QFileSystemModel: Add options
Add Options flags similar to QFileDialog:

- DontWatch: Do not use file system watchers for simple
  use cases like line edit completion. This brings it
  closer to QDirModel, which then can be deprecated.

- DontResolveSymlinks: Similar to
  QFileDialog::DontResolveSymlinks.

- DontUseCustomDirectoryIcons: matching
  QFileIconProvider::DontUseCustomDirectoryIcons for
  convenience.

Task-number: QTBUG-76493
Change-Id: I09d3cb73ef902a700e6ebfba427e2d990fce4b4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-14 15:02:04 +02:00
Marc Mutz
c58ca4256d Deprecate QStringViewLiteral
As a macro, we can't directly deprecate it, but need to make it call
something deprecated. That is a new ctor with a new enum type
added. The type might be useful for other such ventures, so put it
into qglobal.h

Remove the QT_NO_UNICODE_LITERAL protection, as it's always false
these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20
lines above.

[ChangeLog][QtCore][QStringView] Deprecated the (undocumented)
QStringViewLiteral macro. Just use u"" or QStringView(u"") instead.

Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-10 22:13:49 +02:00
Sona Kurazyan
376715f1a5 Remove usages of deprecated APIs of qtbase/widgets
- Replace the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Build docs for deprecated APIs conditionally, based on deprecation
  version. Remove the docs of methods deprecated since 5.0.0, these
  methods are not compiled anymore.

- Modify the tests to make them build when deprecated APIs disabled:
    * Make the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods
      are enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, add tests for the replacement

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:04:13 +00:00
Sona Kurazyan
d914a5ba4e Remove the remaining usages of deprecated APIs of qtbase
This change removes the leftovers form other cleanup commits.

Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 06:48:27 +02:00
Marc Mutz
082f10c9eb QOpenGLWindow example: use std::unique_ptr instead of QScopedPointer
QScopedPointer is scheduled for deprecation, and can't decide whether
it wants to be a scoped, or a unique pointer.

The use of a unique_ptr members requires that the destructor be
out-of-line, since the payload classes are only forward-declared in
the header file.

Change-Id: Id0dcdde52cb3adc30d3051d2eed1d24c76154921
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-25 14:17:51 +00:00
Qt Forward Merge Bot
64df0eda36 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qlogging.cpp
	src/gui/painting/qtextureglyphcache_p.h
	src/gui/text/qfontengine.cpp
	src/widgets/widgets/qlineedit.cpp

Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
2019-07-17 10:44:21 +02:00
Sona Kurazyan
2f33e030b8 Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-13 10:43:15 +02:00
Qt Forward Merge Bot
77d126ccb5 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	configure.pri

Also required s/solid\.color/solidColor/ in a couple of places in:
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
2019-07-12 12:23:29 +02:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Volker Hilsheimer
89984a8a61 Fix the systray example to only show an icon when requested
The "None" and "Custom icon" cases where using the same value for icon
type, which resulted in both options showing the application icon.

Use -1 to indicate the custom option, and treat all other options
the same.

Task-number: QTBUG-76916
Change-Id: Ib715f5d328175bd6e221b3f507087954fa542838
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-09 18:32:48 +02:00
Sona Kurazyan
9b3e8b32f2 Remove usages of deprecated APIs of corelib
- Replaced the usages of deprecated APIs of corelib by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 11:25:46 +02:00
Liang Qi
d25c322729 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/network/ssl/qsslsocket_openssl.cpp
	src/platformsupport/vkconvenience/qvkconvenience.cpp

Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
2019-07-01 10:21:37 +02:00
Qt Forward Merge Bot
7265fb0597 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I912bd8851c390302414d3dfb3c8220df5a0d5630
2019-06-28 01:00:23 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Venugopal Shivashankar
e3b3dbbe93 Example: Move the SQL statements
Used const variables for the SQL statements,
so that the code looks similar to its
couterpart in Qt for Python.

Change-Id: If2a505a404deff77d3d37c5ffad913c8c538d0b3
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-06-21 09:14:36 +02:00
Tor Arne Vestbø
244ff33119 styles example: Use QImage instead of QPixmap in NorwegianWoodStyle
Using QImage allows creating the style before the application has
been created, and is the more modern API.

No changes to the documentation needed.

Change-Id: Ifa0e5fa1113802fca18fbd45bb3c0a5ba1dbfeab
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-06-25 20:08:26 +02:00
Liang Qi
bd9959bde2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/network/ssl/qsslsocket_openssl.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: Ibe1cd40f46a823c9e5edbe0a3cd16be1e1686b17
2019-06-20 07:50:44 +02:00
Paul Wicking
6398588338 Doc: Fix typo in brief
Fixes: QTBUG-76512
Change-Id: I8db4288b22416c6af9aaaa72c5005b81d79bf620
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-06-19 15:18:50 +02:00
Liang Qi
ef37ab9970 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/gui/text/qdistancefield.cpp
	src/gui/text/qdistancefield_p.h
	src/network/ssl/qsslsocket_openssl.cpp
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
2019-06-25 13:04:27 +02:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
This changes many different CMake places to mention Qt6 instead of
Qt5.

Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.

Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
2019-06-14 16:31:09 +02:00
Simon Hausmann
efa9998521 Fix compiling of examples on Android
* Simplify add_qt_gui_executable() to not require WIN32/MACOSX_BUNDLE
  but provide it implicitly. It's redundant :)

* When on Android, build a module (shared library), just like qmake.
  This requires an additional library destination in the install() call,
  but that's ignored on other platforms.

* Fix typos in the android deployment generation settings function

* Use the correct cache variable to determine whether we're inside a Qt
  build or not. Right now this only works inside Qt builds anyway as
  QtPlatformAndroid.cmake is not publically accessible.

Change-Id: If1c763c31a7a83d0e0d854362ba7901657f63eb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-06-12 14:19:53 +00:00
Simon Hausmann
6732fa3a29 Fix linking of examples
Provide add_qt_gui_executable() as function in our public API that takes
care of automaticWinMain linkage. We can use this in the future to
encapsulate similarplatform-specific behavior and adjustments, such as
module generation onAndroid.

In order for the examples to see the function in Qt5CoreMacros, three more
additional fixes were required:

    * Do the build_repo_end() call _before_ attempting to build the
      examples, as we need the build_repo_end() to include QtPostProcess
      and complete the creation of all the target config files.
      Otherwise the find_package() calls in the examples see something
      incomplete.

    * Add more QT_NO_CREATE_TARGET guards

    * Always call find_dependency on the dependencies, regardless of the
      target creation mode. This way a find_package(Qt5 COMPONENTS
      Widgets) will still load Qt5CoreMacros.

Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-12 14:19:34 +00:00
Leander Beernaert
053766d796 Fix Standalone Example build when crosscompiling
Added qt_examples_begin() and qt_examples_end() macros to setup the
example list so it can be re-used in other projects.

When cross-compiling, we also need to set
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH in order for find_package()
to work correctly.

Removed support for building the whole qtbase/examples folder as a
standalone project. Building examples is only supported when building
the whole of qtbase (qtbase + examples together) or each individual
example is built separately against an installed Qt version.

Change-Id: I9d26b94b48b95af230b76ab618becb21d2d45581
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-06 12:27:41 +00:00
Kevin Funk
99539a2894 Allow to build examples as standalone project
Create CMake config files which can be used from the very same CMake
project. These CMake config files simply do not create any targets,
controlled via the QT_NO_CREATE_TARGETS.

This patch also allows to build qtbase.git:examples as a standalone
project, against an already-built Qt.

Ran this:
  ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example

Task-number: QTBUG-74713
Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-05 12:53:28 +00:00
Simon Hausmann
38cd18384f Fix OpenGL vs. GLESv2 linkage, attempt number three
We introduced WrapOpenGL to link against either desktop GL or GLESv2
depending on the GL feature in QtGui. This works "fine", with two
caveats:

    (1) find_package(WrapOpenGL) must be called after
    find_package(Qt5Gui) in order for the feature check in
    FindWrapOpenGL.cmake to work. That's error prone.

    (2) More and more places are popping up, in particular examples,
    where GL linkage is required due to inline functions in Qt that
    forward to GL functions - such as on Android.

    This in particular explains the qmake behavior of making the GL
    linkage (desktop _or_ GLES) a public dependency of QtGui, so only
    Gui linkage is required.

Those two aspects combined are the nail in the coffin of FindWrapOpenGL
and it would seem much easier to simply make the Desktop GL vs. GLES
decision once in Gui's CMakeLists.txt and let Qt5GuiDependencies.cmake
propagate this well. This allows us to get rid of plenty of special
cases as well.

Change-Id: I3a7e8af49537ce5f215f24470e075a4ae9aeb944
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-05 09:38:02 +00:00
Alexandru Croitor
5591e82135 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ide5b3408bfefca410323cf26b810b44c06d3a227
2019-06-03 15:51:20 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Edward Welbourne
84e89c1e9e Convert uses of QTime as a timer to QElapsedTimer
Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-14 10:42:33 +02:00
Alexandru Croitor
837f592c5e Regenerate more projects that are using uic
Amends fa21d29b75

Change-Id: I54d9cca77122d61016e06c4057949747b19472bb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-23 08:59:35 +00:00
Alexandru Croitor
fa21d29b75 Rerun pro2cmake on projects that use .ui files
Task-number: QTBUG-75875
Change-Id: I95109b07fc4a6e09fe7911a21fc5f27f2c895d77
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-05-22 14:58:24 +00:00
Marc Mutz
eae4668afa Torrent example: replace a QMultiMap with a sorted vector
This came about trying to remove the Java-style iterator. It was used to
iterate in reverse order, something QMap can't do, easily, due to lack
of rbegin()/rend(). Instead of writing ugly loops, use a vector of pairs,
fill it, sort it, then iterate over that one in reverse.

Change-Id: I09c8a2732a0699fff4c497778745523e20d348a1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-05-25 09:30:51 +00:00
Marc Mutz
e4c0fca194 RelationalTableModel example: use std::unique_ptr instead of QScopedPointer
There's talk that QScopedPointer may be deprecated. Don't use it
in examples anymore.

Change-Id: I3c4647a569b72cd3a628c9b92ef34c87fd588342
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-05-15 11:03:52 +02:00
Marc Mutz
1a872e5ff2 HTTP example: use std::unique_ptr instead of QScopedPointer
This allows the QFile factory there to actually return the payload in
a unique_ptr instead of falling back to a raw pointer.

The use of a unique_ptr member requires that the destructor be
out-of-line, since QFile is only forward-declared in the header
file. This is good hygiene, so do it for ProgressDialog, too.

Change-Id: Idb6ed327f9592526bb7d0d5b2cfbffe9f08f3eea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-15 11:03:52 +02:00
Marc Mutz
4715d6db80 ThreadedOpenGL example: use std::unique_ptr instead of QScopedPointer
There's talk that QScopedPointer may be deprecated. Don't use it
in examples anymore.

Change-Id: I05a486c2a86fcc7015a9c21ed0ce9682b0c24034
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-05-15 11:03:52 +02:00
Marc Mutz
bc6ffcd0c5 Torrent example: Replace the last Java-style iterator with STL ones
Scope a previous iterator variable better so we can re-use 'it' as the
iterator name.

Change-Id: I46d239ad2d3646168408d1ef29ed74fd07bc663f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-23 13:55:40 +02:00
Marc Mutz
fbb2ed1505 Icons example: use std::unique_ptr instead of QScopedPointer
There's talk that QScopedPointer may be deprecated. Don't use it
in examples anymore.

Change-Id: Ia50ef66de84dae2885f71a9dd83c5909bfa253f0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-05-15 11:03:53 +02:00
Marc Mutz
f0463f0cc6 Torrent example: add missing qAsConst()
The function is const, but the d-pointer doesn't propagate it (raw pointer),
so we need the qAsConst() even here.

Change-Id: I9d2e1f7715abb3dc67a87cdadaa7ded971b15848
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-23 13:35:16 +02:00
Marc Mutz
54590c4f8a Torrent example: rewrite some very convoluted code
The old code iterated over the peer list, inserting active peers into
a QSet, curiously not stopping to search for clients if it had already
determined the peer to be active.

It then iterated over the peers again, storing the indexes of the
peers it had determined to be active in the first loop, in a QList.

It _then_ iterated over the index list, in reverse, calling removeAt()
on the peers list.

<sean parent>That's a remove_if!</sean parent>

The twist is, that only some maximum number of inactive peers should
be removed, just enough to bring the number of peers below a
predefined number.

To solve, use a lambda that keeps track of the number of times it has
returned true, returning false once the count drops to zero. We can't
use a mutable lambda here, since the STL algorithms are allowed to
copy the predicate as many times as they wish, and, indeed, remove_if
is commonly implemented by calling find_if. But the standard
guarantees exactly one application of the predicate per element, so we
can assume that we're not called again on the same element, and
therefore keep a reference to an external count.

With this, what was a horrible mess becomes a single call to remove_if.

Also change a while(--n) c.removeFirst() loop to a single call of
range-erase.

Change-Id: I6c6a54a1805e5b376800e1116e7aec643e95e4e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-24 12:27:36 +00:00
Marc Mutz
77e708d167 Torrent example: replace Java-style iteration with STL iterators
Java-iterators are going to be deprecated.

Change-Id: I2e6353f3fd9e2ddaf0767e7f6cea713249d9591e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-05-23 13:35:15 +02:00
Joerg Bornemann
c9b7cc349a Remove usages of Q_OS_WINCE
This platform is history.

Change-Id: Iddfab008a509f4828c321730414c8204055cf7af
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-05-23 13:51:05 +02:00
Simon Hausmann
b4a1336bb0 Fix memory leak with arthur style
ASAN reports a leak here, so let's delete the style after the widgets
using them have been destroyed.

Change-Id: I0e8603fc5d2d0c13deca35a1c0020646c65eaf49
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-23 15:57:51 +02:00
Friedemann Kleint
ce211b1f83 Fix qdoc warnings for Qt 5.14
src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String'
src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView'
src/corelib/tools/qstringview.cpp:822:Unknown command '\t'
src/corelib/tools/qstringview.cpp:825:Unknown command '\t'
src/corelib/tools/qstringview.cpp:826:Unknown command '\t'
src/corelib/tools/qstringview.cpp:831:Unknown command '\t'
src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat
src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher()
src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError
src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent()
src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent()
src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent()
src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property
src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property
src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property
src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown()
src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=()
src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=()
src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=()
src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=()
examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp'
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap
src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap
src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN
src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN

Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-05-21 17:39:58 +02:00
Marc Mutz
b4a88aa758 examples: port away from Java-style iterators
There's no reason to use them here, the Mutable is misleading in a
few instances, ranged-for is much simpler, and more future-proof.

Change-Id: Ifd5eaae95bbaa0b4cf0f435e6cfee6d778817b44
Reviewed-by: David Faure <david.faure@kdab.com>
2019-05-23 17:30:51 +02:00
Alexandru Croitor
9b0b464e82 Write find_dependency() calls in Qt Module config files
This change introduces a new function called qt_find_package()
which can take an extra option called PROVIDED_TARGETS, which
associates targets with the package that defines those targets.
This is done by setting the INTERFACE_QT_PACKAGE_NAME and
INTERFACE_QT_PACKAGE_VERSION properties on the imported targets.

This information allows us to generate appropriate find_dependency()
calls in a module's Config file for third party libraries.

For example when an application links against QtCore, it should also
link against zlib and atomic libraries. In order to do that, the
library locations first have to be found by CMake. This is achieved by
embedding find_dependency(ZLIB) and find_dependency(Atomic) in
Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake.
The latter is picked up when an application project contains
find_package(Qt5Core), and thus all linking dependencies are resolved.

The information 'which package provides which targets' is contained
in the python json2cmake conversion script. The generated output of
the script contains qt_find_package() calls that represent that
information.

The Qt5CoreDependencies.cmake file and which which dependencies it
contains is generated at the QtPostProcess stop.

Note that for non-static Qt builds, we only need to propagate public
3rd party libraries. For static builds, we need all third party
libraries.

In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any
scope, the targets on which the property is set, have to be GLOBAL.

Also for applications and other modules to find all required third
party libraries, we have to install all our custom Find modules, and
make sure they define INTERFACE IMPORTED libraries, and not just
IMPORTED libraries.

Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-02 07:30:42 +00:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Qt Forward Merge Bot
f8212b87d9 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
2019-05-12 01:00:08 +02:00
Laszlo Agocs
45aa3c73f7 hellogles3: Request core profile context
...instead of compatibility, in order to play nice with systems
that have no compatibility profile support (macOS). Instancing
needs OpenGL 3.x so sticking with 2.x contexts is not an option.

The example looks fully compatible with core profile so its
functionality should not change.

Change-Id: If0d554a6208973aa8a4fb86757e246d170cd0e71
Fixes: QTBUG-75680
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-11 12:01:53 +00:00
Miguel Costa
7ab84cfe74 factorial example: Fix issue with WinRT console output
Replaced the display of the calculation output, generated using
fprintf(stdout, ...), with qInfo() << ... In WinRT, fprintf to stdout
does not cause output to be generated.

Task-number: QTBUG-67566
Change-Id: I3b95bbf888e863683cbaf54deb26c3821433a5b8
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-04-03 13:59:47 +00:00
Edward Welbourne
4690d4efa6 Fix use of qrand/qsrand in an example
Convert an example to use QRandomGenerator::global().
This saves the need for seeding.

At the same time, use continuum random values rather than discrete
ones, to better fit what the example using it is doing.

Change-Id: I0adebaadb2e35832c629e314fda37e60b51f760d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:39:53 +00:00
Liang Qi
e104c19728 Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-03-31 18:45:03 +00:00
Christian Ehrlicher
c19d556863 QVariant: deprecate qVariantFromValue/qVariantSetValue()
qVariantFromValue/qVariantSetValue() was marked as obsolete since Qt4.
Therefore mark them as deprecated with Qt5.14.
Since QVariant::setValue/fromValue() were using the now deprecated
functions move the implementation to them and let
qVariantFromValue/qVariantSetValue() call
QVariant::setValue/fromValue().

Fixes: QTBUG-74043
Change-Id: I46617cc4d5c1e8c162d0f1f7ae32e4cfe9ce915c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-03-31 12:25:46 +00:00
Liang Qi
29f01b32f5 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/configure.json

Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
2019-03-31 12:39:42 +02:00
Tobias Hunger
72404ef3e1 CMake: allow custom plugin output/install directories
Only require TYPE if no OUTPUT_DIRECTORY, ARCHIVE_INSTALL_DIRECTORY
and INSTALL_DIRECTORY is provided.

Change-Id: I6db1cfaa576bfa3ee3dc8ecf81db20e3afcd61e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-27 14:35:46 +00:00
Tobias Hunger
aa50b377a7 CMake: Add widgets examples
Change-Id: Ib6142b93df066e3658eb189b50ca74c455fe7e56
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-26 15:25:39 +00:00
Tobias Hunger
64c6c943c7 CMake: Add more examples
Change-Id: I7a8a3fd0a844a518592957fe07c6e707dd452d5f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-26 13:03:01 +00:00
Friedemann Kleint
8f1acd29e4 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
2019-03-26 08:27:02 +01:00
Friedemann Kleint
7f635d9777 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
2019-03-26 08:24:59 +01:00
Thiago Macieira
66fc17eb5c Examples: properly parse more than one element in maps and lists
Change-Id: I46363e5b8944459e8c48fffd158c03bca4b7394e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-22 02:08:02 +00:00
Qt Forward Merge Bot
6893919b0c Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/gui/kernel/qplatformintegration.cpp
	src/gui/kernel/qplatformintegration.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/xcb/qxcbconnection_screens.cpp

Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
2019-03-20 14:09:30 +01:00
Friedemann Kleint
8c9e41cc78 Use QSaveFile in MainWindow examples
QSaveFile should preferably be used by editor applications to catch
write errors.

Task-number: QTBUG-60635
Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-12 09:29:31 +02:00
Marc Mutz
c6a3507de2 SecureUDPServer example: use std::unique_ptr instead of QSharedPointer
The only reason the code used QSharedPointer is that it used QVector
to hold a collection of them, and QVector infamously cannot hold
move-only types such as std::unique_ptr.

Fix by using std::vector<std::unique_ptr> instead. Also, pass the
objeccts into non-sink functions by raw pointer instead of shared_ptr.

As a drive-by, replace clear-following-iterate by the for-exchanged
pattern.

Change-Id: I605fbb98af840c1b93eab9e65c07defd6e7b39e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-15 14:40:23 +02:00
Friedemann Kleint
50f3f8f6bb Use High DPI pixmaps in prominent examples and tests
Set AA_UseHighDpiPixmaps.

Task-number: QTBUG-52622
Change-Id: Ic4373a9c94952f50bc1ad36bcc0dec850efc124a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-03-15 18:26:56 +00:00
Christian Ehrlicher
10ec683a96 QLineF: mark angle(const QLineF&) as deprecated
QLineF::angle(const QLineF&) was deprecated during Qt4 times but not
decorated with QT_DEPRECATED_X. Add this so it can be removed with Qt6

Change-Id: I8950b646cc5fa8206e47bdd16647d17d615f6c6a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-03-05 17:56:45 +00:00
Christian Ehrlicher
d8ac4b40b5 Examples: replace deprecated QComboBox functions
Replace the deprecated currentIndexChanged(QString) and
activated(QString) with the new currentTextChanged() and textActivated()
functions

Change-Id: I8616354fa06cc63dce6f5cfef0902f4b55981043
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-03-04 16:54:52 +00:00
Christian Ehrlicher
332f295743 QtBase: replace deprecated QString functions
Replace deprecated QString functions in examples and tests:
 - QString::sprintf()
 - QString::null
 - QString::fromAscii

Change-Id: I4404d17c1a65496c9079e8a7300e72a5b3740fe5
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-03-04 16:54:12 +00:00
Marc Mutz
8ab4d2028f Composition example: use std::unique_ptr instead of QScopedPointer
The use of a unique_ptr member requires that the destructor be
out-of-line, since the payload is only forward-declared in the header
file. This is good hygiene, so do it for CompositionWidget, too.

Add 'explicit' and missing = nullptr to both constructors as a
drive-by.

Change-Id: Ied1c89864f90d3f2c13fb4e9a8bbbe2e6fd6f1d7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-05-15 11:03:53 +02:00
Christian Ehrlicher
edb53d761e QFileDialog: mark obsolete enum DontUseSheet as deprecated
QFileDialog::DontUseSheet is obsolete since 4.5 and not used anywhere
inside the Qt code base. Mark it as deprecated and remove the last usage
in the examples.

Change-Id: If3d23fd5906314e6ebc7080efa79da14a2aa2720
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-17 14:08:34 +00:00
Christian Ehrlicher
4f6eb43898 QtCore: mark obsolete enumerations as deprecated
The following enumerations were obsolete for a log time but not marked
as deprecated:
 - WA_NoBackground
 - WA_MacNoClickThrough
 - WA_MacBrushedMetal
 - WA_MacMetalStyle
 - WA_MSWindowsUseDirect3D
 - WA_MacFrameworkScaled
 - AA_MSWindowsUseDirect3DByDefault
 - AA_X11InitThreads
 - ImMicroFocus

mark them as deprecated and remove the usage inside QtBase so they can
be removed with Qt6

Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-17 14:08:30 +00:00
Liang Qi
c0359bd3c3 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qfloat16.cpp
	src/corelib/global/qfloat16.h
	src/plugins/platforms/windows/qwindowswindow.cpp

Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
2019-05-15 07:11:41 +02:00
Joerg Bornemann
ce1830fd21 Migrate Windows system libs to external dependencies
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-08 08:30:02 +00:00
Lars Knoll
92f9842732 Deprecate conversion functions between QList and QSet
Users should use range constructors instead to do the conversion.
Keep conversion methods between QList and QVector as these will turn
into a no-op in Qt 6, whereas forcing people to use range constructors
would lead to deep copies of the data.

Change-Id: Id9fc9e4d007044e019826da523e8418857c91283
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-07 14:15:44 +00:00
Shawn Rutledge
1b8a1e04ef Fix heading level in style combobox in TextEdit example
Amends 0df30ff22e: when adding the
checked and unchecked styles to the combobox, it changed the offsets
for the heading styles; so the combobox stopped changing to the correct
index when clicking on a heading, and also changed the heading
two sizes smaller than it should when attempting to select a different
heading level.

Change-Id: Ib3f61987c786e34f32a81bf7b3ebc5ca730f40df
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-06 19:25:12 +00:00
Shawn Rutledge
b922c97c9c TextEdit example: add indent/unindent feature
It was not possible to interactively create the example text without
this feature; and in general it's necessary to work with nested lists.
But currently it does not deal with all possible changes of list nesting,
because the API seems incomplete for that purpose.

Task-number: QTBUG-75589
Change-Id: I3e29ca15a2e7c37300a0103ceb90670716472ffb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-06 19:24:32 +00:00
Allan Sandfeld Jensen
d775b1fcb3 Remove handling of missing Q_COMPILER_INITIALIZER_LISTS
Change-Id: Id65b39c787235a051262544932e6717d076f1ea0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-02 23:10:55 +00:00
Lars Knoll
343528841e Prefix textstream operators with Qt::
As the non prefixed variants are deprecated

Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-02 11:52:02 +00:00
Shawn Rutledge
0df30ff22e Add task list checkbox manipulation features to the TextEdit example
Change-Id: I5f0b8cb94d1af609ec531f9765d58be65b1129a3
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-02 04:10:28 +00:00
Shawn Rutledge
75256d62d2 Render markdown task lists (checkboxes instead of bullets) in QTextEdit
Checkboxes are right-aligned with any bullets that are in the same
QTextList so that there is enough space to make them larger than bullets.
But hopefully mixing bullets and checkboxes will be a rarely-used feature.

Change-Id: I28e274d1f7883aa093df29eb4988e99641e87a71
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-02 04:10:21 +00:00
Shawn Rutledge
deae75ae09 TextEdit example: add Markdown as a supported format
Also use QT_CONFIG to disable features gracefully if Qt is
configured without them.

Change-Id: I38e92bf5fd70f77fc4d5158769d590619be8905f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-02 04:10:10 +00:00
James McDonnell
9ec564b0bf Basic foreign window support for QNX
Requires a screen with working context permission parsing.  Currently,
all context permission requests fail because the parsing is incorrect.
A context permission is added temporarily to prevent CLOSE/CREATE
events when Qt reparents foreign windows.  Qt does this temporarily
when a foreign window is wrapped in a widget.

Change-Id: I84c18e70d43239286fcd53715332d7015cf1a826
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
2019-05-01 13:49:18 +00:00
Jesus Fernandez
8e28955574 Plug and paint example: Fix -Wweak-tables
Fixes warning: 'BrushInterface' has no out-of-line virtual method definitions;
its vtable will be emitted in every translation unit

Change-Id: I2e693ac60e9eba1976665546e1c9c4a92e6ff63b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-04-29 14:10:54 +00:00
Christian Ehrlicher
c530ca1c17 QLineF: add intersects() as a replacement for intersect()
QLineF::intersect() does not follow the naming rules for functions.
Therefore add a replacement function intersects() instead and also
rename the return type from IntersectType to IntersectionType

[ChangeLog][QtCore][QLineF] added QLineF::intersects() as a replacement
for QLineF::intersect()

Change-Id: I744b960ea339cb817facb12f296f78cca3e7d938
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
2019-04-25 17:58:40 +00:00
Qt Forward Merge Bot
035f934d7a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp

Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.

Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
2019-02-20 09:51:12 +01:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Christian Ehrlicher
8cba096c2a QtBase: compile examples with QT_DISABLE_DEPRECATED_BEFORE=0x050d00
Replace deprecated functions to be able to compile examples with
QT_DISABLE_DEPRECATED_BEFORE=0x050d00

Change-Id: If6b8de31f526320d6a0e2a20bb5f8e26c77f2353
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-13 05:55:46 +00:00
Allan Sandfeld Jensen
90a8de656f Long live QColorSpace and friends
Adds QColorSpace and QColorTransform classes,
and parsing of a common subset of ICC profiles
found in images, and also parses the ICC profiles
in PNG and JPEGs.

For backwards compatibility no automatic color
handling is done by this patch.

[ChangeLog][QtGui] A QColorSpace class has been added,
and color spaces are now parsed from PNG and JPEG images.
No automatic color space conversion is done however, and
applications must request it.

Change-Id: Ic09935f84640a716467fa3a9ed1e73c02daf3675
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-02-08 10:12:05 +00:00
Friedemann Kleint
5c98d15a45 Fix some deprecation warnings in examples
googlesuggest.cpp:163:36: warning: ‘void QTreeWidgetItem::setTextColor(int, const QColor&)’ is deprecated: Use QTreeWidgetItem::setForeground() instead [-Wdeprecated-declarations]
xbeltree.cpp:187:34: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
imageitem.cpp:114:21: warning: ‘void QGraphicsItem::setMatrix(const QMatrix&, bool)’ is deprecated: Use setTransform() instead [-Wdeprecated-declarations]
xbelreader.cpp:143:48: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
xbelgenerator.cpp:103:55: warning: ‘bool QTreeWidget::isItemExpanded(const QTreeWidgetItem*) const’ is deprecated: Use QTreeWidgetItem::isExpanded() instead [-Wdeprecated-declarations]
xbelwriter.cpp:90:55: warning: ‘bool QTreeWidget::isItemExpanded(const QTreeWidgetItem*) const’ is deprecated: Use QTreeWidgetItem::isExpanded() instead [-Wdeprecated-declarations]
xbelhandler.cpp:97:50: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
node.cpp:180:60: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
node.cpp:181:64: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
chip.cpp:82:81: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
chip.cpp:84:40: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
chip.cpp:108:93: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
roundrectitem.cpp:65:42: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
roundrectitem.cpp:97:51: warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
roundrectitem.cpp:105:34: warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
splashitem.cpp:82:57: warning: ‘void QPainter::drawRoundRect(int, int, int, int, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
robot.cpp:116:53: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
robot.cpp:176:49: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
robot.cpp:200:49: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
mandelbrotwidget.cpp:120:41: warning: ‘const QMatrix& QPainter::matrix() const’ is deprecated: Use transform() instead [-Wdeprecated-declarations]
composition.cpp:344:47: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
composition.cpp:346:46: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
colorswatch.cpp:89:34: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
mainwindow.cpp:81:62: warning: ‘void QTreeWidget::setItemSelected(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setSelected() instead [-Wdeprecated-declarations]
puzzlewidget.cpp:172:35: warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
spreadsheet.cpp:191:37: warning: ‘QColor QTableWidgetItem::backgroundColor() const’ is deprecated: Use QTableWidgetItem::background() instead [-Wdeprecated-declarations]
spreadsheet.cpp:198:32: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
spreadsheet.cpp:203:24: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
spreadsheet.cpp:238:47: warning: ‘QColor QTableWidgetItem::backgroundColor() const’ is deprecated: Use QTableWidgetItem::background() instead [-Wdeprecated-declarations]
spreadsheet.cpp:249:38: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:494:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:509:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:513:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:527:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:531:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:545:56: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:549:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:563:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:567:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:581:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:585:58: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
spreadsheet.cpp:599:55: warning: ‘void QTableWidgetItem::setBackgroundColor(const QColor&)’ is deprecated: Use QTableWidgetItem::setBackground() instead [-Wdeprecated-declarations]
starrating.cpp:91:46: warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
document.cpp:341:36: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
document.cpp:342:39: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
document.cpp:343:36: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:88:39: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:89:39: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:188:52: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
norwegianwoodstyle.cpp:264:56: warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
plugindialog.cpp:128:49: warning: ‘void QTreeWidget::setItemExpanded(const QTreeWidgetItem*, bool)’ is deprecated: Use QTreeWidgetItem::setExpanded() instead [-Wdeprecated-declarations]
tetrixboard.cpp:361:74: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
tetrixboard.cpp:408:32: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations]
tetrixboard.cpp:412:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations]
mandelbrotwidget.cpp:120:41: warning: ‘const QMatrix& QPainter::matrix() const’ is deprecated: Use transform() instead [-Wdeprecated-declarations]

Change-Id: If0afabbc35ef25f127f211c11699011d4ae4ae65
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 22:12:23 +00:00
Christian Ehrlicher
4715ca7bc5 Cleanup QtCore examples
Cleanup QtCore examples:
 - use new signal/slot syntax
 - use 0 instead nullptr
 - remove unneeded includes
 - use initializer lists
 - replace foreach with range-based-for loop

Change-Id: I5581f485fa0e9ccf3f4ce6f643908832bc6959bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-06 22:11:27 +00:00
Christian Ehrlicher
daee9af969 QtGui: mark obsolete QPixmapCache::find() functions as deprecated
QPixmapCache::find(QString) and QPixmapCache::find(QString, QPixmap&)
are deprecated since Qt4 times.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: Iaf185f69afe02203559a1c812fbb4a95c9049a1d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-02-02 12:49:25 +00:00
Christian Ehrlicher
df39627fa3 Examples: cleanup foreach usage
Replace deprecated foreach macro with range-based for loop

Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-02 12:49:19 +00:00
Christian Ehrlicher
004d7168a3 Cleanup Widgets examples - includes
Cleanup the Widgets examples - adjust includes to Qt coding style and
remove unused includes and formward declarations

Change-Id: I9f2e513284ad631337ff52ec9c0b98645055dcca
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:43 +00:00
Christian Ehrlicher
64b2eb7490 Cleanup Widgets examples - replace foreach
Cleanup the Widget examples - replace foreach with a standard for loop

Change-Id: I59cb2bf4494201f9f0228b07a8bb936ce40da46f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:39 +00:00
Christian Ehrlicher
9f971ca816 QtWidgets: replace 0 with \nullptr in documentation
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.

Change-Id: I8d7e9c838da1399988a830669d58fc7f2f010696
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-28 19:37:26 +00:00
Liang Qi
e3621dd6bd Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2019-01-28 19:30:32 +00:00
Christian Ehrlicher
bf4bf3a583 Cleanup Widgets examples - signals/slots
Cleanup the widgets examples - use new signal/slot syntax where possible

Change-Id: I6bc8953534d8b1efca0de4ee6a9fe4a6aa79fda9
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-26 10:37:06 +00:00
Liang Qi
980567b3a3 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/android/templates/AndroidManifest.xml
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
2019-01-26 08:35:40 +01:00
Christian Ehrlicher
e0e22d56ac Cleanup EditableItemModel example
Cleanup the EditableItemModel example:
 - include own headers first
 - use nullptr
 - add sanity checks
 - use for loop instead foreach
 - use const where possible

Change-Id: Ib36e5710c07979576b48a905ee50908a64dcb697
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-24 20:31:55 +00:00
Christian Ehrlicher
34e4a8ef6d Cleanup Widgets examples - foreach
Cleanup the Widgets examples - replace foreach with range-based for loop
in the remaining directories

Change-Id: I321e6c0f414401a1ae4fb65762b97d894b725afa
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2019-01-23 18:49:05 +00:00
Christian Ehrlicher
26f7edb09e Cleanup Widgets examples - foreach
Cleanup the Widgets examples - replace foreach with range-based for loop
in graphicsview subdirectory

Change-Id: I9093b3ae89d73d0b860d29929943881c90074bce
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-23 18:49:02 +00:00
Christian Ehrlicher
bce32c8ab8 Cleanup Widgets examples - foreach
Cleanup the Widgets examples - replace foreach with range-based for loop
in mainwindows and painting subdirectories

Change-Id: I3c1556dffd22e29dd0a5ba960e699291c496278a
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-01-23 18:48:59 +00:00
Christian Ehrlicher
aa32510430 Cleanup Widgets examples - nullptr
Cleanup the widgets examples - replace 0 with nullptr

Change-Id: Id4bf119b9a41f6d10117f3a613a6e604128fa196
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-23 15:13:45 +00:00
Christian Ehrlicher
c590aa678d Cleanup SimpleTreeModel example
Cleanup the SimpleTreeModel example:
 - include own headers first
 - use nullptr
 - add sanity checks

Change-Id: If57d608e3919368b2022ff86aede8de9c2ba7369
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2019-01-23 15:13:41 +00:00
Tor Arne Vestbø
a20c52dffc Use requestUpdate instead of timer in a few GL examples
Change-Id: I235ad367fe693c86ef5a0844fde0573371b284db
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-01-22 21:25:39 +00:00
Christian Ehrlicher
1f2c23a7ca Cleanup Widgets examples - foreach
Cleanup the Widget examples - replace foreach with range-based for loop
in subdirectory tools, touch and tutorials

Change-Id: I008d23b5993a18a3332fe9f5e5bca68cb0561066
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-07 13:15:59 +00:00
Christian Ehrlicher
8cf8122314 Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - animation, effects and graphicsview subdirectory

Change-Id: I6cbaea6e628eb06f8e0ca6a0b795030a66b83878
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2019-01-06 17:08:03 +00:00
Christian Ehrlicher
cf27d9e8a5 Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - painting and richtext subdirectory

Change-Id: If0e365ab1cabf9184076595494cfca151406fddf
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2019-01-06 17:07:59 +00:00
Christian Ehrlicher
7984327c40 Network examples: cleanup foreach usage
Replace deprecated foreach macro with range-based for loop

Change-Id: I0d1f2cfd557d02ccc48b41b3fea137baa2962fc1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-06 13:39:49 +00:00
Liang Qi
03039979b5 Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.

 Conflicts:
	qmake/generators/makefile.cpp
	src/corelib/itemmodels/qstringlistmodel.cpp
	src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
	tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
	tests/auto/gui/text/qglyphrun/BLACKLIST
	tests/auto/gui/text/qrawfont/BLACKLIST

Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
2019-01-04 07:33:14 +01:00
Samuel Gaist
7ca39bf7bc Doc: cleanup semaphore example
This patch removes unused signal and variable.

Change-Id: Ia4eaf083493d3d37e3ff22e0380d5a5ee69f91cf
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2019-01-03 11:37:22 +00:00
Christian Ehrlicher
a21f3431b8 Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - tutorials subdirectory

Change-Id: I741589f6616578412ad74f8371e0e3c87df783a2
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2019-01-03 08:30:04 +00:00
Christian Ehrlicher
8c04aab896 Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - layout, statemachine, tools and touch subdirectory

Change-Id: I466b309b643ef7ffc27be7591fa10f4c75cfd3f8
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-03 08:29:56 +00:00
Jeremy Whiting
c8720d6210 Fix typo in fetchmore example documentation
In fetchmore example documentation there's a typo on the first line.
The text should read 'shows how to' but instead reads 'shows how two'

Change-Id: Ifc169581e8fc43315dc01c7d1f267dd45600af82
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-12-24 12:01:03 +00:00
Christian Ehrlicher
af84f12298 Cleanup Itemviews examples
Cleanup the Itemviews examples
 - use nullptr instead 0
 - use for loop instead foreach
 - include own header first
 - remove uselss includes

Change-Id: I32e9f64356e42038707d063dcad977239ce1fe9e
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-12-17 19:50:38 +00:00
Christian Ehrlicher
b8720e3e7a Cleanup Widgets examples - Validator example
Cleanup the widgets examples - move the ValidatorWidget class into its
own source/header file instead of implementing it in main.cpp

Change-Id: I2b74ca4f2491168453dc31e0631f31e3ac83123c
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-17 19:50:23 +00:00
Tobias Hunger
e57a94cbd8 CMake: Use AUTOMOC/AUTOUIC/AUTORCC
Change-Id: I0235ca4f227623e5937348b4b010637921dbf154
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-14 14:04:59 +00:00
Christian Ehrlicher
588bd92228 Cleanup Widgets examples - parent ctor
Cleanup the Widgets examples - add missing parent parameter

Change-Id: I5cd7aa333dbb8e6e4b7b9e05c085120733da83ec
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-12-13 16:57:05 +00:00
Qt Forward Merge Bot
a2fd99c430 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I91e684e74c36467efda8ded6ed19791baa0c1a1f
2018-12-11 01:00:13 +01:00
Christian Ehrlicher
b688c7e99a DropSite example: fix documentation
The DropSite documentation mentioned the foreach keyword which was
removed some times ago in the code. Therefore also remove the
corresponding documentation snippet.

Change-Id: Id9dd3f01dbdd37eeda43fabe12b60ef9e0b32d10
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-10 18:38:56 +00:00
Lorn Potter
45c358b0da threads: disable threads examples for nothread builds
Change-Id: I2c253de973f5399c5ed68194b969ccebe457c689
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-10 05:36:08 +00:00
Liang Qi
009a5538eb Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-04 19:41:52 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Christian Ehrlicher
b5e0d854bd Cleanup SimpleDomModel example
Cleanup the SimpleDomModel example:
 - include own headers first
 - use nullptr
 - use const where possible
 - init members in initialization list

Change-Id: If7029a774793927b9a3a9115ea4a7053402a86a1
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-12-04 07:00:49 +00:00
Christian Ehrlicher
1cfe064632 Cleanup StarDelegate example
Cleanup the StarDelegate example:
 - use QStyledItemDelegate instead QItemDelegate
 - use nullptr and other useful c++11 constructs
 - include the correct headers

Change-Id: If2f65fe7cbdcdd4571d10ffa98d36eeab7836bbb
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-12-04 07:00:44 +00:00
Christian Ehrlicher
51f6d5d8c2 Cleanup Addressbook example
Cleanup the Addressbook example:
 - use nullptr
 - use for instead foreach
 - don't use public members but setters/getters
 - use QVector instead QList
 - make user-visible translatable

Change-Id: Ie7bdad8a2799c8fa6f634659b51c3064cc8a04ce
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-12-04 07:00:41 +00:00
Friedemann Kleint
7aaf54f572 Codecs example: Add a dialog for showing common C++ encodings
Add a dialog where the user can enter a line of text, which is then
displayed in several encodings with special characters converted
suitable for C++/Python string literals.

Task-number: QTBUG-60635
Change-Id: Ibd436f9f76e128c93cbb581235c730d636641d8a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-30 10:00:04 +00:00
Christian Ehrlicher
8b42614c6c Cleanup Spreadsheet example
Cleanup the Spreadsheet example:
 - use nullptr
 - use for instead foreach

Change-Id: I55deed157403a46d98a6d753ef46e4cbe5730b4f
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-11-23 15:44:20 +00:00
Liang Qi
bf58c70546 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/io/qdir.cpp
	src/corelib/kernel/qtimer.cpp
	src/corelib/kernel/qtimer.h

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
2018-11-22 01:53:29 +01:00
Tor Arne Vestbø
666f3b4a78 Take device-pixel-ratio into account in openglwindow example
Also affects the windowcontainer example, which includes an OpenGL
window.

Change-Id: Ic9f0f2aa66410b657e08c0225b085dd8df44e2a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-20 19:51:12 +00:00
Qt Forward Merge Bot
0441d959ff Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
2018-11-13 01:00:13 +01:00
Christian Ehrlicher
8c685b765b Itemviews: Cleanup examples
Cleanup some minor issues in the chart example:
 - remove unused members
 - use initializer list for members
 - pass a proper role to dataChanged()
 - honor roles parameter in PieView::dataChanged()
 - use nullptr instead 0
 - use new-style connect
 - fix indentation and other whitespaces

Change-Id: Idb212b07c006fe3ae31bee9cd9b1ba4d03043b5e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-11-12 13:01:30 +00:00
Liang Qi
58437fb125 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/serialization/qcborcommon.h
	src/corelib/tools/qlocale_data_p.h
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
2018-11-10 11:38:40 +01:00
Liang Qi
bc07958f92 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	.qmake.conf
	qmake/Makefile.unix
	src/gui/text/qtextdocument.cpp
	src/gui/text/qtextdocument.h

Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
2018-11-09 10:34:33 +01:00
Allan Sandfeld Jensen
6d255b467b Fix composition example during OpenGL resizes
Previous images were sometimes not cleared correctly.

Change-Id: I62949b756bf797aa79c5160774f2f258e5c353dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-07 12:26:03 +00:00
Thiago Macieira
b5d249f953 Update the floppy disk icon (save) to be physically correct
[ChangeLog][Documentation] Fixed the icons for the "file save" action
that were inaccurate representations of a 3.5-inch floppy disk (the cut
edge was on the wrong side). Now all floppy representations are
physically accurate.

Change-Id: Ia3b27ae12a1a4fefa3b7fffd155bb86fee5271c3
Fixes: QTBUG-71012
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-06 20:43:36 +00:00
Qt Forward Merge Bot
79c5c68dca Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-11-06 00:01:16 +00:00
Qt Forward Merge Bot
290aac23a7 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Id1e4664d3c942226b76e2c3b338df3116ff89297
2018-11-06 01:00:56 +01:00
Christian Ehrlicher
e9bebc1281 Fix use of deprecated ItemDataRoles Background/TextColorRole
Replace BackgroundColorRole/TextColorRole with
BackgroundRole/ForegroundRole and explicit deprecate them for 5.13

Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-05 21:58:37 +00:00
Christian Ehrlicher
f06e0f62fa Fix usage of QGuiApplication::set/resetOverrideCursor
Replace all occurrences of QApplication::set/resetOverrideCursor with
the QGuiApplication::set/resetOverrideCursor since it's a static
function of QGuiApplication.

Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-05 21:57:43 +00:00
Friedemann Kleint
ae0843eca0 Tablet example: Fix warning about switch/fallthrough
Add Q_FALLTHROUGH(), fixing:
tabletcanvas.cpp:222:55: warning: this statement may fall through [-Wimplicit-fallthrough=]

Change-Id: I573f4add56774218e28a7c5f1dac09c5402333c0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-01 12:46:59 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Alexander Volkov
7aad542629 Notepad example: Get rid of auto-connection slots
Their correctness is not checked at compile time and even object
renames can break code.

Change-Id: I99273a28743a79a76c00e6db0ed4cd6d7eba8bf2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-11-01 11:46:00 +00:00
Liang Qi
e28e91ae99 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/animation/qpropertyanimation.cpp
	src/gui/image/qicon.cpp
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp

Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
2018-10-25 07:21:53 +02:00
Allan Sandfeld Jensen
0ead3b7142 Move arthurwidget based examples to new QOpenGL classes
Several of the examples were not even working besides using deprecated
classes.

Change-Id: I352e0629d490593edcc5868d2ec5a8ff222eaeab
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-17 09:16:01 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Qt Forward Merge Bot
fedcaf0256 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2715ee7c694e5579bcedc7bab0ae68e79d5fd0b6
2018-10-13 00:07:20 +02:00
Liang Qi
c593492d16 Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:15 +00:00
Allan Sandfeld Jensen
25830cf912 Fix builds without DTLS
Change-Id: Ic7215c7aa0bf6f7b37ae34649d809f2e1e1ee95b
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-10-09 13:14:42 +00:00
Jędrzej Nowacki
31f3facac3 Implement QDataStream operator for QCborSimpleValue
That allows us to remove custom handling in QMetaType.

Change-Id: Ic09fb96e1a05c6897803811d70aebbc6ea6e4f2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-03 14:49:27 +00:00
Qt Forward Merge Bot
07e9261105 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
2018-09-30 01:00:19 +02:00
Liang Qi
555a6b5d5d Modernize the "filesystemwatcher" feature
Change-Id: If030b56ad97e047d89d442629262b4839df306d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-27 08:18:55 +00:00
Morten Johan Sørvig
213cfc3fae Make the textedit example use dark text on light background on macOS
Many text documents will be designed for a white-paper
look, and in these cases it is desirable that the editor
colors matches.

Change-Id: I66d721f8c2e27b78a2b885c6cfd74f897fe42389
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-25 12:15:36 +00:00
Paul Wicking
a62bab95d3 Doc: Move touch examples around so they get included in docs
Task-number: QTBUG-59249
Change-Id: I71f1d2e28f0cadbad1d6bcf117198018eaf8e012
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-09-14 03:56:22 +00:00
Qt Forward Merge Bot
42f84de26a Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
2018-09-14 01:00:08 +02:00
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