Skip to content

Commit 023ab81

Browse files
committed
make sure textarea runs checkSyntax whenever amount of columns changes
1 parent a5250c3 commit 023ab81

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

QMLComponents/components/JASP/Controls/TextArea.qml

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ TextAreaBase
2929
property bool useTabAsSpaces : true
3030
property var nextTabItem
3131

32-
signal applyRequest()
33-
signal editingFinished()
34-
3532
Component.onCompleted: control.editingFinished.connect(editingFinished)
3633

3734
function userEnteredInput() {

QMLComponents/controls/textareabase.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ void TextAreaBase::setUp()
7070
_separators.push_back(separator.toString());
7171
}
7272

73-
connect(this, SIGNAL(applyRequest()), this, SLOT(checkSyntaxHandler()));
73+
//If "rowCount" changes on VariableInfo it means a column has been added or removed, this means the model should be reencoded and checked
74+
//Fixes https://github.com/jasp-stats/jasp-issues/issues/2462
75+
connect(VariableInfo::info(), &VariableInfo::rowCountChanged, this, &TextAreaBase::checkSyntaxHandler);
76+
77+
//Also do it on request of course ;)
78+
connect(this, &TextAreaBase::applyRequest, this, &TextAreaBase::checkSyntaxHandler);
7479
}
7580

7681
void TextAreaBase::rScriptDoneHandler(const QString & result)

QMLComponents/controls/textareabase.h

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public slots:
7575
signals:
7676
void textTypeChanged();
7777
void hasScriptErrorChanged();
78+
void applyRequest();
79+
void editingFinished();
7880

7981
protected slots:
8082
void termsChangedHandler() override;

0 commit comments

Comments
 (0)