Commit Graph

653 Commits

Author SHA1 Message Date
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
Liang Qi
60fefff22f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
	examples/widgets/graphicsview/elasticnodes/node.cpp
	examples/widgets/graphicsview/elasticnodes/node.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_drawing.mm
	src/widgets/kernel/qmacgesturerecognizer_p.h

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

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

Change-Id: I9d437059362c367e452b1b4f16077d4e0abd18de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-05-02 09:35:49 +00:00
Liang Qi
866b47916d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm

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

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

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

Amends 3b2d2ada5b1b66ad65eda10d70b5b48d32ef9c5.

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

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

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

Task-number QTBUG-60635

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

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

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

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

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

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

Task-number: QTBUG-52640
Change-Id: I8ad04b1231958628caab18a233d54d42ea6449e7
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-03-21 06:24:41 +00:00
Qt Forward Merge Bot
d58f3c4878 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icf3b9346117ce7149d8687e4cfa182e7586713f3
2018-03-18 01:00:11 +01:00
Friedemann Kleint
f6f40014c4 regularexpression example: Add raw string literal display
Factor out the line edit displaying the code to a class and add
another instance for displaying raw string literals.

Task-number: QTBUG-60635
Change-Id: I4614e4a56e355bad5158523c58edf784868dbf4d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-03-17 18:15:15 +00:00
Qt Forward Merge Bot
8264e495fa Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
2018-03-15 01:00:11 +01:00
Friedemann Kleint
59343eef7d sub-attaq example: Fix crash with software Open GL
Check whether an Open GL context could be created, else
fall back to raster.

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

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

Change-Id: Iad616b285ee1470571adc38b868fcf8a0ed64840
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-13 12:08:13 +00:00
Nico Vertriest
e9dc2f1783 Doc: Add doc to Graphics View Flow Layout example
Change-Id: Id3965d099222607cee4252bbb33c6a1e9c17765a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-13 12:07:55 +00:00
Christian Ehrlicher
1c98cb2b04 Examples: fix superfluous ';' in undo example
There was a superfluous ';' at the end of main. No compiler will
complain I guess but the examples should be syntactically correct.

Task-number: QTBUG-55128
Change-Id: I2ddc3041ed05106d04fb4f4ad74735c72c9ddb26
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-03-12 20:38:18 +00:00
Qt Forward Merge Bot
cf00c01f68 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I110feec4750bd304975bab4f3f33d3a61a4e08bd
2018-03-07 01:00:10 +01:00
Nico Vertriest
1504dda578 Doc: Update example Embedded Dialogs
Changed old signal/slot syntax to new version

