Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
None
-
None
Description
Currently, default snippets like "NumberAnimation with target" have each statement on the same line:
import QtQuick 2.2 Rectangle { id: window width: 600 height: 600 Rectangle { id: rect width: 60 height: 60 anchors.centerIn: parent color: "green" NumberAnimation { target: object; property: "name"; duration: 200; easing.type: Easing.InOutQuad } } }
This is not a nice way of writing code for the following reasons:
- Adding a new property means you may need to wrap the line.
- Removing a property becomes more difficult (instead of just deleting a whole line).
- Changing the name or value of a property becomes more difficult; you can't just home/end your way around, you need to use CTRL + left/right to get to individual properties.
- What it saves on lines of code, it loses on readibility. It's hideous to look at. I know that's subjective, but even Tools > QML/JS > Reformat File agrees with me on this:
import QtQuick 2.2 import QtGraphicalEffects 1.0 Rectangle { id: window width: 600 height: 600 Rectangle { id: rect width: 60 height: 60 anchors.centerIn: parent color: "green" NumberAnimation { target: object property: "name" duration: 200 easing.type: Easing.InOutQuad } } }
- It impedes the usefulness of things like git blame.
Attachments
For Gerrit Dashboard: QTCREATORBUG-12253 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
99844,2 | Place each statement of default snippets on their own line. | 3.3 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |