In table of increments select next cell in this row after end of editing previous.
--HG-- branch : develop
This commit is contained in:
parent
c94e939149
commit
11b7c6a1f0
|
@ -29,7 +29,8 @@
|
||||||
#include "exception/vexception.h"
|
#include "exception/vexception.h"
|
||||||
|
|
||||||
DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent) :
|
DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent) :
|
||||||
DialogTool(data, Draw::Calculation, parent), ui(new Ui::DialogIncrements), data(data), doc(doc){
|
DialogTool(data, Draw::Calculation, parent), ui(new Ui::DialogIncrements), data(data), doc(doc),
|
||||||
|
row(0), column(0){
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
InitialStandartTable();
|
InitialStandartTable();
|
||||||
InitialIncrementTable();
|
InitialIncrementTable();
|
||||||
|
@ -58,6 +59,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget
|
||||||
|
|
||||||
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||||
connect(bOk, &QPushButton::clicked, this, &DialogIncrements::DialogAccepted);
|
connect(bOk, &QPushButton::clicked, this, &DialogIncrements::DialogAccepted);
|
||||||
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogIncrements::FillStandartTable(){
|
void DialogIncrements::FillStandartTable(){
|
||||||
|
@ -155,6 +157,7 @@ void DialogIncrements::FillIncrementTable(){
|
||||||
ui->tableWidgetIncrement->resizeColumnsToContents();
|
ui->tableWidgetIncrement->resizeColumnsToContents();
|
||||||
ui->tableWidgetIncrement->resizeRowsToContents();
|
ui->tableWidgetIncrement->resizeRowsToContents();
|
||||||
ui->tableWidgetIncrement->verticalHeader()->setDefaultSectionSize(20);
|
ui->tableWidgetIncrement->verticalHeader()->setDefaultSectionSize(20);
|
||||||
|
ui->tableWidgetIncrement->setCurrentCell( row, column );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogIncrements::FillLengthLines(){
|
void DialogIncrements::FillLengthLines(){
|
||||||
|
@ -377,6 +380,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
QTableWidgetItem *itemName = 0;
|
QTableWidgetItem *itemName = 0;
|
||||||
qint64 id;
|
qint64 id;
|
||||||
QDomElement domElement;
|
QDomElement domElement;
|
||||||
|
this->row = row;
|
||||||
switch(column) {
|
switch(column) {
|
||||||
case 0:
|
case 0:
|
||||||
item = ui->tableWidgetIncrement->item(row, 0);
|
item = ui->tableWidgetIncrement->item(row, 0);
|
||||||
|
@ -385,6 +389,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
if(domElement.isElement()){
|
if(domElement.isElement()){
|
||||||
domElement.setAttribute("name", item->text());
|
domElement.setAttribute("name", item->text());
|
||||||
data->ClearIncrementTable();
|
data->ClearIncrementTable();
|
||||||
|
this->column = 2;
|
||||||
emit FullUpdateTree();
|
emit FullUpdateTree();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -398,6 +403,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
qreal value = item->text().toDouble(&ok);
|
qreal value = item->text().toDouble(&ok);
|
||||||
if(ok){
|
if(ok){
|
||||||
domElement.setAttribute("base", value);
|
domElement.setAttribute("base", value);
|
||||||
|
this->column = 3;
|
||||||
emit FullUpdateTree();
|
emit FullUpdateTree();
|
||||||
} else {
|
} else {
|
||||||
throw VException(tr("Can't convert toDouble value."));
|
throw VException(tr("Can't convert toDouble value."));
|
||||||
|
@ -411,6 +417,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
domElement = doc->elementById(QString().setNum(id));
|
domElement = doc->elementById(QString().setNum(id));
|
||||||
if(domElement.isElement()){
|
if(domElement.isElement()){
|
||||||
domElement.setAttribute("ksize", item->text().toDouble());
|
domElement.setAttribute("ksize", item->text().toDouble());
|
||||||
|
this->column = 4;
|
||||||
emit FullUpdateTree();
|
emit FullUpdateTree();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -421,6 +428,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
domElement = doc->elementById(QString().setNum(id));
|
domElement = doc->elementById(QString().setNum(id));
|
||||||
if(domElement.isElement()){
|
if(domElement.isElement()){
|
||||||
domElement.setAttribute("kgrowth", item->text().toDouble());
|
domElement.setAttribute("kgrowth", item->text().toDouble());
|
||||||
|
this->column = 5;
|
||||||
emit FullUpdateTree();
|
emit FullUpdateTree();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -434,6 +442,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ){
|
||||||
VIncrementTableRow incr = data->GetIncrementTableRow(itemName->text());
|
VIncrementTableRow incr = data->GetIncrementTableRow(itemName->text());
|
||||||
incr.setDescription(item->text());
|
incr.setDescription(item->text());
|
||||||
data->UpdateIncrementTableRow(itemName->text(), incr);
|
data->UpdateIncrementTableRow(itemName->text(), incr);
|
||||||
|
ui->tableWidgetIncrement->setCurrentCell( row, 0 );
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,6 +48,8 @@ private:
|
||||||
Ui::DialogIncrements *ui;
|
Ui::DialogIncrements *ui;
|
||||||
VContainer *data; // need because we must change data
|
VContainer *data; // need because we must change data
|
||||||
VDomDocument *doc;
|
VDomDocument *doc;
|
||||||
|
qint32 row;
|
||||||
|
qint32 column;
|
||||||
void InitialStandartTable();
|
void InitialStandartTable();
|
||||||
void InitialIncrementTable();
|
void InitialIncrementTable();
|
||||||
void InitialLinesTable();
|
void InitialLinesTable();
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<enum>QTabWidget::North</enum>
|
<enum>QTabWidget::North</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabStandart">
|
<widget class="QWidget" name="tabStandart">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user