|
|
@ -14,7 +14,9 @@
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdpch.h"
|
|
|
|
#include "georgesform_model.h"
|
|
|
|
#include "georgesform_model.h"
|
|
|
|
|
|
|
|
#include "formitem.h"
|
|
|
|
|
|
|
|
|
|
|
|
// NeL includes
|
|
|
|
// NeL includes
|
|
|
|
#include <nel/misc/types_nl.h>
|
|
|
|
#include <nel/misc/types_nl.h>
|
|
|
@ -35,9 +37,6 @@
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
|
|
|
|
// project includes
|
|
|
|
|
|
|
|
#include "formitem.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace NLGEORGES;
|
|
|
|
using namespace NLGEORGES;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeorgesQt
|
|
|
|
namespace GeorgesQt
|
|
|
@ -406,7 +405,7 @@ namespace GeorgesQt
|
|
|
|
//uint value_uint;
|
|
|
|
//uint value_uint;
|
|
|
|
//sint value_sint;
|
|
|
|
//sint value_sint;
|
|
|
|
//double value_double;
|
|
|
|
//double value_double;
|
|
|
|
QString elmtType = "";
|
|
|
|
QString elmtType;
|
|
|
|
UFormElm *elmt = 0;
|
|
|
|
UFormElm *elmt = 0;
|
|
|
|
if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true))
|
|
|
|
if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -428,13 +427,23 @@ namespace GeorgesQt
|
|
|
|
switch (type->getType())
|
|
|
|
switch (type->getType())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case UType::UnsignedInt:
|
|
|
|
case UType::UnsignedInt:
|
|
|
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toUtf8();
|
|
|
|
{
|
|
|
|
|
|
|
|
uint v;
|
|
|
|
|
|
|
|
NLMISC::fromString(value, v);
|
|
|
|
|
|
|
|
value = NLMISC::toString(v);
|
|
|
|
elmtType.append("_uint");break;
|
|
|
|
elmtType.append("_uint");break;
|
|
|
|
|
|
|
|
}
|
|
|
|
case UType::SignedInt:
|
|
|
|
case UType::SignedInt:
|
|
|
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toUtf8();
|
|
|
|
{
|
|
|
|
|
|
|
|
sint v;
|
|
|
|
|
|
|
|
NLMISC::fromString(value, v);
|
|
|
|
|
|
|
|
value = NLMISC::toString(v);
|
|
|
|
elmtType.append("_sint");break;
|
|
|
|
elmtType.append("_sint");break;
|
|
|
|
|
|
|
|
}
|
|
|
|
case UType::Double:
|
|
|
|
case UType::Double:
|
|
|
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toUtf8();
|
|
|
|
float v;
|
|
|
|
|
|
|
|
NLMISC::fromString(value, v);
|
|
|
|
|
|
|
|
value = NLMISC::toString(v);
|
|
|
|
elmtType.append("_double");break;
|
|
|
|
elmtType.append("_double");break;
|
|
|
|
case UType::String:
|
|
|
|
case UType::String:
|
|
|
|
elmtType.append("_string");break;
|
|
|
|
elmtType.append("_string");break;
|
|
|
@ -569,7 +578,7 @@ namespace GeorgesQt
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QList<QVariant> columnData;
|
|
|
|
QList<QVariant> columnData;
|
|
|
|
std::string value;
|
|
|
|
std::string value;
|
|
|
|
QString elmtType = "";
|
|
|
|
QString elmtType;
|
|
|
|
|
|
|
|
|
|
|
|
UFormElm *elmt = 0;
|
|
|
|
UFormElm *elmt = 0;
|
|
|
|
if(root->getArrayNode(&elmt,0) && elmt)
|
|
|
|
if(root->getArrayNode(&elmt,0) && elmt)
|
|
|
|