Task-number: QTBUG-60635
Change-Id: I7cbe8851d321b7632a08c098b69a96cc346d5f83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-03-05 14:52:27 +00:00
Shawn Rutledge
310daae539 preserve HTML heading level in QTextBlockFormat; demonstrate in example
When reading an HTML file with <H1> for example, we still set the font
size as before (that's how it always was done),
but now it remembers that it came from an H1 tag, so it writes
<h1 ...><span font-size:xx-large ...> ...  rather than
<p ...><span ...> ...  This will help with the upcoming Markdown
format, where heading level is saved but the font is not.

Now the style combobox in examples/widgets/richtext/textedit can set
list item type, heading type or "standard" formatting, and also shows the
current formatting of the line that has the cursor.  It was always a
shortcoming in this example that it only allowed setting the current line's
block format but had no feedback to show the current format.

Change-Id: I0a7849b74f23fea84d3375c487c3a6b9f43240c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-02 08:05:00 +00:00
Qt Forward Merge Bot
b949c44783 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9c90d71fde002544fd97df7e8a2690953cf9f817
2018-02-21 09:41:47 +01:00
Nico Vertriest
0d4ce766ae Doc: review language and spelling in Editable Tree Model Example
Task-number: QTBUG-60635
Change-Id: If82e3e36e5f6d1044028dc4454f2db13f84754d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-19 14:22:15 +00:00
Nico Vertriest
195b2321d2 Doc: complete Border Layout Example
Task-number: QTBUG-60635
Change-Id: Icc605e5bad96aaad0233d4b05ab1ed46972bd725
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-19 12:28:46 +00:00
Liang Qi
942ab49072 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/tools/tools.pri

Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
2018-02-16 08:54:58 +01:00
Liang Qi
1ef03f69e8 Merge "Merge remote-tracking branch 'origin/5.10' into 5.11" into refs/staging/5.11 2018-02-15 21:19:50 +00:00
Liang Qi
bb0fec8057 Merge remote-tracking branch 'origin/5.10' into 5.11
Conflicts:
	src/corelib/corelib.pro
	src/corelib/global/qrandom.cpp
	src/network/access/qhttpnetworkrequest_p.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoansmenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/offscreen/qoffscreenintegration.h
	src/widgets/kernel/qaction.cpp
	src/widgets/widgets.pro

Done-with: Andy Shaw <andy.shaw@qt.io>
Change-Id: Ib01547cf4184023f19858ccf0ce7fb824fed2a8d
2018-02-15 10:14:11 +01:00
Nico Vertriest
2908a13a78 Doc: Remove Validators example from highlighted widgets examples
Contains several bugs.

Task-number: QTBUG-60635
Change-Id: I64d7431ebab2e3f7776e7d2a94e301d677c1bb1e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-15 09:05:29 +00:00
Qt Forward Merge Bot
9c055e8e47 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Iaec2e57d6bf33355ddfa61d25133580a8740335f
2018-02-13 22:56:03 +01:00
Jarek Kobus
c6de55a0bb Fix typos
Change-Id: Id625efea998f2b4dce9970b903830dc3b3efcd3d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-02-13 15:51:10 +00:00
Liang Qi
8dd22d9255 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
2018-02-11 09:13:21 +01:00
Jake Petroules
3343295d80 Fix a bunch of compiler warnings in the qtbase examples
Change-Id: Id0c615aa72d4f4c5941cfa5ca258c3114694ef67
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:22 +00:00
Martin Smith
e177fc4d39 doc: Change \l StyleSheetEditor to \c StyleSheetEditor
A \l was changed to \c to be consistent with all the other references
to the class name..

Change-Id: Ic7449a06e0a1f1d6d7087e11cc85258e81a0dfab
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:27 +00:00
Oliver Wolff
6c3f864ec0 examples: Fix notepad example for configurations without printsupport
Task-number: QTBUG-65735
Change-Id: I7e0d19de4ac92603f2fd033007343f20a408618a
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-01-22 08:27:26 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

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

Task-number: QTBUG-53141
Change-Id: I73d8787241291ae6230861a89b38e91d900fede0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-01-12 07:58:20 +00:00
Christian Ehrlicher
e954951423 Fix QAbstractItemModel::beginRemoveRows in examples
QAbstractItemModel::beginRemoveRows() must not take a negative value
for first or last. It will assert so we should make sure the examples
are correct.
The assertion was added in 00c09e752f

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

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

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

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

Demonstrate the new QLocale::formattedDataSize() function.

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

Change-Id: I9c2bb15bb5ec353d38181b160f0be198774cbea2
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-12-27 08:40:22 +00:00
Andre de la Rocha
ac8011c161 Make the Main Window example use high-DPI toolbar icons
The Main Window example generates icons programmatically for its
toolbars. However, these icons are shown with low resolution in a
high-DPI display because the application is not enabling high-DPI
pixmap support.

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

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

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

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

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

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

Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
2017-11-30 09:16:58 +01:00
Nico Vertriest
d0812cbdab Doc: modify connect statement to new syntax
Task-number: QTBUG-60635
Change-Id: I776bdc49ae42e2d0c11dc33d58d9ce91b9f5e753
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-29 14:09:31 +00:00
Nico Vertriest
1fe6a75fec Doc: Minor corrections custom sort filter example
Task-number: QTBUG-60635
Change-Id: I17a69f85663eaa92e92b4e97385c21a729405e1f
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-11-29 14:09:18 +00:00
Shawn Rutledge
cfccd44b9d Demonstrate the new AA_CompressTabletEvents in the tablet example
Change-Id: I1972da2ead51274771ff24b4c506c2b581ee6abe
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-11-24 11:50:01 +00:00
Liang Qi
153e8b49ad Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/network/access/qhttp2protocolhandler_p.h
	src/network/kernel/kernel.pri
	src/network/ssl/qsslkey_qt.cpp
	src/plugins/platforms/cocoa/qcocoascreen.mm
	src/plugins/platforms/windows/accessible/iaccessible2.cpp
	src/plugins/platforms/windows/accessible/iaccessible2.h
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
	src/widgets/widgets/qmenu_p.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp
	tests/auto/testlib/selftests/expected_cmptest.lightxml
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/testlib/selftests/expected_cmptest.xml

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
2017-11-23 09:36:03 +01:00
Nico Vertriest
64298b42a3 Doc: drop Application Chooser Example
There are plenty of other examples showing how to use QStateMachine

Task-number: QTBUG-60635
Change-Id: I82300b2a0f4e7733f08579a2aa9b548cb7d87efa
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-11-20 09:32:38 +00:00
Nico Vertriest
b00feb8cfc Doc: Add screenshot to Validators example
Task-number: QTBUG-60635
Change-Id: Ie68e611b57900847a00587fdf8558be4be38f23d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-11-20 09:32:31 +00:00
Nico Vertriest
6e7cf8b918 Doc: update screenshots in Addressbook Example doc
Task-number: QTBUG-60635
Change-Id: I5b098120f0e47687ac90d7f05b91a2a60f1eab32
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-11-20 09:32:20 +00:00
Nico Vertriest
f39f813113 Doc: drop Lighting Effect Example
Task-number: QTBUG-60635
Change-Id: If455a778ff6ebd53d8110b3dc25d8b9e27255bac
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2017-11-20 09:31:55 +00:00
Nico Vertriest
0bdbefa3c0 Doc: add doc to Style Sheet example
Task-number: QTBUG-60635
Change-Id: I6c80427bce1efc67bbf4ec67b0afeafc27088d79
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-11-20 09:31:22 +00:00
Nico Vertriest
a78cae73b1 Doc: review Star Delegate Example
- update screenshot
- minor corrections description example

Task-number: QTBUG-60635
Change-Id: I2351160ee9ec0a926fddb122e720c887f851dba5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-11-20 09:30:58 +00:00
Thiago Macieira
19b0ce5daa Change almost all other uses of qrand() to QRandomGenerator
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)

