Commit Graph

117 Commits

Author SHA1 Message Date
Friedemann Kleint 4300d3d031 Gallery example: Brush up the .cpp file
Use modern string literals and replace #if-defery by a check on
QOperatingSystemVersion::currentType().

Change-Id: I319b6c7665a4c4cadd7d1e711d8527f79ca35261
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit a6da6b3aca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d78d99d3f5)
2025-09-12 05:40:09 +00:00
Volker Hilsheimer ee4c1c338a EventCalendar example: reference the listview explicitly in the delegate
The example generates warnings on stderr when shutting down, presumably
because (some) delegate items no longer have a parent. Instead of
referencing parent, give the ListView an ID and reference it explicitly.

Pick-to: 6.8
Change-Id: If968e9f95e31226e9c3fb2f63eb92cff5afd3cba
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 57c635abf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-25 12:27:26 +00:00
Volker Hilsheimer 9f790c208a EventCalendar example: balance begin/endResetModel calls
The repopulate() implementation has an early return. Use a scope guard
to make sure that we always balance being and end calls.

Pick-to: 6.8
Fixes: QTBUG-136947
Change-Id: I8d817ad7bdcae8645afe15479a510c6fd070c88b
Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit efad13b530)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-25 12:27:23 +00:00
Mitch Curtis 8308e8180b Revert "TextEditor example: add actions to built-in context menu, remove custom menu"
This reverts commit e5824ea91b.

Reason for revert: dfcde3ea4d, which this
requires, causes a regression: QTBUG-134903. The feature will be post-poned
to 6.10 instead.

Also amends da064518e4 in order to keep
it working after a small conflict.

Change-Id: I339e1afc77b11bf446d04aad5aae933c8c1f6b45
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-05-19 11:34:12 +08:00
Shawn Rutledge f5599b18e7 TextEditor example: allow setting multiple font attributes
When a user activates the boldAction for example, the code was replacing
QTextCharFormat's font with a default-constructed font that has the bold
attribute set, which meant that it could not be bold, italic, underlined
struck out, and with a custom size and color at the same time. On the
other hand, when we do it the current way:
  textArea.cursorSelection.font.bold = checked
we call QQuickTextSelection::font(), QFont::setBold(), and then
QQuickTextSelection::setFont(). (QFont is a QML value type, so it's the
only way.) Perhaps at some point, something was going wrong with that,
but it seems to work now.

Amends 045f9ce192

Fixes: QTBUG-136250
Pick-to: 6.8
Change-Id: I268e5814e7aa52aeb5aaec2d1a8fbfbc0d670236
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 17a225f09a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-29 22:25:23 +00:00
Shawn Rutledge f2df3a1491 Remove menu shortcut from Controls gallery example
Text editing controls TextField and TextEdit provide their own context
menus since 3b598b6f75. We don't want a
global menu key shortcut to preempt those.

Task-number: QTBUG-136253
Change-Id: I7d0ec3754e24154b203c8ccd95801542a185a1c4
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 31f2f0e378)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-29 09:16:03 +00:00
Shawn Rutledge da064518e4 TextEditor example: Add font and color dialog actions to Format menu
Task-number: QTBUG-136251
Pick-to: 6.8
Change-Id: I64d7a406d4acff5395cfc18c201888c17a44e10f
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 5e8fba7715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 20:54:07 +00:00
Shawn Rutledge a116b64839 Improve QML in Controls TextEditor example
Pick-to: 6.8
Task-number: QTBUG-119988
Change-Id: Iffc7df85f25024301efef591eb3fbfb1cfbe2f17
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 9cd4e29afd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 20:54:01 +00:00
Shawn Rutledge e5824ea91b TextEditor example: add actions to built-in context menu, remove custom menu
Since 3b598b6f75 TextArea comes with a built-in
context menu. Here we demonstrate how to add extra menu items to the end.

Task-number: QTBUG-35598
Task-number: QTBUG-134903
Change-Id: I1e3d8c044939521aaa076486630e3b879130dfd1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 64063946db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-09 13:29:15 +00:00
Tor Arne Vestbø 6de96f43fb Compute implicitSize based on implicitContentSize in Popup and subclasses
Popup uses a Pane as its popup item, so now that Pane reflects its
explicitly set contentWidth/Height through implicitContentWidth/Height
we can use the same expression for implicit width/height as regular
controls, which hooks us into the safe area binding loop detection
as well.

