Editor: set combo box events for pathgrid creator

- Handles when combo box should automatically gain or lose focus.
- Checks user input when combo box selection changes.
0.6.1
Rob Cutmore 8 years ago
parent 95d164a6e6
commit 491fd3d0be

@ -48,6 +48,8 @@ CSVWorld::PathgridCreator::PathgridCreator(
mCell->model()->sort(0);
mCell->setCurrentIndex(0);
connect(mCell, SIGNAL (currentIndexChanged(const QString&)), this, SLOT (cellChanged()));
}
std::string CSVWorld::PathgridCreator::getErrors() const
@ -73,3 +75,19 @@ std::string CSVWorld::PathgridCreator::getErrors() const
return errors;
}
void CSVWorld::PathgridCreator::focus()
{
mCell->setFocus();
}
void CSVWorld::PathgridCreator::reset()
{
CSVWorld::GenericCreator::reset();
mCell->setCurrentIndex(0);
}
void CSVWorld::PathgridCreator::cellChanged()
{
update();
}

@ -29,6 +29,17 @@ namespace CSVWorld
/// \return Error description for current user input.
virtual std::string getErrors() const;
/// \brief Set focus to cell ID input widget.
virtual void focus();
/// \brief Reset selected cell ID.
virtual void reset();
private slots:
/// \brief Check user input for errors.
void cellChanged();
};
}

Loading…
Cancel
Save