2016-07-05 20:14:14 +00:00
|
|
|
/*
|
2017-01-20 10:55:49 +00:00
|
|
|
Copyright 2006-2017 The QElectroTech Team
|
2016-07-05 20:14:14 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
#include "formulaautonumberingw.h"
|
|
|
|
#include "ui_formulaautonumberingw.h"
|
2016-07-05 20:14:14 +00:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QtWidgets>
|
2018-07-19 14:14:31 +00:00
|
|
|
#include <utility>
|
2016-07-05 20:14:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) :
|
2016-07-05 20:14:14 +00:00
|
|
|
QWidget(parent),
|
2016-08-29 15:37:42 +00:00
|
|
|
ui(new Ui::FormulaAutonumberingW)
|
2016-07-05 20:14:14 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2016-07-10 01:33:49 +00:00
|
|
|
setContext(formula_);
|
2016-07-05 20:14:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
FormulaAutonumberingW::~FormulaAutonumberingW()
|
2016-07-05 20:14:14 +00:00
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-08-29 15:37:42 +00:00
|
|
|
* @brief FormulaAutonumberingW::setContext
|
2016-07-05 20:14:14 +00:00
|
|
|
* @param formula to be inserted into context
|
|
|
|
*/
|
2018-07-19 14:14:31 +00:00
|
|
|
void FormulaAutonumberingW::setContext(const QString& formula) {
|
2016-07-05 20:14:14 +00:00
|
|
|
ui->m_formula_le->insert(formula);
|
|
|
|
}
|
|
|
|
|
2016-07-10 01:33:49 +00:00
|
|
|
/**
|
2016-08-29 15:37:42 +00:00
|
|
|
* @brief FormulaAutonumberingW::clearContext
|
2016-07-10 01:33:49 +00:00
|
|
|
* @param clear formula line edit text
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
void FormulaAutonumberingW::clearContext() {
|
2016-07-10 01:33:49 +00:00
|
|
|
ui->m_formula_le->clear();
|
|
|
|
}
|
|
|
|
|
2016-07-05 20:14:14 +00:00
|
|
|
/**
|
2016-08-29 15:37:42 +00:00
|
|
|
* @brief FormulaAutonumberingW::formula
|
2016-07-05 20:14:14 +00:00
|
|
|
* @return formula to be stored into project
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
QString FormulaAutonumberingW::formula() {
|
2016-07-05 20:14:14 +00:00
|
|
|
return ui->m_formula_le->text();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-08-29 15:37:42 +00:00
|
|
|
* @brief FormulaAutonumberingW::on_m_formula_le_textChanged
|
2016-07-05 20:14:14 +00:00
|
|
|
* Update Apply Button
|
|
|
|
*/
|
2016-08-29 15:37:42 +00:00
|
|
|
void FormulaAutonumberingW::on_m_formula_le_textChanged(QString text) {
|
2018-07-19 14:14:31 +00:00
|
|
|
emit (textChanged(std::move(text)));
|
2016-07-05 20:14:14 +00:00
|
|
|
}
|