Change-Id: I3709978dae0271d7daf44fc6988f09f03df15b1f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 43083e6441)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-19 17:07:44 +00:00
Tor Arne Vestbø ee8a5577f8 Compute implicitSize based on implicitContentSize in Pane and subclasses
Now that Pane reflects its explicitly set contentWidth/Height through
implicitContentWidth/Height we can use the same expression for implicit
width/height as regular controls, which hooks us into the safe area
binding loop detection as well.

Change-Id: Ie31b740a1e405341fc5f0ed9673b213292e4afd9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit ae7a573fe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-19 00:10:41 +00:00
MohammadHossein Qanbari 21883adaf3 Spreadsheets Example: Use TableViewDelegate
This update removes the custom table cell and uses the TableViewDelegate
type as the main TableView's delegate.

Task-number: QTBUG-114636
Change-Id: Icc2fd121d66f2bd1a6102e8575b75abd46940b96
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-11-30 20:10:33 +01:00
Santhosh Kumar 65263fe2fc SpreadSheet: Use SpreadModel to invoke the required mapping functions
The 'model' used when invoking mapColumn/mapRow during section
reordering seems incorrect as the model here has been referred to as
QHeaderProxyModel and not the SpreadModel. Updated the corresponding qml
to refer to the correct model.

Pick-to: 6.8
Change-Id: Ia8fe900eb0574319fd4c967b6f85cf8dd11bddd8
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-11-11 21:30:28 +01:00
MohammadHossein Qanbari 1e02f013a5 Spreadsheets Example: Fix hang on dragging header through selected cells
The bug occurred when dragging a column over a selected column cells.
The DropArea in TableView attempted to process inconsistent drag data
for all the selected cells (up to 1000), causing the application to
hang.

Fix: Enable DropArea only for dragging TableView cells; disable for
other cases.

Fixes: QTBUG-130928
Pick-to: 6.8
Change-Id: I162a57638d89b97f3f1ef553850e3be3be389f1d
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-11-07 20:06:02 +01:00
Volker Hilsheimer 22bc4a4f52 Gallery example: add colorScheme selection
Works with Fusion, iOS, and FluentWin3 styles.

Should also work with macOS and ideally Basic, but those styles
do not respect the global palette yet. So disable the row with the
color scheme selection check boxes unless we know it works.

The color scheme setting is not stored across sessions, and is
instead applied "live".

Task-number: QTBUG-124490
Change-Id: If6bec56884e6dc9093d541fc87800596aa1b9ca3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-10-24 00:00:08 +02:00
Ed Cooke d55134197a Clean up CMake output from wearable example when building qtdeclarative
Remove the two CMake warnings from the CMake output when building
QtDeclarative. The warnings come from a missing optional dependency for
the wearable example.

Pick-to: 6.7 6.8
Change-Id: Id9bf2ccc4d6db2ea44618b2119c69c89e271a870
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2024-10-10 14:45:21 +02:00
MohammadHossein Qanbari c2ff06f90e Spreadsheets Example: Remove circular dependency
The example fails to compile on some platforms due to an existing
circular dependency. To fix this issue, the inclusion of
`spreadformula.h` has been moved to the related .cpp files, and a
forward declaration is used in the `spreadmodel.h` file instead.

Fixes: QTBUG-128272
Pick-to: 6.8
Change-Id: Ic2c589f9126e0ba0eed6ffe5150bacd4afa6d239
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-09-10 15:49:10 +02:00
Leena Miettinen c127031cae Doc: Fix links to Qt Creator documentation
- Update the link targets to 14.0 level
- Use the \QC and \QDS macros
- Remove \externalpage entries from the repository to use
  \qtbase\doc\global\externalsites\qtcreator.qdoc

