m_unit = ChemicalDataObject::noUnit;
}
-QString ChemicalDataObject::valueAsString()
-{
- return m_value.toString();
-}
-
-bool ChemicalDataObject::operator==( const int v )
+bool ChemicalDataObject::operator==( const int v ) const
{
kdDebug() << "ChemicalDataObject::operator==() with int" << endl;
if ( m_value.type() != QVariant::Int )
return m_value.toInt() == v;
}
-bool ChemicalDataObject::operator==( const bool v )
+bool ChemicalDataObject::operator==( const bool v ) const
{
kdDebug() << "ChemicalDataObject::operator==() with bool" << endl;
if ( m_value.type() != QVariant::Bool )
return m_value.toBool() == v;
}
-bool ChemicalDataObject::operator==( const double v )
+bool ChemicalDataObject::operator==( const double v ) const
{
kdDebug() << "ChemicalDataObject::operator==() with double" << endl;
if ( m_value.type() != QVariant::Double )
return m_value.toDouble() == v;
}
-bool ChemicalDataObject::operator==( const QString& v )
+bool ChemicalDataObject::operator==( const QString& v ) const
{
kdDebug() << "ChemicalDataObject::operator==() with QString" << endl;
if ( m_value.type() != QVariant::String )
ChemicalDataObject::~ChemicalDataObject()
{}
+QString ChemicalDataObject::valueAsString() const
+{
+ return m_value.toString();
+}
+
+ChemicalDataObject::BlueObelisk ChemicalDataObject::type() const
+{
+ return m_type;
+}
+
+QVariant ChemicalDataObject::value() const
+{
+ return m_value;
+}
+
+void ChemicalDataObject::setUnit( ChemicalDataObject::BlueObeliskUnit unit )
+{
+ m_unit = unit;
+}
+
+ChemicalDataObject::BlueObeliskUnit ChemicalDataObject::unit() const
+{
+ return m_unit;
+}
+
+void ChemicalDataObject::setData( QVariant v )
+{
+ m_value = v;
+}
+
+void ChemicalDataObject::setType( BlueObelisk type )
+{
+ m_type = type;
+}
+
+void ChemicalDataObject::setType( int type )
+{
+ m_type = ( ChemicalDataObject::BlueObelisk ) type;
+}
+
QString ChemicalDataObject::dictRef()
{
QString botype;
* Set the data of this object to @p v
* @param v the value of the object
*/
- void setData( QVariant v ){
- m_value = v;
- }
+ void setData( QVariant v );
/**
* Destructor.
*
* @return the value as a QString
*/
- QString valueAsString();
+ QString valueAsString() const;
/**
* Every ChemicalDataObject contains one data. For example a
*
* @return the value as a QVariant
*/
- QVariant value() const{
- return m_value;
- }
+ QVariant value() const;
/**
* @return the type of dataset of this object
*/
- BlueObelisk type() const{
- return m_type;
- }
+ BlueObelisk type() const;
/**
* @param type the type of this object
*/
- void setType( BlueObelisk type ){
- m_type = type;
- }
+ void setType( BlueObelisk type );
/**
* @overload
*/
- void setType( int type ){
- m_type = ( BlueObelisk ) type;
- }
+ void setType( int type );
/**
* Compare the value @p v with the data of this object
*/
- bool operator== ( const int v );
+ bool operator== ( const int v ) const;
/**
* Compare the value @p v with the data of this object
*/
- bool operator== ( const double v );
+ bool operator== ( const double v ) const;
/**
* Compare the value @p v with the data of this object
*/
- bool operator== ( const bool v );
+ bool operator== ( const bool v ) const;
/**
* Compare the value @p v with the data of this object
*/
- bool operator== ( const QString& v );
+ bool operator== ( const QString& v ) const;
/**
* @return the dictRef attribute of the XML. This is an
/**
* @return the unit of the object
*/
- BlueObeliskUnit unit() const{
- return m_unit;
- }
+ BlueObeliskUnit unit() const;
/**
* set the unit of this object to @p unit
* @param the BlueObeliskUnit of this object
*/
- void setUnit( BlueObeliskUnit unit ){
- m_unit = unit;
- }
+ void setUnit( BlueObeliskUnit unit );
/**
* @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text