91 if(
x1-5 <= x_)
if(
x2+5 >= x_)
if(
y1-5 <= y_)
if(
y2+5 >= y_)
111 p->
Painter->setPen(QPen(Qt::darkGray,6));
113 p->
Painter->setPen(QPen(Qt::lightGray,2));
117 p->
Painter->setPen(QPen(Qt::darkBlue,2));
129 void Wire::setName(
const QString& Name_,
const QString& Value_,
int delta_,
int x_,
int y_)
131 if(Name_.isEmpty() && Value_.isEmpty()) {
153 QString s =
"<"+QString::number(
x1)+
" "+QString::number(
y1);
154 s +=
" "+QString::number(
x2)+
" "+QString::number(
y2);
157 s += QString::number(
Label->
x1)+
" "+QString::number(
Label->
y1)+
" ";
161 else { s +=
" \"\" 0 0 0 \"\">"; }
172 if(s.at(0) !=
'<')
return false;
173 if(s.at(s.length()-1) !=
'>')
return false;
174 s = s.mid(1, s.length()-2);
177 n = s.section(
' ',0,0);
179 if(!ok)
return false;
181 n = s.section(
' ',1,1);
183 if(!ok)
return false;
185 n = s.section(
' ',2,2);
187 if(!ok)
return false;
189 n = s.section(
' ',3,3);
191 if(!ok)
return false;
193 n = s.section(
'"',1,1);
195 int nx = s.section(
' ',5,5).toInt(&ok);
196 if(!ok)
return false;
198 int ny = s.section(
' ',6,6).toInt(&ok);
199 if(!ok)
return false;
201 int delta = s.section(
' ',7,7).toInt(&ok);
202 if(!ok)
return false;
204 setName(n, s.section(
'"',3,3), delta, nx, ny);
void setName(const QString &Name_)
void drawLine(int, int, int, int)
void paint(ViewPainter *)
void paintScheme(QPainter *)
bool getSelected(int, int)
Wire(int _x1=0, int _y1=0, int _x2=0, int _y2=0, Node *n1=0, Node *n2=0)
void getCenter(int &, int &)
void setCenter(int, int, bool relative=false)
bool load(const QString &)
void setName(const QString &, const QString &, int delta_=0, int x_=0, int y_=0)