[Companion] Unix format used everywhere

This commit is contained in:
Bertrand Songis
2016-11-23 16:42:24 +01:00
parent b0f5b646af
commit d5e4f7b6e9
32 changed files with 4331 additions and 4331 deletions
+68 -68
View File
@@ -20,72 +20,72 @@
#ifndef _NODE_H_
#define _NODE_H_
#include <QtWidgets>
#define DEFAULT_BALL_SIZE 10
#define BALL_HEIGHT 2
class Edge;
QT_BEGIN_NAMESPACE
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE
class Node : public QGraphicsObject
{
Q_OBJECT
public:
Node();
void addEdge(Edge *edge);
QList<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const { return Type; }
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void setBallSize(int size);
void stepToCenter(qreal step=10);
int getBallSize() {return ballSize;}
qreal getX();
qreal getY();
void setX(qreal newX);
void setY(qreal newX);
void setCenteringX(bool val) {centerX = val;}
void setCenteringY(bool val) {centerY = val;}
void setFixedX(bool val) {fixedX = val;}
void setFixedY(bool val) {fixedY = val;}
bool getFixedX() {return fixedX;}
bool getFixedY() {return fixedY;}
void setMinX(int val) {minX = val;};
void setMaxX(int val) {maxX = val;};
void setColor(const QColor & color);
signals:
void moved(int x, int y);
void focus();
void unfocus();
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
bool bPressed;
bool centerX;
bool centerY;
bool fixedX;
bool fixedY;
int ballSize;
int minX;
int maxX;
QList<Edge *> edgeList;
QPointF newPos;
QColor nodecolor;
};
#include <QtWidgets>
#define DEFAULT_BALL_SIZE 10
#define BALL_HEIGHT 2
class Edge;
QT_BEGIN_NAMESPACE
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE
class Node : public QGraphicsObject
{
Q_OBJECT
public:
Node();
void addEdge(Edge *edge);
QList<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const { return Type; }
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void setBallSize(int size);
void stepToCenter(qreal step=10);
int getBallSize() {return ballSize;}
qreal getX();
qreal getY();
void setX(qreal newX);
void setY(qreal newX);
void setCenteringX(bool val) {centerX = val;}
void setCenteringY(bool val) {centerY = val;}
void setFixedX(bool val) {fixedX = val;}
void setFixedY(bool val) {fixedY = val;}
bool getFixedX() {return fixedX;}
bool getFixedY() {return fixedY;}
void setMinX(int val) {minX = val;};
void setMaxX(int val) {maxX = val;};
void setColor(const QColor & color);
signals:
void moved(int x, int y);
void focus();
void unfocus();
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
bool bPressed;
bool centerX;
bool centerY;
bool fixedX;
bool fixedY;
int ballSize;
int minX;
int maxX;
QList<Edge *> edgeList;
QPointF newPos;
QColor nodecolor;
};
#endif // _NODE_H_