Commit Graph

61 Commits

Author SHA1 Message Date
Venugopal Shivashankar d220b4a8d0 Example: Drop "2" against "Qt Quick Controls" text
This should ensure that the examples give the same
message as the documentation. In addition,
dropped a phrase about Qt Quick Controls claiming
that it is designed for mobile and embedded. The
latest version of controls covers the entire spectrum.

Change-Id: Ia856fa47a6e6fc35f80bedc549378a00c7fbbc2a
Pick-to: 5.15
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-11-17 09:30:18 +00:00
Volker Hilsheimer cde1a8a10b Get rid of all instance usage of QFontDatabase
All QFontDatabase APIs are static, use them accordingly.

Task-number: QTBUG-88114
Change-Id: Iae40e1354eaa6a6098a9fdbce9e237a9f498cc7d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-03 16:55:32 +01:00
Alexandru Croitor edfb8943fc CMake: Regenerate examples to set the WIN32_EXECUTABLE property
As well as the MACOSX_BUNDLE properties as necessary.

Task-number: QTBUG-87664
Change-Id: I1113701f04a16b05b03fbb1a49f131c84659cdcb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-26 21:20:04 +01:00
Alexandru Croitor a4445cf2f7 CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: I0d26db40fdb7bd35c92c8fd970b60ec580acc0e0
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-10-20 09:13:34 +02:00
Mårten Nordheim 3a9f84fb37 Update QStringConverter usage
Following fa8d021fa6fcb040fb702b6ffd2deee52a3b748a

Change-Id: Ifa08b5e1bceecb8657ce528eb315c19fa34a1e1f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-09 11:44:18 +02:00
Volker Hilsheimer 153c0ee3c4 Fix more compiler warnings from deprecated application attributes
Also cleanup documentation, with the exception of the "High-DPI
Support in Qt Quick Controls" page, which needs to be either
removed or rewritten after some fact checking.

Change-Id: I3cdf1f8554f8f26627a9a5f17c2ee0038c933468
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-09-16 10:32:15 +02:00
Mitch Curtis bb33370005 Fix examples' usages of styles
After the type registration changes, importing a style explicitly
will cause that style's QML types to be used, so applications
should put style-specific code into file-selected directories if
they need to support multiple styles.

[ChangeLog][Important Behavior Changes] Due to the recent type
registration changes, importing a style explicitly (e.g.
"import QtQuick.Controls.Material") now registers that style's
QML types in addition to making its API (attached, singleton, etc.)
available. For this reason, it is now advised to have style-specific
code in a separate QML file and use file selectors if your application
supports more than one style. If your style only supports one style,
importing that style explicitly will work as expected.
For example, if you use Material.foreground in your QML code and your
application supports more than one style, you should refactor the code
that uses the binding into its own file; e.g.
+Material/MyComponent.qml.

Fixes: QTBUG-86263
Change-Id: I38e40ff4f20f61218550ad73945dafb912193466
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-10 12:31:45 +02:00
Mitch Curtis d451cab0c8 Remove all version numbers from QML imports
As of Qt 6, the latest version will be used by default. This saves us a
lot of effort in terms of version bumps.

Task-number: QTBUG-82922
Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-26 11:46:00 +02:00
Shawn Rutledge 0672882cab Support Markdown in the TextEditor example, including local paths
The example still loads an HTML file from resources by default, but now
it's possible to give either a relative or absolute file path on the
command line to load an html, markdown or plain text file. Alternatively
you can use the file dialog to load any of these types. We assume that
any resources (such as images) with relative paths are to be loaded from
the directory where the source text file is.

Pick-to: 5.15
Change-Id: I37bc2d6aa2306016453770dc2fd66efa41a16618
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-08-10 16:20:06 +02:00
Karsten Heimrich 602bffd346 Port QtQuickControls2 from QTextCodec to QString{Converter|Decoder}
Task-number: QTBUG-75665
Change-Id: Ib66a260dc3bfc39e2e50c38db56ca72b8186a4ac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-17 15:09:27 +02:00
Mitch Curtis 0e18524a84 Remove Qt Labs Calendar
This is getting its own repository as part of the move to the
marketplace.

Task-number: QTBUG-84172
Pick-to: 5.15
Change-Id: I2f963c298d6ef95e0832f95aa1e1ea809f4867a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-28 08:09:33 +02:00
Samuli Piippo 014736755e Add special case for escaping quotes
<command-line>: warning: missing terminating " character
<command-line>: error: stray ‘\’ in program

Change-Id: Iab23419a707a105a9789b8d7af3740e320d54119
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-31 12:52:32 +03:00
Alexandru Croitor e558d0794b CMake: Regenerate projects
Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-17 14:39:47 +00:00
Alexandru Croitor f52b95a96c Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
2020-03-17 09:54:04 +01:00
Alexandru Croitor 92dc998f6d Fix build failures as a result of QMetaType changes in qtbase
moc now stores the QMetaType of properties as a result of
46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires
full type information about the property type inside the moc generated
source file.

Many of the property types were forward-declared, and this resulted
in build errors like
  "invalid application of 'sizeof' to an incomplete type 'QQuickTransition'"

