aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Replace the "Qt Quick Controls 2" instancesVenugopal Shivashankar2019-08-221-2/+2
| | | | | | | | | 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>
* TextEditor: Add modified handlingFriedemann Kleint2019-08-213-2/+39
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-12-052-6/+6
|\ | | | | | | Change-Id: I7fe9e74beff3cdbfbf02ee0f129a8204ad31046e
| * Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-022-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Doc: Update \titles with "Controls 2" in itVenugopal Shivashankar2018-12-041-1/+2
|/ | | | | | | | 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>
* Doc: Ensure all links to 'Qt Quick Controls' lead to controls 2Venugopal Shivashankar2018-10-291-0/+1
| | | | | | | | | | 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>
* Add missing includesJ-P Nurmi2017-02-241-0/+1
| | | | | | | Found while doing a -no-accessibility build. Change-Id: I9772316eed3d544b21926970371a590ef2c15bef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update license headers to silence qtqa/tst_license warningsJ-P Nurmi2017-02-244-10/+40
| | | | | | | | | | 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>
* Welcome to 2017J-P Nurmi2017-01-096-6/+6
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: fix selectedNameFilter usageJ-P Nurmi2016-10-041-2/+2
| | | | | | | | texteditor.qml:165 Invalid property assignment: "selectedNameFilter" is a read-only property Change-Id: I691142ea0d3ed62a4041fb13916c251446ccea0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Update the image and example's descriptionVenugopal Shivashankar2016-09-154-12/+67
| | | | | | | Replaced the png image with two jpeg images, one for desktop and touch. Change-Id: I5073244fdf82c70309e4412a51af02bbe0469c36 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Platform: add experimental StandardPathsJ-P Nurmi2016-09-131-0/+2
| | | | | | | This complements the File/FolderDialog offering. Change-Id: I44a105724321092a6efc4126c8fb25f7d31b77e2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: add mnemonicsJ-P Nurmi2016-09-121-12/+12
| | | | | Change-Id: Id11f2ab1ec9b11962e5ca3c5c5982709d9b2dac2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: use RoundButtonJ-P Nurmi2016-09-051-16/+1
| | | | | Change-Id: I4cb9b2151698e30deec969868ffdb0100b7d98a3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: allow passing -touch as a command line argumentJ-P Nurmi2016-09-051-2/+9
| | | | | | | | | 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>
* texteditor/touch: highlight the floating editor buttonJ-P Nurmi2016-08-271-2/+1
| | | | | | | A style-independent way to get light foreground color. Change-Id: Idf43020d0724af993723143d74a2b1f8ab467c1e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor/touch: elide the title when it doesn't fitJ-P Nurmi2016-08-261-3/+1
| | | | | Change-Id: Ib1e9de9d23b708e5ddfc131dce8da5570a61d17a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor/touch: simplify the toolbarJ-P Nurmi2016-08-261-72/+66
| | | | | | | A single Row positioner is sufficient. Change-Id: Ib244ddf875e40df341cb99172995d1717cb6439f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: remove outdated todo-commentsJ-P Nurmi2016-08-262-4/+0
| | | | | | | | | | 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>
* texteditor: add touch UIMitch Curtis2016-08-249-18/+351
| | | | | | Task-number: QTBUG-54952 Change-Id: I14fe95608c4393b928edc80fc93ebaa843ce478f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* texteditor: cleanup the commented out universal importJ-P Nurmi2016-08-161-1/+0
| | | | | Change-Id: I99c5b79d80987216be7b680de91ec6c66cf127e0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* FileDialog: add missing selectedNameFilter-propertyJ-P Nurmi2016-08-141-0/+2
| | | | | Change-Id: If31d657e29a9cc3049af5cd3cf39d68979ff2db0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* FileDialog: replace file(s)Selected() with declarative propertiesJ-P Nurmi2016-08-141-2/+2
| | | | | | | Follow the same convention that ColorDialog, FontDialog and FolderDialog. Change-Id: I960d4fc1ba275ab997f2a079a799d2b90796eca3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* FontDialog: replace fontSelected() with a declarative propertyJ-P Nurmi2016-08-141-1/+1
| | | | | | | This is consistent with the QML FontDialog from QtQuick Dialogs 1. Change-Id: I14a5a313be5ba9a9e0fb1645fe272cf9c2cdd389 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* ColorDialog: replace colorSelected() with a declarative propertyJ-P Nurmi2016-08-141-1/+1
| | | | | | | This is consistent with the QML ColorDialog from QtQuick Dialogs 1. Change-Id: I4068a98156494eb36b2d9ecf4c1af90ad173bb97 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* texteditor: enable persistent selectionJ-P Nurmi2016-08-131-0/+1
| | | | | | | | | | 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>
* texteditor: use "brush" icon for text color and "A" for fontMitch Curtis2016-08-122-15/+15
| | | | | | | | | | "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>
* texteditor: use a wrapping Flow for the toolbarJ-P Nurmi2016-08-121-35/+36
| | | | | | | | | | | | | | A proper toolbar extension would be better, but this is a workaround to make the window scalable/resizable until we have a better solution available. The font button was moved together with the other formatting buttons, because it looked a bit awkward when it was wrapping alone on the second row, and in general it caused things looking somehow mis-aligned when actions were wrapped on multiple rows. Change-Id: I0c1f432e81d5fde6aa763c13ea9efbb8af68ad50 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Platform: add MenuSeparator for convenience and consistencyJ-P Nurmi2016-08-121-3/+1
| | | | | Change-Id: I0c0aae219c81b9248a5a8a0fd0e78521cbe86360 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: replace setFileUrl() with load()J-P Nurmi2016-08-123-29/+10
| | | | | | | | This allows to remove the text property to avoid storing the whole document's initial content for no real purpose. Change-Id: Iad59576b5304be9739c1dfb0a7d4c263323b0edb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: add fileName & fileTypeJ-P Nurmi2016-08-123-22/+22
| | | | | | | | | 'document.fileName' reads better than 'document.documentTitle', and 'document.fileType' can be set as the default suffix for the file save dialog. Change-Id: I935586296c91d3efdd5edea03d81c685e7edcab2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: cosmetic cleanupJ-P Nurmi2016-08-123-6/+5
| | | | | Change-Id: Id1d5f0f8c1e7851ea33241fa09af5c0029b74db3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: fix, unify and cleanup the settersJ-P Nurmi2016-08-121-9/+1
| | | | | | | | | - setCursorPosition() was missing cursorPositionChanged() - setAlignment() does not need to check for doc, it's done in textCursor() - remove the unnecessary cursor.isNull() checks to gain shorter code Change-Id: I4448224ab02fc22f43ef10749200aca80eed537c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: remove uninitialized/duplicate pointer memberJ-P Nurmi2016-08-122-20/+25
| | | | | | | | Use textDocument() similarly than textCursor() is already used, to access the underlying document and cursors. Change-Id: I1f90f95420132251792f4f9dda302c0509fbad0c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: re-order the property accessorsJ-P Nurmi2016-08-122-172/+189
| | | | | | | | | | There's no reason to register all setters as slots. Properties are fine for QML usage. Re-order them also in the .cpp file in the same order than they are in the header. It's a bit easier to follow when logical pairs are next to each other. Change-Id: Ib8097ecafe10f2c785b05b045694c338977860ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: simplify saveAs() - let FileDialog handle the suffixJ-P Nurmi2016-08-123-26/+12
| | | | | Change-Id: Id1b415ebcbe12a9eeff9b54dcfa2cec67054a8d6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* texteditor: fix the file dialog name filtersJ-P Nurmi2016-08-121-1/+1
| | | | | | | OS X interpreted the suffix literally ".html," Change-Id: Icdf889592e4457db5dd4ffd420501b890cbcfd27 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add Text Editor exampleMitch Curtis2016-08-1112-0/+1211
A follow up commit will contain the touch UI. Change-Id: I26275fdd31294506821fa3e3e4a4bb63329665b9 Task-number: QTBUG-54952 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>