File indexing completed on 2024-06-30 05:51:24
0001 /* 0002 This file is part of the Okteta Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2009, 2010, 2011 Alex Richardson <alex.richardson@gmx.de> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef KASTEN_DOUBLEDATAINFORMATION_HPP 0010 #define KASTEN_DOUBLEDATAINFORMATION_HPP 0011 0012 #include "primitivedatainformation.hpp" 0013 0014 class DoubleDataInformationMethods 0015 { 0016 public: 0017 static QString staticValueString(double value); 0018 static PrimitiveDataType staticType(); 0019 static QScriptValue asScriptValue(double value, QScriptEngine* engine, ScriptHandlerInfo* handler); 0020 static double fromVariant(const QVariant& value, bool* ok); 0021 static QVariant staticToQVariant(double value); 0022 0023 static QWidget* staticCreateEditWidget(QWidget* parent); 0024 static QVariant staticDataFromWidget(const QWidget* w); 0025 static void staticSetWidgetData(double value, QWidget* w); 0026 }; 0027 0028 inline PrimitiveDataType DoubleDataInformationMethods::staticType() 0029 { 0030 return PrimitiveDataType::Double; 0031 } 0032 0033 inline QVariant DoubleDataInformationMethods::staticToQVariant(double value) 0034 { 0035 return QVariant(value); 0036 } 0037 0038 inline double DoubleDataInformationMethods::fromVariant(const QVariant& value, bool* ok) 0039 { 0040 double result = value.toDouble(ok); 0041 return result; 0042 } 0043 0044 #endif /* KASTEN_DOUBLEDATAINFORMATION_HPP */