Make sure to explicitly include the moc files inside the counterpart
.cpp files, so that full information is available from included headers.

Fixes: QTBUG-82774
Change-Id: I5971713864992398daed72ce9f6ab866668cf8e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-03-12 15:48:31 +01:00
Mitch Curtis bcdd38074b clang-tidy: fix cppcoreguidelines-pro-type-member-init
Ensure that all members are initialized and remove an unused member.

Change-Id: Ibfb3ea86b7791cd6f8683b68e7cd3bc4256b33f7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-12 15:41:00 +01:00
Leander Beernaert 2bd4f5cd58 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I61919fabd4a3a07ed374f2c3c1fae2d589d6e124
2019-11-25 12:45:06 +00:00
Alexandru Croitor 5e6bf7e22e Regenerate projects to be in sync
Change-Id: I3a57449c9025e22414b8337fcffdeb0f4d769af2
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:22:59 +00:00
Mitch Curtis 17cc497f16 Run optipng on all images
find . -name "*.png" -exec optipng -o 7 -strip all {} \;

Change-Id: I2238b2dd38813d33ed48d79817f872f922cfa28d
Fixes: QTBUG-79275
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-04 13:31:34 +02:00
Mitch Curtis e748ad35b5 texteditor: update links in html file
Change-Id: I7e3bd670039d181fb562967c5e9d3830f63d46a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-24 11:08:56 +02:00
Alexandru Croitor 6f617349cf Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml.

Change-Id: I1e2b3f486e9ace4bc8dc0419a64848990b3a6b39
2019-10-15 13:55:22 +02:00
Alexandru Croitor 718e08392f Regenerate examples
Change-Id: I8a55e330f8f251df1498f1b906d25b3311f5fd70
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-11 11:47:43 +00:00
Leander Beernaert 833d8c305b Conversion of QtQuickControls2 examples
Initial Conversion of QtQuickControls2 examples.

Change-Id: I21ddf792d039dc26e4ba58d8592101eb131618d3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-08 16:25:53 +00:00
Venugopal Shivashankar f74cff42a7 Doc: Replace the "Qt Quick Controls 2" instances
Now that Controls 1 is deprecated, it's ideal to use
"Qt Quick Controls" instead of "Qt Quick Controls 2".

Task-number: QTBUG-70333
Change-Id: Ie745db4b61071ddb5e06150d4e739cda74c59f41
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-08-22 08:32:02 +02:00
Friedemann Kleint 63a4ecea93 TextEditor: Add modified handling
Add a modified property to the document and add
handling in onClosing(). Connect the actions to
call close() instead of Qt.quit() for it to
become active.

Change-Id: I0fec75629db64e91508ed8ba45d4fb60be146b1b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-08-21 10:13:23 +02:00
Qt Forward Merge Bot 86f09add21 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I7fe9e74beff3cdbfbf02ee0f129a8204ad31046e
2018-12-05 09:19:46 +01:00
Venugopal Shivashankar 05597ef3e5 Doc: Update \titles with "Controls 2" in it
Alternatively, the old \title is now a \keyword, to avoid
broken links to the page.

Change-Id: Ib8b97efe8be13559c45c7ca430b2afc93edaa3e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-12-04 08:22:47 +00:00
Mitch Curtis 3c7bfc1567 Tie minor version of all imports to Qt's minor version
This change makes all Qt Quick Controls 2 imports match the current
Qt minor version, which is 12 as of this patch.

It also updates all other Qt Quick imports to match.
This will also make future version bumps easier as all version numbers
in existing code/docs will match.

The following commands were used to verify that no old versions remain:

for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done
for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done

[ChangeLog] From Qt 5.12 onwards, all import versions in
Qt Quick Controls 2 follow the same minor version as Qt's
minor version number. For example, the import version for Qt 5.12 is:
"import QtQuick.Controls 2.12".

Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3
Fixes: QTBUG-71095
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-02 16:45:04 +00:00
Venugopal Shivashankar 1abdfe5d5a Doc: Ensure all links to 'Qt Quick Controls' lead to controls 2
The name of the documentation module is also changed from 'qtquickcontrols2'
to 'qtquickcontrols', and this is reflected in other modules' dependencies
and licensing source files (qt_attribution.json).

Task-number: QTBUG-70333
Change-Id: I2ba308b7eddae3af00dfb49a751cac8527c46bba
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-10-29 07:05:28 +00:00
J-P Nurmi 732c519dc6 Add missing includes
Found while doing a -no-accessibility build.

Change-Id: I9772316eed3d544b21926970371a590ef2c15bef
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-02-24 13:05:07 +00:00
J-P Nurmi 51240b75cc Update license headers to silence qtqa/tst_license warnings
Sync with the qtbase/header.XXX. The license headers were matching
qtbase/header.XXX-OLD, which makes qtqa/tst_license flood warnings:

   Old license being used for foo.qdoc

