Insert value of variable after cursor in line edit.
--HG-- branch : develop
This commit is contained in:
parent
4552f887db
commit
90207bd926
|
@ -217,6 +217,8 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case(Tool::SplineTool):
|
||||||
|
break;//Nothing to do, just ignore.
|
||||||
default:
|
default:
|
||||||
qWarning()<<"Get wrong tool type. Ignore."<<detail[i].getTypeTool();
|
qWarning()<<"Get wrong tool type. Ignore."<<detail[i].getTypeTool();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -139,9 +139,10 @@ void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget){
|
||||||
Q_ASSERT(lineEdit != 0);
|
Q_ASSERT(lineEdit != 0);
|
||||||
Q_ASSERT(listWidget != 0);
|
Q_ASSERT(listWidget != 0);
|
||||||
QListWidgetItem *item = listWidget->currentItem();
|
QListWidgetItem *item = listWidget->currentItem();
|
||||||
QString val = item->text();
|
int pos = lineEdit->cursorPosition();
|
||||||
lineEdit->setText(lineEdit->text().append(val));
|
lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
|
||||||
lineEdit->setFocus();
|
lineEdit->setFocus();
|
||||||
|
lineEdit->setCursorPosition(pos + item->text().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer){
|
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer){
|
||||||
|
@ -328,9 +329,12 @@ void DialogTool::PutHere(){
|
||||||
|
|
||||||
void DialogTool::PutVal(QListWidgetItem *item){
|
void DialogTool::PutVal(QListWidgetItem *item){
|
||||||
Q_ASSERT(lineEditFormula != 0);
|
Q_ASSERT(lineEditFormula != 0);
|
||||||
QString val = item->text();
|
Q_ASSERT(item != 0);
|
||||||
lineEditFormula->setText(lineEditFormula->text().append(val));
|
int pos = lineEditFormula->cursorPosition();
|
||||||
|
lineEditFormula->setText(lineEditFormula->text().insert(lineEditFormula->cursorPosition(),
|
||||||
|
item->text()));
|
||||||
lineEditFormula->setFocus();
|
lineEditFormula->setFocus();
|
||||||
|
lineEditFormula->setCursorPosition(pos + item->text().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogTool::ValChenged(int row){
|
void DialogTool::ValChenged(int row){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user