mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-09 16:09:59 +02:00
Import initial
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
50
element.h
Normal file
50
element.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef ELEMENT_H
|
||||
#define ELEMENT_H
|
||||
#include <QtGui>
|
||||
#include "borne.h"
|
||||
class Schema;
|
||||
class Element : public QGraphicsItem {
|
||||
public:
|
||||
enum { Type = UserType + 1000 };
|
||||
virtual int type() const { return Type; }
|
||||
Element(QGraphicsItem * = 0, Schema * = 0);
|
||||
|
||||
virtual int nbBornes() const = 0;
|
||||
virtual int nbBornesMin() const = 0;
|
||||
virtual int nbBornesMax() const = 0;
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *) = 0;
|
||||
virtual QString typeId() = 0;
|
||||
|
||||
virtual QString nom() = 0;
|
||||
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
|
||||
QRectF boundingRect() const;
|
||||
QSize setSize(int, int);
|
||||
QPoint setHotspot(QPoint);
|
||||
QPoint hotspot() const;
|
||||
void select();
|
||||
void deselect();
|
||||
QPixmap pixmap();
|
||||
QVariant itemChange(GraphicsItemChange, const QVariant &);
|
||||
bool orientation() const;
|
||||
bool invertOrientation();
|
||||
void setPos(const QPointF &);
|
||||
void setPos(qreal, qreal);
|
||||
bool connexionsInternesAcceptees() { return(peut_relier_ses_propres_bornes); }
|
||||
static bool valideXml(QDomElement &);
|
||||
virtual bool fromXml(QDomElement &, QHash<int, Borne *>&) = 0;
|
||||
|
||||
protected:
|
||||
void drawAxes(QPainter *, const QStyleOptionGraphicsItem *);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *);
|
||||
bool peut_relier_ses_propres_bornes;
|
||||
|
||||
private:
|
||||
void drawSelection(QPainter *, const QStyleOptionGraphicsItem *);
|
||||
void updatePixmap();
|
||||
bool sens;
|
||||
QSize dimensions;
|
||||
QPoint hotspot_coord;
|
||||
QPixmap apercu;
|
||||
QMenu menu;
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user