Hi everyone,
This time I'm facing a new problem :\. When I register a field, in the initializePage() I cannot go back and forth again in the wizard because it will attempt to register that field again. Is it possible to unregister a field when I go back?
void ObjectsPage::initializePage()
{
QString numLayers
= field
("numObjs").
toString();
int num = numLayers.toInt();
for (int i = 0; i < num; ++i) {
sbVel->setMinimum(500);
sbVel->setMaximum(20000);
sbVel->setSingleStep(500);
sbVel->setValue((i+1)*500);
lblVel
->setText
("Capa " + QString::number(i
+1));
sbObjs.push_back(sbVel);
lblObjs.push_back(lblVel);
layout->addWidget(lblVel, i, 0);
layout->addWidget(sbVel, i, 1);
registerField
("sbVel" + QString::number(i
), sbObjs
[i
]);
}
setLayout(layout);
}
void ObjectsPage::initializePage()
{
layout = new QGridLayout;
QSpinBox* sbVel = NULL;
QLabel* lblVel = NULL;
QString numLayers = field("numObjs").toString();
int num = numLayers.toInt();
for (int i = 0; i < num; ++i) {
sbVel = new QSpinBox();
sbVel->setMinimum(500);
sbVel->setMaximum(20000);
sbVel->setSingleStep(500);
sbVel->setValue((i+1)*500);
lblVel = new QLabel;
lblVel->setText("Capa " + QString::number(i+1));
sbObjs.push_back(sbVel);
lblObjs.push_back(lblVel);
layout->addWidget(lblVel, i, 0);
layout->addWidget(sbVel, i, 1);
registerField("sbVel" + QString::number(i), sbObjs[i]);
}
setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
Bookmarks