Commit Graph

6 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 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