Skip to content

Commit

Permalink
minor: cleaning version number from qml import statement
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang authored and JorisGoosen committed Feb 19, 2025
1 parent 2a27f2a commit 61fa732
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Desktop/components/JASP/Theme/DarkTheme.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 2.12
import QtQuick

Theme
{
Expand Down
1 change: 0 additions & 1 deletion Desktop/components/JASP/Widgets/FileMenu/OSF.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import QtQuick.Controls as QtC
import JASP.Controls
import JASP.Widgets

//import QtQuick.Layouts 1.3

Item
{
Expand Down
10 changes: 5 additions & 5 deletions Desktop/qquick/datasetview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ QQuickItem * DataSetView::createTextItem(int row, int col)
if(_itemDelegate == nullptr)
{
_itemDelegate = new QQmlComponent(qmlEngine(this));
_itemDelegate->setData("import QtQuick 2.9\nText { text: itemText; color: itemActive ? 'black' : 'grey'; verticalAlignment: Text.AlignVCenter; }", QUrl());
_itemDelegate->setData("import QtQuick \nText { text: itemText; color: itemActive ? 'black' : 'grey'; verticalAlignment: Text.AlignVCenter; }", QUrl());

emit itemDelegateChanged();
}
Expand Down Expand Up @@ -783,7 +783,7 @@ QQuickItem * DataSetView::createRowNumber(int row)
if(_rowNumberDelegate == nullptr)
{
_rowNumberDelegate = new QQmlComponent(qmlEngine(this));
_rowNumberDelegate->setData("import QtQuick 2.9\nItem {\n"
_rowNumberDelegate->setData("import QtQuick \nItem {\n"
"Rectangle { color: jaspTheme.uiBackground; anchors.fill: parent }\n"
"Text { text: rowNumber; anchors.centerIn: parent; color: jaspTheme.textEnabled; }\n"
"}", QUrl());
Expand Down Expand Up @@ -873,7 +873,7 @@ QQuickItem * DataSetView::createColumnHeader(int col)
if(_columnHeaderDelegate == nullptr)
{
_columnHeaderDelegate = new QQmlComponent(qmlEngine(this));
_columnHeaderDelegate->setData("import QtQuick 2.9\nItem {\n"
_columnHeaderDelegate->setData("import QtQuick \nItem {\n"
"Rectangle { color: jaspTheme.uiBackground; anchors.fill: parent }\n"
"Text { text: headerText; anchors.centerIn: parent; color: jaspTheme.textEnabled; }\n"
"}", QUrl());
Expand Down Expand Up @@ -977,7 +977,7 @@ QQuickItem * DataSetView::createleftTopCorner()
if(_leftTopCornerDelegate == nullptr)
{
_leftTopCornerDelegate = new QQmlComponent(qmlEngine(this));
_leftTopCornerDelegate->setData("import QtQuick 2.9\nItem {}", QUrl());
_leftTopCornerDelegate->setData("import QtQuick \nItem {}", QUrl());
}

QQmlIncubator localIncubator(QQmlIncubator::Synchronous);
Expand Down Expand Up @@ -1065,7 +1065,7 @@ void DataSetView::positionEditItem(int row, int col)
_editDelegate = new QQmlComponent(qmlEngine(this));

_editDelegate->setData(
"import QtQuick 2.9" "\n"
"import QtQuick" "\n"
"TextInput { text: itemText; color: itemActive ? 'black' : 'grey'; verticalAlignment: Text.AlignVCenter; \n"
" onEditingFinished: dataview.commitEdit(rowIndex, columnIndex, text); " "\n"
"}", QUrl());
Expand Down
4 changes: 2 additions & 2 deletions Docs/development/jasp-adding-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Click below to see an example. In the next lines, we'll dissect it to understand
<summary>Example</summary>

```qml
import QtQuick 2.12
import JASP.Module 1.0
import QtQuick
import JASP.Module
Description
{
Expand Down
34 changes: 17 additions & 17 deletions Docs/development/jasp-qml-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,10 @@ We can begin actual work on the QML file, first we have to tell the engine where
<summary>Code</summary>

```qml
import QtQuick 2.11
import QtQuick.Layouts 1.3
import JASP.Controls 1.0
import JASP.Widgets 1.0
import QtQuick
import QtQuick.Layouts
import JASP.Controls
import JASP.Widgets
```

If you want to import QML components from another jasp module, you can!
Expand All @@ -914,11 +914,11 @@ In the future, we will require using qualified namespace for the import statemen
<summary>Code</summary>

```qml
import QtQuick 2.11
import QtQuick.Layouts 1.3
import JASP.Controls 1.0 as JC
import JASP.Theme 1.0 as JT
import JASP.Widgets 1.0 as JW
import QtQuick
import QtQuick.Layouts
import JASP.Controls as JC
import JASP.Theme as JT
import JASP.Widgets as JW
```
</details>

Expand All @@ -931,10 +931,10 @@ At this point we add a `Form` which will hold all our input components:
<summary>Code</summary>

```qml
import QtQuick 2.11
import QtQuick.Layouts 1.3
import JASP.Controls 1.0
import JASP.Widgets 1.0
import QtQuick
import QtQuick.Layouts
import JASP.Controls
import JASP.Widgets
Form
{
Expand All @@ -951,10 +951,10 @@ It's now a matter of mixing and matching the previously shown components to crea
<summary>Code</summary>

```qml
import QtQuick 2.11
import QtQuick.Layouts 1.3
import JASP.Controls 1.0
import JASP.Widgets 1.0
import QtQuick
import QtQuick.Layouts
import JASP.Controls
import JASP.Widgets
Form
{
Expand Down
8 changes: 4 additions & 4 deletions Docs/development/jasp-upgrade-qml.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ If you are writing an `Upgrade` for an analysis as it was in JASP before version
Just having a `functionName` and the two `version`s would do very little and the minimal sensible change you could make is adding `newFunctionName` with a new name for the analysis.
A very short example of that would be fixing the typo that someone could have made in 0.9 of a fictional module:
```qml
import QtQuick 2.12
import JASP.Module 1.0
import QtQuick
import JASP.Module
Upgrades
{
Expand Down Expand Up @@ -57,8 +57,8 @@ Something important to keep in mind is that a list of these `Changes` will be ap

For all following examples the full QML file would look something like:
```qml
import QtQuick 2.12
import JASP.Module 1.0
import QtQuick
import JASP.Module
Upgrades
{
Expand Down

0 comments on commit 61fa732

Please sign in to comment.