64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
/* generated by rust_qt_binding_generator */
|
|
#include "Bindings.h"
|
|
|
|
namespace {
|
|
|
|
struct qstring_t {
|
|
private:
|
|
const void* data;
|
|
int len;
|
|
public:
|
|
qstring_t(const QString& v):
|
|
data(static_cast<const void*>(v.utf16())),
|
|
len(v.size()) {
|
|
}
|
|
operator QString() const {
|
|
return QString::fromUtf8(static_cast<const char*>(data), len);
|
|
}
|
|
};
|
|
typedef void (*qstring_set)(QString*, qstring_t*);
|
|
void set_qstring(QString* v, qstring_t* val) {
|
|
*v = *val;
|
|
}
|
|
inline void simpleMessageChanged(Simple* o)
|
|
{
|
|
emit o->messageChanged();
|
|
}
|
|
}
|
|
extern "C" {
|
|
Simple::Private* simple_new(Simple*, void (*)(Simple*));
|
|
void simple_free(Simple::Private*);
|
|
void simple_message_get(const Simple::Private*, QString*, qstring_set);
|
|
void simple_message_set(Simple::Private*, qstring_t);
|
|
};
|
|
|
|
Simple::Simple(bool /*owned*/, QObject *parent):
|
|
QObject(parent),
|
|
m_d(0),
|
|
m_ownsPrivate(false)
|
|
{
|
|
}
|
|
|
|
Simple::Simple(QObject *parent):
|
|
QObject(parent),
|
|
m_d(simple_new(this,
|
|
simpleMessageChanged)),
|
|
m_ownsPrivate(true)
|
|
{
|
|
}
|
|
|
|
Simple::~Simple() {
|
|
if (m_ownsPrivate) {
|
|
simple_free(m_d);
|
|
}
|
|
}
|
|
QString Simple::message() const
|
|
{
|
|
QString v;
|
|
simple_message_get(m_d, &v, set_qstring);
|
|
return v;
|
|
}
|
|
void Simple::setMessage(const QString& v) {
|
|
simple_message_set(m_d, v);
|
|
}
|