git-svn-id: svn://db.shs.com.ru/libs@36 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -12,11 +12,15 @@
|
||||
#include <QFileDialog>
|
||||
#include <QTime>
|
||||
#include <QTranslator>
|
||||
#include <QGestureEvent>
|
||||
#include <qmath.h>
|
||||
#include <float.h>
|
||||
#include "graphic_conf.h"
|
||||
#include "clineedit.h"
|
||||
#include "qpievaluator.h"
|
||||
#if QT_VERSION >= 0x050100
|
||||
# include <QSensorGestureManager>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
@@ -53,8 +57,7 @@ class Graphic: public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_FLAGS(Buttons)
|
||||
Q_ENUMS(Alignment)
|
||||
Q_ENUMS(Graduation)
|
||||
Q_ENUMS(Alignment Graduation AxisType)
|
||||
|
||||
Q_PROPERTY(QString caption READ caption WRITE setCaption)
|
||||
Q_PROPERTY(QString labelX READ labelX WRITE setLabelX)
|
||||
@@ -111,6 +114,7 @@ class Graphic: public QFrame
|
||||
Q_PROPERTY(Graduation graduationY READ graduationY WRITE setGraduationY)
|
||||
Q_PROPERTY(double graduationStepX READ graduationStepX WRITE setGraduationStepX)
|
||||
Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY)
|
||||
Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType)
|
||||
|
||||
Q_PROPERTY(int histogramMinIntervals READ histogramMinIntervals WRITE setHistogramMinIntervals)
|
||||
Q_PROPERTY(int histogramMaxIntervals READ histogramMaxIntervals WRITE setHistogramMaxIntervals)
|
||||
@@ -142,6 +146,7 @@ public:
|
||||
};
|
||||
enum Alignment {Left, Right};
|
||||
enum Graduation {Auto, Fixed};
|
||||
enum AxisType {Numeric, DateTime};
|
||||
Q_DECLARE_FLAGS(Buttons, Button)
|
||||
|
||||
QString caption() const;
|
||||
@@ -198,6 +203,7 @@ public:
|
||||
Graduation graduationY() const {return grad_y;}
|
||||
double graduationStepX() const {return gridx;}
|
||||
double graduationStepY() const {return gridy;}
|
||||
AxisType axisType() const {return axis_type_x;}
|
||||
QVector<QPointF> graphicData(const int index = 0) const {return graphics[index].polyline;}
|
||||
GraphicsData graphicsData() const;
|
||||
QWidget * viewport() const {return canvas;}
|
||||
@@ -278,6 +284,7 @@ public slots:
|
||||
void setGraduationStepX(double sx) {gridx = sx; if (aupdate) update();}
|
||||
void setGraduationStepY(double sy) {gridy = sy; if (aupdate) update();}
|
||||
void setGraduationSteps(double sx, double sy) {gridx = sx; gridy = sy; if (aupdate) update();}
|
||||
void setAxisType(AxisType t) {axis_type_x = t; if (aupdate) update();}
|
||||
|
||||
void addPoint(const QPointF & p, int graphic, bool update_ = true);
|
||||
void addPoint(const QPointF & p, bool update = true) {addPoint(p, curGraphic, update);}
|
||||
@@ -322,7 +329,9 @@ protected:
|
||||
virtual void resizeEvent(QResizeEvent * ) {if (leg_update) updateLegend();}
|
||||
virtual QSize sizeHint() const {return QSize(400, 300);}
|
||||
virtual void timerEvent(QTimerEvent * );
|
||||
virtual bool eventFilter(QObject * o, QEvent * e);
|
||||
|
||||
void procGesture(QGesture * g);
|
||||
void setCurrentAction(GraphicAction action);
|
||||
void findGraphicsRect(double start_x = 0., double end_x = 0., double start_y = 0., double end_y = 0.);
|
||||
void tick(int index, bool slide = true, bool update = true);
|
||||
@@ -342,6 +351,7 @@ protected:
|
||||
double roundTo(double value, double round_to);
|
||||
QPointF absPoint(QPointF point) {return QPointF(qAbs(point.x()), qAbs(point.y()));}
|
||||
QString pointCoords(QPointF point) {return "(" + QString::number(point.x(), 'f', 3) + " ; " + QString::number(point.y(), 'f', 3) + ")";}
|
||||
QPair<QString, QString> gridMark(double v) const;
|
||||
|
||||
Ui::Graphic * ui;
|
||||
QMutex mutex, mutex_;
|
||||
@@ -356,6 +366,7 @@ protected:
|
||||
GraphicAction curaction, prevaction;
|
||||
QRectF grect, rrect, selrect, limit_;
|
||||
QRect margins_;
|
||||
QSize font_sz;
|
||||
QPoint startpos, curpos, prevpos, gridborder;
|
||||
QString label_x, label_y, ppath;
|
||||
Graphic::Buttons buttons_;
|
||||
@@ -366,9 +377,10 @@ protected:
|
||||
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
|
||||
QImage icon_pause_b, icon_pause_f;
|
||||
Graduation grad_x, grad_y;
|
||||
AxisType axis_type_x;
|
||||
double gridx, gridy, history, visible_time, inc_x, mdm, grid_numbers_x, grid_numbers_y, LN2, LN5, LN10;
|
||||
double eminx, eminy, emaxx, emaxy, pause_phase;
|
||||
int legy, lastw, lasth, min_repaint_int, min_int, max_int, timer_pause;
|
||||
int legy, lastw, lasth, min_repaint_int, min_int, max_int, timer_pause, thick;
|
||||
bool aalias, aupdate, mupdate, grid, guides, isFit, isEmpty, isOGL, isHover, bufferActive, cancel, pause_, isPrinting;
|
||||
bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user