Change-Id: I199bf303a2d648e0d5f7bc01cb0814a5f945eeff
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-02-24 13:04:52 +00:00
J-P Nurmi 00a062649b Welcome to 2017
Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-01-09 17:29:40 +00:00
J-P Nurmi a908a2d25c texteditor: fix selectedNameFilter usage
texteditor.qml:165 Invalid property assignment: "selectedNameFilter"
                   is a read-only property

Change-Id: I691142ea0d3ed62a4041fb13916c251446ccea0d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-10-04 12:08:30 +00:00
Venugopal Shivashankar c5a44092c8 Doc: Update the image and example's description
Replaced the png image with two jpeg images, one for desktop and touch.

Change-Id: I5073244fdf82c70309e4412a51af02bbe0469c36
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-09-15 13:52:22 +00:00
J-P Nurmi 658b0f610a Platform: add experimental StandardPaths
This complements the File/FolderDialog offering.

Change-Id: I44a105724321092a6efc4126c8fb25f7d31b77e2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-09-13 09:37:56 +00:00
J-P Nurmi fbbe0b6e0d texteditor: add mnemonics
Change-Id: Id11f2ab1ec9b11962e5ca3c5c5982709d9b2dac2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-09-12 14:05:45 +00:00
J-P Nurmi 9a55b34e29 texteditor: use RoundButton
Change-Id: I4cb9b2151698e30deec969868ffdb0100b7d98a3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-09-05 08:12:51 +00:00
J-P Nurmi 850f6e2f2f texteditor: allow passing -touch as a command line argument
It was already possible to specify QT_FILE_SELECTORS=touch, but in
Qt Creator, it's more convenient to specify a command line argument
than an environment variable.

Change-Id: I83a86aa88fb0c229d9bcedb6646351f0675db199
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-09-05 08:12:48 +00:00
J-P Nurmi b588ad9e45 texteditor/touch: highlight the floating editor button
A style-independent way to get light foreground color.

Change-Id: Idf43020d0724af993723143d74a2b1f8ab467c1e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-08-27 11:56:07 +00:00
J-P Nurmi 6d2f05a8e2 texteditor/touch: elide the title when it doesn't fit
Change-Id: Ib1e9de9d23b708e5ddfc131dce8da5570a61d17a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-08-26 15:23:42 +00:00
J-P Nurmi 7bc619bd07 texteditor/touch: simplify the toolbar
A single Row positioner is sufficient.

Change-Id: Ib244ddf875e40df341cb99172995d1717cb6439f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-08-26 15:23:39 +00:00
J-P Nurmi c3097c1688 texteditor: remove outdated todo-comments
The comments refer to the original code that was setting a declarative
source property in the Component.onCompleted signal handler, but this
does not really apply anymore now that we have an imperative method to
load document contents.

Change-Id: I9054cbc6ecec2c66d65251c49a5b1de2ad0623dc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-08-26 15:23:37 +00:00
Mitch Curtis a80f50ab9b texteditor: add touch UI
Task-number: QTBUG-54952
Change-Id: I14fe95608c4393b928edc80fc93ebaa843ce478f
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-24 08:09:24 +00:00
J-P Nurmi 14ee7d5b94 texteditor: cleanup the commented out universal import
Change-Id: I99c5b79d80987216be7b680de91ec6c66cf127e0
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-16 18:24:57 +00:00
J-P Nurmi 6f5477369d FileDialog: add missing selectedNameFilter-property
Change-Id: If31d657e29a9cc3049af5cd3cf39d68979ff2db0
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-14 10:09:17 +00:00
J-P Nurmi 51192e8ef5 FileDialog: replace file(s)Selected() with declarative properties
Follow the same convention that ColorDialog, FontDialog and FolderDialog.

Change-Id: I960d4fc1ba275ab997f2a079a799d2b90796eca3
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-14 09:26:14 +00:00
J-P Nurmi 877ac7226c FontDialog: replace fontSelected() with a declarative property
This is consistent with the QML FontDialog from QtQuick Dialogs 1.

Change-Id: I14a5a313be5ba9a9e0fb1645fe272cf9c2cdd389
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-14 09:26:00 +00:00
J-P Nurmi fb05eafac5 ColorDialog: replace colorSelected() with a declarative property
This is consistent with the QML ColorDialog from QtQuick Dialogs 1.

Change-Id: I4068a98156494eb36b2d9ecf4c1af90ad173bb97
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-14 09:25:52 +00:00
J-P Nurmi eecfe10207 texteditor: enable persistent selection
We want to keep the selection even if the editor loses focus when
a color or font dialog is opened. The selected color or font should
naturally apply to the whole text selection that was there before
the dialog was opened.

Change-Id: I76e6b95f979a090533b028be76e7b2cf1fd53e99
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-13 22:39:31 +00:00
Mitch Curtis 5f324ed201 texteditor: use "brush" icon for text color and "A" for font
"F" looks a bit silly. Even though most word processing applications
seem to use the "A" icon with a bar underneath it for the text color,
we want to use it to represent the button that opens the font dialog,
since we don't use comboboxes for that.

Change-Id: I3cc60ffbe388644cdcbd9e8ec0dcffbc041aa124
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-08-12 13:11:01 +00:00