actual version libs withiout pip
git-svn-id: svn://db.shs.com.ru/libs@2 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include <QScrollBar>
|
||||
#include <QMessageBox>
|
||||
#include <math.h>
|
||||
#include "kx_pult.h"
|
||||
#include "ui_kx_pult.h"
|
||||
@@ -400,7 +399,7 @@ void KX_Pult::on_buttonSetDesc_clicked() {
|
||||
QString ret = QFileDialog::getOpenFileName(this, trUtf8("Select *.h file with K description"), kdesc_file, "C/C++ header files(*.h *.hpp);;All files(*)");
|
||||
if (ret.isEmpty()) return;
|
||||
kdesc_file = QDir::current().relativeFilePath(ret);
|
||||
updateKDesc(true);
|
||||
updateKDesc();
|
||||
}
|
||||
|
||||
|
||||
@@ -479,7 +478,7 @@ void KX_Pult::updateDiag() {
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateKDesc(bool ask_move) {
|
||||
void KX_Pult::updateKDesc() {
|
||||
kdesc.clear();
|
||||
QFile f(kdesc_file);
|
||||
if (!f.open(QIODevice::ReadOnly)) {
|
||||
@@ -533,10 +532,7 @@ void KX_Pult::updateKDesc(bool ask_move) {
|
||||
ui->spinSize->setValue(cind);
|
||||
ui->spinSize->setStyleSheet("background-color: rgb(220, 220, 255);");
|
||||
}
|
||||
bool move = false;
|
||||
if (ask_move)
|
||||
move = (QMessageBox::question(this, "KX Pult", "Save values at associated names?", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes);
|
||||
updateTree(move);
|
||||
updateTree();
|
||||
}
|
||||
|
||||
|
||||
@@ -546,21 +542,12 @@ bool stringComp(const QString & s1, const QString & s2) {
|
||||
return s1 > s2;
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateTree(bool move) {
|
||||
void KX_Pult::updateTree() {
|
||||
int sp = ui->treeK->verticalScrollBar()->value();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
//qDebug() << "fill tree ...";
|
||||
QMap<QString, QString> prev_val;
|
||||
if (move) {
|
||||
for (int i = 0; i < ui->treeK->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem * ti = ui->treeK->topLevelItem(i);
|
||||
if (!ti->text(1).isEmpty())
|
||||
prev_val[ti->text(1)] = ti->text(2);
|
||||
}
|
||||
}
|
||||
ui->treeK->clear();
|
||||
ui->treeK->setUpdatesEnabled(false);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
//qDebug() << "fill tree ...";
|
||||
eval.clearCustomVariables();
|
||||
for (int i = 0; i < K.size_s(); ++i) {
|
||||
QTreeWidgetItem * ti = new QTreeWidgetItem();
|
||||
@@ -575,10 +562,6 @@ void KX_Pult::updateTree(bool move) {
|
||||
knames_sort << kd.name;
|
||||
eval.content.addVariable(kd.name, 0., false);
|
||||
}
|
||||
if (move && !kd.name.isEmpty()) {
|
||||
if (prev_val.contains(kd.name))
|
||||
coeffs.setFormula(i, Q2PIString(prev_val[kd.name]));
|
||||
}
|
||||
ti->setText(0, QString::number(i));
|
||||
ti->setText(1, kd.name);
|
||||
ti->setText(2, PI2QString(coeffs.formula(i)));
|
||||
|
||||
Reference in New Issue
Block a user