Change-Id: I5b63b4f5fab2e4e6aceec385b3ce5516b803c682
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2024-08-30 13:08:06 +02:00
MohammadHossein Qanbari c07b32d6de Spreadsheets Example: Add Documentation
The documentation was missing for the example. This patch provides a
screenshot image of the application and a documentation file.

Fixes: QTBUG-128224
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I2aa73ea7e82eb019db84a7ce685837b89e62f300
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-08-30 00:28:36 +02:00
Volker Hilsheimer e033f93a01 Gallery example: add FluentWinUI3 to the list of styles
Pick-to: 6.8
Task-number: QTBUG-124490
Change-Id: I88609e870c4db7ba989d4fc60ecb8445745f34ce
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-08-29 01:35:27 +02:00
Volker Hilsheimer 3dd38c0ad0 Gallery example: don't hardcode the width of the settings dialog
The combobox exceeds the width of the dialog. Let the layout determine
the dialog's width.

Pick-to: 6.8
Task-number: QTBUG-124490
Change-Id: I9d91941713dd1e5b7c5e7e099c04b2ffbe4d371f
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-08-29 01:35:27 +02:00
MohammadHossein Qanbari 371efb4ca2 Spreadsheets Example: Fix Installation and Deployment
After installing the example outside the build directory using
`cmake --install --prefix`, the installed application could not run
because the Spreadsheet subproject library was not found at runtime.

To fix this issue, the Spreadsheets subproject has been added as a
static library to the project. Now, it can be found in the installed
directory.

Fixes: QTBUG-127846
Pick-to: 6.8
Change-Id: I30968afa958ec6bda6017969de157e27550a7616
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-22 21:35:38 +02:00
MohammadHossein Qanbari b1ae89155b Spreadsheets Example: Some improvements
The following changes are applied:
- Using ScrollView
- Cut action removes the data from the model
- Selection handle: smaller size, lighter color and border is used

Pick-to: 6.8
Change-Id: Id09c12db5f5c38c2254e1bf81970616e7e84f38d
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-08-17 11:00:06 +02:00
Andreas Eliasson df340d9ca8 Doc: Fix qdoc link warnings to Qt Creator docs
Also, use the macro, \QC.

Change-Id: I0c0fddf4c70bbe420a27d54c2ad8ee01487dff81
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2024-08-08 09:25:38 +00:00
Santhosh Kumar 1fca1477eb Add an example to create and use custom tree model in quick tree view
Add an example 'Table of Contents' to show how to create and use custom
tree model (derived from QAbstractItemModel) in the Quick TreeView
control.

Fixes: QTBUG-127016
Pick-to: 6.8
Change-Id: I9a5d9e837e1b18de322a0ec895d9832918fd5816
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-08-07 00:35:55 +02:00
Even Oscar Andersen f8b9bf5c52 wasm: Remove qmldir from RESOURCES in CMakeLists.txt
Having qmldir in RESOURCES causes it to be copied incorrectly
to the gallery subdirectory, causing this sequence of commands
to fail:

${QT}/bin/qt-cmake .
cmake --build . -t clean
cmake --build .

Or alternatively it will also fail if building in a separate
directory

The symptoms are:
After start, clicking Button in the menu, the following console
log entry is created:

qrc:/gallery.qml:192:5: QML StackView: push: qrc:/pages/ButtonPage.qml:8
ScrollablePage is not a type

Fixes: QTBUG-127572
Pick-to: 6.8
Change-Id: I7da9853dff5fcc11c2318ac5431b33ea9ce4b096
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-08-01 15:01:37 +00:00
MohammadHossein Qanbari 6db74d7340 Spreadsheets Example: Check if clipboard is supported
The Spreadsheets example does not build on QNX as it uses the clipboard,
which is not supported on QNX.

To fix this issue, it checks `QT_NO_CLIPBOARD` macro around the
clipboard usage and prints a warning if it is not supported.

Fixes: QTBUG-127273
Pick-to: 6.8
Change-Id: Ib677ecd79c216f4e7dde20d82875ee3f492a21ea
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-23 18:38:20 +02:00
Jan Arve Sæther ccf59c66d9 Add Expanding size policy to some controls and items
Applies to the following Quick items:
* TextEdit
* TextInput
* Flickable

