Commit Graph

11 Commits

Author SHA1 Message Date
Kai Köhne f47c18d6b1 calqlatr: Reformat .qml files
Do use qmlformat to make sure that the .qml files in
the example are uniform. Just leave out some changes that
make lines like

      case Qt.Key_0: digitPressed("0"); break;

unneccessarily long.

Store the restriction to 100chars in a .qmlformat.ini file
for other examples.

Pick-to: 6.10
Change-Id: I3f77efa83b2d5e01f1497687763e5c327da71ff2
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2025-06-30 11:22:15 +02:00
Ed Cooke 37b941f544 Fix for backspace not considering unary minus in calqlatr demo
In the calqlatr demo, you are able to use backspace to remove the last
digit. This does not consider the last minus sign left when using
backspace on a single digit negative number. In this case, set the
displayed digits to an empty string.

Fixes: QTBUG-127814
Pick-to: 6.7 6.8
Change-Id: Iec82e0650b3b50022be0b5a716976aefa78118a3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-08-19 13:52:51 +02:00
Samuli Piippo f89dfde4ed calqlatr: remove special characters
The demo's buttons were using Mathematical Alphanumeric Symbols, which
are not available in all fonts. Replace them with regular characters.

Fixes: QTBUG-122605
Pick-to: 6.7
Change-Id: I24e61eb11f8df34149d0d0fd962054ea759729c1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-04-13 11:12:39 +02:00
Ed Cooke 697eaa086a Rewrite the calqlatr example to use responsive layouts
Implement the new design for the calqlatr example, including a
scientific/landscape mode. The animation controller has been removed for
practicality. Responsive layouts now handle changing between a portrait
and a landscape layout.

Fixes: QTBUG-118519
Change-Id: I1a33b1825a877b2b45afedc3a019a906c3f45d29
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-12-13 17:17:22 +01:00
Mitch Curtis c6a2a9ed4a Improve calqlatr example
- Fixed code formatting.
- Clip the contents of the ListView containing the operation history to
  prevent it from spilling out into other UI elements.
- Update copyright year.
- Simplify some expressions.
- Replaced root scope lookups with direct access to JS functions.
- Make calculator.js a library so that it can be imported by
  other QML files without duplicating its state.
- Replace "var" with "let".
- Replace == and != with === and !==.
- Simplify key event handling.
- Removed unused ids.
- Fix unqualified accesses.

Fixes: QTBUG-54267
Pick-to: 6.2 6.5 6.6
Change-Id: I0d8e8f1d9b3cfe8123fd98b8c280dc3ff4bd86a0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-06 16:54:46 +08:00
Shawn Rutledge edf70b2a42 Embiggen the calqlatr buttons
The buttons were too hard to hit, with such big gaps between columns and
rows, and such a small active area. You can't see how big the active
area is, so the expectation is that it should be large, for easy
fat-fingering on a touchscreen.

Pick-to: 6.2 6.4
Task-number: QTBUG-102408
Task-number: QTBUG-108335
Change-Id: I9aab5d64a8c6c0a0218e9a91f93d072033e04e8a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-11-10 16:32:23 +00:00
Lucie Gérard 6f57506953 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: Idfd176b7f7b077a5b7c66b7738dc9bcac94ab290
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-07 18:23:52 +02:00
Oliver Eftevaag 3d2a816595 calqlatr: use QQC2 buttons and new cmake api
In the process of preparing this example to become highlighted
in Qt Creator, we want to update it to reflect how we think a modern
qml application should be written.

Some of the changes done here includes
* Use QQC2 buttons, rather than a custom button component.
* Update the CMake list to use qt_add_qml_module()
* Some code refactoring (e.g const/let instead of var, switch/case,
  reduced binding spaghetti)

Fixes: QTBUG-96460
Pick-to: 6.2
Change-Id: I6e6789038c053dac9528ba564431cef6c9168454
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-09-20 16:24:30 +02:00
Andrei Golubev 4bb8995364 Modernize calqlatr example
Several things are addressed:
* some unqualified accesses fixed
* parent is replaced with actual ids

Change-Id: I5ee1d1a2b1abad468ea330cd4eca0bf0b9b993ed
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
2021-07-05 09:32:03 +02:00
Kai Koehne 9194f8602b examples: Do not use versioned QML import
Ignore .ui.qml files though for now, until they are properly handled
by Qt Design Studio.

Task-number: QTBUG-89033
Change-Id: I85ea1dc2f85928e9fa1f473535687ab8b0288e9d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-02 16:04:51 +01:00
Venugopal Shivashankar 70ce5f4d3e Move demos to qtdoc repository
These demos use several modules and moving them allows to use for
example Qt Quick Controls 2 in them.

The shared directory should be removed and the examples made
self-contained.

Change-Id: I5dc667d22388651894d7d145b65752bc5c5cf6cf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-07-09 12:43:59 +00:00