]> Git trees. - libqmvoc.git/commitdiff
Updating the selected element in the PSE when changing element from the detail dialog.
authorPino Toscano <pino@kde.org>
Sun, 5 Jun 2005 21:13:58 +0000 (21:13 +0000)
committerPino Toscano <pino@kde.org>
Sun, 5 Jun 2005 21:13:58 +0000 (21:13 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=422590

kalzium/src/element.cpp
kalzium/src/element.h

index 7912289809c32cc6cb982d9f21c94c97f85293c7..4dd0fa2ef9f9b0a6e37ee1c331c4e9bdf68d25e5 100644 (file)
@@ -526,6 +526,26 @@ double Element::radius( RADIUSTYPE type )
        return 0.0;
 }
 
+int Element::xPos() const
+{
+       return ( x-1 )*ELEMENTSIZE;
+}
+
+int Element::yPos() const
+{
+       return ( y-1 )*ELEMENTSIZE + ELEMENTSIZE;
+}
+
+QPoint Element::pos() const
+{
+       return QPoint( xPos(), yPos() );
+}
+
+QPoint Element::coords() const
+{
+       return QPoint( x, y );
+}
+
 KalziumDataObject::KalziumDataObject()
 {
        QDomDocument doc( "datadocument" );
index 16908144ed2c6560f92c4e92c3e4705e65c539bb..b75e11db9d4bd85cbfb5ded332e8da4d152c0f3a 100644 (file)
@@ -28,6 +28,7 @@
 class Element;
 class QDomDocument;
 class QPainter;
+class QPoint;
 
 struct coordinate;
 
@@ -349,6 +350,8 @@ class Element{
                 */
                static double strippedValue( double w );
 
+               QPoint pos() const;
+               QPoint coords() const;
 
     /**
      * accessor for the element's color
@@ -367,12 +370,8 @@ class Element{
        
                QColor m_Color;
 
-               inline int xPos() const{
-                       return ( x-1 )*ELEMENTSIZE;
-               }
-               inline int yPos() const{
-                       return ( y-1 )*ELEMENTSIZE + ELEMENTSIZE;
-               }
+               int xPos() const;
+               int yPos() const;
 
                double  m_mass,
                        m_MP,