and Qt Quick Controls:
* ProgressBar
* Slider
* RangeSlider

It follows the same Expanding size policies as the corresponding widgets

Also enable size policies the following examples (and thus remove
several lines of Layout.fill.*):

* quick/layouts
* quickcontrols/ios/todolist

Task-number: QTBUG-117597
Pick-to: 6.8
Change-Id: Id4f552aa4c8e85a65b00ff1cf06f34dd7ddeb9fa
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-17 15:21:35 +00:00
MohammadHossein Qanbari 33b5ba74ed Spreadsheets Example: Fix bug in inserting a new row
When inserting a new row (above or below an existing row), it was
causing a crash.

There was a forgotten call of the previous() method on the iterator
that was supposed to iterate backward.

It has been fixed by adding this function call inside the loop.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I6a4436bacb0348c1b6bccd929f715e36d0279754
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-12 20:59:51 +02:00
MohammadHossein Qanbari 74fef51927 Spreadsheets Example: Separate HeaderViews and TapHandlers as types
The Main.qml file was growing larger due to modifications in header
views. To prevent this, the header views have been separated into
ColumnHeaderView and RowHeaderView QML module types.

Similar to the header views, the tap handlers have been separated into
a QML module type to maintain consistent behavior for header views.

Additionally, the mouse tap handlers have been merged into a single
tap handler to manage mouse events with different combinations of
buttons and modifiers.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: Ib465b8b631cb8fe2aeeaaea229e2c4985619d2e9
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-10 13:37:32 +02:00
MohammadHossein Qanbari 1d344045a9 Spreadsheets Example: Use TapHandler instead of MouseArea
When MouseArea is used for the header views, it blocks events for the
column/row reordering event handler.

To fix this issue, TapHandler is used instead of MouseArea. With proper
configuration of TapHandler properties, the column/row reordering event
handler can access events when they're not accepted by TapHandler.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: Ie59dfc681bb3d853e0a73a05d46bdcd2607091b0
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-09 16:47:25 +02:00
Fabian Kosmale 15a49ef0c1 Examples: use qt_standard_project_setup in more places
And remove the redundant AUTOMOC lines.
This also avoids a few policy related warnings.

Task-number: QTBUG-126201
Pick-to: 6.8
Change-Id: Idaa58d7fbc0236aa2091ead43d5a0e6f396647e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-07-03 08:44:01 +02:00
Fabian Kosmale 2a32ec77c0 examples: Consistently require Qt 6.8
This prevents policy warnings in a few cases, and we want people to
opt-in to new policies, so make our examples copy'n'paste friendly.

Pick-to: 6.8
Task-number: QTBUG-126201
Task-number: QTBUG-126468
Change-Id: Iefa666b61c2d2f767da3583f0f6efd8e4a2169e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-07-03 08:43:43 +02:00
Andreas Eliasson a7bd27f17d Doc: Fix qsTr() link
Fixes qdoc warning:
qtquickcontrols-texteditor.qdoc:128: Can't link to 'qsTr'

Pick-to: 6.8 6.7
Change-Id: Ib2543779cc97052fd754b417468cb315313503a9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-07-01 05:21:46 +00:00
Lucie Gérard 746ee15415 Correct license for example files
According to QUIP-18 [1], all example files
should be LicenseRef-Qt-Commercial OR BSD-3-Clause
Example takes precedence over build system

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.8
Task-number: QTBUG-121787
Change-Id: Ia60be3cc375a3a16af7e6ea7755a61cfe6e1573b
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-06-27 09:17:10 +02:00
MohammadHossein Qanbari 5bdf12fc6a Spreadsheet Example: Fix bug in update and minor improvement
If the user drags a column from outside the visible area and drops it
into the visible area when the column contains a formula that depends
on a visible cell, updating that cell will not update the cell
containing the formula.

The reason is that the update method in the SpreadModel updates the
wrong rows and columns. The visible rows and columns need to be mapped
to the model's rows and columns.

The improvement is that the update uses a mutex instead of enabling or
disabling the connection in the view. However, the blockConnection()
function has been kept because some actions need to update a large
amount of data in the model, and then the view can be updated without
any extra view updates.

