mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 11:09:43 +00:00
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.
This commit is contained in:
parent
95d164a6e6
commit
491fd3d0be
2 changed files with 29 additions and 0 deletions
|
@ -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…
Reference in a new issue