summaryrefslogtreecommitdiffstats
path: root/examples/widgets/richtext/textedit
Commit message (Collapse)AuthorAgeFilesLines
* preserve HTML heading level in QTextBlockFormat; demonstrate in exampleShawn Rutledge2018-03-022-49/+95
| | | | | | | | | | | | | | | | | | 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>
* qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-121-0/+1
| | | | | | | | | 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>
* Convert features.printdialog to QT_[REQUIRE_]CONFIGStephan Binner2017-05-301-3/+10
| | | | | Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* examples: Use QOverload to select overloaded signals and slotsAlexander Volkov2016-12-221-5/+3
| | | | | | | | | | | We can use QOverload since Qt 5.7 (it depends on Q_COMPILER_VARIADIC_TEMPLATES which is required since Qt 5.7). Use it in the examples to show the best practice. qOverload currently can't be used because it requires c++14. Change-Id: I94a3c0db9d551fe169fa3d19c07ec0b329d5946c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Examples: Remove a redundant virtual specifier for overridersAlexander Volkov2016-11-251-1/+1
| | | | | | | | It's a good practice to use override without virtual: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override Change-Id: I5c2d73600e6c706424589c0487133c03a4ef3629 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Replace 'Q_DECL_OVERRIDE' by 'override'hjk2016-06-151-1/+1
| | | | | | | | Examples should demonstrate best practice, and we can use the keyword directly nowadays. Change-Id: I1f122e5caceca17290757ffbaf3d660e7daa9ae4 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Unify license header usage.Jani Heikkinen2016-03-291-5/+5
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-213-48/+99
| | | | | | | | | | | | From Qt 5.7 -> examples are lisenced under BSD license, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new BSD header instead of LGPL21 one (in those files which will be under BSD) Change-Id: I3ad61caaf07802eb9da7d29eca3fe49d8a51b6a8 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* TextEdit example: fix build when clipboard is disabled.Rafael Roquetto2015-10-192-2/+4
| | | | | Change-Id: Ib25563e3dc299dc2d23bed8b3071af1ba81150e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Polish rich text example.Friedemann Kleint2015-08-313-221/+196
| | | | | | | | | | | | | - Introduce Qt 5 signals & slot syntax. - Use mime types in the file dialogs. - Streamline the code creating the actions. - Introduce QCommandLineParser. - Query the available size when determining the initial size instead of using hard-coded values for High-DPI screens. Change-Id: Ifc84a41ed55a4a674b6eafdb6120ac42441405b6 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update copyright headersJani Heikkinen2015-02-114-27/+27
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-243-57/+33
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Changed font-family to Times New RomanTomi Korpipää2014-09-191-1/+1
| | | | | | Task-number: QTBUG-40839 Change-Id: I3be6de829b6f26b26e7ec654ccb117bdb58cdf41 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| * Font Database: Add support for private, system UI font familiesGabriel de Dietrich2014-08-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow testing for private, system UI font families. Both QFontComboBox and QFontDialog need to filter out those private font families which, by definition, should be hidden from the end user. (The textedit example had to be updated to fix the issue where the default font would be private. In 5.4, we will be adding an equivalent, public API in QFontDatabase, and a better solution for the textedit example and QTexEdit in general). In particular, on OS X and iOS, private fonts are used for the system UI font. Those have their font family name prefixed by a dot. QCoreTextFontDatabase knows about this, and makes sure those are tested positive as private font families. In order to have a cleaner layer separation, we moved the QPA theme font resolution from the platform theme classes into QCoreTextFontDatabase for both Cocoa and iOS QPA plugins. In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that nicely maps to the HITheme API we were using so far on Mac. That means one HITheme dependency less. We also cache the font descriptors we get for these font for each time QCTFD::populateFamilies() gets called. (While not common, this currently happens in auto-tests, like tst_QFontDatabase, and could happen in actual applications -- specially when adding and removing application fonts.) Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Examples: Add Q_DECL_OVERRIDE to overridden functionsOlivier Goffart2014-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_DECL_OVERRIDE (which expands to 'override' for supported compiler) helps to declare the intent (that it is an overridden function) and force compilation error when there is no such virtual function in the base class. The examples should show the best practice of having it, as it may save the programmer quite some time in case of change of API or typo in the function name or arguments. This change was done automatically with clang-modernize -add-override -override-macros And fixed MSVC compilation by removing inline for TorrentViewDelegate::paint Change-Id: Ice66ae93fae571266f908703d5b8892b2c1ebb1a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Use the new unified toolbar implementation in examples on OS X.Jake Petroules2014-05-121-0/+4
|/ | | | | Change-Id: Ica3476d16a4baab1f75e253eb406505f88018d47 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-1/+1
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do not attempt to save a file in the resourcesGiuseppe D'Angelo2013-08-271-2/+3
| | | | | | | | | | A wrong code path caused the textedit example to attempting to try to save the file it was currently editing even if it was loaded from the resource system. Task-number: QTBUG-33105 Change-Id: I9e03168968a98a421e8ab93a8d06f808b72ac3b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-162-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Compile fix when QT_NO_PRINTDIALOG is definedPaul Olav Tvete2013-02-261-2/+2
| | | | | | | ...but QT_NO_PRINTER isn't. Change-Id: I888c177cfdd2245eb55de766dfd93f6acd4293e9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-184-4/+4
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* add and use qtHaveModule() functionOswald Buddenhagen2012-12-211-1/+1
| | | | | | | | | | | this is much more elegant than the so far propagated !isEmpty(QT.foo.name). also replace feature-specific tests (no-gui and no-widgets) and the obsolete contains(QT_CONFIG, foo) syntax. Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* clean up example project files, mostly wrt QT+=widgetsOswald Buddenhagen2012-12-171-3/+3
| | | | | | | | | move QT+=widgets (and printsupport) statements before the install statements, and de-duplicate some cases. also move some TARGET assignments to a more conventional place. Change-Id: I6140d8611680f66c24490e5894e4eb90cae95635 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove some unnecessary CONFIG additionsOswald Buddenhagen2012-12-171-2/+0
| | | | | | | | qt is already added by spec_pre.prf, warn_on and depend_includepath by default_pre.prf. Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* QtBase: Doc: Fix Links to designer manual.David Schulz2012-12-101-3/+2
| | | | | Change-Id: I87f68fb70aa773c44b90b58bd56fc5585a7e4107 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* centralize and fixup example sources install targetsOswald Buddenhagen2012-11-291-3/+3
| | | | | | | | | | | | | it's confusing for the users if the examples' project files contain code to install their own sources. also, this constitutes an enormous code duplication, and lots of mistakes. consequently, automate it. more or less as a side effect, this also removes the entirely meaningless target installs in subdirs projects. Task-number: QTBUG-28184 Change-Id: I9fc1367a06db9e2c46aeb67d68729a4f67163ef9 Reviewed-by: hjk <qthjk@ovi.com>
* Add \brief to the examples.Eike Ziller2012-11-291-1/+1
| | | | | | | | | That is used by qdoc to generate brief descriptions for the example manifests. Change-Id: I142a6d3259f90d0c9990033b3c36e139062ac343 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
* Examples: Install to $$[QT_INSTALL_EXAMPLES]/$submodule/$examplehjk2012-11-261-2/+2
| | | | | | | | This makes the structure of the examples after an 'make install' similar to the one in a 'developer build'. Change-Id: I9120bd741fab332e64e30adc01cefe87e5633454 Reviewed-by: Martin Smith <martin.smith@digia.com>
* QtBase: examples/widgets/richtext code styleDavid Schulz2012-11-243-56/+70
| | | | | Change-Id: Ie0c27464e0fdb8f26caf0d8f27043da4ec45f41f Reviewed-by: hjk <qthjk@ovi.com>
* Fix building of examples.Friedemann Kleint2012-11-211-2/+2
| | | | | | | | | | | - Correct install path of widget examples to contain widgets directory in target tree. - Add missing resources. Task-number: QTBUG-27977 Change-Id: If4cb117998892b0b165d7678367553d3a7553b91 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-224-87/+87
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Moving .qdoc files under examples/widgets/docGabriel de Dietrich2012-08-2046-0/+1112
Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>