mirror of https://github.com/KLayout/klayout.git
WIP: fixed some Qt binding and GSI issues, added tests
This commit is contained in:
parent
e677cc7300
commit
ab97a4722d
|
|
@ -42,6 +42,7 @@ drop_method :all_classes, /\(.*std::initializer_list.*\)/ # no brace initializat
|
|||
drop_method :all_classes, /\(.*std::function.*\)/ # std::function not bindable
|
||||
drop_method :all_classes, /^std::function</ # std::function not bindable as return value
|
||||
drop_method :all_classes, /::bindable/ # no QBindable available
|
||||
drop_method :all_classes, /.*QtPrivate::.*/ # no private stuff
|
||||
|
||||
rename :all_classes, /::create\(/, "qt_create" # clashes with GSI/Ruby
|
||||
rename :all_classes, /::destroy\(/, "qt_destroy" # clashes with GSI/Ruby
|
||||
|
|
@ -117,6 +118,7 @@ drop_class "QCborValueRef" # complex API & there are better alternatives
|
|||
drop_class "QChar"
|
||||
drop_class "QCharRef"
|
||||
drop_class "QConstIterator"
|
||||
drop_class "QConstOverload"
|
||||
drop_class "QConstString"
|
||||
drop_class "QContainerInfo"
|
||||
drop_class "QContiguousCache"
|
||||
|
|
@ -199,6 +201,7 @@ drop_class "QMutableVectorIterator"
|
|||
drop_class "QMutexLocker"
|
||||
drop_class "QNativeInterface"
|
||||
drop_class "QNoImplicitBoolCast"
|
||||
drop_class "QNonConstOverload"
|
||||
drop_class "QObjectBindableProperty"
|
||||
drop_class "QObjectCleanupHandler"
|
||||
drop_class "QObjectComputedProperty"
|
||||
|
|
@ -208,6 +211,7 @@ drop_class "QObjectUserData"
|
|||
drop_class "QOverload"
|
||||
drop_class "QPair"
|
||||
drop_class "QPointer"
|
||||
drop_class "QPromise"
|
||||
drop_class "QProperty"
|
||||
drop_class "QPropertyAlias"
|
||||
drop_class "QPropertyBinding"
|
||||
|
|
@ -216,6 +220,7 @@ drop_class "QPropertyChangeHandler"
|
|||
drop_class "QPropertyData"
|
||||
drop_class "QQueue"
|
||||
drop_class "QReturnArgument"
|
||||
drop_class "QRgbaFloat"
|
||||
drop_class "QScopedArrayPointer"
|
||||
drop_class "QScopedPointer"
|
||||
drop_class "QScopedPointerArrayDeleter"
|
||||
|
|
@ -309,6 +314,8 @@ drop_class "QWeakPointer"
|
|||
|
||||
drop_enum_const "QEvent", /CocoaRequestModal/ # not available on WIN
|
||||
|
||||
drop_method "QMetaType", /QMetaType::staticMetaObject/ # not available
|
||||
drop_method "QMetaType", /QMetaType::register.*Function\(/ # std::function not available
|
||||
drop_method "QDeadlineTimer", /QDeadlineTimer::_q_data/ # internal (@@@ TODO: QDealineTimer is present twice?)
|
||||
drop_method "QObject", /QObject::bindingStorage/ # no QBindingStorage
|
||||
drop_method "QPluginLoader", /QPluginLoader::staticPlugins/ # no QStaticPlugin
|
||||
|
|
@ -487,9 +494,6 @@ drop_method "QGuiApplication", /QGuiApplication::notify/
|
|||
# alternative implementation for QObject::findChild
|
||||
add_native_impl_QObject_findChild
|
||||
|
||||
# alternative implementation for QFont::Light, QFont::Bold, QFont::Normal, QFont::DemiBold, QFont::Black
|
||||
add_native_impl_QFont
|
||||
|
||||
# alternative implementation for QRegion::setRects
|
||||
add_native_impl_QRegion
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ grammar CPP
|
|||
end
|
||||
|
||||
rule class_struct_body_declarations
|
||||
( s ";" / s friend_decl / s using / s typedef / s !( "public" / "private" / "protected" ) member_declaration )*
|
||||
( s ";" / s static_assert / s friend_decl / s using / s typedef / s !( "public" / "private" / "protected" ) member_declaration )*
|
||||
end
|
||||
|
||||
rule class_struct_body
|
||||
|
|
@ -230,8 +230,8 @@ grammar CPP
|
|||
rule class_id
|
||||
# In order to easily distinguish between constructor methods without
|
||||
# a return type and class or typedef names we assume that all "name("
|
||||
# constructs are considered constructor names but "name (*func_ptr) ()" is not.
|
||||
qualified_id s ( "..." s )? !( "(" !( s "*" ) )
|
||||
# constructs are considered constructor names but "name (*func_ptr) ()" or "name (class::*method_ptr) ()" is not.
|
||||
qualified_id s ( "..." s )? !( "(" !( s "*" / s qualified_id s "::*" ) )
|
||||
end
|
||||
|
||||
rule typeof
|
||||
|
|
|
|||
|
|
@ -1927,6 +1927,7 @@ END
|
|||
native_impl = conf.native_impl(cls)
|
||||
|
||||
has_metaobject = ((struct.body_decl || []).find { |bd| bd.is_a?(CPPDeclaration) && bd.type.name == "metaObject" } != nil)
|
||||
has_metaobject = has_metaobject && !conf.is_dropped?(cls, cls + "::staticMetaObject")
|
||||
|
||||
mdecl = []
|
||||
mdecl_ctors = []
|
||||
|
|
|
|||
|
|
@ -549,9 +549,12 @@ private:
|
|||
{
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **)mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
tl_assert (p.get () != 0);
|
||||
|
||||
tl_assert (p != 0);
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
X x = X ();
|
||||
copy_to<X> (*p, x, heap);
|
||||
|
|
@ -565,9 +568,12 @@ private:
|
|||
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **)mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
tl_assert (p.get () != 0);
|
||||
|
||||
tl_assert (p != 0);
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
x_type *x = new x_type ();
|
||||
heap.push (x);
|
||||
|
|
@ -601,14 +607,19 @@ private:
|
|||
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **) mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
|
||||
x_type *x = 0;
|
||||
if (p.get () != 0) {
|
||||
if (p != 0) {
|
||||
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
x = new x_type ();
|
||||
heap.push (x);
|
||||
copy_to<x_type> (*p, *x, heap);
|
||||
|
||||
}
|
||||
|
||||
return x;
|
||||
|
|
@ -1024,17 +1035,8 @@ public:
|
|||
virtual void set (const char *c_str, size_t s, tl::Heap &)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
*mp_s = QLatin1String (QString::fromUtf8 (c_str, int (s)).toLatin1 ());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
StringAdaptorImpl<QLatin1String> *s = dynamic_cast<StringAdaptorImpl<QLatin1String> *>(target);
|
||||
if (s) {
|
||||
*s->mp_s = *mp_s;
|
||||
} else {
|
||||
StringAdaptor::copy_to (target, heap);
|
||||
m_latin1_holder = QString::fromUtf8 (c_str, int (s)).toLatin1 ();
|
||||
*mp_s = QLatin1String (m_latin1_holder.constData (), m_latin1_holder.size ());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1042,6 +1044,7 @@ private:
|
|||
QLatin1String *mp_s;
|
||||
bool m_is_const;
|
||||
QLatin1String m_s;
|
||||
QByteArray m_latin1_holder;
|
||||
mutable QByteArray m_s_utf8;
|
||||
};
|
||||
|
||||
|
|
@ -1835,7 +1838,7 @@ public:
|
|||
|
||||
virtual tl::Variant var () const
|
||||
{
|
||||
return tl::Variant (mp_v->value ());
|
||||
return *mp_v ? tl::Variant (mp_v->value ()) : tl::Variant ();
|
||||
}
|
||||
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/)
|
||||
|
|
|
|||
|
|
@ -1350,10 +1350,10 @@ private:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
|
||||
ArgSpec ()
|
||||
: Base ()
|
||||
|
|
@ -1387,10 +1387,10 @@ public:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec<const T &>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
|
||||
ArgSpec ()
|
||||
: Base ()
|
||||
|
|
@ -1424,10 +1424,10 @@ public:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec<T &>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
typedef T &init_type;
|
||||
|
||||
ArgSpec ()
|
||||
|
|
@ -1454,7 +1454,7 @@ public:
|
|||
T &init () const
|
||||
{
|
||||
// this simplifies the implementation, but it's not really clean since the caller may modify the default.
|
||||
return const_cast<T &> (ArgSpecImpl<T, std::is_copy_constructible<T>::value>::init ());
|
||||
return const_cast<T &> (Base::init ());
|
||||
}
|
||||
|
||||
virtual ArgSpecBase *clone () const
|
||||
|
|
|
|||
|
|
@ -220,6 +220,42 @@ A::ia_cref_to_qs_ref (const std::vector<int> &ia)
|
|||
return s;
|
||||
}
|
||||
|
||||
std::vector<int>
|
||||
A::ql1s_cref_to_ia (const QLatin1String &ql1s)
|
||||
{
|
||||
const char *cp = ql1s.data ();
|
||||
size_t n = ql1s.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back (*cp++);
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QLatin1String
|
||||
A::ia_cref_to_ql1s (const std::vector<int> &ia)
|
||||
{
|
||||
static std::string str;
|
||||
str.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
str += char (*i);
|
||||
}
|
||||
return QLatin1String (str.c_str (), str.size ());
|
||||
}
|
||||
|
||||
QLatin1String &
|
||||
A::ia_cref_to_ql1s_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static std::string str;
|
||||
str.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
str += char (*i);
|
||||
}
|
||||
static QLatin1String s;
|
||||
s = QLatin1String (str.c_str (), str.size ());
|
||||
return s;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
std::vector<int>
|
||||
|
|
@ -238,6 +274,7 @@ QStringView
|
|||
A::ia_cref_to_qsv (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
|
|
@ -1016,6 +1053,17 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
gsi::method ("ia_cref_to_qs_cptr", &A::ia_cref_to_qs_cptr) +
|
||||
gsi::method ("ia_cref_to_qs_ptr", &A::ia_cref_to_qs_ptr) +
|
||||
|
||||
gsi::method ("ql1s_cref_to_ia", &A::ql1s_cref_to_ia) +
|
||||
gsi::method ("ql1s_ref_to_ia", &A::ql1s_ref_to_ia) +
|
||||
gsi::method ("ql1s_cptr_to_ia", &A::ql1s_cptr_to_ia) +
|
||||
gsi::method ("ql1s_ptr_to_ia", &A::ql1s_ptr_to_ia) +
|
||||
gsi::method ("ql1s_to_ia", &A::ql1s_to_ia) +
|
||||
gsi::method ("ia_cref_to_ql1s", &A::ia_cref_to_ql1s) +
|
||||
gsi::method ("ia_cref_to_ql1s_cref", &A::ia_cref_to_ql1s_cref) +
|
||||
gsi::method ("ia_cref_to_ql1s_ref", &A::ia_cref_to_ql1s_ref) +
|
||||
gsi::method ("ia_cref_to_ql1s_cptr", &A::ia_cref_to_ql1s_cptr) +
|
||||
gsi::method ("ia_cref_to_ql1s_ptr", &A::ia_cref_to_ql1s_ptr) +
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
gsi::method ("qbav_cref_to_ia", &A::qbav_cref_to_ia) +
|
||||
|
|
@ -1180,6 +1228,18 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
static gsi::Class<A_NC> decl_a_nc (decl_a, "", "A_NC");
|
||||
|
||||
static gsi::Class<B> decl_b ("", "B",
|
||||
gsi::method ("int_to_optional", &B::int_to_optional) +
|
||||
gsi::method ("int_to_optional_a", &B::int_to_optional_a) +
|
||||
gsi::method ("optional_to_int", &B::optional_to_int) +
|
||||
gsi::method ("optional_cref_to_int", &B::optional_cref_to_int) +
|
||||
gsi::method ("optional_ref_to_int", &B::optional_ref_to_int) +
|
||||
gsi::method ("optional_cptr_to_int", &B::optional_cptr_to_int) +
|
||||
gsi::method ("optional_ptr_to_int", &B::optional_ptr_to_int) +
|
||||
gsi::method ("optional_a_to_int", &B::optional_a_to_int) +
|
||||
gsi::method ("optional_a_cref_to_int", &B::optional_a_cref_to_int) +
|
||||
gsi::method ("optional_a_ref_to_int", &B::optional_a_ref_to_int) +
|
||||
gsi::method ("optional_a_cptr_to_int", &B::optional_a_cptr_to_int) +
|
||||
gsi::method ("optional_a_ptr_to_int", &B::optional_a_ptr_to_int) +
|
||||
gsi::method ("inst", &B::inst) +
|
||||
gsi::method ("has_inst", &B::has_inst) +
|
||||
gsi::method ("set_inst", &B::set_inst) +
|
||||
|
|
|
|||
|
|
@ -131,6 +131,15 @@ struct A
|
|||
static std::vector<int> qs_ptr_to_ia (QString *qs) { return qs_cref_to_ia (*qs); }
|
||||
static std::vector<int> qs_to_ia (QString qs) { return qs_cref_to_ia (qs); }
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QLatin1String
|
||||
*/
|
||||
static std::vector<int> ql1s_cref_to_ia (const QLatin1String &qs);
|
||||
static std::vector<int> ql1s_ref_to_ia (QLatin1String &qs) { return ql1s_cref_to_ia (qs); }
|
||||
static std::vector<int> ql1s_cptr_to_ia (const QLatin1String *qs) { return ql1s_cref_to_ia (*qs); }
|
||||
static std::vector<int> ql1s_ptr_to_ia (QLatin1String *qs) { return ql1s_cref_to_ia (*qs); }
|
||||
static std::vector<int> ql1s_to_ia (QLatin1String qs) { return ql1s_cref_to_ia (qs); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
|
|
@ -175,6 +184,15 @@ struct A
|
|||
static const QString *ia_cref_to_qs_cptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
static QString *ia_cref_to_qs_ptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QString
|
||||
*/
|
||||
static QLatin1String ia_cref_to_ql1s (const std::vector<int> &ia);
|
||||
static QLatin1String &ia_cref_to_ql1s_ref (const std::vector<int> &ia);
|
||||
static const QLatin1String &ia_cref_to_ql1s_cref (const std::vector<int> &ia) { return ia_cref_to_ql1s_ref (ia); }
|
||||
static const QLatin1String *ia_cref_to_ql1s_cptr (const std::vector<int> &ia) { return &ia_cref_to_ql1s_ref (ia); }
|
||||
static QLatin1String *ia_cref_to_ql1s_ptr (const std::vector<int> &ia) { return &ia_cref_to_ql1s_ref (ia); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
|
|
@ -573,6 +591,26 @@ struct B
|
|||
*/
|
||||
static tl::Variant new_b_by_variant ();
|
||||
|
||||
/**
|
||||
* @brief std::optional for simple and complex types
|
||||
*/
|
||||
|
||||
static std::optional<int> int_to_optional (int value, bool exists) { return exists ? std::optional<int> (value) : std::optional<int> (); }
|
||||
static std::optional<A> int_to_optional_a (int value, bool exists) { return exists ? std::optional<A> (A (value)) : std::optional<A> (); }
|
||||
|
||||
static int optional_to_int (std::optional<int> optional, int def) { return optional ? optional.value () : def; }
|
||||
static int optional_cref_to_int (const std::optional<int> &optional, int def) { return optional_to_int (optional, def); }
|
||||
static int optional_ref_to_int (std::optional<int> &optional, int def) { return optional_to_int (optional, def); }
|
||||
static int optional_cptr_to_int (const std::optional<int> *optional, int def) { return optional_to_int (*optional, def); }
|
||||
static int optional_ptr_to_int (std::optional<int> optional, int def) { return optional_to_int (*optional, def); }
|
||||
|
||||
static int optional_a_to_int (std::optional<A> optional, int def) { return optional ? optional.value ().a1 () : def; }
|
||||
static int optional_a_cref_to_int (const std::optional<A> &optional, int def) { return optional_a_to_int (optional, def); }
|
||||
static int optional_a_ref_to_int (std::optional<A> &optional, int def) { return optional_a_to_int (optional, def); }
|
||||
static int optional_a_cptr_to_int (const std::optional<A> *optional, int def) { return optional_a_to_int (*optional, def); }
|
||||
static int optional_a_ptr_to_int (std::optional<A> optional, int def) { return optional_a_to_int (*optional, def); }
|
||||
|
||||
|
||||
std::string addr () const;
|
||||
|
||||
int always_5 () const {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ SOURCES += \
|
|||
$$PWD/gsiDeclQMetaObject_Connection.cc \
|
||||
$$PWD/gsiDeclQMetaProperty.cc \
|
||||
$$PWD/gsiDeclQMetaSequence.cc \
|
||||
$$PWD/gsiDeclQMetaType.cc \
|
||||
$$PWD/gsiDeclQMethodRawArguments.cc \
|
||||
$$PWD/gsiDeclQMimeData.cc \
|
||||
$$PWD/gsiDeclQMimeDatabase.cc \
|
||||
|
|
@ -178,6 +179,7 @@ SOURCES += \
|
|||
$$PWD/gsiDeclQUrl.cc \
|
||||
$$PWD/gsiDeclQUrlQuery.cc \
|
||||
$$PWD/gsiDeclQVariantAnimation.cc \
|
||||
$$PWD/gsiDeclQVersionNumber.cc \
|
||||
$$PWD/gsiDeclQWaitCondition.cc \
|
||||
$$PWD/gsiDeclQWriteLocker.cc \
|
||||
$$PWD/gsiDeclQXmlStreamAttribute.cc \
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,346 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file gsiDeclQPromise.cc
|
||||
*
|
||||
* DO NOT EDIT THIS FILE.
|
||||
* This file has been created automatically
|
||||
*/
|
||||
|
||||
#include <QPromise>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// class QPromise
|
||||
|
||||
// Constructor QPromise::QPromise()
|
||||
|
||||
|
||||
static void _init_ctor_QPromise_0 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
decl->set_return_new<QPromise> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QPromise_0 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QPromise *> (new QPromise ());
|
||||
}
|
||||
|
||||
|
||||
// Constructor QPromise::QPromise(const QPromise &)
|
||||
|
||||
|
||||
static void _init_ctor_QPromise_2129 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("arg1");
|
||||
decl->add_arg<const QPromise & > (argspec_0);
|
||||
decl->set_return_new<QPromise> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QPromise_2129 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QPromise &arg1 = gsi::arg_reader<const QPromise & >() (args, heap);
|
||||
ret.write<QPromise *> (new QPromise (arg1));
|
||||
}
|
||||
|
||||
|
||||
// Constructor QPromise::QPromise(const QFutureInterface<T> &other)
|
||||
|
||||
|
||||
static void _init_ctor_QPromise_3148 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("other");
|
||||
decl->add_arg<const QFutureInterface<T> & > (argspec_0);
|
||||
decl->set_return_new<QPromise> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QPromise_3148 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QFutureInterface<T> &arg1 = gsi::arg_reader<const QFutureInterface<T> & >() (args, heap);
|
||||
ret.write<QPromise *> (new QPromise (arg1));
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::finish()
|
||||
|
||||
|
||||
static void _init_f_finish_0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_finish_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->finish ();
|
||||
}
|
||||
|
||||
|
||||
// QFuture<T> QPromise::future()
|
||||
|
||||
|
||||
static void _init_f_future_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<QFuture<T> > ();
|
||||
}
|
||||
|
||||
static void _call_f_future_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QFuture<T> > ((QFuture<T>)((QPromise *)cls)->future ());
|
||||
}
|
||||
|
||||
|
||||
// bool QPromise::isCanceled()
|
||||
|
||||
|
||||
static void _init_f_isCanceled_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<bool > ();
|
||||
}
|
||||
|
||||
static void _call_f_isCanceled_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<bool > ((bool)((QPromise *)cls)->isCanceled ());
|
||||
}
|
||||
|
||||
|
||||
// QPromise &QPromise::operator=(const QPromise &)
|
||||
|
||||
|
||||
static void _init_f_operator_eq__2129 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("arg1");
|
||||
decl->add_arg<const QPromise & > (argspec_0);
|
||||
decl->set_return<QPromise & > ();
|
||||
}
|
||||
|
||||
static void _call_f_operator_eq__2129 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QPromise &arg1 = gsi::arg_reader<const QPromise & >() (args, heap);
|
||||
ret.write<QPromise & > ((QPromise &)((QPromise *)cls)->operator= (arg1));
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::setException(const QException &e)
|
||||
|
||||
|
||||
static void _init_f_setException_2337 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("e");
|
||||
decl->add_arg<const QException & > (argspec_0);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_setException_2337 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QException &arg1 = gsi::arg_reader<const QException & >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->setException (arg1);
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::setException(std::exception_ptr e)
|
||||
|
||||
|
||||
static void _init_f_setException_2295 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("e");
|
||||
decl->add_arg<std::exception_ptr > (argspec_0);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_setException_2295 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
std::exception_ptr arg1 = gsi::arg_reader<std::exception_ptr >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->setException (arg1);
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::setProgressRange(int minimum, int maximum)
|
||||
|
||||
|
||||
static void _init_f_setProgressRange_1426 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("minimum");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("maximum");
|
||||
decl->add_arg<int > (argspec_1);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_setProgressRange_1426 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
int arg2 = gsi::arg_reader<int >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->setProgressRange (arg1, arg2);
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::setProgressValue(int progressValue)
|
||||
|
||||
|
||||
static void _init_f_setProgressValue_767 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("progressValue");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_setProgressValue_767 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->setProgressValue (arg1);
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::setProgressValueAndText(int progressValue, const QString &progressText)
|
||||
|
||||
|
||||
static void _init_f_setProgressValueAndText_2684 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("progressValue");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("progressText");
|
||||
decl->add_arg<const QString & > (argspec_1);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_setProgressValueAndText_2684 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
const QString &arg2 = gsi::arg_reader<const QString & >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->setProgressValueAndText (arg1, arg2);
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::start()
|
||||
|
||||
|
||||
static void _init_f_start_0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_start_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->start ();
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::suspendIfRequested()
|
||||
|
||||
|
||||
static void _init_f_suspendIfRequested_0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_suspendIfRequested_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->suspendIfRequested ();
|
||||
}
|
||||
|
||||
|
||||
// void QPromise::swap(QPromise<T> &other)
|
||||
|
||||
|
||||
static void _init_f_swap_1640 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("other");
|
||||
decl->add_arg<QPromise<T> & > (argspec_0);
|
||||
decl->set_return<void > ();
|
||||
}
|
||||
|
||||
static void _call_f_swap_1640 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
QPromise<T> &arg1 = gsi::arg_reader<QPromise<T> & >() (args, heap);
|
||||
__SUPPRESS_UNUSED_WARNING(ret);
|
||||
((QPromise *)cls)->swap (arg1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace gsi
|
||||
{
|
||||
|
||||
static gsi::Methods methods_QPromise () {
|
||||
gsi::Methods methods;
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QPromise::QPromise()\nThis method creates an object of class QPromise.", &_init_ctor_QPromise_0, &_call_ctor_QPromise_0);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QPromise::QPromise(const QPromise &)\nThis method creates an object of class QPromise.", &_init_ctor_QPromise_2129, &_call_ctor_QPromise_2129);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QPromise::QPromise(const QFutureInterface<T> &other)\nThis method creates an object of class QPromise.", &_init_ctor_QPromise_3148, &_call_ctor_QPromise_3148);
|
||||
methods += new qt_gsi::GenericMethod ("finish", "@brief Method void QPromise::finish()\n", false, &_init_f_finish_0, &_call_f_finish_0);
|
||||
methods += new qt_gsi::GenericMethod ("future", "@brief Method QFuture<T> QPromise::future()\n", true, &_init_f_future_c0, &_call_f_future_c0);
|
||||
methods += new qt_gsi::GenericMethod ("isCanceled?", "@brief Method bool QPromise::isCanceled()\n", true, &_init_f_isCanceled_c0, &_call_f_isCanceled_c0);
|
||||
methods += new qt_gsi::GenericMethod ("assign", "@brief Method QPromise &QPromise::operator=(const QPromise &)\n", false, &_init_f_operator_eq__2129, &_call_f_operator_eq__2129);
|
||||
methods += new qt_gsi::GenericMethod ("setException", "@brief Method void QPromise::setException(const QException &e)\n", false, &_init_f_setException_2337, &_call_f_setException_2337);
|
||||
methods += new qt_gsi::GenericMethod ("setException", "@brief Method void QPromise::setException(std::exception_ptr e)\n", false, &_init_f_setException_2295, &_call_f_setException_2295);
|
||||
methods += new qt_gsi::GenericMethod ("setProgressRange", "@brief Method void QPromise::setProgressRange(int minimum, int maximum)\n", false, &_init_f_setProgressRange_1426, &_call_f_setProgressRange_1426);
|
||||
methods += new qt_gsi::GenericMethod ("setProgressValue", "@brief Method void QPromise::setProgressValue(int progressValue)\n", false, &_init_f_setProgressValue_767, &_call_f_setProgressValue_767);
|
||||
methods += new qt_gsi::GenericMethod ("setProgressValueAndText", "@brief Method void QPromise::setProgressValueAndText(int progressValue, const QString &progressText)\n", false, &_init_f_setProgressValueAndText_2684, &_call_f_setProgressValueAndText_2684);
|
||||
methods += new qt_gsi::GenericMethod ("start", "@brief Method void QPromise::start()\n", false, &_init_f_start_0, &_call_f_start_0);
|
||||
methods += new qt_gsi::GenericMethod ("suspendIfRequested", "@brief Method void QPromise::suspendIfRequested()\n", false, &_init_f_suspendIfRequested_0, &_call_f_suspendIfRequested_0);
|
||||
methods += new qt_gsi::GenericMethod ("swap", "@brief Method void QPromise::swap(QPromise<T> &other)\n", false, &_init_f_swap_1640, &_call_f_swap_1640);
|
||||
return methods;
|
||||
}
|
||||
|
||||
gsi::Class<QPromise> decl_QPromise ("QtCore", "QPromise",
|
||||
methods_QPromise (),
|
||||
"@qt\n@brief Binding of QPromise");
|
||||
|
||||
|
||||
GSI_QTCORE_PUBLIC gsi::Class<QPromise> &qtdecl_QPromise () { return decl_QPromise; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,459 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file gsiDeclQVersionNumber.cc
|
||||
*
|
||||
* DO NOT EDIT THIS FILE.
|
||||
* This file has been created automatically
|
||||
*/
|
||||
|
||||
#include <QVersionNumber>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// class QVersionNumber
|
||||
|
||||
// Constructor QVersionNumber::QVersionNumber()
|
||||
|
||||
|
||||
static void _init_ctor_QVersionNumber_0 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
decl->set_return_new<QVersionNumber> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QVersionNumber_0 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QVersionNumber *> (new QVersionNumber ());
|
||||
}
|
||||
|
||||
|
||||
// Constructor QVersionNumber::QVersionNumber(const QList<int> &seg)
|
||||
|
||||
|
||||
static void _init_ctor_QVersionNumber_2259 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("seg");
|
||||
decl->add_arg<const QList<int> & > (argspec_0);
|
||||
decl->set_return_new<QVersionNumber> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QVersionNumber_2259 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QList<int> &arg1 = gsi::arg_reader<const QList<int> & >() (args, heap);
|
||||
ret.write<QVersionNumber *> (new QVersionNumber (arg1));
|
||||
}
|
||||
|
||||
|
||||
// Constructor QVersionNumber::QVersionNumber(int maj)
|
||||
|
||||
|
||||
static void _init_ctor_QVersionNumber_767 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("maj");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
decl->set_return_new<QVersionNumber> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QVersionNumber_767 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
ret.write<QVersionNumber *> (new QVersionNumber (arg1));
|
||||
}
|
||||
|
||||
|
||||
// Constructor QVersionNumber::QVersionNumber(int maj, int min)
|
||||
|
||||
|
||||
static void _init_ctor_QVersionNumber_1426 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("maj");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("min");
|
||||
decl->add_arg<int > (argspec_1);
|
||||
decl->set_return_new<QVersionNumber> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QVersionNumber_1426 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
int arg2 = gsi::arg_reader<int >() (args, heap);
|
||||
ret.write<QVersionNumber *> (new QVersionNumber (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
// Constructor QVersionNumber::QVersionNumber(int maj, int min, int mic)
|
||||
|
||||
|
||||
static void _init_ctor_QVersionNumber_2085 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("maj");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("min");
|
||||
decl->add_arg<int > (argspec_1);
|
||||
static gsi::ArgSpecBase argspec_2 ("mic");
|
||||
decl->add_arg<int > (argspec_2);
|
||||
decl->set_return_new<QVersionNumber> ();
|
||||
}
|
||||
|
||||
static void _call_ctor_QVersionNumber_2085 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
int arg2 = gsi::arg_reader<int >() (args, heap);
|
||||
int arg3 = gsi::arg_reader<int >() (args, heap);
|
||||
ret.write<QVersionNumber *> (new QVersionNumber (arg1, arg2, arg3));
|
||||
}
|
||||
|
||||
|
||||
// bool QVersionNumber::isNormalized()
|
||||
|
||||
|
||||
static void _init_f_isNormalized_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<bool > ();
|
||||
}
|
||||
|
||||
static void _call_f_isNormalized_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<bool > ((bool)((QVersionNumber *)cls)->isNormalized ());
|
||||
}
|
||||
|
||||
|
||||
// bool QVersionNumber::isNull()
|
||||
|
||||
|
||||
static void _init_f_isNull_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<bool > ();
|
||||
}
|
||||
|
||||
static void _call_f_isNull_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<bool > ((bool)((QVersionNumber *)cls)->isNull ());
|
||||
}
|
||||
|
||||
|
||||
// bool QVersionNumber::isPrefixOf(const QVersionNumber &other)
|
||||
|
||||
|
||||
static void _init_f_isPrefixOf_c2753 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("other");
|
||||
decl->add_arg<const QVersionNumber & > (argspec_0);
|
||||
decl->set_return<bool > ();
|
||||
}
|
||||
|
||||
static void _call_f_isPrefixOf_c2753 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QVersionNumber &arg1 = gsi::arg_reader<const QVersionNumber & >() (args, heap);
|
||||
ret.write<bool > ((bool)((QVersionNumber *)cls)->isPrefixOf (arg1));
|
||||
}
|
||||
|
||||
|
||||
// int QVersionNumber::majorVersion()
|
||||
|
||||
|
||||
static void _init_f_majorVersion_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_majorVersion_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<int > ((int)((QVersionNumber *)cls)->majorVersion ());
|
||||
}
|
||||
|
||||
|
||||
// int QVersionNumber::microVersion()
|
||||
|
||||
|
||||
static void _init_f_microVersion_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_microVersion_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<int > ((int)((QVersionNumber *)cls)->microVersion ());
|
||||
}
|
||||
|
||||
|
||||
// int QVersionNumber::minorVersion()
|
||||
|
||||
|
||||
static void _init_f_minorVersion_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_minorVersion_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<int > ((int)((QVersionNumber *)cls)->minorVersion ());
|
||||
}
|
||||
|
||||
|
||||
// QVersionNumber QVersionNumber::normalized()
|
||||
|
||||
|
||||
static void _init_f_normalized_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<QVersionNumber > ();
|
||||
}
|
||||
|
||||
static void _call_f_normalized_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QVersionNumber > ((QVersionNumber)((QVersionNumber *)cls)->normalized ());
|
||||
}
|
||||
|
||||
|
||||
// int QVersionNumber::segmentAt(int index)
|
||||
|
||||
|
||||
static void _init_f_segmentAt_c767 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("index");
|
||||
decl->add_arg<int > (argspec_0);
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_segmentAt_c767 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
int arg1 = gsi::arg_reader<int >() (args, heap);
|
||||
ret.write<int > ((int)((QVersionNumber *)cls)->segmentAt (arg1));
|
||||
}
|
||||
|
||||
|
||||
// int QVersionNumber::segmentCount()
|
||||
|
||||
|
||||
static void _init_f_segmentCount_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_segmentCount_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<int > ((int)((QVersionNumber *)cls)->segmentCount ());
|
||||
}
|
||||
|
||||
|
||||
// QList<int> QVersionNumber::segments()
|
||||
|
||||
|
||||
static void _init_f_segments_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<QList<int> > ();
|
||||
}
|
||||
|
||||
static void _call_f_segments_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QList<int> > ((QList<int>)((QVersionNumber *)cls)->segments ());
|
||||
}
|
||||
|
||||
|
||||
// QString QVersionNumber::toString()
|
||||
|
||||
|
||||
static void _init_f_toString_c0 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
decl->set_return<QString > ();
|
||||
}
|
||||
|
||||
static void _call_f_toString_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
ret.write<QString > ((QString)((QVersionNumber *)cls)->toString ());
|
||||
}
|
||||
|
||||
|
||||
// static QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2)
|
||||
|
||||
|
||||
static void _init_f_commonPrefix_5398 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("v1");
|
||||
decl->add_arg<const QVersionNumber & > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("v2");
|
||||
decl->add_arg<const QVersionNumber & > (argspec_1);
|
||||
decl->set_return<QVersionNumber > ();
|
||||
}
|
||||
|
||||
static void _call_f_commonPrefix_5398 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QVersionNumber &arg1 = gsi::arg_reader<const QVersionNumber & >() (args, heap);
|
||||
const QVersionNumber &arg2 = gsi::arg_reader<const QVersionNumber & >() (args, heap);
|
||||
ret.write<QVersionNumber > ((QVersionNumber)QVersionNumber::commonPrefix (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
// static int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2)
|
||||
|
||||
|
||||
static void _init_f_compare_5398 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("v1");
|
||||
decl->add_arg<const QVersionNumber & > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("v2");
|
||||
decl->add_arg<const QVersionNumber & > (argspec_1);
|
||||
decl->set_return<int > ();
|
||||
}
|
||||
|
||||
static void _call_f_compare_5398 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QVersionNumber &arg1 = gsi::arg_reader<const QVersionNumber & >() (args, heap);
|
||||
const QVersionNumber &arg2 = gsi::arg_reader<const QVersionNumber & >() (args, heap);
|
||||
ret.write<int > ((int)QVersionNumber::compare (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
// static QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixIndex)
|
||||
|
||||
|
||||
static void _init_f_fromString_2870 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("string");
|
||||
decl->add_arg<const QString & > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("suffixIndex", true, "nullptr");
|
||||
decl->add_arg<int * > (argspec_1);
|
||||
decl->set_return<QVersionNumber > ();
|
||||
}
|
||||
|
||||
static void _call_f_fromString_2870 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
const QString &arg1 = gsi::arg_reader<const QString & >() (args, heap);
|
||||
int *arg2 = args ? gsi::arg_reader<int * >() (args, heap) : gsi::arg_maker<int * >() (nullptr, heap);
|
||||
ret.write<QVersionNumber > ((QVersionNumber)QVersionNumber::fromString (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
// static QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex)
|
||||
|
||||
|
||||
static void _init_f_fromString_2546 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("string");
|
||||
decl->add_arg<QLatin1String > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("suffixIndex", true, "nullptr");
|
||||
decl->add_arg<int * > (argspec_1);
|
||||
decl->set_return<QVersionNumber > ();
|
||||
}
|
||||
|
||||
static void _call_f_fromString_2546 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
QLatin1String arg1 = gsi::arg_reader<QLatin1String >() (args, heap);
|
||||
int *arg2 = args ? gsi::arg_reader<int * >() (args, heap) : gsi::arg_maker<int * >() (nullptr, heap);
|
||||
ret.write<QVersionNumber > ((QVersionNumber)QVersionNumber::fromString (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
// static QVersionNumber QVersionNumber::fromString(QStringView string, int *suffixIndex)
|
||||
|
||||
|
||||
static void _init_f_fromString_2404 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("string");
|
||||
decl->add_arg<QStringView > (argspec_0);
|
||||
static gsi::ArgSpecBase argspec_1 ("suffixIndex", true, "nullptr");
|
||||
decl->add_arg<int * > (argspec_1);
|
||||
decl->set_return<QVersionNumber > ();
|
||||
}
|
||||
|
||||
static void _call_f_fromString_2404 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
QStringView arg1 = gsi::arg_reader<QStringView >() (args, heap);
|
||||
int *arg2 = args ? gsi::arg_reader<int * >() (args, heap) : gsi::arg_maker<int * >() (nullptr, heap);
|
||||
ret.write<QVersionNumber > ((QVersionNumber)QVersionNumber::fromString (arg1, arg2));
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace gsi
|
||||
{
|
||||
|
||||
static gsi::Methods methods_QVersionNumber () {
|
||||
gsi::Methods methods;
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QVersionNumber::QVersionNumber()\nThis method creates an object of class QVersionNumber.", &_init_ctor_QVersionNumber_0, &_call_ctor_QVersionNumber_0);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QVersionNumber::QVersionNumber(const QList<int> &seg)\nThis method creates an object of class QVersionNumber.", &_init_ctor_QVersionNumber_2259, &_call_ctor_QVersionNumber_2259);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QVersionNumber::QVersionNumber(int maj)\nThis method creates an object of class QVersionNumber.", &_init_ctor_QVersionNumber_767, &_call_ctor_QVersionNumber_767);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QVersionNumber::QVersionNumber(int maj, int min)\nThis method creates an object of class QVersionNumber.", &_init_ctor_QVersionNumber_1426, &_call_ctor_QVersionNumber_1426);
|
||||
methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QVersionNumber::QVersionNumber(int maj, int min, int mic)\nThis method creates an object of class QVersionNumber.", &_init_ctor_QVersionNumber_2085, &_call_ctor_QVersionNumber_2085);
|
||||
methods += new qt_gsi::GenericMethod ("isNormalized?", "@brief Method bool QVersionNumber::isNormalized()\n", true, &_init_f_isNormalized_c0, &_call_f_isNormalized_c0);
|
||||
methods += new qt_gsi::GenericMethod ("isNull?", "@brief Method bool QVersionNumber::isNull()\n", true, &_init_f_isNull_c0, &_call_f_isNull_c0);
|
||||
methods += new qt_gsi::GenericMethod ("isPrefixOf?", "@brief Method bool QVersionNumber::isPrefixOf(const QVersionNumber &other)\n", true, &_init_f_isPrefixOf_c2753, &_call_f_isPrefixOf_c2753);
|
||||
methods += new qt_gsi::GenericMethod ("majorVersion", "@brief Method int QVersionNumber::majorVersion()\n", true, &_init_f_majorVersion_c0, &_call_f_majorVersion_c0);
|
||||
methods += new qt_gsi::GenericMethod ("microVersion", "@brief Method int QVersionNumber::microVersion()\n", true, &_init_f_microVersion_c0, &_call_f_microVersion_c0);
|
||||
methods += new qt_gsi::GenericMethod ("minorVersion", "@brief Method int QVersionNumber::minorVersion()\n", true, &_init_f_minorVersion_c0, &_call_f_minorVersion_c0);
|
||||
methods += new qt_gsi::GenericMethod ("normalized", "@brief Method QVersionNumber QVersionNumber::normalized()\n", true, &_init_f_normalized_c0, &_call_f_normalized_c0);
|
||||
methods += new qt_gsi::GenericMethod ("segmentAt", "@brief Method int QVersionNumber::segmentAt(int index)\n", true, &_init_f_segmentAt_c767, &_call_f_segmentAt_c767);
|
||||
methods += new qt_gsi::GenericMethod ("segmentCount", "@brief Method int QVersionNumber::segmentCount()\n", true, &_init_f_segmentCount_c0, &_call_f_segmentCount_c0);
|
||||
methods += new qt_gsi::GenericMethod ("segments", "@brief Method QList<int> QVersionNumber::segments()\n", true, &_init_f_segments_c0, &_call_f_segments_c0);
|
||||
methods += new qt_gsi::GenericMethod ("toString", "@brief Method QString QVersionNumber::toString()\n", true, &_init_f_toString_c0, &_call_f_toString_c0);
|
||||
methods += new qt_gsi::GenericStaticMethod ("commonPrefix", "@brief Static method QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2)\nThis method is static and can be called without an instance.", &_init_f_commonPrefix_5398, &_call_f_commonPrefix_5398);
|
||||
methods += new qt_gsi::GenericStaticMethod ("compare", "@brief Static method int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2)\nThis method is static and can be called without an instance.", &_init_f_compare_5398, &_call_f_compare_5398);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromString", "@brief Static method QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixIndex)\nThis method is static and can be called without an instance.", &_init_f_fromString_2870, &_call_f_fromString_2870);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromString", "@brief Static method QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex)\nThis method is static and can be called without an instance.", &_init_f_fromString_2546, &_call_f_fromString_2546);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromString", "@brief Static method QVersionNumber QVersionNumber::fromString(QStringView string, int *suffixIndex)\nThis method is static and can be called without an instance.", &_init_f_fromString_2404, &_call_f_fromString_2404);
|
||||
return methods;
|
||||
}
|
||||
|
||||
gsi::Class<QVersionNumber> decl_QVersionNumber ("QtCore", "QVersionNumber",
|
||||
methods_QVersionNumber (),
|
||||
"@qt\n@brief Binding of QVersionNumber");
|
||||
|
||||
|
||||
GSI_QTCORE_PUBLIC gsi::Class<QVersionNumber> &qtdecl_QVersionNumber () { return decl_QVersionNumber; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -349,6 +349,10 @@ class QMetaSequence;
|
|||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QMetaSequence> &qtdecl_QMetaSequence (); }
|
||||
|
||||
class QMetaType;
|
||||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QMetaType> &qtdecl_QMetaType (); }
|
||||
|
||||
struct QMethodRawArguments;
|
||||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QMethodRawArguments> &qtdecl_QMethodRawArguments (); }
|
||||
|
|
@ -669,6 +673,10 @@ class QVariantAnimation;
|
|||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QVariantAnimation> &qtdecl_QVariantAnimation (); }
|
||||
|
||||
class QVersionNumber;
|
||||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QVersionNumber> &qtdecl_QVersionNumber (); }
|
||||
|
||||
class QWaitCondition;
|
||||
|
||||
namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QWaitCondition> &qtdecl_QWaitCondition (); }
|
||||
|
|
|
|||
|
|
@ -35,11 +35,6 @@
|
|||
|
||||
// -----------------------------------------------------------------------
|
||||
// class QFont
|
||||
static unsigned int font_const_light () { return (unsigned int) QFont::Light; }
|
||||
static unsigned int font_const_normal () { return (unsigned int) QFont::Normal; }
|
||||
static unsigned int font_const_demibold () { return (unsigned int) QFont::DemiBold; }
|
||||
static unsigned int font_const_bold () { return (unsigned int) QFont::Bold; }
|
||||
static unsigned int font_const_black () { return (unsigned int) QFont::Black; }
|
||||
|
||||
// Constructor QFont::QFont()
|
||||
|
||||
|
|
@ -1462,12 +1457,6 @@ static gsi::Methods methods_QFont () {
|
|||
}
|
||||
|
||||
gsi::Class<QFont> decl_QFont ("QtGui", "QFont",
|
||||
gsi::method("Light", &font_const_light, "@brief Font weight constant 'QFont::Light'.") +
|
||||
gsi::method("Normal", &font_const_normal, "@brief Font weight constant 'QFont::Normal'.") +
|
||||
gsi::method("DemiBold", &font_const_demibold, "@brief Font weight constant 'QFont::DemiBold'.") +
|
||||
gsi::method("Bold", &font_const_bold, "@brief Font weight constant 'QFont::Bold'.") +
|
||||
gsi::method("Black", &font_const_black, "@brief Font weight constant 'QFont::Black'.")
|
||||
+
|
||||
methods_QFont (),
|
||||
"@qt\n@brief Binding of QFont");
|
||||
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ object_to_python (void *obj, PYAObjectBase *self, const gsi::ClassBase *cls, boo
|
|||
|
||||
}
|
||||
|
||||
if (! pass_obj && prefer_copy && ! clsact->adapted_type_info () && ! clsact->is_managed () && clsact->can_copy ()) {
|
||||
if (! pass_obj && prefer_copy && ! clsact->adapted_type_info () && ! clsact->is_managed () && clsact->can_copy () && clsact->can_default_create ()) {
|
||||
|
||||
// We copy objects passed by const reference if they are not managed
|
||||
// (derived from gsi::ObjectBase, in that case, client_data is not 0).
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ object_to_ruby (void *obj, Proxy *self, const gsi::ClassBase *cls, bool pass_obj
|
|||
|
||||
}
|
||||
|
||||
if (! pass_obj && prefer_copy && ! clsact->adapted_type_info () && ! clsact->is_managed () && clsact->can_copy ()) {
|
||||
if (! pass_obj && prefer_copy && ! clsact->adapted_type_info () && ! clsact->is_managed () && clsact->can_copy () && clsact->can_default_create ()) {
|
||||
|
||||
// We copy objects passed by const reference if they are not managed.
|
||||
// Such objects are often exposed internals. First we can't
|
||||
|
|
|
|||
|
|
@ -2993,6 +2993,35 @@ class BasicTest(unittest.TestCase):
|
|||
|
||||
self.assertEqual(pya.A.qsv_to_ia('\x00\x01\x02'), [ 0, 1, 2 ])
|
||||
|
||||
def test_QLatin1String(self):
|
||||
|
||||
# QLatin1String
|
||||
|
||||
if "ia_cref_to_ql1s" in pya.A.__dict__:
|
||||
|
||||
ql1s = pya.A.ia_cref_to_ql1s([ 16, 42, 0, 8 ])
|
||||
self.assertEqual(repr(ql1s), "'\\x10*\\x00\\x08'")
|
||||
|
||||
self.assertEqual(pya.A.ql1s_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
self.assertEqual(pya.A.ql1s_cref_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
self.assertEqual(pya.A.ql1s_cptr_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
self.assertEqual(pya.A.ql1s_ref_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
self.assertEqual(pya.A.ql1s_ptr_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
|
||||
ql1s = pya.A.ia_cref_to_ql1s_cref([ 17, 42, 0, 8 ])
|
||||
self.assertEqual(repr(ql1s), "'\\x11*\\x00\\x08'")
|
||||
|
||||
ql1s = pya.A.ia_cref_to_ql1s_ref([ 18, 42, 0, 8 ])
|
||||
self.assertEqual(repr(ql1s), "'\\x12*\\x00\\x08'")
|
||||
|
||||
ql1s = pya.A.ia_cref_to_ql1s_cptr([ 19, 42, 0, 8 ])
|
||||
self.assertEqual(repr(ql1s), "'\\x13*\\x00\\x08'")
|
||||
|
||||
ql1s = pya.A.ia_cref_to_ql1s_ptr([ 20, 42, 0, 8 ])
|
||||
self.assertEqual(repr(ql1s), "'\\x14*\\x00\\x08'")
|
||||
|
||||
self.assertEqual(pya.A.ql1s_to_ia('\x00\x01\x02'), [ 0, 1, 2 ])
|
||||
|
||||
def test_binaryStrings(self):
|
||||
|
||||
# binary strings (non-Qt)
|
||||
|
|
|
|||
|
|
@ -2893,6 +2893,36 @@ class Basic_TestClass < TestBase
|
|||
|
||||
end
|
||||
|
||||
def test_QLatin1String
|
||||
|
||||
# QLatin1String
|
||||
|
||||
if RBA::A.respond_to?(:ia_cref_to_ql1s)
|
||||
|
||||
ql1s = RBA::A::ia_cref_to_ql1s([ 16, 42, 0, 8 ])
|
||||
assert_equal(ql1s.inspect, "\"\\x10*\\x00\\b\"")
|
||||
|
||||
assert_equal(RBA::A::ql1s_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::ql1s_cref_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::ql1s_cptr_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::ql1s_ref_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::ql1s_ptr_to_ia(ql1s), [ 16, 42, 0, 8 ])
|
||||
|
||||
ql1s = RBA::A::ia_cref_to_ql1s_cref([ 17, 42, 0, 8 ])
|
||||
assert_equal(ql1s.inspect, "\"\\x11*\\x00\\b\"")
|
||||
ql1s = RBA::A::ia_cref_to_ql1s_ref([ 18, 42, 0, 8 ])
|
||||
assert_equal(ql1s.inspect, "\"\\x12*\\x00\\b\"")
|
||||
ql1s = RBA::A::ia_cref_to_ql1s_cptr([ 19, 42, 0, 8 ])
|
||||
assert_equal(ql1s.inspect, "\"\\x13*\\x00\\b\"")
|
||||
ql1s = RBA::A::ia_cref_to_ql1s_ptr([ 20, 42, 0, 8 ])
|
||||
assert_equal(ql1s.inspect, "\"\\x14*\\x00\\b\"")
|
||||
|
||||
assert_equal(RBA::A::ql1s_to_ia("\x00\x01\x02"), [ 0, 1, 2 ])
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def test_QStringView
|
||||
|
||||
# QStringView
|
||||
|
|
@ -2949,6 +2979,35 @@ class Basic_TestClass < TestBase
|
|||
|
||||
end
|
||||
|
||||
def test_optional
|
||||
|
||||
assert_equal(RBA::B::int_to_optional(1, true), 1)
|
||||
assert_equal(RBA::B::int_to_optional(1, false), nil)
|
||||
assert_equal(RBA::B::int_to_optional_a(1, true).a1, 1)
|
||||
assert_equal(RBA::B::int_to_optional_a(1, false), nil)
|
||||
|
||||
assert_equal(RBA::B::optional_to_int(1, -1), 1)
|
||||
assert_equal(RBA::B::optional_to_int(nil, -1), -1)
|
||||
assert_equal(RBA::B::optional_cref_to_int(2, -1), 2)
|
||||
assert_equal(RBA::B::optional_cref_to_int(nil, -1), -1)
|
||||
assert_equal(RBA::B::optional_ref_to_int(3, -1), 3)
|
||||
assert_equal(RBA::B::optional_ref_to_int(nil, -1), -1)
|
||||
|
||||
assert_equal(RBA::B::optional_cptr_to_int(4, -1), 4)
|
||||
assert_equal(RBA::B::optional_ptr_to_int(5, -1), 5)
|
||||
|
||||
assert_equal(RBA::B::optional_a_to_int(RBA::A::new(1), -1), 1)
|
||||
assert_equal(RBA::B::optional_a_to_int(nil, -1), -1)
|
||||
assert_equal(RBA::B::optional_a_cref_to_int(RBA::A::new(2), -1), 2)
|
||||
assert_equal(RBA::B::optional_a_cref_to_int(nil, -1), -1)
|
||||
assert_equal(RBA::B::optional_a_ref_to_int(RBA::A::new(3), -1), 3)
|
||||
assert_equal(RBA::B::optional_a_ref_to_int(nil, -1), -1)
|
||||
|
||||
assert_equal(RBA::B::optional_a_cptr_to_int(RBA::A::new(4), -1), 4)
|
||||
assert_equal(RBA::B::optional_a_ptr_to_int(RBA::A::new(5), -1), 5)
|
||||
|
||||
end
|
||||
|
||||
# Custom factory implemented in Ruby
|
||||
def test_80
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue