Skip to content

Commit 80010d5

Browse files
committed
Set connections in TableView not in Bound object
1 parent 10f17c5 commit 80010d5

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

QMLComponents/boundcontrols/boundcontrolbase.h

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class BoundControlBase : public BoundControl
4444
const Json::Value& defaultBoundValue() const override { return _defaultValue; }
4545
void setDefaultBoundValue(const Json::Value& defaultValue) override { _defaultValue = defaultValue; }
4646

47-
JASPControl * control() { return _control; }
48-
4947
protected:
5048
std::string getName() const;
5149
bool setValueType();

QMLComponents/boundcontrols/boundcontroltableview.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
BoundControlTableView::BoundControlTableView(TableViewBase* tableView)
2424
: BoundControlBase(tableView), _tableView(tableView)
2525
{
26-
QObject::connect(qobject_cast<ListModelTableViewBase*>(_tableView->model()), &ListModelTableViewBase::requestComputedColumnCreation, control(), &JASPControl::requestComputedColumnCreation);
27-
QObject::connect(qobject_cast<ListModelTableViewBase*>(_tableView->model()), &ListModelTableViewBase::requestComputedColumnDestruction, control(), &JASPControl::requestComputedColumnDestruction);
28-
2926
}
3027

3128
bool BoundControlTableView::isJsonValid(const Json::Value &value) const

QMLComponents/controls/tableviewbase.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ void TableViewBase::setUpModel()
5454
connect(_tableModel, &ListModelTableViewBase::columnCountChanged, this, &TableViewBase::columnCountChanged);
5555
connect(_tableModel, &ListModelTableViewBase::rowCountChanged, this, &TableViewBase::rowCountChanged);
5656
connect(_tableModel, &ListModelTableViewBase::variableCountChanged, this, &TableViewBase::variableCountChanged);
57+
connect(_tableModel, &ListModelTableViewBase::requestComputedColumnCreation, this, &TableViewBase::requestComputedColumnCreation);
58+
connect(_tableModel, &ListModelTableViewBase::requestComputedColumnDestruction, this, &TableViewBase::requestComputedColumnDestruction);
5759
}
5860

5961
void TableViewBase::setUp()

QMLComponents/controls/textinputbase.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void TextInputBase::checkIfColumnIsFreeOrMine()
288288
if(form() && !form()->isColumnFreeOrMine(val))
289289
{
290290
setHasScriptError(true);
291-
control()->addControlError(tr("Column '%1' already exists and is not created by this analysis.").arg(val));
291+
addControlError(tr("Column '%1' already exists and is not created by this analysis.").arg(val));
292292
}
293293
else
294294
setHasScriptError(false);

0 commit comments

Comments
 (0)