ruby-qt6-qtcore 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.rubocop.yml +14 -0
- data/LICENSE +185 -0
- data/README.md +3 -0
- data/Rakefile +19 -0
- data/ext/qt6/qtcore/bando-qobject-rb.cpp +17 -0
- data/ext/qt6/qtcore/bando-qobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/bando-rb.cpp +37 -0
- data/ext/qt6/qtcore/bando-rb.hpp +4 -0
- data/ext/qt6/qtcore/extconf.rb +18 -0
- data/ext/qt6/qtcore/qabstractitemmodel-rb.cpp +123 -0
- data/ext/qt6/qtcore/qabstractitemmodel-rb.hpp +4 -0
- data/ext/qt6/qtcore/qanystringview-rb.cpp +19 -0
- data/ext/qt6/qtcore/qanystringview-rb.hpp +4 -0
- data/ext/qt6/qtcore/qbasictimer-rb.cpp +24 -0
- data/ext/qt6/qtcore/qbasictimer-rb.hpp +4 -0
- data/ext/qt6/qtcore/qbytearray-rb.cpp +17 -0
- data/ext/qt6/qtcore/qbytearray-rb.hpp +4 -0
- data/ext/qt6/qtcore/qchar-rb.cpp +404 -0
- data/ext/qt6/qtcore/qchar-rb.hpp +4 -0
- data/ext/qt6/qtcore/qcoreapplication-rb.cpp +74 -0
- data/ext/qt6/qtcore/qcoreapplication-rb.hpp +4 -0
- data/ext/qt6/qtcore/qcoreevent-rb.cpp +234 -0
- data/ext/qt6/qtcore/qcoreevent-rb.hpp +4 -0
- data/ext/qt6/qtcore/qdatetime-rb.cpp +188 -0
- data/ext/qt6/qtcore/qdatetime-rb.hpp +4 -0
- data/ext/qt6/qtcore/qdir-rb.cpp +133 -0
- data/ext/qt6/qtcore/qdir-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfile-rb.cpp +52 -0
- data/ext/qt6/qtcore/qfile-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfiledevice-rb.cpp +105 -0
- data/ext/qt6/qtcore/qfiledevice-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfileinfo-rb.cpp +92 -0
- data/ext/qt6/qtcore/qfileinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qiodevice-rb.cpp +71 -0
- data/ext/qt6/qtcore/qiodevice-rb.hpp +4 -0
- data/ext/qt6/qtcore/qiodevicebase-rb.cpp +33 -0
- data/ext/qt6/qtcore/qiodevicebase-rb.hpp +4 -0
- data/ext/qt6/qtcore/qitemselection-rb.cpp +51 -0
- data/ext/qt6/qtcore/qitemselection-rb.hpp +4 -0
- data/ext/qt6/qtcore/qitemselectionmodel-rb.cpp +70 -0
- data/ext/qt6/qtcore/qitemselectionmodel-rb.hpp +4 -0
- data/ext/qt6/qtcore/qlibraryinfo-rb.cpp +36 -0
- data/ext/qt6/qtcore/qlibraryinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qline-rb.cpp +84 -0
- data/ext/qt6/qtcore/qline-rb.hpp +4 -0
- data/ext/qt6/qtcore/qlocale-rb.cpp +1033 -0
- data/ext/qt6/qtcore/qlocale-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmargins-rb.cpp +53 -0
- data/ext/qt6/qtcore/qmargins-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaclassinfo-rb.cpp +16 -0
- data/ext/qt6/qtcore/qmetaclassinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetamethod-rb.cpp +66 -0
- data/ext/qt6/qtcore/qmetamethod-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaobject-rb.cpp +49 -0
- data/ext/qt6/qtcore/qmetaobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaobjectbuilder-rb.cpp +157 -0
- data/ext/qt6/qtcore/qmetaobjectbuilder-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetatype-rb.cpp +109 -0
- data/ext/qt6/qtcore/qmetatype-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmodelindex-rb.cpp +30 -0
- data/ext/qt6/qtcore/qmodelindex-rb.hpp +4 -0
- data/ext/qt6/qtcore/qobject-rb.cpp +80 -0
- data/ext/qt6/qtcore/qobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/qpoint-rb.cpp +65 -0
- data/ext/qt6/qtcore/qpoint-rb.hpp +4 -0
- data/ext/qt6/qtcore/qrect-rb.cpp +162 -0
- data/ext/qt6/qtcore/qrect-rb.hpp +4 -0
- data/ext/qt6/qtcore/qregularexpression-rb.cpp +114 -0
- data/ext/qt6/qtcore/qregularexpression-rb.hpp +4 -0
- data/ext/qt6/qtcore/qresource-rb.cpp +48 -0
- data/ext/qt6/qtcore/qresource-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsettings-rb.cpp +72 -0
- data/ext/qt6/qtcore/qsettings-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsignalmapper-rb.cpp +32 -0
- data/ext/qt6/qtcore/qsignalmapper-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsize-rb.cpp +81 -0
- data/ext/qt6/qtcore/qsize-rb.hpp +4 -0
- data/ext/qt6/qtcore/qstring-rb.cpp +67 -0
- data/ext/qt6/qtcore/qstring-rb.hpp +4 -0
- data/ext/qt6/qtcore/qstringlist-rb.cpp +53 -0
- data/ext/qt6/qtcore/qstringlist-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-af-rb.cpp +345 -0
- data/ext/qt6/qtcore/qt-enum-af-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-gl-rb.cpp +703 -0
- data/ext/qt6/qtcore/qt-enum-gl-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-mr-rb.cpp +159 -0
- data/ext/qt6/qtcore/qt-enum-mr-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-sz-rb.cpp +390 -0
- data/ext/qt6/qtcore/qt-enum-sz-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-flags-al-rb.cpp +61 -0
- data/ext/qt6/qtcore/qt-flags-al-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-flags-mz-rb.cpp +61 -0
- data/ext/qt6/qtcore/qt-flags-mz-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtcore-rb.cpp +130 -0
- data/ext/qt6/qtcore/qtcore-rb.hpp +3 -0
- data/ext/qt6/qtcore/qtcoreversion-rb.cpp +9 -0
- data/ext/qt6/qtcore/qtcoreversion-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtextstream-rb.cpp +99 -0
- data/ext/qt6/qtcore/qtextstream-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtimer-rb.cpp +47 -0
- data/ext/qt6/qtcore/qtimer-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtranslator-rb.cpp +26 -0
- data/ext/qt6/qtcore/qtranslator-rb.hpp +4 -0
- data/ext/qt6/qtcore/qurl-rb.cpp +140 -0
- data/ext/qt6/qtcore/qurl-rb.hpp +4 -0
- data/ext/qt6/qtcore/quuid-rb.cpp +60 -0
- data/ext/qt6/qtcore/quuid-rb.hpp +4 -0
- data/ext/qt6/qtcore/qvariant-rb.cpp +70 -0
- data/ext/qt6/qtcore/qvariant-rb.hpp +4 -0
- data/ext/qt6/qtcore/t-qtcore-rb.cpp +31 -0
- data/ext/qt6/qtcore/t-qtcore-rb.hpp +4 -0
- data/lib/qt6/bando/dsl.rb +91 -0
- data/lib/qt6/bando/qobject.rb +9 -0
- data/lib/qt6/configuration.rb +16 -0
- data/lib/qt6/ducktyping.rb +74 -0
- data/lib/qt6/qtcore/private/_nodoc.rb +9 -0
- data/lib/qt6/qtcore/private/inflector.rb +27 -0
- data/lib/qt6/qtcore/private/metamethod.rb +67 -0
- data/lib/qt6/qtcore/private/metaobject.rb +98 -0
- data/lib/qt6/qtcore/private/signal.rb +26 -0
- data/lib/qt6/qtcore/private/signalmanager.rb +30 -0
- data/lib/qt6/qtcore/qabstractitemmodel.rb +42 -0
- data/lib/qt6/qtcore/qabstractlistmodel.rb +12 -0
- data/lib/qt6/qtcore/qabstracttablemodel.rb +12 -0
- data/lib/qt6/qtcore/qanystringview.rb +33 -0
- data/lib/qt6/qtcore/qbasictimer.rb +16 -0
- data/lib/qt6/qtcore/qbool.rb +21 -0
- data/lib/qt6/qtcore/qbytearray.rb +22 -0
- data/lib/qt6/qtcore/qchar.rb +46 -0
- data/lib/qt6/qtcore/qchildevent.rb +9 -0
- data/lib/qt6/qtcore/qcoreapplication.rb +44 -0
- data/lib/qt6/qtcore/qdate.rb +43 -0
- data/lib/qt6/qtcore/qdatetime.rb +54 -0
- data/lib/qt6/qtcore/qdir.rb +34 -0
- data/lib/qt6/qtcore/qdynamicpropertychangeevent.rb +9 -0
- data/lib/qt6/qtcore/qevent.rb +11 -0
- data/lib/qt6/qtcore/qfile.rb +21 -0
- data/lib/qt6/qtcore/qfiledevice.rb +29 -0
- data/lib/qt6/qtcore/qfileinfo.rb +30 -0
- data/lib/qt6/qtcore/qiodevice.rb +31 -0
- data/lib/qt6/qtcore/qiodevicebase.rb +13 -0
- data/lib/qt6/qtcore/qitemselection.rb +11 -0
- data/lib/qt6/qtcore/qitemselectionmodel.rb +40 -0
- data/lib/qt6/qtcore/qitemselectionrange.rb +25 -0
- data/lib/qt6/qtcore/qlibraryinfo.rb +11 -0
- data/lib/qt6/qtcore/qline.rb +42 -0
- data/lib/qt6/qtcore/qlinef.rb +42 -0
- data/lib/qt6/qtcore/qlocale.rb +44 -0
- data/lib/qt6/qtcore/qmargins.rb +38 -0
- data/lib/qt6/qtcore/qmarginsf.rb +38 -0
- data/lib/qt6/qtcore/qmetaclassinfo.rb +13 -0
- data/lib/qt6/qtcore/qmetamethod.rb +20 -0
- data/lib/qt6/qtcore/qmetamethodbuilder.rb +12 -0
- data/lib/qt6/qtcore/qmetaobject.rb +12 -0
- data/lib/qt6/qtcore/qmetaobjectbuilder.rb +30 -0
- data/lib/qt6/qtcore/qmetatype.rb +31 -0
- data/lib/qt6/qtcore/qmodelindex.rb +16 -0
- data/lib/qt6/qtcore/qobject.rb +103 -0
- data/lib/qt6/qtcore/qpoint.rb +36 -0
- data/lib/qt6/qtcore/qpointf.rb +36 -0
- data/lib/qt6/qtcore/qrect.rb +46 -0
- data/lib/qt6/qtcore/qrectf.rb +46 -0
- data/lib/qt6/qtcore/qregularexpression.rb +34 -0
- data/lib/qt6/qtcore/qregularexpressionmatch.rb +16 -0
- data/lib/qt6/qtcore/qresource.rb +29 -0
- data/lib/qt6/qtcore/qsettings.rb +73 -0
- data/lib/qt6/qtcore/qsignalmapper.rb +33 -0
- data/lib/qt6/qtcore/qsize.rb +36 -0
- data/lib/qt6/qtcore/qsizef.rb +36 -0
- data/lib/qt6/qtcore/qstring.rb +58 -0
- data/lib/qt6/qtcore/qstringlist.rb +18 -0
- data/lib/qt6/qtcore/qt/qvariant.rb +46 -0
- data/lib/qt6/qtcore/qt.rb +226 -0
- data/lib/qt6/qtcore/qtcoreversion.rb +6 -0
- data/lib/qt6/qtcore/qtextstream.rb +32 -0
- data/lib/qt6/qtcore/qtime.rb +49 -0
- data/lib/qt6/qtcore/qtimer.rb +32 -0
- data/lib/qt6/qtcore/qtimerevent.rb +9 -0
- data/lib/qt6/qtcore/qtranslator.rb +27 -0
- data/lib/qt6/qtcore/qurl.rb +55 -0
- data/lib/qt6/qtcore/quuid.rb +47 -0
- data/lib/qt6/qtcore/qvariant.rb +48 -0
- data/lib/qt6/qtcore/version.rb +7 -0
- data/lib/qt6/qtcore.rb +86 -0
- data/lib/qt6/refinements/kernel.rb +38 -0
- data/lib/qt6/refinements/string.rb +8 -0
- metadata +244 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#include "quuid-rb.hpp"
|
|
2
|
+
#include <quuid.h>
|
|
3
|
+
#include <rice/qt6/qenum.hpp>
|
|
4
|
+
|
|
5
|
+
using namespace Rice;
|
|
6
|
+
|
|
7
|
+
Rice::Class rb_cQUuid;
|
|
8
|
+
|
|
9
|
+
int QUuid_operator_compare(QUuid *lhs, QUuid *rhs)
|
|
10
|
+
{
|
|
11
|
+
if (*lhs < *rhs) return -1;
|
|
12
|
+
if (*lhs > *rhs) return 1;
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
void Init_quuid(Rice::Module rb_mQt6QtCore)
|
|
17
|
+
{
|
|
18
|
+
rb_cQUuid =
|
|
19
|
+
// RubyQt6::QtCore::QUuid
|
|
20
|
+
define_class_under<QUuid>(rb_mQt6QtCore, "QUuid")
|
|
21
|
+
// RubyQt6-Defined Functions
|
|
22
|
+
.define_method("variant", [](QUuid *self) -> QUuid::Variant { return self->variant(); })
|
|
23
|
+
.define_method("version", [](QUuid *self) -> QUuid::Version { return self->version(); })
|
|
24
|
+
.define_singleton_function("_operator_compare", QUuid_operator_compare, Arg("lhs"), Arg("rhs"))
|
|
25
|
+
// Constructor
|
|
26
|
+
.define_constructor(Constructor<QUuid>())
|
|
27
|
+
.define_constructor(Constructor<QUuid, QAnyStringView>(), Arg("string"))
|
|
28
|
+
// Public Functions
|
|
29
|
+
.define_method("null?", &QUuid::isNull)
|
|
30
|
+
.define_method("to_byte_array", &QUuid::toByteArray, Arg("mode") = static_cast<QUuid::StringFormat>(QUuid::StringFormat::WithBraces))
|
|
31
|
+
.define_method("to_string", &QUuid::toString, Arg("mode") = static_cast<QUuid::StringFormat>(QUuid::StringFormat::WithBraces));
|
|
32
|
+
|
|
33
|
+
Data_Type<QUuid::StringFormat> rb_cQUuidStringFormat =
|
|
34
|
+
// RubyQt6::QtCore::QUuid::StringFormat
|
|
35
|
+
define_qenum_under<QUuid::StringFormat>(rb_cQUuid, "StringFormat");
|
|
36
|
+
define_qenum_value_under(rb_cQUuidStringFormat, "WithBraces", QUuid::StringFormat::WithBraces);
|
|
37
|
+
define_qenum_value_under(rb_cQUuidStringFormat, "WithoutBraces", QUuid::StringFormat::WithoutBraces);
|
|
38
|
+
define_qenum_value_under(rb_cQUuidStringFormat, "Id128", QUuid::StringFormat::Id128);
|
|
39
|
+
|
|
40
|
+
Data_Type<QUuid::Variant> rb_cQUuidVariant =
|
|
41
|
+
// RubyQt6::QtCore::QUuid::Variant
|
|
42
|
+
define_qenum_under<QUuid::Variant>(rb_cQUuid, "Variant");
|
|
43
|
+
define_qenum_value_under(rb_cQUuidVariant, "VarUnknown", QUuid::Variant::VarUnknown);
|
|
44
|
+
define_qenum_value_under(rb_cQUuidVariant, "NCS", QUuid::Variant::NCS);
|
|
45
|
+
define_qenum_value_under(rb_cQUuidVariant, "DCE", QUuid::Variant::DCE);
|
|
46
|
+
define_qenum_value_under(rb_cQUuidVariant, "Microsoft", QUuid::Variant::Microsoft);
|
|
47
|
+
define_qenum_value_under(rb_cQUuidVariant, "Reserved", QUuid::Variant::Reserved);
|
|
48
|
+
|
|
49
|
+
Data_Type<QUuid::Version> rb_cQUuidVersion =
|
|
50
|
+
// RubyQt6::QtCore::QUuid::Version
|
|
51
|
+
define_qenum_under<QUuid::Version>(rb_cQUuid, "Version");
|
|
52
|
+
define_qenum_value_under(rb_cQUuidVersion, "VerUnknown", QUuid::Version::VerUnknown);
|
|
53
|
+
define_qenum_value_under(rb_cQUuidVersion, "Time", QUuid::Version::Time);
|
|
54
|
+
define_qenum_value_under(rb_cQUuidVersion, "EmbeddedPOSIX", QUuid::Version::EmbeddedPOSIX);
|
|
55
|
+
define_qenum_value_under(rb_cQUuidVersion, "Md5", QUuid::Version::Md5);
|
|
56
|
+
define_qenum_value_under(rb_cQUuidVersion, "Name", QUuid::Version::Name);
|
|
57
|
+
define_qenum_value_under(rb_cQUuidVersion, "Random", QUuid::Version::Random);
|
|
58
|
+
define_qenum_value_under(rb_cQUuidVersion, "Sha1", QUuid::Version::Sha1);
|
|
59
|
+
define_qenum_value_under(rb_cQUuidVersion, "UnixEpoch", QUuid::Version::UnixEpoch);
|
|
60
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#include "qvariant-rb.hpp"
|
|
2
|
+
#include <qvariant.h>
|
|
3
|
+
|
|
4
|
+
#include <QString>
|
|
5
|
+
#include <QDateTime>
|
|
6
|
+
#include <QDate>
|
|
7
|
+
#include <QTime>
|
|
8
|
+
#include <QLine>
|
|
9
|
+
#include <QLineF>
|
|
10
|
+
#include <QPoint>
|
|
11
|
+
#include <QPointF>
|
|
12
|
+
#include <QRect>
|
|
13
|
+
#include <QRectF>
|
|
14
|
+
#include <QSizeF>
|
|
15
|
+
#include <QSizeF>
|
|
16
|
+
|
|
17
|
+
using namespace Rice;
|
|
18
|
+
|
|
19
|
+
Rice::Class rb_cQVariant;
|
|
20
|
+
|
|
21
|
+
void Init_qvariant(Rice::Module rb_mQt6QtCore)
|
|
22
|
+
{
|
|
23
|
+
rb_cQVariant =
|
|
24
|
+
// RubyQt6::QtCore::QVariant
|
|
25
|
+
define_class_under<QVariant>(rb_mQt6QtCore, "QVariant")
|
|
26
|
+
// RubyQt6-Defined Functions
|
|
27
|
+
.define_singleton_function("from_bool", [](bool value) -> QVariant { return QVariant(value); })
|
|
28
|
+
.define_singleton_function("from_int", [](int value) -> QVariant { return QVariant(value); })
|
|
29
|
+
.define_singleton_function("from_double", [](double value) -> QVariant { return QVariant(value); })
|
|
30
|
+
.define_singleton_function("from_qstring", [](const char *value) -> QVariant { return QVariant(QString(value)); })
|
|
31
|
+
.define_singleton_function("from_qstring", [](const QString &value) -> QVariant { return QVariant(value); })
|
|
32
|
+
.define_singleton_function("from_qdatetime", [](const QDateTime &value) -> QVariant { return QVariant(value); })
|
|
33
|
+
.define_singleton_function("from_qdate", [](const QDate &value) -> QVariant { return QVariant(value); })
|
|
34
|
+
.define_singleton_function("from_qtime", [](const QTime &value) -> QVariant { return QVariant(value); })
|
|
35
|
+
.define_singleton_function("from_qline", [](const QLine &value) -> QVariant { return QVariant(value); })
|
|
36
|
+
.define_singleton_function("from_qlinef", [](const QLine &value) -> QVariant { return QVariant(QLineF(value)); })
|
|
37
|
+
.define_singleton_function("from_qlinef", [](const QLineF &value) -> QVariant { return QVariant(value); })
|
|
38
|
+
.define_singleton_function("from_qpoint", [](const QPoint &value) -> QVariant { return QVariant(value); })
|
|
39
|
+
.define_singleton_function("from_qpointf", [](const QPoint &value) -> QVariant { return QVariant(QPointF(value)); })
|
|
40
|
+
.define_singleton_function("from_qpointf", [](const QPointF &value) -> QVariant { return QVariant(value); })
|
|
41
|
+
.define_singleton_function("from_qrect", [](const QRect &value) -> QVariant { return QVariant(value); })
|
|
42
|
+
.define_singleton_function("from_qrectf", [](const QRect &value) -> QVariant { return QVariant(QRectF(value)); })
|
|
43
|
+
.define_singleton_function("from_qrectf", [](const QRectF &value) -> QVariant { return QVariant(value); })
|
|
44
|
+
.define_singleton_function("from_qsize", [](const QSize &value) -> QVariant { return QVariant(value); })
|
|
45
|
+
.define_singleton_function("from_qsizef", [](const QSize &value) -> QVariant { return QVariant(QSizeF(value)); })
|
|
46
|
+
.define_singleton_function("from_qsizef", [](const QSizeF &value) -> QVariant { return QVariant(value); })
|
|
47
|
+
.define_singleton_function("from_qstringlist", [](const QStringList &value) -> QVariant { return QVariant(value); })
|
|
48
|
+
.define_singleton_function("from_qobject", [](QObject *value) -> QVariant { return QVariant::fromValue(value); })
|
|
49
|
+
.define_singleton_function("to_bool", [](const QVariant &qvariant) -> bool { return qvariant.toBool(); })
|
|
50
|
+
.define_singleton_function("to_int", [](const QVariant &qvariant) -> int { return qvariant.toInt(); })
|
|
51
|
+
.define_singleton_function("to_double", [](const QVariant &qvariant) -> double { return qvariant.toDouble(); })
|
|
52
|
+
.define_singleton_function("to_qstring", [](const QVariant &qvariant) -> QString { return qvariant.toString(); })
|
|
53
|
+
.define_singleton_function("to_qdatetime", [](const QVariant &qvariant) -> QDateTime { return qvariant.toDateTime(); })
|
|
54
|
+
.define_singleton_function("to_qdate", [](const QVariant &qvariant) -> QDate { return qvariant.toDate(); })
|
|
55
|
+
.define_singleton_function("to_qtime", [](const QVariant &qvariant) -> QTime { return qvariant.toTime(); })
|
|
56
|
+
.define_singleton_function("to_qline", [](const QVariant &qvariant) -> QLine { return qvariant.toLine(); })
|
|
57
|
+
.define_singleton_function("to_qlinef", [](const QVariant &qvariant) -> QLineF { return qvariant.toLineF(); })
|
|
58
|
+
.define_singleton_function("to_qpoint", [](const QVariant &qvariant) -> QPoint { return qvariant.toPoint(); })
|
|
59
|
+
.define_singleton_function("to_qpointf", [](const QVariant &qvariant) -> QPointF { return qvariant.toPointF(); })
|
|
60
|
+
.define_singleton_function("to_qrect", [](const QVariant &qvariant) -> QRect { return qvariant.toRect(); })
|
|
61
|
+
.define_singleton_function("to_qrectf", [](const QVariant &qvariant) -> QRectF { return qvariant.toRectF(); })
|
|
62
|
+
.define_singleton_function("to_qsize", [](const QVariant &qvariant) -> QSize { return qvariant.toSize(); })
|
|
63
|
+
.define_singleton_function("to_qsizef", [](const QVariant &qvariant) -> QSizeF { return qvariant.toSizeF(); })
|
|
64
|
+
.define_singleton_function("to_qstringlist", [](const QVariant &qvariant) -> QStringList { return qvariant.toStringList(); })
|
|
65
|
+
.define_singleton_function("_to_qobject", [](const QVariant &qvariant) -> QObject * { return qvariant.value<QObject *>(); })
|
|
66
|
+
// Public Functions
|
|
67
|
+
.define_method("valid?", &QVariant::isValid)
|
|
68
|
+
.define_method("type_id", &QVariant::typeId)
|
|
69
|
+
.define_method("type_name", &QVariant::typeName);
|
|
70
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#include "t-qtcore-rb.hpp"
|
|
2
|
+
#include <rice/qt6/qlist.hpp>
|
|
3
|
+
|
|
4
|
+
#include <QItemSelectionRange>
|
|
5
|
+
#include <QModelIndex>
|
|
6
|
+
#include <QObject>
|
|
7
|
+
#include <QString>
|
|
8
|
+
#include <QVariant>
|
|
9
|
+
|
|
10
|
+
using namespace Rice;
|
|
11
|
+
|
|
12
|
+
void Init_t_qtcore(Rice::Module rb_mQt6T)
|
|
13
|
+
{
|
|
14
|
+
// QList<QByteArray>
|
|
15
|
+
define_qlist_under<QByteArray>(rb_mQt6T);
|
|
16
|
+
|
|
17
|
+
// QList<QItemSelectionRange> -> QItemSelection
|
|
18
|
+
define_qlist_under<QItemSelectionRange>(rb_mQt6T);
|
|
19
|
+
|
|
20
|
+
// QList<QModelIndex> -> QModelIndexList
|
|
21
|
+
define_qlist_under<QModelIndex>(rb_mQt6T);
|
|
22
|
+
|
|
23
|
+
// QList<QObject *>
|
|
24
|
+
define_qlist_under<QObject *>(rb_mQt6T);
|
|
25
|
+
|
|
26
|
+
// QList<QString> -> QStringList
|
|
27
|
+
define_qlist_under<QString>(rb_mQt6T);
|
|
28
|
+
|
|
29
|
+
// QList<QVariant>
|
|
30
|
+
define_qlist_under<QVariant>(rb_mQt6T);
|
|
31
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module Bando
|
|
5
|
+
# @!visibility private
|
|
6
|
+
def self.define_bando_qobject(qlass)
|
|
7
|
+
unless qlass <= QtCore::QObject
|
|
8
|
+
raise "Invalid superclass: macro `define_bando_qobject` " \
|
|
9
|
+
"only available for subclass of RubyQt6::QtCore::QObject"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
define_bando_qlass(qlass) do
|
|
13
|
+
{
|
|
14
|
+
child_event: FunctionName::ChildEvent,
|
|
15
|
+
timer_event: FunctionName::TimerEvent
|
|
16
|
+
}.each do |meth, fn|
|
|
17
|
+
define_method("_#{meth}") do |event|
|
|
18
|
+
_ruby_value_handle_event(fn, event)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @!visibility private
|
|
25
|
+
def self.define_bando_qwidget(qlass)
|
|
26
|
+
unless qlass <= QtWidgets::QWidget
|
|
27
|
+
raise "Invalid superclass: macro `define_bando_qwidget` " \
|
|
28
|
+
"only available for subclass of RubyQt6::QtWidgets::QWidget"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
define_bando_qlass(qlass) do
|
|
32
|
+
{
|
|
33
|
+
child_event: FunctionName::ChildEvent,
|
|
34
|
+
timer_event: FunctionName::TimerEvent,
|
|
35
|
+
action_event: FunctionName::ActionEvent,
|
|
36
|
+
change_event: FunctionName::ChangeEvent,
|
|
37
|
+
close_event: FunctionName::CloseEvent,
|
|
38
|
+
context_menu_event: FunctionName::ContextMenuEvent,
|
|
39
|
+
drag_enter_event: FunctionName::DragEnterEvent,
|
|
40
|
+
drag_leave_event: FunctionName::DragLeaveEvent,
|
|
41
|
+
drag_move_event: FunctionName::DragMoveEvent,
|
|
42
|
+
drop_event: FunctionName::DropEvent,
|
|
43
|
+
enter_event: FunctionName::EnterEvent,
|
|
44
|
+
focus_in_event: FunctionName::FocusInEvent,
|
|
45
|
+
focus_out_event: FunctionName::FocusOutEvent,
|
|
46
|
+
hide_event: FunctionName::HideEvent,
|
|
47
|
+
input_method_event: FunctionName::InputMethodEvent,
|
|
48
|
+
key_press_event: FunctionName::KeyPressEvent,
|
|
49
|
+
key_release_event: FunctionName::KeyReleaseEvent,
|
|
50
|
+
leave_event: FunctionName::LeaveEvent,
|
|
51
|
+
mouse_double_click_event: FunctionName::MouseDoubleClickEvent,
|
|
52
|
+
mouse_move_event: FunctionName::MouseMoveEvent,
|
|
53
|
+
mouse_press_event: FunctionName::MousePressEvent,
|
|
54
|
+
mouse_release_event: FunctionName::MouseReleaseEvent,
|
|
55
|
+
move_event: FunctionName::MoveEvent,
|
|
56
|
+
paint_event: FunctionName::PaintEvent,
|
|
57
|
+
resize_event: FunctionName::ResizeEvent,
|
|
58
|
+
show_event: FunctionName::ShowEvent,
|
|
59
|
+
tablet_event: FunctionName::TabletEvent,
|
|
60
|
+
wheel_event: FunctionName::WheelEvent
|
|
61
|
+
}.each do |meth, fn|
|
|
62
|
+
define_method("_#{meth}") do |event|
|
|
63
|
+
_ruby_value_handle_event(fn, event)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @!visibility private
|
|
70
|
+
def self.define_bando_qlass(qlass, &blk)
|
|
71
|
+
qlass.class_eval do
|
|
72
|
+
alias_method :_initialize, :initialize
|
|
73
|
+
|
|
74
|
+
def initialize(*args)
|
|
75
|
+
super
|
|
76
|
+
_initialize_ruby_value(self, self.class._qmetaobject)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def self._qmetaobject
|
|
80
|
+
superclass._qmetaobject
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def self._rubyqt6_metaobject
|
|
84
|
+
superclass._rubyqt6_metaobject
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
qlass.class_eval(&blk)
|
|
88
|
+
end
|
|
89
|
+
private_class_method :define_bando_qlass
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
# @!visibility private
|
|
5
|
+
def self.load_defaults
|
|
6
|
+
mods = RubyQt6.constants.grep(/^Qt/).map { |const| RubyQt6.const_get(const) }
|
|
7
|
+
mods.each do |mod|
|
|
8
|
+
mod.constants.each do |const|
|
|
9
|
+
next if const.match?("VERSION")
|
|
10
|
+
Object.const_set(const, mod.const_get(const)) if const.start_with?("Q")
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
true
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
# @!visibility private
|
|
5
|
+
module T
|
|
6
|
+
def self.args_nth_delete_qobject(args, index)
|
|
7
|
+
return unless args[index].is_a?(QtCore::QObject)
|
|
8
|
+
args.delete_at(index)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.args_nth_delete_qwidget(args, index)
|
|
12
|
+
return unless args[index].is_a?(QtWidgets::QWidget)
|
|
13
|
+
args.delete_at(index)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.args_nth_delete_qgraphicsitem(args, index)
|
|
17
|
+
return unless args[index].is_a?(QtWidgets::QGraphicsItem)
|
|
18
|
+
args.delete_at(index)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.args_nth_to_qanystringview(args, index)
|
|
22
|
+
return unless args[index].is_a?(String) || args[index].is_a?(QtCore::QString)
|
|
23
|
+
args[index] = QtCore::QAnyStringView.new(args[index])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.args_nth_to_qstr(args, index)
|
|
27
|
+
return unless args[index].is_a?(String)
|
|
28
|
+
args[index] = QtCore::QString.new(args[index])
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.to_qanystringview(str)
|
|
32
|
+
return str unless str.is_a?(String) || str.is_a?(QtCore::QString)
|
|
33
|
+
QtCore::QAnyStringView.new(str)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.to_qbytearray(str)
|
|
37
|
+
return str unless str.is_a?(String)
|
|
38
|
+
QtCore::QByteArray.new(str)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.to_qstr(str)
|
|
42
|
+
return str unless str.is_a?(String)
|
|
43
|
+
QtCore::QString.new(str)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.to_qvariantlist(array)
|
|
47
|
+
array.each_with_object(T::QList≺QVariant≻.new) do |o, memo|
|
|
48
|
+
memo << (o.is_a?(QtCore::QVariant) ? o : QtCore::QVariant.new(o))
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.to_qflags(enum_or_flags)
|
|
53
|
+
return enum_or_flags unless enum_or_flags.respond_to?(:to_qflags)
|
|
54
|
+
enum_or_flags.to_qflags
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.bando_qobject_cast(object)
|
|
58
|
+
return object unless object.class.name.start_with?("RubyQt6::Bando::")
|
|
59
|
+
object._ruby_value
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def self.inspect_struct(object, **attributes)
|
|
63
|
+
name = object.class.name.split("::").last + " "
|
|
64
|
+
attributes = Array(attributes).map { |(name, value)| "#{name}=#{value.inspect}" }.join(", ")
|
|
65
|
+
["#<", name, attributes, ">"].join
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.inspect_struct_enum(object, **attributes)
|
|
69
|
+
name = object.class.name.split("::").last(2).join("::") + " "
|
|
70
|
+
attributes = Array(attributes).map { |(name, value)| "#{name}=#{value.inspect}" }.join(", ")
|
|
71
|
+
["#<", name, attributes, ">"].join
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
module Private
|
|
6
|
+
class Inflector
|
|
7
|
+
def camelize(str)
|
|
8
|
+
str = str.dup
|
|
9
|
+
str.gsub!(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" }
|
|
10
|
+
str
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def underscore(str)
|
|
14
|
+
str = str.dup
|
|
15
|
+
str.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
|
16
|
+
str.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
|
|
17
|
+
str.downcase!
|
|
18
|
+
str
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.inflector
|
|
23
|
+
@inflector ||= QtCore::Private::Inflector.new
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
module Private
|
|
6
|
+
class MetaMethod
|
|
7
|
+
RE = /(\w+ )?(\w+)\((.*)\)/
|
|
8
|
+
|
|
9
|
+
attr_reader :name
|
|
10
|
+
attr_reader :parameters
|
|
11
|
+
attr_reader :signature
|
|
12
|
+
attr_reader :return_type
|
|
13
|
+
attr_reader :type
|
|
14
|
+
|
|
15
|
+
def self.normalized_name(name)
|
|
16
|
+
QtCore::Private.inflector.underscore(name)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.normalized_parameters(parameters)
|
|
20
|
+
parameters.map(&->(param) { param.delete(" ") })
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.normalized_signature(normalized_name, normalized_parameters)
|
|
24
|
+
normalized_name + "(" + normalized_parameters.join(",") + ")"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.normalized_return_type(return_type)
|
|
28
|
+
return nil if return_type.nil?
|
|
29
|
+
return_type.delete(" ")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def initialize(signature, type, underlying)
|
|
33
|
+
matched = signature.match(RE)
|
|
34
|
+
raise "Invalid metamethod signature: #{signature}" if matched.nil?
|
|
35
|
+
|
|
36
|
+
@name = self.class.normalized_name(matched[2])
|
|
37
|
+
@parameters = self.class.normalized_parameters(matched[3].split(","))
|
|
38
|
+
@signature = self.class.normalized_signature(@name, @parameters)
|
|
39
|
+
@return_type = self.class.normalized_return_type(matched[1])
|
|
40
|
+
@type = type.to_sym
|
|
41
|
+
@underlying = underlying.to_sym
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def signal?
|
|
45
|
+
@type == :signal
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def slot?
|
|
49
|
+
@type == :slot
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def qsignature
|
|
53
|
+
signature = self.class.normalized_signature(qsignature_name, @parameters)
|
|
54
|
+
signal? ? "2#{signature}" : "1#{signature}"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def qsignature_name
|
|
58
|
+
case @underlying
|
|
59
|
+
when :libQt6 then QtCore::Private.inflector.camelize(@name)
|
|
60
|
+
when :ruby then "_rubyqt6_#{QtCore::Private.inflector.underscore(@name)}"
|
|
61
|
+
else raise "Unknown underlying type: #{@underlying}"
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
module Private
|
|
6
|
+
class MetaObject
|
|
7
|
+
attr_reader :metamethods
|
|
8
|
+
|
|
9
|
+
def self.find_receiver_metamethod!(receiver, method, signal = nil)
|
|
10
|
+
if signal.nil?
|
|
11
|
+
signature = "anonymous()"
|
|
12
|
+
signal = QtCore::Private::MetaMethod.new(signature, :signal, :ruby)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
name = QtCore::Private::MetaMethod.normalized_name(method.to_s)
|
|
16
|
+
compatible_methods = signal.parameters.count.downto(0).map do |n|
|
|
17
|
+
QtCore::Private::MetaMethod.normalized_signature(name, signal.parameters[0...n])
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
mo = receiver.class._rubyqt6_metaobject
|
|
21
|
+
until mo.nil?
|
|
22
|
+
mo.metamethods.each { |meth| return meth if compatible_methods.include?(meth.signature) }
|
|
23
|
+
mo.metamethods.each { |meth| return meth if name == meth.name } if mo.ruby?
|
|
24
|
+
mo = mo.super_class
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
qlass = receiver.class.name.split("::").last
|
|
28
|
+
raise "No compatible metamethod: #{qlass}##{name}"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def initialize(qlass)
|
|
32
|
+
@qlass = qlass
|
|
33
|
+
@qlass_underlying = @qlass.name.start_with?("RubyQt6::") ? :libQt6 : :ruby
|
|
34
|
+
@classinfo = {}
|
|
35
|
+
@metamethods = []
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def add_classinfo(name, value)
|
|
39
|
+
@classinfo[name] = value
|
|
40
|
+
end
|
|
41
|
+
alias_method :classinfo, :add_classinfo
|
|
42
|
+
|
|
43
|
+
def add_signal(signature)
|
|
44
|
+
@metamethods << QtCore::Private::MetaMethod.new(signature, :signal, @qlass_underlying)
|
|
45
|
+
end
|
|
46
|
+
alias_method :signal, :add_signal
|
|
47
|
+
|
|
48
|
+
def add_slot(signature)
|
|
49
|
+
@metamethods << QtCore::Private::MetaMethod.new(signature, :slot, @qlass_underlying)
|
|
50
|
+
end
|
|
51
|
+
alias_method :slot, :add_slot
|
|
52
|
+
|
|
53
|
+
def class_name
|
|
54
|
+
@qlass.name
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def super_class
|
|
58
|
+
return nil if @qlass == QtCore::QObject
|
|
59
|
+
@qlass.superclass._rubyqt6_metaobject
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def ruby?
|
|
63
|
+
@qlass_underlying == :ruby
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def to_qmetaobject
|
|
67
|
+
return @qlass._static_meta_object unless ruby?
|
|
68
|
+
|
|
69
|
+
builder = QtCore::QMetaObjectBuilder.new
|
|
70
|
+
builder.set_class_name(@qlass.name)
|
|
71
|
+
builder.set_super_class(@qlass.superclass._qmetaobject)
|
|
72
|
+
@classinfo.each { |name, value| builder.add_class_info(name, value) }
|
|
73
|
+
@metamethods.each { |meth| _to_qmetaobject_method(builder, meth) }
|
|
74
|
+
builder.to_meta_object
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
private
|
|
78
|
+
|
|
79
|
+
def _to_qmetaobject_method(builder, meth)
|
|
80
|
+
case meth.type
|
|
81
|
+
when :signal then _to_qmetaobject_method_signal(builder, meth)
|
|
82
|
+
when :slot then _to_qmetaobject_method_slot(builder, meth)
|
|
83
|
+
else raise "Unknown metamethod type: #{meth.type}"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def _to_qmetaobject_method_signal(builder, meth)
|
|
88
|
+
_methbuilder = builder.add_signal(meth.qsignature[1..])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def _to_qmetaobject_method_slot(builder, meth)
|
|
92
|
+
methbuilder = builder.add_slot(meth.qsignature[1..])
|
|
93
|
+
methbuilder.set_return_type(meth.return_type) unless meth.return_type.nil?
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
module Private
|
|
6
|
+
class Signal
|
|
7
|
+
def initialize(sender, metamethod)
|
|
8
|
+
@sender = sender
|
|
9
|
+
@metamethod = metamethod
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def connect(receiver, metamethod)
|
|
13
|
+
QtCore::Private::SignalManager.connect(@sender, @metamethod, receiver, metamethod)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def disconnect(receiver, metamethod)
|
|
17
|
+
QtCore::Private::SignalManager.disconnect(@sender, @metamethod, receiver, metamethod)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def emit(*args)
|
|
21
|
+
QtCore::Private::SignalManager.emit(@sender, @metamethod, *args)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
module Private
|
|
6
|
+
class SignalManager
|
|
7
|
+
def self.connect(sender, signal, receiver, metamethod)
|
|
8
|
+
metamethod = QtCore::Private::MetaObject.find_receiver_metamethod!(receiver, metamethod, signal)
|
|
9
|
+
QtCore::QObject._connect(sender, signal.qsignature, receiver, metamethod.qsignature)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.disconnect(sender, signal, receiver, metamethod)
|
|
13
|
+
metamethod = QtCore::Private::MetaObject.find_receiver_metamethod!(receiver, metamethod, signal)
|
|
14
|
+
QtCore::QObject._disconnect(sender, signal.qsignature, receiver, metamethod.qsignature)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.emit(sender, signal, *args)
|
|
18
|
+
qmo = sender.class._qmetaobject
|
|
19
|
+
qmetamethod = qmo.method(qmo.index_of_signal(signal.qsignature[1..]))
|
|
20
|
+
|
|
21
|
+
raise "Too many arguments" if qmetamethod.parameter_count < args.count
|
|
22
|
+
raise "Not enough arguments" if qmetamethod.parameter_count > args.count
|
|
23
|
+
args = args.map.with_index { |arg, i| QtCore::QVariant.new(arg, qmetamethod.parameter_meta_type(i)) }
|
|
24
|
+
|
|
25
|
+
QtCore::QObject._emit(sender, qmetamethod, args)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|