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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
Update docs after b46d6a75ac,
fdbacf2d5c etc.
Pick-to: 6.7
Change-Id: Ieb49d6876f0a86031fb0ffe970f695e5acbe4c43
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
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>
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>
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>