Warning, file /sdk/rust-qt-binding-generator/templates/qt_widgets/src/Bindings.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* generated by rust_qt_binding_generator */ 0002 #include "Bindings.h" 0003 0004 namespace { 0005 0006 typedef void (*qstring_set)(QString* val, const char* utf8, int nbytes); 0007 void set_qstring(QString* val, const char* utf8, int nbytes) { 0008 *val = QString::fromUtf8(utf8, nbytes); 0009 } 0010 inline void simpleMessageChanged(Simple* o) 0011 { 0012 Q_EMIT o->messageChanged(); 0013 } 0014 } 0015 extern "C" { 0016 Simple::Private* simple_new(Simple*, void (*)(Simple*)); 0017 void simple_free(Simple::Private*); 0018 void simple_message_get(const Simple::Private*, QString*, qstring_set); 0019 void simple_message_set(Simple::Private*, const ushort *str, int len); 0020 }; 0021 0022 Simple::Simple(bool /*owned*/, QObject *parent): 0023 QObject(parent), 0024 m_d(nullptr), 0025 m_ownsPrivate(false) 0026 { 0027 } 0028 0029 Simple::Simple(QObject *parent): 0030 QObject(parent), 0031 m_d(simple_new(this, 0032 simpleMessageChanged)), 0033 m_ownsPrivate(true) 0034 { 0035 } 0036 0037 Simple::~Simple() { 0038 if (m_ownsPrivate) { 0039 simple_free(m_d); 0040 } 0041 } 0042 QString Simple::message() const 0043 { 0044 QString v; 0045 simple_message_get(m_d, &v, set_qstring); 0046 return v; 0047 } 0048 void Simple::setMessage(const QString& v) { 0049 simple_message_set(m_d, reinterpret_cast<const ushort*>(v.data()), v.size()); 0050 }