//***************************
//* Rig Inventory Data... *
//***************************
riginvmodel->setTable ("rig_inventory");
riginvmodel->sort (32, Qt::AscendingOrder);
riginvmodel
->setFilter
(QString("riginv_rig_id = %1").
arg(rig_id
));
riginvmodel->select ();
riginvmapper->setModel (riginvmodel);
ui->EquipIDCB->setModel (riginvmodel);
ui->EquipIDCB->setModelColumn (32);
ui->EquipIDCB->setCurrentIndex (0);
riginvmapper->addMapping (ui->RigInvSerialNumLE, 0);
riginvmapper->addMapping (ui->RigInvNumJointsLE, 1);
riginvmapper->addMapping (ui->RigInvTypeLE, 2);
riginvmapper->addMapping (ui->RigInvWtLE, 3);
riginvmapper->addMapping (ui->RigInvJointLenLE, 4);
riginvmapper->addMapping (ui->RigInvODLE, 5);
.
.
.
riginvmapper->addMapping (ui->EquipIDCB, 32);
riginvmapper->toFirst ();
.
.
.
this, SLOT(enable_save_button()));
//***************************
//* Rig Inventory Data... *
//***************************
riginvmodel = new QSqlTableModel(this);
riginvmodel->setTable ("rig_inventory");
riginvmodel->sort (32, Qt::AscendingOrder);
riginvmodel->setEditStrategy (QSqlTableModel::OnManualSubmit);
riginvmodel->setFilter (QString("riginv_rig_id = %1").arg(rig_id));
riginvmodel->select ();
riginvmapper = new QDataWidgetMapper(this);
riginvmapper->setModel (riginvmodel);
ui->EquipIDCB->setModel (riginvmodel);
ui->EquipIDCB->setModelColumn (32);
ui->EquipIDCB->setCurrentIndex (0);
riginvmapper->addMapping (ui->RigInvSerialNumLE, 0);
riginvmapper->addMapping (ui->RigInvNumJointsLE, 1);
riginvmapper->addMapping (ui->RigInvTypeLE, 2);
riginvmapper->addMapping (ui->RigInvWtLE, 3);
riginvmapper->addMapping (ui->RigInvJointLenLE, 4);
riginvmapper->addMapping (ui->RigInvODLE, 5);
.
.
.
riginvmapper->addMapping (ui->EquipIDCB, 32);
riginvmapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
riginvmapper->toFirst ();
.
.
.
connect(riginvmodel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(enable_save_button()));
To copy to clipboard, switch view to plain text mode
Bookmarks