mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Fix QComboBox::activate(QString) #239
This commit is contained in:
parent
e898278144
commit
6e564f87c9
@ -358,8 +358,8 @@ ComponentDialog::ComponentDialog(Component *c, Schematic *d)
|
||||
v1->addWidget(ComboEdit);
|
||||
ComboEdit->setVisible(false);
|
||||
ComboEdit->installEventFilter(this); // to catch Enter keypress
|
||||
connect(ComboEdit, SIGNAL(activated(const QString&)),
|
||||
SLOT(slotApplyChange(const QString&)));
|
||||
connect(ComboEdit, SIGNAL(activated(int)),
|
||||
SLOT(slotApplyChange(int)));
|
||||
|
||||
QHBoxLayout *h3 = new QHBoxLayout;
|
||||
v1->addLayout(h3);
|
||||
@ -700,7 +700,7 @@ void ComponentDialog::slotSelectProperty(QTableWidgetItem *item)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
void ComponentDialog::slotApplyChange(const QString& Text)
|
||||
void ComponentDialog::slotApplyChange(int idx)
|
||||
{
|
||||
/// \bug what if the table have no items?
|
||||
// pick selected row
|
||||
@ -710,6 +710,7 @@ void ComponentDialog::slotApplyChange(const QString& Text)
|
||||
|
||||
int row = item->row();
|
||||
|
||||
auto Text = ComboEdit->itemText(idx);
|
||||
edit->setText(Text);
|
||||
// apply edit line
|
||||
prop->item(row, 1)->setText(Text);
|
||||
|
@ -53,7 +53,7 @@ private slots:
|
||||
void slotApplyState(int State);
|
||||
void slotBrowseFile();
|
||||
void slotEditFile();
|
||||
void slotApplyChange(const QString& Text);
|
||||
void slotApplyChange(int idx);
|
||||
void slotApplyProperty();
|
||||
void slotApplyPropName();
|
||||
|
||||
|
@ -237,8 +237,8 @@ OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)
|
||||
VarTypeCombo->insertItem(8, tr("E48 series"));
|
||||
VarTypeCombo->insertItem(9, tr("E96 series"));
|
||||
VarTypeCombo->insertItem(10, tr("E192 series"));
|
||||
connect(VarTypeCombo, SIGNAL(activated(const QString&)),
|
||||
SLOT(slotChangeVarType(const QString&)));
|
||||
connect(VarTypeCombo, SIGNAL(activated(int)),
|
||||
SLOT(slotChangeVarType(int)));
|
||||
|
||||
QPushButton *AddVar_Butt = new QPushButton(tr("Add"));
|
||||
connect(AddVar_Butt, SIGNAL(clicked()), SLOT(slotAddVariable()));
|
||||
@ -305,8 +305,8 @@ OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)
|
||||
GoalTypeCombo->insertItem(3, tr("greater"));
|
||||
GoalTypeCombo->insertItem(4, tr("equal"));
|
||||
GoalTypeCombo->insertItem(5, tr("monitor"));
|
||||
connect(GoalTypeCombo, SIGNAL(activated(const QString&)),
|
||||
SLOT(slotChangeGoalType(const QString&)));
|
||||
connect(GoalTypeCombo, SIGNAL(activated(int)),
|
||||
SLOT(slotChangeGoalType(int)));
|
||||
gp4->addWidget(GoalTypeCombo,2,2);
|
||||
|
||||
QPushButton *AddGoal_Butt = new QPushButton(tr("Add"));
|
||||
@ -607,8 +607,9 @@ void OptimizeDialog::slotChangeVarMax(const QString& Text)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
void OptimizeDialog::slotChangeVarType(const QString& Text)
|
||||
void OptimizeDialog::slotChangeVarType(int idx)
|
||||
{
|
||||
auto Text = VarTypeCombo->itemText(idx);
|
||||
int selectedrow = VarTable->currentRow();
|
||||
QTableWidgetItem *item = VarTable->item(selectedrow, 5);
|
||||
if (item) {
|
||||
@ -690,8 +691,9 @@ void OptimizeDialog::slotChangeGoalName(const QString&)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
void OptimizeDialog::slotChangeGoalType(const QString& Text)
|
||||
void OptimizeDialog::slotChangeGoalType(int idx)
|
||||
{
|
||||
auto Text = GoalTypeCombo->itemText(idx);
|
||||
int selectedrow = GoalTable->currentRow();
|
||||
QTableWidgetItem *item = GoalTable->item(selectedrow, 1);
|
||||
if (item) {
|
||||
|
@ -55,10 +55,10 @@ private slots:
|
||||
void slotChangeVarInit(const QString&);
|
||||
void slotChangeVarMin(const QString&);
|
||||
void slotChangeVarMax(const QString&);
|
||||
void slotChangeVarType(const QString&);
|
||||
void slotChangeVarType(int);
|
||||
void slotChangeGoalName(const QString&);
|
||||
void slotChangeGoalNum(const QString&);
|
||||
void slotChangeGoalType(const QString&);
|
||||
void slotChangeGoalType(int);
|
||||
void slotCreateEqn();
|
||||
void slotSetPrecision(const QPoint&);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user