Auryn
1st September 2008, 17:23
I have these connection:
connect((const QObject *)my_model, SIGNAL(beforeUpdate(int, QSqlRecord &)), this, SLOT(My_verify_record(int, QSqlRecord &)));
connect((const QObject *)my_model, SIGNAL(primeInsert(int, QSqlRecord &)), this, SLOT(My_verify_record(int, QSqlRecord &)));
This is my slot definition:
void My_class::My_verify_record(int my_row, QSqlRecord &my_record)
{
for(int my_column = 0; my_column < my_record.count(); my_column++)
{
// Verify that current column content fulfills the field definition in PostgreSQL
}
}
For example, if one field is defined as "NOT NULL" in PostgreSQL, I need to detect this fact inside the loop to warn the user.
connect((const QObject *)my_model, SIGNAL(beforeUpdate(int, QSqlRecord &)), this, SLOT(My_verify_record(int, QSqlRecord &)));
connect((const QObject *)my_model, SIGNAL(primeInsert(int, QSqlRecord &)), this, SLOT(My_verify_record(int, QSqlRecord &)));
This is my slot definition:
void My_class::My_verify_record(int my_row, QSqlRecord &my_record)
{
for(int my_column = 0; my_column < my_record.count(); my_column++)
{
// Verify that current column content fulfills the field definition in PostgreSQL
}
}
For example, if one field is defined as "NOT NULL" in PostgreSQL, I need to detect this fact inside the loop to warn the user.