git-svn-id: svn://db.shs.com.ru/libs@334 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-11-30 09:13:49 +00:00
parent b46c65f826
commit 8cdbe203bf
20 changed files with 707 additions and 227 deletions

View File

@@ -16,34 +16,12 @@
#include <qmath.h>
#include <float.h>
#include "graphic_conf.h"
#include "clineedit.h"
#include "qpievaluator.h"
#include "evalspinbox.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class ELineEdit: public CLineEdit {
Q_OBJECT
public:
explicit ELineEdit(QWidget * parent = 0);
//void setText(const QString & v) {if (!is_auto) is_reset = false; CLineEdit::setText(v); setDefaultText(v, is_reset); last_ret = complexd(v.toDouble(), 0.); emit valueChanged(last_ret.real());}
void setValue(const int & v) {if (is_reset) setDefaultText(QString::number(v).toUpper(), is_reset); else setText(QString::number(v).toUpper()); last_ret = complexd(v, 0.); if (!is_auto) emit valueChanged(last_ret.real());}
void setValue(const double & v) {if (is_reset) setDefaultText(QString::number(v).toUpper(), is_reset); else setText(QString::number(v).toUpper()); last_ret = complexd(v, 0.); if (!is_auto) emit valueChanged(last_ret.real());}
double value() const {return last_ret.real();}
bool isDefault() const {return !cw->isVisible();}
bool is_reset, is_auto;
protected:
void wheelEvent(QWheelEvent * e);
QPIEvaluator evaluator;
complexd last_ret;
private slots:
void toDefaultClicked() {is_reset = true; calculate();}
void calculate();
signals:
void valueChanged(double value);
};
namespace Ui {
class Graphic;
@@ -381,7 +359,7 @@ protected:
Graphic::Buttons buttons_;
Graphic::Alignment align;
GraphicConf * conf;
ELineEdit line_x_min, line_x_max, line_y_min, line_y_max;
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
QTime tm;
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
QImage icon_pause_b, icon_pause_f;