mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
revert some change in comit 2675:
Qt use enum for use flags: Qt is a good exemple to make code git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2686 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -549,7 +549,7 @@ bool CustomElement::parseText(QDomElement &e, QPainter &qp) {
|
|||||||
QFont used_font = QETApp::diagramTextsFont(size);
|
QFont used_font = QETApp::diagramTextsFont(size);
|
||||||
QFontMetrics qfm(used_font);
|
QFontMetrics qfm(used_font);
|
||||||
QColor text_color = (e.attribute("color") != "white"? Qt::black : Qt::white);
|
QColor text_color = (e.attribute("color") != "white"? Qt::black : Qt::white);
|
||||||
|
|
||||||
// instancie un QTextDocument (comme la classe QGraphicsTextItem) pour
|
// instancie un QTextDocument (comme la classe QGraphicsTextItem) pour
|
||||||
// generer le rendu graphique du texte
|
// generer le rendu graphique du texte
|
||||||
QTextDocument text_document;
|
QTextDocument text_document;
|
||||||
@@ -742,7 +742,7 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
|||||||
// attributs par defaut
|
// attributs par defaut
|
||||||
pen.setJoinStyle(Qt::BevelJoin);
|
pen.setJoinStyle(Qt::BevelJoin);
|
||||||
pen.setCapStyle(Qt::SquareCap);
|
pen.setCapStyle(Qt::SquareCap);
|
||||||
|
|
||||||
// recupere la liste des couples style / valeur
|
// recupere la liste des couples style / valeur
|
||||||
QStringList styles = e.attribute("style").split(";", QString::SkipEmptyParts);
|
QStringList styles = e.attribute("style").split(";", QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,6 @@
|
|||||||
class Diagram;
|
class Diagram;
|
||||||
class ElementTextItem;
|
class ElementTextItem;
|
||||||
|
|
||||||
// this define is use to know the kind of element and
|
|
||||||
// to use flag for element provider class
|
|
||||||
#define SIMPLE 1
|
|
||||||
#define REPORT 2
|
|
||||||
#define MASTER 4
|
|
||||||
#define SLAVE 8
|
|
||||||
#define BORNIER 16
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is the base class for electrical elements.
|
This is the base class for electrical elements.
|
||||||
@@ -49,6 +42,15 @@ class Element : public QetGraphicsItem {
|
|||||||
// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
enum { Type = UserType + 1000 };
|
enum { Type = UserType + 1000 };
|
||||||
|
// this enum is use to know the kind of element and
|
||||||
|
// to use flag for element provider class
|
||||||
|
enum {Simple = 1,
|
||||||
|
Report = 2,
|
||||||
|
Master = 4,
|
||||||
|
SlaveNO = 8,
|
||||||
|
SlaveNC = 16,
|
||||||
|
AllSlave = 24,
|
||||||
|
Bornier = 32};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList <Element *> connected_elements;
|
QList <Element *> connected_elements;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class GhostElement : public CustomElement {
|
|||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
|
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
|
||||||
virtual int linkType() const {return SIMPLE;}
|
virtual int linkType() const {return Simple;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QRectF minimalBoundingRect() const;
|
QRectF minimalBoundingRect() const;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void ReportElement::linkToElement(Element * elmt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//ensure elmt is a report
|
//ensure elmt is a report
|
||||||
if (elmt->linkType() == REPORT && i) {
|
if (elmt->linkType() == Report && i) {
|
||||||
unLinkAllElements();
|
unLinkAllElements();
|
||||||
connected_elements << elmt;
|
connected_elements << elmt;
|
||||||
connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(updateLabel()));
|
connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(updateLabel()));
|
||||||
@@ -73,7 +73,7 @@ void ReportElement::unLinkAllElements(){
|
|||||||
* @return the kind of link type
|
* @return the kind of link type
|
||||||
*/
|
*/
|
||||||
int ReportElement::linkType() const {
|
int ReportElement::linkType() const {
|
||||||
return REPORT;
|
return Report;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qg
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
int SimpleElement::linkType() const {
|
int SimpleElement::linkType() const {
|
||||||
return SIMPLE;
|
return Simple;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ FolioReportProperties::~FolioReportProperties()
|
|||||||
*/
|
*/
|
||||||
void FolioReportProperties::BuildRadioList() {
|
void FolioReportProperties::BuildRadioList() {
|
||||||
ElementProvider ep(element_->diagram()->project(), element_->diagram());
|
ElementProvider ep(element_->diagram()->project(), element_->diagram());
|
||||||
QList <Element *> elmt_list = ep.FreeElement(REPORT);
|
QList <Element *> elmt_list = ep.FreeElement(Element::Report);
|
||||||
|
|
||||||
foreach (Element *elmt, elmt_list) {
|
foreach (Element *elmt, elmt_list) {
|
||||||
if (elmt != element_) {
|
if (elmt != element_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user