The pan and reset_reordering icons are updated. The new icons have
been designed by the designers.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I20ea1ef0bb777b5b0b04e7ae74df172ffc5b5ed8
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-06-11 05:23:07 +02:00
MohammadHossein Qanbari e0e2f447ad Spreadsheets Example: some fixes and improvements
The HelpDialog is improved by defining an inline component inside it.
The column selection issue is fixed by removing the unnecessary margins
and rows as well.
When the user tries to cut cell data and paste it onto an area including
the cell itself, that cell would be deleted because it was a cut action.
However, this is not correct because the value of that cell is replaced
with the data from the clipboard (mime data) already. To fix this bug,
before deleting the data of the cutting cell, that cell should be
checked to ensure it is not part of the target cells.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I1adab2c17dab1cf07245bfaed03193904d7d7a2e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-06-11 05:23:03 +02:00
MohammadHossein Qanbari 3de85ce8b9 Add the Spreadsheet example
The example demonstrates a Spreadsheet that provides adding, editing,
and deleting data, and also the ability to write formulas for numeric
data. Also, it's possible to select cells, rows, and columns for
deleting them or their data, copying or cutting the data, and dragging
them to other places. The user can hide columns or rows, and also show
them again. Thanks to the reordering API, columns and rows can be
reordered and also can be reset to the default order.

There is a SpreadModel class which handles the entered data. It only
stores the data of the cells that is provided by the user. It means
that it does not create any empty data structure for empty cells, in
order to reduce memory usage.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I1d9cc5b4b8d902257e9ed508d4a712b0574490f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-06-03 17:27:22 +02:00
Mitch Curtis 85ea1653db Fix contactlist example not finding ContactList type on macOS
ec9312687e added
NO_RESOURCE_TARGET_PATH, which causes issues on macOS.

Fixes: QTBUG-123773
Pick-to: 6.5 6.7
Change-Id: I80f4cb740dde47549e4357f08b6ae00c243b77b5
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-15 09:27:29 +08:00
Alexandru Croitor a6bd1dc3e0 CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor

A few examples had to be adapted manually, mostly those that build
additional qml modules / plugins.

The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed, these are not needed anymore because example directory
selection is handled by the qt_internal_add_example calls.

The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_qml_app_script.

A qt_generate_deploy_qml_app_script call was added for each
executable target.

Note that the deployment step will be skipped in the CI for now,
because:
- we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus
  set QT_INTERNAL_SKIP_DEPLOYMENT to true
- standalone examples feature is not yet enabled in the CI, which
  means we continue to build examples in-tree, and deployment is
  disabled for in-tree prefix builds.
A small list of examples to deploy in the CI will be chosen in the
future, to ensure deployment coverage, without slowing down overall CI
times due to all the *deployqt invocations.

Even if deployment is disabled in the CI, the install(TARGETS) calls
for each example will still run, installing into an
'installed_examples' directory, which will not be archived by the CI.

The QtBundleQmlModuleForMacOS and bundle_shared code was removed,
because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the
deployment api, to ensure macOS bundle examples run properly in the
build dir. This works even in prefix in-tree builds, when installation
deployment is disabled.

Finally, for all examples that build additional qml module libraries or
plugins, the libraries / plugins must be installed into the bin dir of
each project, along with a qmldir file.

This is to support running the installed project for platforms that
don't have deployment api yet, like boot2qt / yocto.

If we want to have super clean install / deployment rules in the
future, we won't be able to avoid adding ugly per-platform conditions.
The current status quo is deemed an improvement over what we had
before.

Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I843d934668c25dbcd1abca52495b393579633fc5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-27 18:57:34 +01:00
Fabian Kosmale e6ddee9c57 Fix contactlist example (CMake version)
The example didn't set the QTP0001 policy, causing loadFromModule to not
find the QML file. Use qt_standard_project_setup to set the policy, and
remove the now superfluous AUTOMOC setting.

The qmake project already migrated to putting the files into the default
resource path, that's why it was working.