This commit also found a couple of calls to rand() instead of qrand().

This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
  src/network/ssl/qsslkey_qt.cpp
  src/network/ssl/qsslsocket_mac.cpp
  tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-08 09:14:03 +00:00
Allan Sandfeld Jensen
fa9d12f4a2 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/plugins/platforms/xcb/qxcbimage.cpp
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/manual/qtabletevent/regular_widgets/main.cpp

Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Done-with: Mårten Nordheim<marten.nordheim@qt.io>
Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
2017-10-24 13:40:55 +02:00
Alexander Volkov
c181f418b9 Address Book example: Correctly update "Edit entry" and "Remove entry" actions
They are not updated after switching tabs. Thus they can be enabled even
when no entry is selected: select an entry on the current tab and then
switch to an empty tab.

Emit AddressWidget::selectionChanged() signal after changing the current tab
to update these actions.

Change-Id: I00da15ed6c3d3839210ae3ffbe1436e234695522
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-23 14:38:22 +00:00
Friedemann Kleint
879f98106d Revamp QtWidgets/DragAndDrop examples to C++11
Introduce nullptr and replace foreach with new C++11 range based for
loops. Minor fixups of signals, file dialog usage.

Apply the same changes to the ItemViews/puzzle example since it
shares parts of the code with DragAndDrop/puzzle. Make some
changes to both examples to that the diff of the two becomes
small for easier comparison.

Task-number: QTBUG-60635
Change-Id: I8af824229ebac24d6ec151eae92176d227695490
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-18 10:31:44 +00:00
Liang Qi
7e4571b7e7 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-17 18:29:37 +00:00
Alexander Volkov
66119a07e8 Address Book example: Replace QPair by struct
Introduce Contact struct to store contact data and use it
instead of QPair<QString, QString>. Proper naming really
clarifies the code.

