Bug of insert bool type
My AccountType class:
-------------------
.H
class COOKIEMAIL_DLL_EXPORT AccountType
{
public:
AccountType() : id(0), port(0), ssl(false) {};
virtual ~AccountType() {};
int id;
QString name;
QString host;
int port;
bool ssl;
QString script;
AccountList accountListX;
};
QX_REGISTER_PRIMARY_KEY(AccountType, int)
QX_REGISTER_HPP_COOKIEMAIL(AccountType, qx::trait::no_base_class_defined, 0)
-------------------
.CPP
#include "StdAfx.h"
#include "accounttype.h"
QX_REGISTER_CPP_COOKIEMAIL(AccountType)
namespace qx
{
template <> void register_class(QxClass<AccountType> & t)
{
//t.setName("[AccountType]");
t.id(&AccountType::id, "id");
t.data(&AccountType::name, "name");
t.data(&AccountType::host, "host");
t.data(&AccountType::port, "port");
t.data(&AccountType::ssl, "ssl");
t.data(&AccountType::script, "script");
t.relationOneToMany(&AccountType::accountListX, "AccountList", "type_id");
}
}
-------------------
AccountTypePtr accountTypePtr1(new AccountType());
accountTypePtr1->name = "Yahoo";
accountTypePtr1->host = "pop.mail.yahoo.cn";
accountTypePtr1->port = 995;
accountTypePtr1->ssl = true;
accountTypePtr1->script = "script";
daoError = qx::dao::insert(accountTypePtr1);
When I insert accountTypePtr into Sqlite DB, the ssl is always 0. if I changed it from bool to int type, the ssl is normal 1.
This problem existed both in 1.2.4 and 1.2.3.(MT and MD)
-------------------
.H
class COOKIEMAIL_DLL_EXPORT AccountType
{
public:
AccountType() : id(0), port(0), ssl(false) {};
virtual ~AccountType() {};
int id;
QString name;
QString host;
int port;
bool ssl;
QString script;
AccountList accountListX;
};
QX_REGISTER_PRIMARY_KEY(AccountType, int)
QX_REGISTER_HPP_COOKIEMAIL(AccountType, qx::trait::no_base_class_defined, 0)
-------------------
.CPP
#include "StdAfx.h"
#include "accounttype.h"
QX_REGISTER_CPP_COOKIEMAIL(AccountType)
namespace qx
{
template <> void register_class(QxClass<AccountType> & t)
{
//t.setName("[AccountType]");
t.id(&AccountType::id, "id");
t.data(&AccountType::name, "name");
t.data(&AccountType::host, "host");
t.data(&AccountType::port, "port");
t.data(&AccountType::ssl, "ssl");
t.data(&AccountType::script, "script");
t.relationOneToMany(&AccountType::accountListX, "AccountList", "type_id");
}
}
-------------------
AccountTypePtr accountTypePtr1(new AccountType());
accountTypePtr1->name = "Yahoo";
accountTypePtr1->host = "pop.mail.yahoo.cn";
accountTypePtr1->port = 995;
accountTypePtr1->ssl = true;
accountTypePtr1->script = "script";
daoError = qx::dao::insert(accountTypePtr1);
When I insert accountTypePtr into Sqlite DB, the ssl is always 0. if I changed it from bool to int type, the ssl is normal 1.
This problem existed both in 1.2.4 and 1.2.3.(MT and MD)