Resize policy back (586 ms with grid layout, 1347 ms with table layout)
This commit is contained in:
@@ -45,9 +45,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row,
|
|||||||
horizontalLayout->addWidget(gv);
|
horizontalLayout->addWidget(gv);
|
||||||
QComboBox * cb = new QComboBox();
|
QComboBox * cb = new QComboBox();
|
||||||
horizontalLayout->addWidget(cb);
|
horizontalLayout->addWidget(cb);
|
||||||
cb->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
horizontalLayout->addWidget(spinbox);
|
horizontalLayout->addWidget(spinbox);
|
||||||
spinbox->setMinimumWidth(80);
|
|
||||||
tableLayout->addLayout(row, col, horizontalLayout);
|
tableLayout->addLayout(row, col, horizontalLayout);
|
||||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
|
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
fswtchSwtch[i] = new QComboBox(this);
|
fswtchSwtch[i] = new QComboBox(this);
|
||||||
fswtchSwtch[i]->setProperty("index", i);
|
fswtchSwtch[i]->setProperty("index", i);
|
||||||
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
|
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
|
||||||
fswtchSwtch[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||||
fswtchSwtch[i]->setMaxVisibleItems(10);
|
fswtchSwtch[i]->setMaxVisibleItems(10);
|
||||||
connect(fswtchSwtch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
|
connect(fswtchSwtch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
|
||||||
tableLayout->addWidget(i, 1, fswtchSwtch[i]);
|
tableLayout->addWidget(i, 1, fswtchSwtch[i]);
|
||||||
@@ -117,7 +117,6 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
fswtchFunc[i] = new QComboBox(this);
|
fswtchFunc[i] = new QComboBox(this);
|
||||||
fswtchFunc[i]->setProperty("index", i);
|
fswtchFunc[i]->setProperty("index", i);
|
||||||
populateFuncCB(fswtchFunc[i], functions[i].func);
|
populateFuncCB(fswtchFunc[i], functions[i].func);
|
||||||
fswtchFunc[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
|
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
|
||||||
tableLayout->addWidget(i, 2, fswtchFunc[i]);
|
tableLayout->addWidget(i, 2, fswtchFunc[i]);
|
||||||
// s1.report("func");
|
// s1.report("func");
|
||||||
@@ -136,6 +135,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
fswtchParamGV[i] = new QCheckBox(this);
|
fswtchParamGV[i] = new QCheckBox(this);
|
||||||
fswtchParamGV[i]->setProperty("index", i);
|
fswtchParamGV[i]->setProperty("index", i);
|
||||||
fswtchParamGV[i]->setText("GV");
|
fswtchParamGV[i]->setText("GV");
|
||||||
|
fswtchParamGV[i]->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
|
||||||
connect(fswtchParamGV[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
|
connect(fswtchParamGV[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
|
||||||
paramLayout->addWidget(fswtchParamGV[i]);
|
paramLayout->addWidget(fswtchParamGV[i]);
|
||||||
|
|
||||||
@@ -189,7 +189,6 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
QHBoxLayout * repeatLayout = new QHBoxLayout();
|
QHBoxLayout * repeatLayout = new QHBoxLayout();
|
||||||
tableLayout->addLayout(i, 4, repeatLayout);
|
tableLayout->addLayout(i, 4, repeatLayout);
|
||||||
fswtchRepeat[i] = new RepeatComboBox(this, functions[i].repeatParam);
|
fswtchRepeat[i] = new RepeatComboBox(this, functions[i].repeatParam);
|
||||||
fswtchRepeat[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
repeatLayout->addWidget(fswtchRepeat[i], i+1);
|
repeatLayout->addWidget(fswtchRepeat[i], i+1);
|
||||||
connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
|||||||
QHBoxLayout *v1Layout = new QHBoxLayout();
|
QHBoxLayout *v1Layout = new QHBoxLayout();
|
||||||
cswitchSource1[i] = new QComboBox(this);
|
cswitchSource1[i] = new QComboBox(this);
|
||||||
cswitchSource1[i]->setProperty("index",i);
|
cswitchSource1[i]->setProperty("index",i);
|
||||||
cswitchSource1[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
connect(cswitchSource1[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v1Edited(int)));
|
connect(cswitchSource1[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v1Edited(int)));
|
||||||
v1Layout->addWidget(cswitchSource1[i]);
|
v1Layout->addWidget(cswitchSource1[i]);
|
||||||
|
cswitchSource1[i]->setVisible(false);
|
||||||
cswitchValue[i] = new QDoubleSpinBox(this);
|
cswitchValue[i] = new QDoubleSpinBox(this);
|
||||||
cswitchValue[i]->setMaximum(channelsMax);
|
cswitchValue[i]->setMaximum(channelsMax);
|
||||||
cswitchValue[i]->setMinimum(-channelsMax);
|
cswitchValue[i]->setMinimum(-channelsMax);
|
||||||
@@ -64,7 +64,6 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
|||||||
QHBoxLayout *v2Layout = new QHBoxLayout();
|
QHBoxLayout *v2Layout = new QHBoxLayout();
|
||||||
cswitchSource2[i] = new QComboBox(this);
|
cswitchSource2[i] = new QComboBox(this);
|
||||||
cswitchSource2[i]->setProperty("index", i);
|
cswitchSource2[i]->setProperty("index", i);
|
||||||
cswitchSource2[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
connect(cswitchSource2[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v2Edited(int)));
|
connect(cswitchSource2[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v2Edited(int)));
|
||||||
v2Layout->addWidget(cswitchSource2[i]);
|
v2Layout->addWidget(cswitchSource2[i]);
|
||||||
cswitchSource2[i]->setVisible(false);
|
cswitchSource2[i]->setVisible(false);
|
||||||
@@ -97,7 +96,6 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
|||||||
// AND
|
// AND
|
||||||
cswitchAnd[i] = new QComboBox(this);
|
cswitchAnd[i] = new QComboBox(this);
|
||||||
cswitchAnd[i]->setProperty("index", i);
|
cswitchAnd[i]->setProperty("index", i);
|
||||||
cswitchAnd[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int)));
|
connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int)));
|
||||||
tableLayout->addWidget(i, 4, cswitchAnd[i]);
|
tableLayout->addWidget(i, 4, cswitchAnd[i]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user