Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
ObjectBinder::ObjectBinder(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
}
|
||||
|
||||
void ObjectBinder::registerBinding(QWidget *widget) {
|
||||
@@ -18,7 +18,7 @@ void ObjectBinder::registerBinding(QComboBox *combo, const QList<ComboData> &val
|
||||
}
|
||||
|
||||
void ObjectBinder::registerValidator(IValidator *validator) {
|
||||
m_validators.append(validator);
|
||||
m_validators.append(QSharedPointer<IValidator>(validator));
|
||||
}
|
||||
|
||||
void ObjectBinder::setData(QObject *data)
|
||||
@@ -49,6 +49,8 @@ void ObjectBinder::bindToUi() {
|
||||
ComboData data = m_bindCombos[combo][i];
|
||||
combo->addItem(data.label(), data.index());
|
||||
|
||||
qDebug() << data.index();
|
||||
|
||||
if (data.index().canConvert<QObject*>()) {
|
||||
ComboItem* ci = qobject_cast<ComboItem*>(data.index().value<QObject*>());
|
||||
ComboItem* ciField = qobject_cast<ComboItem*>(field.value<QObject*>());
|
||||
@@ -56,7 +58,10 @@ void ObjectBinder::bindToUi() {
|
||||
idx = i;
|
||||
}
|
||||
}
|
||||
else if (field == data.index()) {
|
||||
else if (field.canConvert<int>() && data.index().canConvert<int>()
|
||||
&& field.toInt() == data.index().toInt()) {
|
||||
idx = i;
|
||||
} else if (field == data.index()) {
|
||||
idx = i;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +71,7 @@ void ObjectBinder::bindToUi() {
|
||||
}
|
||||
|
||||
bool ObjectBinder::bindToData() {
|
||||
foreach (IValidator *val, m_validators) {
|
||||
for (const auto& val : m_validators) {
|
||||
if (!val->validate()) {
|
||||
emit validationError(val->errMessage());
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user