Backout changeset 38e907833133b065c72ba362fed040f608d4b66d
--HG-- branch : XML Editor
This commit is contained in:
parent
81e8638a6d
commit
2afc195a87
|
@ -39,13 +39,10 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
InitVariables(ui);
|
InitVariables(ui);
|
||||||
labelResultCalculation = ui->labelResultCalculation;
|
labelResultCalculation = ui->labelResultCalculation;
|
||||||
plainTextEditFormula = ui->plainTextEditFormula;
|
lineEditFormula = ui->lineEditFormula;
|
||||||
labelEditFormula = ui->labelEditFormula;
|
labelEditFormula = ui->labelEditFormula;
|
||||||
labelEditNamePoint = ui->labelEditNamePoint;
|
labelEditNamePoint = ui->labelEditNamePoint;
|
||||||
|
|
||||||
// TODO : auto extend height on first value length.
|
|
||||||
this->formulaBaseHeight=ui->plainTextEditFormula->height();
|
|
||||||
|
|
||||||
InitOkCansel(ui);
|
InitOkCansel(ui);
|
||||||
flagFormula = false;
|
flagFormula = false;
|
||||||
flagName = false;
|
flagName = false;
|
||||||
|
@ -60,29 +57,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||||
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEndLine::PutVal);
|
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEndLine::PutVal);
|
||||||
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEndLine::EvalFormula);
|
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEndLine::EvalFormula);
|
||||||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
|
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
|
||||||
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged);
|
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
|
||||||
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEndLine::DeployFormulaTextEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogEndLine::FormulaTextChanged()
|
|
||||||
{
|
|
||||||
// TODO issue #79 : back to FormulaChanged when full update
|
|
||||||
// Also remove this function if only one function called here
|
|
||||||
this->FormulaChanged2();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogEndLine::DeployFormulaTextEdit()
|
|
||||||
{
|
|
||||||
if (ui->plainTextEditFormula->height() < 64)
|
|
||||||
{
|
|
||||||
ui->plainTextEditFormula->setFixedHeight(64);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -115,10 +90,7 @@ void DialogEndLine::setTypeLine(const QString &value)
|
||||||
void DialogEndLine::setFormula(const QString &value)
|
void DialogEndLine::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = value;
|
formula = value;
|
||||||
ui->plainTextEditFormula->setPlainText(value);
|
ui->lineEditFormula->setText(formula);
|
||||||
//QTextCursor cursor = ui->plainTextEditFormula->textCursor();
|
|
||||||
//cursor.insertText(value);
|
|
||||||
//ui->plainTextEditFormula->setCursor(cursor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -139,7 +111,7 @@ void DialogEndLine::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
typeLine = GetTypeLine(ui->comboBoxLineType);
|
typeLine = GetTypeLine(ui->comboBoxLineType);
|
||||||
formula = ui->plainTextEditFormula->toPlainText();
|
formula = ui->lineEditFormula->text();
|
||||||
angle = ui->doubleSpinBoxAngle->value();
|
angle = ui->doubleSpinBoxAngle->value();
|
||||||
basePointId = getCurrentObjectId(ui->comboBoxBasePoint);
|
basePointId = getCurrentObjectId(ui->comboBoxBasePoint);
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
|
|
|
@ -112,14 +112,6 @@ public slots:
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief DeployFormulaTextEdit grow or shrink formula input
|
|
||||||
*/
|
|
||||||
void DeployFormulaTextEdit();
|
|
||||||
/**
|
|
||||||
* @brief FormulaTextChanged when formula text changes for validation and calc
|
|
||||||
*/
|
|
||||||
void FormulaTextChanged();
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogEndLine)
|
Q_DISABLE_COPY(DialogEndLine)
|
||||||
/**
|
/**
|
||||||
|
@ -146,10 +138,6 @@ private:
|
||||||
* @brief basePointId id base point of line
|
* @brief basePointId id base point of line
|
||||||
*/
|
*/
|
||||||
quint32 basePointId;
|
quint32 basePointId;
|
||||||
/**
|
|
||||||
* @brief formulaBaseHeight base height defined by dialogui
|
|
||||||
*/
|
|
||||||
int formulaBaseHeight;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString DialogEndLine::getPointName() const
|
inline QString DialogEndLine::getPointName() const
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>486</width>
|
<width>539</width>
|
||||||
<height>522</height>
|
<height>559</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -74,17 +74,17 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<widget class="QLineEdit" name="lineEditFormula">
|
||||||
<property name="orientation">
|
<property name="sizePolicy">
|
||||||
<enum>Qt::Horizontal</enum>
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="toolTip">
|
||||||
<size>
|
<string>Formula for calculation of length of line</string>
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="toolButtonPutHere">
|
<widget class="QToolButton" name="toolButtonPutHere">
|
||||||
|
@ -147,56 +147,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
|
||||||
<item>
|
|
||||||
<widget class="QPlainTextEdit" name="plainTextEditFormula">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="baseSize">
|
|
||||||
<size>
|
|
||||||
<width>4</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButtonGrowLength">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../share/resources/icon.qrc">
|
|
||||||
<normaloff>:/icon/16x16/go-down.png</normaloff>
|
|
||||||
<activeoff>:/icon/16x16/go-next.png</activeoff>:/icon/16x16/go-down.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
|
@ -600,6 +550,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
<tabstop>lineEditFormula</tabstop>
|
||||||
<tabstop>comboBoxBasePoint</tabstop>
|
<tabstop>comboBoxBasePoint</tabstop>
|
||||||
<tabstop>lineEditNamePoint</tabstop>
|
<tabstop>lineEditNamePoint</tabstop>
|
||||||
<tabstop>doubleSpinBoxAngle</tabstop>
|
<tabstop>doubleSpinBoxAngle</tabstop>
|
||||||
|
|
|
@ -33,15 +33,10 @@
|
||||||
|
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
// TODO : for issue #79
|
|
||||||
// replace lineEditFormula -> plainTextEditFormula
|
|
||||||
// delete lineEditFormala everywhrer
|
|
||||||
// delete PutValHere and eval overloaded functions
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
||||||
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
||||||
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), plainTextEditFormula(nullptr), listWidget(nullptr),
|
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), listWidget(nullptr),
|
||||||
labelResultCalculation(nullptr), labelDescription(nullptr), labelEditNamePoint(nullptr),
|
labelResultCalculation(nullptr), labelDescription(nullptr), labelEditNamePoint(nullptr),
|
||||||
labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr),
|
labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr),
|
||||||
radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr),
|
radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr),
|
||||||
|
@ -288,42 +283,22 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
||||||
{ // TODO issue #79 : erase this function after all tools updated to plainTextEdit
|
{
|
||||||
Q_CHECK_PTR(lineEdit);
|
Q_CHECK_PTR(lineEdit);
|
||||||
Q_CHECK_PTR(listWidget);
|
Q_CHECK_PTR(listWidget);
|
||||||
QListWidgetItem *item = listWidget->currentItem();
|
QListWidgetItem *item = listWidget->currentItem();
|
||||||
Q_CHECK_PTR(item);
|
Q_CHECK_PTR(item);
|
||||||
|
|
||||||
int pos = lineEdit->cursorPosition();
|
int pos = lineEdit->cursorPosition();
|
||||||
lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
|
lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
|
||||||
lineEdit->setFocus();
|
lineEdit->setFocus();
|
||||||
lineEdit->setCursorPosition(pos + item->text().size());
|
lineEdit->setCursorPosition(pos + item->text().size());
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget)
|
|
||||||
{
|
|
||||||
Q_CHECK_PTR(plainTextEdit);
|
|
||||||
Q_CHECK_PTR(listWidget);
|
|
||||||
QListWidgetItem *item = listWidget->currentItem();
|
|
||||||
Q_CHECK_PTR(item);
|
|
||||||
|
|
||||||
QTextCursor cursor = plainTextEdit->textCursor();
|
|
||||||
cursor.insertText(item->text());
|
|
||||||
plainTextEdit->setTextCursor(cursor);
|
|
||||||
/*
|
|
||||||
int pos = lineEdit->cursorPosition();
|
|
||||||
lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
|
|
||||||
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)
|
||||||
{// TODO issue #79 : erase this function after all tools updated to plainTextEdit
|
{
|
||||||
Q_CHECK_PTR(edit);
|
Q_CHECK_PTR(edit);
|
||||||
Q_CHECK_PTR(timer);
|
Q_CHECK_PTR(timer);
|
||||||
Q_CHECK_PTR(labelEditFormula);
|
Q_CHECK_PTR(labelEditFormula);
|
||||||
|
@ -338,26 +313,10 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
||||||
}
|
}
|
||||||
timer->start(1000);
|
timer->start(1000);
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *timer)
|
|
||||||
{
|
|
||||||
Q_CHECK_PTR(edit);
|
|
||||||
Q_CHECK_PTR(timer);
|
|
||||||
Q_CHECK_PTR(labelEditFormula);
|
|
||||||
if (edit->toPlainText().isEmpty())
|
|
||||||
{
|
|
||||||
flag = false;
|
|
||||||
CheckState();
|
|
||||||
QPalette palette = labelEditFormula->palette();
|
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
|
|
||||||
labelEditFormula->setPalette(palette);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
timer->start(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||||
{ // TODO issue #79 : erase this function after all tools updated to plainTextEdit
|
{
|
||||||
Q_CHECK_PTR(edit);
|
Q_CHECK_PTR(edit);
|
||||||
Q_CHECK_PTR(timer);
|
Q_CHECK_PTR(timer);
|
||||||
Q_CHECK_PTR(label);
|
Q_CHECK_PTR(label);
|
||||||
|
@ -391,45 +350,6 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||||
labelEditFormula->setPalette(palette);
|
labelEditFormula->setPalette(palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
|
||||||
{
|
|
||||||
Q_CHECK_PTR(edit);
|
|
||||||
Q_CHECK_PTR(timer);
|
|
||||||
Q_CHECK_PTR(label);
|
|
||||||
Q_CHECK_PTR(labelEditFormula);
|
|
||||||
QPalette palette = labelEditFormula->palette();
|
|
||||||
if (edit->toPlainText().isEmpty())
|
|
||||||
{
|
|
||||||
flag = false;
|
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Calculator cal(data);
|
|
||||||
QString errorMsg;
|
|
||||||
// Replace line return with spaces for calc
|
|
||||||
QString formula = edit->toPlainText();
|
|
||||||
formula.replace("\n"," ");
|
|
||||||
qreal result = cal.eval(formula, &errorMsg);
|
|
||||||
if (errorMsg.isEmpty() == false)
|
|
||||||
{
|
|
||||||
label->setText(tr("Error"));
|
|
||||||
flag = false;
|
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
label->setText(QString().setNum(result));
|
|
||||||
flag = true;
|
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CheckState();
|
|
||||||
timer->stop();
|
|
||||||
labelEditFormula->setPalette(palette);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
||||||
{
|
{
|
||||||
|
@ -569,17 +489,8 @@ void DialogTool::DialogRejected()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::FormulaChanged()
|
void DialogTool::FormulaChanged()
|
||||||
{ // TODO issue #79 : erase after full update of tools.
|
|
||||||
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
|
||||||
if (edit)
|
|
||||||
{
|
|
||||||
ValFormulaChanged(flagFormula, edit, timerFormula);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogTool::FormulaChanged2()
|
|
||||||
{
|
{
|
||||||
QPlainTextEdit* edit = qobject_cast<QPlainTextEdit*>(sender());
|
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
||||||
if (edit)
|
if (edit)
|
||||||
{
|
{
|
||||||
ValFormulaChanged(flagFormula, edit, timerFormula);
|
ValFormulaChanged(flagFormula, edit, timerFormula);
|
||||||
|
@ -645,9 +556,9 @@ void DialogTool::ArrowRightDown()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::EvalFormula()
|
void DialogTool::EvalFormula()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(plainTextEditFormula);
|
Q_CHECK_PTR(lineEditFormula);
|
||||||
Q_CHECK_PTR(labelResultCalculation);
|
Q_CHECK_PTR(labelResultCalculation);
|
||||||
Eval(plainTextEditFormula, flagFormula, timerFormula, labelResultCalculation);
|
Eval(lineEditFormula, flagFormula, timerFormula, labelResultCalculation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -704,23 +615,19 @@ void DialogTool::Increments()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::PutHere()
|
void DialogTool::PutHere()
|
||||||
{
|
{
|
||||||
PutValHere(plainTextEditFormula, listWidget);
|
PutValHere(lineEditFormula, listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::PutVal(QListWidgetItem *item)
|
void DialogTool::PutVal(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(plainTextEditFormula);
|
Q_CHECK_PTR(lineEditFormula);
|
||||||
Q_CHECK_PTR(item);
|
Q_CHECK_PTR(item);
|
||||||
QTextCursor cursor = plainTextEditFormula->textCursor();
|
int pos = lineEditFormula->cursorPosition();
|
||||||
cursor.insertText(item->text());
|
|
||||||
plainTextEditFormula->setTextCursor(cursor);
|
|
||||||
/*int pos = plainTextEditFormula->cursorPosition();
|
|
||||||
lineEditFormula->setText(lineEditFormula->text().insert(lineEditFormula->cursorPosition(),
|
lineEditFormula->setText(lineEditFormula->text().insert(lineEditFormula->cursorPosition(),
|
||||||
item->text()));
|
item->text()));
|
||||||
lineEditFormula->setFocus();
|
lineEditFormula->setFocus();
|
||||||
lineEditFormula->setCursorPosition(pos + item->text().size());
|
lineEditFormula->setCursorPosition(pos + item->text().size());
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QPlainTextEdit>
|
|
||||||
#include "../../container/vcontainer.h"
|
#include "../../container/vcontainer.h"
|
||||||
#include "../../widgets/vapplication.h"
|
#include "../../widgets/vapplication.h"
|
||||||
|
|
||||||
|
@ -103,7 +102,6 @@ public slots:
|
||||||
* @brief formula check formula
|
* @brief formula check formula
|
||||||
*/
|
*/
|
||||||
void FormulaChanged();
|
void FormulaChanged();
|
||||||
void FormulaChanged2();
|
|
||||||
/**
|
/**
|
||||||
* @brief ArrowUp set angle value 90 degree
|
* @brief ArrowUp set angle value 90 degree
|
||||||
*/
|
*/
|
||||||
|
@ -216,7 +214,6 @@ protected:
|
||||||
* @brief lineEditFormula linEdit for formula
|
* @brief lineEditFormula linEdit for formula
|
||||||
*/
|
*/
|
||||||
QLineEdit *lineEditFormula;
|
QLineEdit *lineEditFormula;
|
||||||
QPlainTextEdit *plainTextEditFormula;
|
|
||||||
/**
|
/**
|
||||||
* @brief listWidget listWidget with variables
|
* @brief listWidget listWidget with variables
|
||||||
*/
|
*/
|
||||||
|
@ -344,7 +341,6 @@ protected:
|
||||||
* @param listWidget listWidget
|
* @param listWidget listWidget
|
||||||
*/
|
*/
|
||||||
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
|
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
|
||||||
void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget);
|
|
||||||
/**
|
/**
|
||||||
* @brief ValFormulaChanged handle change formula
|
* @brief ValFormulaChanged handle change formula
|
||||||
* @param flag flag state of formula
|
* @param flag flag state of formula
|
||||||
|
@ -352,7 +348,6 @@ protected:
|
||||||
* @param timer timer of formula
|
* @param timer timer of formula
|
||||||
*/
|
*/
|
||||||
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
|
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
|
||||||
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer);
|
|
||||||
/**
|
/**
|
||||||
* @brief Eval evaluate formula and show result
|
* @brief Eval evaluate formula and show result
|
||||||
* @param edit lineEdit of formula
|
* @param edit lineEdit of formula
|
||||||
|
@ -360,7 +355,6 @@ protected:
|
||||||
* @param timer timer of formula
|
* @param timer timer of formula
|
||||||
* @param label label for signal error
|
* @param label label for signal error
|
||||||
*/
|
*/
|
||||||
void Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
|
||||||
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
||||||
/**
|
/**
|
||||||
* @brief setCurrentPointId set current point id in combobox
|
* @brief setCurrentPointId set current point id in combobox
|
||||||
|
|
|
@ -52,7 +52,5 @@
|
||||||
<file>icon/flags/uk.png</file>
|
<file>icon/flags/uk.png</file>
|
||||||
<file>icon/Graduation.png</file>
|
<file>icon/Graduation.png</file>
|
||||||
<file>icon/individual.png</file>
|
<file>icon/individual.png</file>
|
||||||
<file>icon/16x16/go-down.png</file>
|
|
||||||
<file>icon/16x16/go-next.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 756 B |
Binary file not shown.
Before Width: | Height: | Size: 829 B |
Loading…
Reference in New Issue
Block a user