Fixes: QTBUG-122564
Pick-to: 6.7
Change-Id: I802bb64b6cab3ad6b21737b41713efb6353385ea
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2024-03-27 16:26:16 +01:00
Frédéric Lefebvre d0dafdbc2a Add pause for the notifications to be properly shown
Add a PauseAnimation so that the notication section is
properly shown. Before it was being hidden immediately after being
shown and was therefore impossible to see.

Pick-to: 6.7 6.7.0
Task-number: QTBUG-123318
Change-Id: I9877a3ac069a74bf370532ea0133fad33a43a2e6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-03-22 17:11:40 +00:00
Lucie Gérard 53295d9102 Correct license for examples files
Example takes precedent over build system file type.
According to QUIP-18 [1], all examples file should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7 6.7.0
Task-number: QTBUG-121787
Change-Id: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-21 10:41:29 +01:00
Shawn Rutledge a96871eac8 Adjust Controls Text Editor example and docs further
- text formatting includes alignment, not just font properties
- update links in example.md
- update texteditor.html: don't mention Qt Labs Platform, but
  link to some recent new stuff
- if ToolButton.action is bound, enabled is redundant (the Action
  already has it)
- don't include QApplication

Amends 6217408799 and
21b3c4741e

Change-Id: Ie4565829f02d8ee1541ba4af9d64bd044739179f
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-03-18 22:02:01 -07:00
Shawn Rutledge 6217408799 doc: Update Controls Text Editor example docs
We also move ScrollBar to make explanation easier.

Pick-to: 6.7 6.7.0
Change-Id: If65de335f840382b5e236d8a04db382b0b7aee6a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-03-12 14:24:26 -07:00
Shawn Rutledge a27b75c89d TextEditor example: use Actions in a DRY way; TapHandler
I'm not sure why the example was written with so much repetition,
but there must have been limitations back then. It's better to have
Action as the encapsulation for an operation, and simply bind it to
all the places where it's used (menubar, toolbar and context menu).
It would be even better if an Action could be added directly to a
Menu or ToolBar, but so far there's not a declarative way to do that
(only by using addAction(), which is only in Menu, not ToolBar).

We now use TapHandler instead of MouseArea to open the context menu.
It works fine either way, but at least we don't need anchors.fill.

Pick-to: 6.7 6.7.0
Change-Id: I74900ec49b57b616ffacddcf81c5aea12d4fefe6
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-03-12 17:56:34 +00:00
Shawn Rutledge 93a18268f9 doc: Update TextEdit.textFormat, text and TextDocument.source
Update docs after b46d6a75ac,
fdbacf2d5c etc.

Pick-to: 6.7
Change-Id: Ieb49d6876f0a86031fb0ffe970f695e5acbe4c43
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-03-06 20:40:19 -07:00
Santhosh Kumar 8d3ed392bb Update manual tests and examples for change in default size policy
The size policy of item updated as part of task QTBUG-117597. This
patch update existing examples and manual tests that depends on quick
layout to embrace size policy change.

Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: I68469a3bba3c4d3e5ed4b6eae0fd765b5206efc0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-02-21 14:27:54 +01:00
Mitch Curtis 8f705f0db9 gallery: fix RadioDelegates not being exclusive
The ButtonGroup was being declared several times rather than once.

Amends b663020c9a.

Fixes: QTBUG-122454
Pick-to: 6.5 6.6 6.7
Change-Id: If66f5a5a6841a56abbf93908c83facc9970def40
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-02-21 21:27:53 +08:00
Shawn Rutledge 5cba3f5a8d Text editor example: fix up the touch-specific UI
Catch up with recent changes in the default texteditor.qml file:

- TextDocument.status is new; the error signal is gone. Update as in
  bec8df96b7 and
  1e6cb2462e
- 3bae41faac changed the mapping of the
  "OK" checkmark in fontello.ttf
- use Actions to show and change cursorSelection styling, as in
  045f9ce192
- set a default window size; it doesn't matter on a mobile device that
  runs everything fullscreen, but it's easier to test on desktop with
  the -touch flag

Fixes: QTBUG-121840
Task-number: QTBUG-121946
Pick-to: 6.7
Change-Id: If678b92efe4e1824022fa0ee9106c0c3b0b9f194
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-15 10:26:05 -07:00