Task-number: QTBUG-60635
Change-Id: Ibfb421dfc854accc382212b0da46e7aafc0d528a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-17 16:42:55 +00:00
Liang Qi
d0a0a3c041 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	examples/network/fortuneclient/client.cpp
	examples/network/fortuneserver/server.cpp
	src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
	src/plugins/platforms/cocoa/qcocoabackingstore.h
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoascreen.h
	src/plugins/platforms/ios/qiosbackingstore.h
	src/plugins/sqldrivers/oci/qsql_oci.cpp
	src/widgets/kernel/qwidgetwindow.cpp

Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
2017-10-17 10:34:24 +02:00
Liang Qi
01afc8c810 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
2017-10-16 22:21:52 +03:00
Nico Vertriest
56a3cbc5c7 Doc: minor language edits
Task-number: QTBUG-60635
Change-Id: Ic1aef003be9cd08dc38021e5b4a4add8cabbfa98
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-09-29 08:52:59 +00:00
Nico Vertriest
e30d67ba27 Doc: update screenshot stylesheet example
Task-number: QTBUG-60635
Change-Id: I4485502510aca2797ead28f3b0085d1060ea3d49
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2017-09-29 08:52:45 +00:00
Nico Vertriest
b7005aa565 Doc: minor corrections doc Calendar Widget Example
Task-number: QTBUG-60635
Change-Id: I41d9af6836dc80b5c5c5303d313d15daff72b37f
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-09-29 08:52:34 +00:00
Nico Vertriest
7631f815db Doc: update Editable Tree Model Example
- new screenshot with more up-to-date graphical look
- deleted itemviews-editabletreemodel.png from old folder
doc/src/images
- deleted unnecessary item in qtwidgets.qdocconf

Task-number: QTBUG-60635
Change-Id: I9b82fa027347fb0fd7adb86038abd32853e68c3a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-09-29 08:52:20 +00:00
Friedemann Kleint
267b1a140a regularexpression example: Fix compilation with clipboard disabled
Use the new configure system consistently.

Task-number: QTBUG-63429
Change-Id: I6668ba9fde09492f3e60e614103e18e88783d0c4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-09-28 04:14:02 +00:00
Liang Qi
aadfe7d634 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/testlib/qtestsystem.h

Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
2017-09-26 16:14:54 +02:00
Gatis Paeglis
971adcaea1 examples: remove wince leftovers
This patch ammends c8602f45cc

Change-Id: I6bbc892b514b1768e4cc3a4d52aa420a6e9bb4e9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-09-22 19:22:07 +00:00
Friedemann Kleint
29b38bea45 Polish the StorageView example
Introduce nullptr and override. Change the ready/valid columns to
use check marks. Right-align the numerical columns. Add a shortcut
to refresh. Sort by path, making sure the root volume is first.

Task-number: QTBUG-60635
Change-Id: I74cda7647f544902aaf4d2a0ab76986f1523aa6f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-09-20 12:19:39 +00:00
Kevin Funk
58c14c4a7e Replace Q_NULLPTR with nullptr where possible
Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
  (definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
  (a test executable compilable both under Qt4 and Qt5)

Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-09-19 11:53:55 +00:00
Shawn Rutledge
0d51767b5d Tablet example: update only the drawn areas of the canvas
This makes an enormous difference in responsiveness on the iPad Pro:
it actually feels like real-time drawing with hardly any lag.

Change-Id: I17c3b948e818d4ee46b4d24934c929ab9b386e69
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-09-15 12:13:51 +00:00
Oswald Buddenhagen
ee07b912a1 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
	src/plugins/styles/mac/qmacstyle_mac.mm
	src/widgets/widgets/qdockarealayout.cpp
	src/widgets/widgets/qmainwindow.cpp
	src/widgets/widgets/qmainwindowlayout.cpp
	src/widgets/widgets/qmainwindowlayout_p.h
	tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
	tests/auto/other/macnativeevents/BLACKLIST
	tests/auto/widgets/widgets/qmenu/BLACKLIST

Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
2017-08-02 22:52:32 +02:00
Friedemann Kleint
f54327c3c3 Regular Expression Example: Add context menu
Add context menu providing:
"Escape Selection" Apply QRegularExpression::escape() to selection
"Paste from Code" Paste from C++
"Copy to Code" (for completeness)

Task-number: QTBUG-60635
Change-Id: Iee15c2243c7d0435b623dde4a1b26249aecd0553
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-07-19 20:58:19 +00:00
Simon Hausmann
407302fb1b Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/corelib/io/qwindowspipewriter.cpp
	src/widgets/styles/qcommonstyle.cpp

Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
2017-07-19 09:47:29 +02:00
Friedemann Kleint
dc81a99dec Examples: Remove remains of wince
Task-number: QTBUG-52590
Task-number: QTBUG-60628
Task-number: QTBUG-60633
Task-number: QTBUG-60635
Task-number: QTBUG-60641
Task-number: QTBUG-60659
Change-Id: I9ffc3e25893d2281b19cc12b70e1a92fb2a8b708
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-07-14 17:30:51 +00:00
Gabriel de Dietrich
d38fe875c7 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
    src/widgets/widgets/qmainwindowlayout.cpp

Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
2017-07-13 16:36:10 -07:00