More refactoring.

--HG--
branch : dfighter-tools
This commit is contained in:
dfighter1985 2014-09-13 22:54:50 +02:00
parent 5fc392623b
commit 275095107b

View file

@ -48,13 +48,7 @@ class NodeSlot
public: public:
NodeSlot( const NodeSlotInfo &info ) NodeSlot( const NodeSlotInfo &info )
{ {
m_tl = info.tl; m_info = info;
m_ttl = info.ttl;
m_text = info.text;
m_tw = info.tw;
m_th = info.th;
m_wh = info.wh;
} }
~NodeSlot() ~NodeSlot()
@ -63,8 +57,8 @@ public:
QPointF pos() const{ QPointF pos() const{
QPointF p; QPointF p;
p.setX( m_tl.x() + m_wh / 2.0 ); p.setX( m_info.tl.x() + m_info.wh / 2.0 );
p.setY( m_tl.y() + m_wh / 2.0 ); p.setY( m_info.tl.y() + m_info.wh / 2.0 );
return p; return p;
} }
@ -82,27 +76,21 @@ public:
QRectF box; QRectF box;
QRectF tbox; QRectF tbox;
box.setTopLeft( m_tl ); box.setTopLeft( m_info.tl );
box.setHeight( m_wh ); box.setHeight( m_info.wh );
box.setWidth( m_wh ); box.setWidth( m_info.wh );
painter->fillRect( box, boxBrush ); painter->fillRect( box, boxBrush );
tbox.setTopLeft( m_ttl ); tbox.setTopLeft( m_info.ttl );
tbox.setHeight( m_th ); tbox.setHeight( m_info.th );
tbox.setWidth( m_tw ); tbox.setWidth( m_info.tw );
painter->drawText( tbox, Qt::AlignRight, m_text ); painter->drawText( tbox, Qt::AlignRight, m_info.text );
} }
private: private:
QPoint m_tl; NodeSlotInfo m_info;
QPoint m_ttl;
QString m_text;
qreal m_th;
qreal m_tw;
qreal m_wh;
}; };