ruby-qt6-qtcore 2.1.1 → 6.1.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 +4 -4
- data/.rubocop.yml +0 -1
- data/ext/qt6/qtcore/bando-core-rb.cpp +1 -1
- data/ext/qt6/qtcore/bando-qsortfilterproxymodel-rb.cpp +17 -0
- data/ext/qt6/qtcore/bando-qsortfilterproxymodel-rb.hpp +5 -0
- data/ext/qt6/qtcore/qabstractitemmodel-rb.cpp +8 -4
- data/ext/qt6/qtcore/qabstractproxymodel-rb.cpp +54 -0
- data/ext/qt6/qtcore/qabstractproxymodel-rb.hpp +5 -0
- data/ext/qt6/qtcore/qanystringview-rb.cpp +1 -1
- data/ext/qt6/qtcore/qbasictimer-rb.cpp +1 -1
- data/ext/qt6/qtcore/qbytearray-rb.cpp +1 -1
- data/ext/qt6/qtcore/qchar-rb.cpp +1 -1
- data/ext/qt6/qtcore/qcoreapplication-rb.cpp +18 -3
- data/ext/qt6/qtcore/qcoreevent-rb.cpp +4 -4
- data/ext/qt6/qtcore/qdatetime-rb.cpp +3 -3
- data/ext/qt6/qtcore/qdir-rb.cpp +2 -2
- data/ext/qt6/qtcore/qeventloop-rb.cpp +2 -1
- data/ext/qt6/qtcore/qfile-rb.cpp +3 -2
- data/ext/qt6/qtcore/qfiledevice-rb.cpp +2 -1
- data/ext/qt6/qtcore/qfileinfo-rb.cpp +1 -1
- data/ext/qt6/qtcore/qiodevice-rb.cpp +2 -1
- data/ext/qt6/qtcore/qiodevicebase-rb.cpp +1 -1
- data/ext/qt6/qtcore/qitemselection-rb.cpp +2 -2
- data/ext/qt6/qtcore/qitemselectionmodel-rb.cpp +2 -1
- data/ext/qt6/qtcore/qlibraryinfo-rb.cpp +1 -1
- data/ext/qt6/qtcore/qline-rb.cpp +2 -2
- data/ext/qt6/qtcore/qlocale-rb.cpp +1 -1
- data/ext/qt6/qtcore/qmargins-rb.cpp +2 -2
- data/ext/qt6/qtcore/qmetaclassinfo-rb.cpp +1 -1
- data/ext/qt6/qtcore/qmetamethod-rb.cpp +1 -1
- data/ext/qt6/qtcore/qmetaobject-rb.cpp +2 -2
- data/ext/qt6/qtcore/qmetaobjectbuilder-rb.cpp +4 -4
- data/ext/qt6/qtcore/qmetatype-rb.cpp +1 -1
- data/ext/qt6/qtcore/qmimetype-rb.cpp +1 -1
- data/ext/qt6/qtcore/qmodelindex-rb.cpp +1 -1
- data/ext/qt6/qtcore/qobject-rb.cpp +3 -1
- data/ext/qt6/qtcore/qpoint-rb.cpp +2 -2
- data/ext/qt6/qtcore/qprocess-rb.cpp +5 -4
- data/ext/qt6/qtcore/qprocessenvironment-rb.cpp +1 -1
- data/ext/qt6/qtcore/qrect-rb.cpp +2 -2
- data/ext/qt6/qtcore/qregularexpression-rb.cpp +3 -3
- data/ext/qt6/qtcore/qresource-rb.cpp +1 -1
- data/ext/qt6/qtcore/qsettings-rb.cpp +2 -1
- data/ext/qt6/qtcore/qsignalmapper-rb.cpp +2 -1
- data/ext/qt6/qtcore/qsize-rb.cpp +2 -2
- data/ext/qt6/qtcore/qsortfilterproxymodel-rb.cpp +109 -0
- data/ext/qt6/qtcore/qsortfilterproxymodel-rb.hpp +5 -0
- data/ext/qt6/qtcore/qstandardpaths-rb.cpp +1 -1
- data/ext/qt6/qtcore/qstring-rb.cpp +2 -1
- data/ext/qt6/qtcore/qstringlist-rb.cpp +1 -1
- data/ext/qt6/qtcore/qtcore-rb.cpp +6 -2
- data/ext/qt6/qtcore/qtextstream-rb.cpp +1 -1
- data/ext/qt6/qtcore/qtimer-rb.cpp +2 -1
- data/ext/qt6/qtcore/qtranslator-rb.cpp +2 -1
- data/ext/qt6/qtcore/qurl-rb.cpp +1 -1
- data/ext/qt6/qtcore/qurlquery-rb.cpp +1 -1
- data/ext/qt6/qtcore/quuid-rb.cpp +1 -1
- data/ext/qt6/qtcore/qvariant-rb.cpp +2 -1
- data/ext/qt6/qtcore/qvariantlist-rb.cpp +1 -1
- data/ext/qt6/qtcore/qvariantmap-rb.cpp +1 -1
- data/lib/qt6/bando/dsl.rb +11 -5
- data/lib/qt6/bando/qsortfilterproxymodel.rb +9 -0
- data/lib/qt6/configuration.rb +1 -1
- data/lib/qt6/ducktyping.rb +25 -12
- data/lib/qt6/qtcore/private/inflector.rb +6 -0
- data/lib/qt6/qtcore/qabstractitemmodel.rb +6 -0
- data/lib/qt6/qtcore/qabstractproxymodel.rb +13 -0
- data/lib/qt6/qtcore/qcoreapplication.rb +12 -18
- data/lib/qt6/qtcore/qdir.rb +5 -0
- data/lib/qt6/qtcore/qfile.rb +5 -0
- data/lib/qt6/qtcore/qobject.rb +4 -4
- data/lib/qt6/qtcore/qprocess.rb +3 -3
- data/lib/qt6/qtcore/qsettings.rb +5 -2
- data/lib/qt6/qtcore/qsortfilterproxymodel.rb +38 -0
- data/lib/qt6/qtcore/qstring.rb +6 -0
- data/lib/qt6/qtcore/qstringlist.rb +12 -0
- data/lib/qt6/qtcore/qtranslator.rb +2 -1
- data/lib/qt6/qtcore/qvariant.rb +7 -1
- data/lib/qt6/qtcore/qvariantlist.rb +12 -0
- data/lib/qt6/qtcore/qvariantmap.rb +9 -1
- data/lib/qt6/qtcore/version.rb +1 -1
- data/lib/qt6/qtcore.rb +5 -1
- data/lib/qt6/refinements/kernel.rb +0 -6
- metadata +12 -4
- data/lib/qt6/refinements/object.rb +0 -15
|
@@ -29,10 +29,11 @@ void Init_qobject(Module rb_mQt6QtCore)
|
|
|
29
29
|
{
|
|
30
30
|
rb_cQObject =
|
|
31
31
|
// RubyQt6::QtCore::QObject
|
|
32
|
-
|
|
32
|
+
define_qlass_under<QObject>(rb_mQt6QtCore, "QObject")
|
|
33
33
|
// RubyQt6-Defined Functions
|
|
34
34
|
.define_method("_qobject_ptr", [](QObject *self) -> uintptr_t { return (uintptr_t)self; })
|
|
35
35
|
.define_singleton_function("_emit", QObject_emit, Arg("sender"), Arg("signal"), Arg("args"))
|
|
36
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QObject * { return qobject_cast<QObject *>(object); })
|
|
36
37
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QObject::staticMetaObject; })
|
|
37
38
|
.define_singleton_function("_delete_now", [](QObject *object) -> void { delete object; }, Arg("object").takeOwnership())
|
|
38
39
|
.define_singleton_function("_take_ownership_from_ruby", [](QObject *) -> void {}, Arg("object").takeOwnership())
|
|
@@ -56,6 +57,7 @@ void Init_qobject(Module rb_mQt6QtCore)
|
|
|
56
57
|
.define_method("window_type?", &QObject::isWindowType)
|
|
57
58
|
.define_method<void (QObject::*)(Qt::TimerId)>("kill_timer", &QObject::killTimer, Arg("id"))
|
|
58
59
|
.define_method<void (QObject::*)(int)>("kill_timer", &QObject::killTimer, Arg("id"))
|
|
60
|
+
.define_method("meta_object", &QObject::metaObject)
|
|
59
61
|
.define_method("move_to_thread", &QObject::moveToThread, Arg("thread"))
|
|
60
62
|
.define_method("object_name", &QObject::objectName)
|
|
61
63
|
.define_method("_parent", &QObject::parent)
|
|
@@ -10,7 +10,7 @@ void Init_qpoint(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQPoint =
|
|
12
12
|
// RubyQt6::QtCore::QPoint
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QPoint>(rb_mQt6QtCore, "QPoint")
|
|
14
14
|
// RubyQt6-Defined Functions
|
|
15
15
|
.define_method("*", [](QPoint *self, qreal factor) -> QPoint { return *self * factor; })
|
|
16
16
|
.define_method("+", [](QPoint *self, QPoint *other) -> QPoint { return *self + *other; })
|
|
@@ -37,7 +37,7 @@ void Init_qpoint(Module rb_mQt6QtCore)
|
|
|
37
37
|
|
|
38
38
|
rb_cQPointF =
|
|
39
39
|
// RubyQt6::QtCore::QPointF
|
|
40
|
-
|
|
40
|
+
define_qlass_under<QPointF>(rb_mQt6QtCore, "QPointF")
|
|
41
41
|
// RubyQt6-Defined Functions
|
|
42
42
|
.define_method("*", [](QPointF *self, qreal factor) -> QPointF { return *self * factor; })
|
|
43
43
|
.define_method("+", [](QPointF *self, QPointF *other) -> QPointF { return *self + *other; })
|
|
@@ -10,15 +10,16 @@ void Init_qprocess(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQProcess =
|
|
12
12
|
// RubyQt6::QtCore::QProcess
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QProcess, QIODevice>(rb_mQt6QtCore, "QProcess")
|
|
14
14
|
// RubyQt6-Defined Functions
|
|
15
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QProcess * { return qobject_cast<QProcess *>(object); })
|
|
15
16
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QProcess::staticMetaObject; })
|
|
16
17
|
// Constructor
|
|
17
18
|
.define_constructor(Constructor<QProcess, QObject *>(), Arg("parent"))
|
|
18
19
|
// Public Functions
|
|
19
20
|
.define_method("arguments", &QProcess::arguments)
|
|
20
21
|
.define_method("bytes_to_write", &QProcess::bytesToWrite)
|
|
21
|
-
.define_method("child_process_modifier", &QProcess::childProcessModifier)
|
|
22
|
+
// .define_method("child_process_modifier", &QProcess::childProcessModifier)
|
|
22
23
|
.define_method("close", &QProcess::close)
|
|
23
24
|
.define_method("close_read_channel", &QProcess::closeReadChannel, Arg("channel"))
|
|
24
25
|
.define_method("close_write_channel", &QProcess::closeWriteChannel)
|
|
@@ -26,7 +27,7 @@ void Init_qprocess(Module rb_mQt6QtCore)
|
|
|
26
27
|
.define_method("error", &QProcess::error)
|
|
27
28
|
.define_method("exit_code", &QProcess::exitCode)
|
|
28
29
|
.define_method("exit_status", &QProcess::exitStatus)
|
|
29
|
-
.define_method("fail_child_process_modifier", &QProcess::failChildProcessModifier, Arg("description"), Arg("error") = static_cast<int>(0))
|
|
30
|
+
// .define_method("fail_child_process_modifier", &QProcess::failChildProcessModifier, Arg("description"), Arg("error") = static_cast<int>(0))
|
|
30
31
|
.define_method("input_channel_mode", &QProcess::inputChannelMode)
|
|
31
32
|
.define_method("sequential?", &QProcess::isSequential)
|
|
32
33
|
.define_method("open", &QProcess::open, Arg("mode") = static_cast<QIODeviceBase::OpenMode>(QIODeviceBase::ReadWrite))
|
|
@@ -38,7 +39,7 @@ void Init_qprocess(Module rb_mQt6QtCore)
|
|
|
38
39
|
.define_method("read_all_standard_output", &QProcess::readAllStandardOutput)
|
|
39
40
|
.define_method("read_channel", &QProcess::readChannel)
|
|
40
41
|
.define_method("set_arguments", &QProcess::setArguments, Arg("arguments"))
|
|
41
|
-
.define_method("set_child_process_modifier", &QProcess::setChildProcessModifier, Arg("modifier"))
|
|
42
|
+
// .define_method("set_child_process_modifier", &QProcess::setChildProcessModifier, Arg("modifier"))
|
|
42
43
|
.define_method("set_environment", &QProcess::setEnvironment, Arg("environment"))
|
|
43
44
|
.define_method("set_input_channel_mode", &QProcess::setInputChannelMode, Arg("mode"))
|
|
44
45
|
.define_method("set_process_channel_mode", &QProcess::setProcessChannelMode, Arg("mode"))
|
|
@@ -10,7 +10,7 @@ void Init_qprocessenvironment(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQProcessEnvironment =
|
|
12
12
|
// RubyQt6::QtCore::QProcessEnvironment
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QProcessEnvironment>(rb_mQt6QtCore, "QProcessEnvironment")
|
|
14
14
|
// Public Functions
|
|
15
15
|
.define_method("clear", &QProcessEnvironment::clear)
|
|
16
16
|
.define_method("_contains", &QProcessEnvironment::contains, Arg("name"))
|
data/ext/qt6/qtcore/qrect-rb.cpp
CHANGED
|
@@ -10,7 +10,7 @@ void Init_qrect(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQRect =
|
|
12
12
|
// RubyQt6::QtCore::QRect
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QRect>(rb_mQt6QtCore, "QRect")
|
|
14
14
|
// RubyQt6-Defined Functions
|
|
15
15
|
.define_method("+", [](QRect *self, QMargins *margins) -> QRect { return *self + *margins; })
|
|
16
16
|
.define_method("-", [](QRect *self, QMargins *margins) -> QRect { return *self - *margins; })
|
|
@@ -88,7 +88,7 @@ void Init_qrect(Module rb_mQt6QtCore)
|
|
|
88
88
|
|
|
89
89
|
rb_cQRectF =
|
|
90
90
|
// RubyQt6::QtCore::QRectF
|
|
91
|
-
|
|
91
|
+
define_qlass_under<QRectF>(rb_mQt6QtCore, "QRectF")
|
|
92
92
|
// RubyQt6-Defined Functions
|
|
93
93
|
.define_method("+", [](QRectF *self, QMarginsF *margins) -> QRectF { return *self + *margins; })
|
|
94
94
|
.define_method("-", [](QRectF *self, QMarginsF *margins) -> QRectF { return *self - *margins; })
|
|
@@ -13,7 +13,7 @@ void Init_qregularexpression(Module rb_mQt6QtCore)
|
|
|
13
13
|
{
|
|
14
14
|
rb_cQRegularExpression =
|
|
15
15
|
// RubyQt6::QtCore::QRegularExpression
|
|
16
|
-
|
|
16
|
+
define_qlass_under<QRegularExpression>(rb_mQt6QtCore, "QRegularExpression")
|
|
17
17
|
// Constructor
|
|
18
18
|
.define_constructor(Constructor<QRegularExpression, const QString &, QRegularExpression::PatternOptions>(), Arg("pattern"), Arg("options"))
|
|
19
19
|
// Public Functions
|
|
@@ -84,7 +84,7 @@ void Init_qregularexpression(Module rb_mQt6QtCore)
|
|
|
84
84
|
|
|
85
85
|
rb_cQRegularExpressionMatch =
|
|
86
86
|
// RubyQt6::QtCore::QRegularExpressionMatch
|
|
87
|
-
|
|
87
|
+
define_qlass_under<QRegularExpressionMatch>(rb_mQt6QtCore, "QRegularExpressionMatch")
|
|
88
88
|
// Constructor
|
|
89
89
|
.define_constructor(Constructor<QRegularExpressionMatch>())
|
|
90
90
|
// Public Functions
|
|
@@ -109,7 +109,7 @@ void Init_qregularexpression(Module rb_mQt6QtCore)
|
|
|
109
109
|
|
|
110
110
|
rb_cQRegularExpressionMatchIterator =
|
|
111
111
|
// RubyQt6::QtCore::QRegularExpressionMatchIterator
|
|
112
|
-
|
|
112
|
+
define_qlass_under<QRegularExpressionMatchIterator>(rb_mQt6QtCore, "QRegularExpressionMatchIterator")
|
|
113
113
|
// Public Functions
|
|
114
114
|
.define_method("has_next", &QRegularExpressionMatchIterator::hasNext)
|
|
115
115
|
.define_method("match_options", &QRegularExpressionMatchIterator::matchOptions)
|
|
@@ -12,7 +12,7 @@ void Init_qresource(Module rb_mQt6QtCore)
|
|
|
12
12
|
{
|
|
13
13
|
rb_cQResource =
|
|
14
14
|
// RubyQt6::QtCore::QResource
|
|
15
|
-
|
|
15
|
+
define_qlass_under<QResource>(rb_mQt6QtCore, "QResource")
|
|
16
16
|
// RubyQt6-Defined Functions
|
|
17
17
|
.define_singleton_function("register_resource", [](const char *rcc_filename, const char *resource_root) -> bool { return QResource::registerResource(QString(rcc_filename), QString(resource_root)); }, Arg("rcc_filename"), Arg("resource_root") = static_cast<const char *>(nullptr))
|
|
18
18
|
.define_singleton_function("unregister_resource", [](const char *rcc_filename, const char *resource_root) -> bool { return QResource::unregisterResource(QString(rcc_filename), QString(resource_root)); }, Arg("rcc_filename"), Arg("resource_root") = static_cast<const char *>(nullptr))
|
|
@@ -10,8 +10,9 @@ void Init_qsettings(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQSettings =
|
|
12
12
|
// RubyQt6::QtCore::QSettings
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QSettings, QObject>(rb_mQt6QtCore, "QSettings")
|
|
14
14
|
// RubyQt6-Defined Functions
|
|
15
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QSettings * { return qobject_cast<QSettings *>(object); })
|
|
15
16
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QSettings::staticMetaObject; })
|
|
16
17
|
// Constructor
|
|
17
18
|
.define_constructor(Constructor<QSettings, QSettings::Format, QSettings::Scope, const QString &, const QString &>(), Arg("format"), Arg("scope"), Arg("organization"), Arg("application"))
|
|
@@ -9,8 +9,9 @@ void Init_qsignalmapper(Module rb_mQt6QtCore)
|
|
|
9
9
|
{
|
|
10
10
|
rb_cQSignalMapper =
|
|
11
11
|
// RubyQt6::QtCore::QSignalMapper
|
|
12
|
-
|
|
12
|
+
define_qlass_under<QSignalMapper, QObject>(rb_mQt6QtCore, "QSignalMapper")
|
|
13
13
|
// RubyQt6-Defined Functions
|
|
14
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QSignalMapper * { return qobject_cast<QSignalMapper *>(object); })
|
|
14
15
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QSignalMapper::staticMetaObject; })
|
|
15
16
|
// Constructor
|
|
16
17
|
.define_constructor(Constructor<QSignalMapper, QObject *>(), Arg("parent"))
|
data/ext/qt6/qtcore/qsize-rb.cpp
CHANGED
|
@@ -10,7 +10,7 @@ void Init_qsize(Module rb_mQt6QtCore)
|
|
|
10
10
|
{
|
|
11
11
|
rb_cQSize =
|
|
12
12
|
// RubyQt6::QtCore::QSize
|
|
13
|
-
|
|
13
|
+
define_qlass_under<QSize>(rb_mQt6QtCore, "QSize")
|
|
14
14
|
// RubyQt6-Defined Functions
|
|
15
15
|
.define_method("*", [](QSize *self, qreal factor) -> QSize { return *self * factor; })
|
|
16
16
|
.define_method("+", [](QSize *self, QSize *other) -> QSize { return *self + *other; })
|
|
@@ -45,7 +45,7 @@ void Init_qsize(Module rb_mQt6QtCore)
|
|
|
45
45
|
|
|
46
46
|
rb_cQSizeF =
|
|
47
47
|
// RubyQt6::QtCore::QSizeF
|
|
48
|
-
|
|
48
|
+
define_qlass_under<QSizeF>(rb_mQt6QtCore, "QSizeF")
|
|
49
49
|
// RubyQt6-Defined Functions
|
|
50
50
|
.define_method("*", [](QSizeF *self, qreal factor) -> QSizeF { return *self * factor; })
|
|
51
51
|
.define_method("+", [](QSizeF *self, QSizeF *other) -> QSizeF { return *self + *other; })
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#include "qsortfilterproxymodel-rb.hpp"
|
|
2
|
+
#include <qsortfilterproxymodel.h>
|
|
3
|
+
#include <rice/qt6/qenum.hpp>
|
|
4
|
+
|
|
5
|
+
#include <QBindable>
|
|
6
|
+
#include <QItemSelection>
|
|
7
|
+
#include <QSize>
|
|
8
|
+
|
|
9
|
+
RICE4RUBYQT6_USE_NAMESPACE
|
|
10
|
+
|
|
11
|
+
Class rb_cQSortFilterProxyModel;
|
|
12
|
+
|
|
13
|
+
void Init_qsortfilterproxymodel(Module rb_mQt6QtCore)
|
|
14
|
+
{
|
|
15
|
+
rb_cQSortFilterProxyModel =
|
|
16
|
+
// RubyQt6::QtCore::QSortFilterProxyModel
|
|
17
|
+
define_qlass_under<QSortFilterProxyModel, QAbstractProxyModel>(rb_mQt6QtCore, "QSortFilterProxyModel")
|
|
18
|
+
// RubyQt6-Defined Functions
|
|
19
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QSortFilterProxyModel * { return qobject_cast<QSortFilterProxyModel *>(object); })
|
|
20
|
+
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QSortFilterProxyModel::staticMetaObject; })
|
|
21
|
+
// Constructor
|
|
22
|
+
.define_constructor(Constructor<QSortFilterProxyModel, QObject *>(), Arg("parent"))
|
|
23
|
+
// Public Functions
|
|
24
|
+
.define_method("auto_accept_child_rows", &QSortFilterProxyModel::autoAcceptChildRows)
|
|
25
|
+
.define_method("bindable_auto_accept_child_rows", &QSortFilterProxyModel::bindableAutoAcceptChildRows)
|
|
26
|
+
.define_method("bindable_dynamic_sort_filter", &QSortFilterProxyModel::bindableDynamicSortFilter)
|
|
27
|
+
.define_method("bindable_filter_case_sensitivity", &QSortFilterProxyModel::bindableFilterCaseSensitivity)
|
|
28
|
+
.define_method("bindable_filter_key_column", &QSortFilterProxyModel::bindableFilterKeyColumn)
|
|
29
|
+
.define_method("bindable_filter_regular_expression", &QSortFilterProxyModel::bindableFilterRegularExpression)
|
|
30
|
+
.define_method("bindable_filter_role", &QSortFilterProxyModel::bindableFilterRole)
|
|
31
|
+
.define_method("bindable_is_sort_locale_aware", &QSortFilterProxyModel::bindableIsSortLocaleAware)
|
|
32
|
+
.define_method("bindable_recursive_filtering_enabled", &QSortFilterProxyModel::bindableRecursiveFilteringEnabled)
|
|
33
|
+
.define_method("bindable_sort_case_sensitivity", &QSortFilterProxyModel::bindableSortCaseSensitivity)
|
|
34
|
+
.define_method("bindable_sort_role", &QSortFilterProxyModel::bindableSortRole)
|
|
35
|
+
.define_method("buddy", &QSortFilterProxyModel::buddy, Arg("index"))
|
|
36
|
+
.define_method("can_fetch_more", &QSortFilterProxyModel::canFetchMore, Arg("parent"))
|
|
37
|
+
.define_method("column_count", &QSortFilterProxyModel::columnCount, Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
38
|
+
.define_method("data", &QSortFilterProxyModel::data, Arg("index"), Arg("role") = static_cast<int>(Qt::DisplayRole))
|
|
39
|
+
.define_method("drop_mime_data", &QSortFilterProxyModel::dropMimeData, Arg("data"), Arg("action"), Arg("row"), Arg("column"), Arg("parent"))
|
|
40
|
+
.define_method("dynamic_sort_filter", &QSortFilterProxyModel::dynamicSortFilter)
|
|
41
|
+
.define_method("fetch_more", &QSortFilterProxyModel::fetchMore, Arg("parent"))
|
|
42
|
+
.define_method("filter_case_sensitivity", &QSortFilterProxyModel::filterCaseSensitivity)
|
|
43
|
+
.define_method("filter_key_column", &QSortFilterProxyModel::filterKeyColumn)
|
|
44
|
+
.define_method("filter_regular_expression", &QSortFilterProxyModel::filterRegularExpression)
|
|
45
|
+
.define_method("filter_role", &QSortFilterProxyModel::filterRole)
|
|
46
|
+
.define_method("flags", &QSortFilterProxyModel::flags, Arg("index"))
|
|
47
|
+
.define_method("has_children", &QSortFilterProxyModel::hasChildren, Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
48
|
+
.define_method("header_data", &QSortFilterProxyModel::headerData, Arg("section"), Arg("orientation"), Arg("role") = static_cast<int>(Qt::DisplayRole))
|
|
49
|
+
.define_method("index", &QSortFilterProxyModel::index, Arg("row"), Arg("column"), Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
50
|
+
.define_method("insert_columns", &QSortFilterProxyModel::insertColumns, Arg("column"), Arg("count"), Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
51
|
+
.define_method("insert_rows", &QSortFilterProxyModel::insertRows, Arg("row"), Arg("count"), Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
52
|
+
.define_method("recursive_filtering_enabled?", &QSortFilterProxyModel::isRecursiveFilteringEnabled)
|
|
53
|
+
.define_method("sort_locale_aware?", &QSortFilterProxyModel::isSortLocaleAware)
|
|
54
|
+
.define_method("map_from_source", &QSortFilterProxyModel::mapFromSource, Arg("source_index"))
|
|
55
|
+
.define_method("map_selection_from_source", &QSortFilterProxyModel::mapSelectionFromSource, Arg("source_selection"))
|
|
56
|
+
.define_method("map_selection_to_source", &QSortFilterProxyModel::mapSelectionToSource, Arg("proxy_selection"))
|
|
57
|
+
.define_method("map_to_source", &QSortFilterProxyModel::mapToSource, Arg("proxy_index"))
|
|
58
|
+
.define_method("match", &QSortFilterProxyModel::match, Arg("start"), Arg("role"), Arg("value"), Arg("hits") = static_cast<int>(1), Arg("flags") = static_cast<Qt::MatchFlags>(Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)))
|
|
59
|
+
.define_method("mime_data", &QSortFilterProxyModel::mimeData, Arg("indexes"))
|
|
60
|
+
.define_method("mime_types", &QSortFilterProxyModel::mimeTypes)
|
|
61
|
+
.define_method<QModelIndex (QSortFilterProxyModel::*)(const QModelIndex &child) const>("_parent", &QSortFilterProxyModel::parent, Arg("child"))
|
|
62
|
+
.define_method<QObject *(QSortFilterProxyModel::*)() const>("_parent", &QSortFilterProxyModel::parent)
|
|
63
|
+
.define_method("remove_columns", &QSortFilterProxyModel::removeColumns, Arg("column"), Arg("count"), Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
64
|
+
.define_method("remove_rows", &QSortFilterProxyModel::removeRows, Arg("row"), Arg("count"), Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
65
|
+
.define_method("row_count", &QSortFilterProxyModel::rowCount, Arg("parent") = static_cast<const QModelIndex &>(QModelIndex()))
|
|
66
|
+
.define_method("set_auto_accept_child_rows", &QSortFilterProxyModel::setAutoAcceptChildRows, Arg("accept"))
|
|
67
|
+
.define_method("set_data", &QSortFilterProxyModel::setData, Arg("index"), Arg("value"), Arg("role") = static_cast<int>(Qt::EditRole))
|
|
68
|
+
.define_method("set_dynamic_sort_filter", &QSortFilterProxyModel::setDynamicSortFilter, Arg("enable"))
|
|
69
|
+
.define_method("set_filter_case_sensitivity", &QSortFilterProxyModel::setFilterCaseSensitivity, Arg("cs"))
|
|
70
|
+
.define_method("set_filter_key_column", &QSortFilterProxyModel::setFilterKeyColumn, Arg("column"))
|
|
71
|
+
.define_method("set_filter_role", &QSortFilterProxyModel::setFilterRole, Arg("role"))
|
|
72
|
+
.define_method("set_header_data", &QSortFilterProxyModel::setHeaderData, Arg("section"), Arg("orientation"), Arg("value"), Arg("role") = static_cast<int>(Qt::EditRole))
|
|
73
|
+
.define_method("set_recursive_filtering_enabled", &QSortFilterProxyModel::setRecursiveFilteringEnabled, Arg("recursive"))
|
|
74
|
+
.define_method("set_sort_case_sensitivity", &QSortFilterProxyModel::setSortCaseSensitivity, Arg("cs"))
|
|
75
|
+
.define_method("set_sort_locale_aware", &QSortFilterProxyModel::setSortLocaleAware, Arg("on"))
|
|
76
|
+
.define_method("set_sort_role", &QSortFilterProxyModel::setSortRole, Arg("role"))
|
|
77
|
+
.define_method("set_source_model", &QSortFilterProxyModel::setSourceModel, Arg("source_model"))
|
|
78
|
+
.define_method("sibling", &QSortFilterProxyModel::sibling, Arg("row"), Arg("column"), Arg("idx"))
|
|
79
|
+
.define_method("sort", &QSortFilterProxyModel::sort, Arg("column"), Arg("order") = static_cast<Qt::SortOrder>(Qt::AscendingOrder))
|
|
80
|
+
.define_method("sort_case_sensitivity", &QSortFilterProxyModel::sortCaseSensitivity)
|
|
81
|
+
.define_method("sort_column", &QSortFilterProxyModel::sortColumn)
|
|
82
|
+
.define_method("sort_order", &QSortFilterProxyModel::sortOrder)
|
|
83
|
+
.define_method("sort_role", &QSortFilterProxyModel::sortRole)
|
|
84
|
+
.define_method("span", &QSortFilterProxyModel::span, Arg("index"))
|
|
85
|
+
.define_method("supported_drop_actions", &QSortFilterProxyModel::supportedDropActions)
|
|
86
|
+
// Public Slots
|
|
87
|
+
.define_method("invalidate", &QSortFilterProxyModel::invalidate)
|
|
88
|
+
.define_method("set_filter_fixed_string", &QSortFilterProxyModel::setFilterFixedString, Arg("pattern"))
|
|
89
|
+
.define_method<void (QSortFilterProxyModel::*)(const QRegularExpression &)>("set_filter_regular_expression", &QSortFilterProxyModel::setFilterRegularExpression, Arg("regular_expression"))
|
|
90
|
+
.define_method<void (QSortFilterProxyModel::*)(const QString &)>("set_filter_regular_expression", &QSortFilterProxyModel::setFilterRegularExpression, Arg("pattern"))
|
|
91
|
+
.define_method("set_filter_wildcard", &QSortFilterProxyModel::setFilterWildcard, Arg("pattern"));
|
|
92
|
+
// Signals
|
|
93
|
+
// .define_method("auto_accept_child_rows_changed", &QSortFilterProxyModel::autoAcceptChildRowsChanged, Arg("auto_accept_child_rows"))
|
|
94
|
+
// .define_method("dynamic_sort_filter_changed", &QSortFilterProxyModel::dynamicSortFilterChanged, Arg("dynamic_sort_filter"))
|
|
95
|
+
// .define_method("filter_case_sensitivity_changed", &QSortFilterProxyModel::filterCaseSensitivityChanged, Arg("filter_case_sensitivity"))
|
|
96
|
+
// .define_method("filter_role_changed", &QSortFilterProxyModel::filterRoleChanged, Arg("filter_role"))
|
|
97
|
+
// .define_method("recursive_filtering_enabled_changed", &QSortFilterProxyModel::recursiveFilteringEnabledChanged, Arg("recursive_filtering_enabled"))
|
|
98
|
+
// .define_method("sort_case_sensitivity_changed", &QSortFilterProxyModel::sortCaseSensitivityChanged, Arg("sort_case_sensitivity"))
|
|
99
|
+
// .define_method("sort_locale_aware_changed", &QSortFilterProxyModel::sortLocaleAwareChanged, Arg("sort_locale_aware"))
|
|
100
|
+
// .define_method("sort_role_changed", &QSortFilterProxyModel::sortRoleChanged, Arg("sort_role"));
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
Data_Type<QSortFilterProxyModel::Direction> rb_cQSortFilterProxyModelDirection =
|
|
104
|
+
// RubyQt6::QtCore::QSortFilterProxyModel::Direction
|
|
105
|
+
define_qenum_under<QSortFilterProxyModel::Direction>(rb_cQSortFilterProxyModel, "Direction");
|
|
106
|
+
define_qenum_value_under(rb_cQSortFilterProxyModelDirection, "Rows", QSortFilterProxyModel::Direction::Rows);
|
|
107
|
+
define_qenum_value_under(rb_cQSortFilterProxyModelDirection, "Columns", QSortFilterProxyModel::Direction::Columns);
|
|
108
|
+
define_qenum_value_under(rb_cQSortFilterProxyModelDirection, "Both", QSortFilterProxyModel::Direction::Both);
|
|
109
|
+
}
|
|
@@ -11,7 +11,7 @@ void Init_qstandardpaths(Module rb_mQt6QtCore)
|
|
|
11
11
|
{
|
|
12
12
|
rb_cQStandardPaths =
|
|
13
13
|
// RubyQt6::QtCore::QStandardPaths
|
|
14
|
-
|
|
14
|
+
define_qlass_under<QStandardPaths>(rb_mQt6QtCore, "QStandardPaths")
|
|
15
15
|
// Static Public Members
|
|
16
16
|
.define_singleton_function("display_name", &QStandardPaths::displayName, Arg("type"))
|
|
17
17
|
.define_singleton_function("find_executable", &QStandardPaths::findExecutable, Arg("executable_name"), Arg("paths") = static_cast<const QStringList &>(QStringList()))
|
|
@@ -41,7 +41,7 @@ void Init_qstring(Module rb_mQt6QtCore)
|
|
|
41
41
|
{
|
|
42
42
|
rb_cQString =
|
|
43
43
|
// RubyQt6::QtCore::QString
|
|
44
|
-
|
|
44
|
+
define_qlass_under<QString>(rb_mQt6QtCore, "QString")
|
|
45
45
|
// RubyQt6-Defined Functions
|
|
46
46
|
.define_method("downcase", [](QString *self) -> QString { return self->toLower(); })
|
|
47
47
|
.define_method("upcase", [](QString *self) -> QString { return self->toUpper(); })
|
|
@@ -62,6 +62,7 @@ void Init_qstring(Module rb_mQt6QtCore)
|
|
|
62
62
|
.define_method("to_std_string", &QString::toStdString)
|
|
63
63
|
.define_method<bool (QString::*)(const QRegularExpression &, QRegularExpressionMatch *) const>("_contains", &QString::contains, Arg("re"), Arg("rmatch") = static_cast<QRegularExpressionMatch *>(nullptr))
|
|
64
64
|
.define_method<bool (QString::*)(const QString &, Qt::CaseSensitivity) const>("_contains", &QString::contains, Arg("s"), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
65
|
+
.define_method<bool (QString::*)(const QString &, Qt::CaseSensitivity) const>("_starts_with", &QString::startsWith, Arg("s"), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
65
66
|
.define_method<bool (QString::*)(const QString &, Qt::CaseSensitivity) const>("_ends_with", &QString::endsWith, Arg("s"), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
66
67
|
.define_method<qsizetype (QString::*)(const QString &, qsizetype, Qt::CaseSensitivity) const>("_index_of", &QString::indexOf, Arg("s"), Arg("from") = static_cast<qsizetype>(0), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
67
68
|
.define_method<qsizetype (QString::*)(const QRegularExpression &, qsizetype, QRegularExpressionMatch *) const>("_index_of", &QString::indexOf, Arg("re"), Arg("from") = static_cast<qsizetype>(0), Arg("rmatch") = static_cast<QRegularExpressionMatch *>(nullptr))
|
|
@@ -11,7 +11,7 @@ void Init_qstringlist(Module rb_mQt6QtCore)
|
|
|
11
11
|
{
|
|
12
12
|
rb_cQStringList =
|
|
13
13
|
// RubyQt6::QtCore::QStringList
|
|
14
|
-
|
|
14
|
+
define_qlass_under<QStringList, QList<QString>>(rb_mQt6QtCore, "QStringList")
|
|
15
15
|
.define_method("join", [](QStringList *self, const char *separator) -> QString { return self->join(separator); }, Arg("separator") = static_cast<const char *>(nullptr))
|
|
16
16
|
.define_method("join", [](QStringList *self, QString &separator) -> QString { return self->join(separator); }, Arg("separator") = static_cast<const QString &>(QString()));
|
|
17
17
|
}
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
|
|
46
46
|
#include "qobject-rb.hpp"
|
|
47
47
|
#include "qabstractitemmodel-rb.hpp"
|
|
48
|
+
#include "qabstractproxymodel-rb.hpp"
|
|
49
|
+
#include "qsortfilterproxymodel-rb.hpp"
|
|
48
50
|
#include "qcoreapplication-rb.hpp"
|
|
49
51
|
#include "qeventloop-rb.hpp"
|
|
50
52
|
#include "qiodevice-rb.hpp"
|
|
@@ -65,14 +67,13 @@
|
|
|
65
67
|
|
|
66
68
|
#include "bando-core-rb.hpp"
|
|
67
69
|
#include "bando-qobject-rb.hpp"
|
|
70
|
+
#include "bando-qsortfilterproxymodel-rb.hpp"
|
|
68
71
|
|
|
69
72
|
RICE4RUBYQT6_USE_NAMESPACE
|
|
70
73
|
|
|
71
74
|
extern "C" void Init_qtcore()
|
|
72
75
|
{
|
|
73
76
|
return detail::cpp_protect([] {
|
|
74
|
-
define_buffer<char *>();
|
|
75
|
-
|
|
76
77
|
Module rb_mQt6 = define_module("RubyQt6");
|
|
77
78
|
Module rb_mQt6QtCore = define_module_under(rb_mQt6, "QtCore");
|
|
78
79
|
|
|
@@ -122,6 +123,8 @@ extern "C" void Init_qtcore()
|
|
|
122
123
|
|
|
123
124
|
Init_qobject(rb_mQt6QtCore);
|
|
124
125
|
Init_qabstractitemmodel(rb_mQt6QtCore);
|
|
126
|
+
Init_qabstractproxymodel(rb_mQt6QtCore);
|
|
127
|
+
Init_qsortfilterproxymodel(rb_mQt6QtCore);
|
|
125
128
|
Init_qcoreapplication(rb_mQt6QtCore);
|
|
126
129
|
Init_qeventloop(rb_mQt6QtCore);
|
|
127
130
|
Init_qiodevice(rb_mQt6QtCore);
|
|
@@ -144,5 +147,6 @@ extern "C" void Init_qtcore()
|
|
|
144
147
|
Module rb_mQt6Bando = define_module_under(rb_mQt6, "Bando");
|
|
145
148
|
Init_bando_core(rb_mQt6Bando);
|
|
146
149
|
Init_bando_qobject(rb_mQt6Bando);
|
|
150
|
+
Init_bando_qsortfilterproxymodel(rb_mQt6Bando);
|
|
147
151
|
});
|
|
148
152
|
}
|
|
@@ -14,7 +14,7 @@ void Init_qtextstream(Module rb_mQt6QtCore)
|
|
|
14
14
|
{
|
|
15
15
|
rb_cQTextStream =
|
|
16
16
|
// RubyQt6::QtCore::QTextStream
|
|
17
|
-
|
|
17
|
+
define_qlass_under<QTextStream, QIODeviceBase>(rb_mQt6QtCore, "QTextStream")
|
|
18
18
|
// Constructor
|
|
19
19
|
.define_constructor(Constructor<QTextStream>())
|
|
20
20
|
.define_constructor(Constructor<QTextStream, QIODevice *>(), Arg("device"))
|
|
@@ -11,8 +11,9 @@ void Init_qtimer(Module rb_mQt6QtCore)
|
|
|
11
11
|
{
|
|
12
12
|
rb_cQTimer =
|
|
13
13
|
// RubyQt6::QtCore::QTimer
|
|
14
|
-
|
|
14
|
+
define_qlass_under<QTimer, QObject>(rb_mQt6QtCore, "QTimer")
|
|
15
15
|
// RubyQt6-Defined Functions
|
|
16
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QTimer * { return qobject_cast<QTimer *>(object); })
|
|
16
17
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QTimer::staticMetaObject; })
|
|
17
18
|
// Constructor
|
|
18
19
|
.define_constructor(Constructor<QTimer, QObject *>(), Arg("parent"))
|
|
@@ -11,8 +11,9 @@ void Init_qtranslator(Module rb_mQt6QtCore)
|
|
|
11
11
|
{
|
|
12
12
|
rb_cQTranslator =
|
|
13
13
|
// RubyQt6::QtCore::QTranslator
|
|
14
|
-
|
|
14
|
+
define_qlass_under<QTranslator, QObject>(rb_mQt6QtCore, "QTranslator")
|
|
15
15
|
// RubyQt6-Defined Functions
|
|
16
|
+
.define_singleton_function("_qobject_cast", [](QObject *object) -> const QTranslator * { return qobject_cast<QTranslator *>(object); })
|
|
16
17
|
.define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QTranslator::staticMetaObject; })
|
|
17
18
|
// Constructor
|
|
18
19
|
.define_constructor(Constructor<QTranslator, QObject *>(), Arg("parent"))
|
data/ext/qt6/qtcore/qurl-rb.cpp
CHANGED
|
@@ -13,7 +13,7 @@ void Init_qurl(Module rb_mQt6QtCore)
|
|
|
13
13
|
{
|
|
14
14
|
rb_cQUrl =
|
|
15
15
|
// RubyQt6::QtCore::QUrl
|
|
16
|
-
|
|
16
|
+
define_qlass_under<QUrl>(rb_mQt6QtCore, "QUrl")
|
|
17
17
|
// RubyQt6-Defined Functions
|
|
18
18
|
.define_method("_to_string", [](QUrl *self, int options) -> QString { return self->toString(QFlag(options)); }, Arg("options"))
|
|
19
19
|
.define_singleton_function("_qvariant_register_metatype", []() -> int { return qRegisterMetaType<QUrl>(); })
|
|
@@ -9,7 +9,7 @@ void Init_qurlquery(Module rb_mQt6QtCore)
|
|
|
9
9
|
{
|
|
10
10
|
rb_cQUrlQuery =
|
|
11
11
|
// RubyQt6::QtCore::QUrlQuery
|
|
12
|
-
|
|
12
|
+
define_qlass_under<QUrlQuery>(rb_mQt6QtCore, "QUrlQuery")
|
|
13
13
|
// Constructor
|
|
14
14
|
.define_constructor(Constructor<QUrlQuery>())
|
|
15
15
|
// Public Functions
|
data/ext/qt6/qtcore/quuid-rb.cpp
CHANGED
|
@@ -17,7 +17,7 @@ void Init_quuid(Module rb_mQt6QtCore)
|
|
|
17
17
|
{
|
|
18
18
|
rb_cQUuid =
|
|
19
19
|
// RubyQt6::QtCore::QUuid
|
|
20
|
-
|
|
20
|
+
define_qlass_under<QUuid>(rb_mQt6QtCore, "QUuid")
|
|
21
21
|
// RubyQt6-Defined Functions
|
|
22
22
|
.define_method("variant", [](QUuid *self) -> QUuid::Variant { return self->variant(); })
|
|
23
23
|
.define_method("version", [](QUuid *self) -> QUuid::Version { return self->version(); })
|
|
@@ -22,8 +22,9 @@ void Init_qvariant(Module rb_mQt6QtCore)
|
|
|
22
22
|
{
|
|
23
23
|
rb_cQVariant =
|
|
24
24
|
// RubyQt6::QtCore::QVariant
|
|
25
|
-
|
|
25
|
+
define_qlass_under<QVariant>(rb_mQt6QtCore, "QVariant")
|
|
26
26
|
// RubyQt6-Defined Functions
|
|
27
|
+
.define_singleton_function("_operator_equal", [](QVariant *lhs, QVariant *rhs) -> bool { return *lhs == *rhs; }, Arg("lhs"), Arg("rhs"))
|
|
27
28
|
.define_singleton_function("from_bool", [](bool value) -> QVariant { return QVariant(value); })
|
|
28
29
|
.define_singleton_function("from_int", [](int value) -> QVariant { return QVariant(value); })
|
|
29
30
|
.define_singleton_function("from_double", [](double value) -> QVariant { return QVariant(value); })
|
|
@@ -12,5 +12,5 @@ void Init_qvariantlist(Module rb_mQt6QtCore)
|
|
|
12
12
|
{
|
|
13
13
|
rb_cQVariantList =
|
|
14
14
|
// RubyQt6::QtCore::QVariantList
|
|
15
|
-
|
|
15
|
+
define_qlass_under<QVariantList, QList<QVariant>>(rb_mQt6QtCore, "QVariantList");
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ void Init_qvariantmap(Module rb_mQt6QtCore)
|
|
|
12
12
|
{
|
|
13
13
|
rb_cQVariantMap =
|
|
14
14
|
// RubyQt6::QtCore::QVariantMap
|
|
15
|
-
|
|
15
|
+
define_qlass_under<QVariantMap, QMap<QString, QVariant>>(rb_mQt6QtCore, "QVariantMap");
|
|
16
16
|
}
|
data/lib/qt6/bando/dsl.rb
CHANGED
|
@@ -71,11 +71,6 @@ module RubyQt6
|
|
|
71
71
|
qlass.class_eval do
|
|
72
72
|
alias_method :_initialize, :initialize
|
|
73
73
|
|
|
74
|
-
def initialize(*args)
|
|
75
|
-
super
|
|
76
|
-
_initialize_ruby_value(self, self.class._qmetaobject)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
74
|
def self._qmetaobject
|
|
80
75
|
superclass._qmetaobject
|
|
81
76
|
end
|
|
@@ -83,6 +78,17 @@ module RubyQt6
|
|
|
83
78
|
def self._rubyqt6_metaobject
|
|
84
79
|
superclass._rubyqt6_metaobject
|
|
85
80
|
end
|
|
81
|
+
|
|
82
|
+
def initialize(*args)
|
|
83
|
+
super
|
|
84
|
+
_initialize_ruby_value(self, self.class._qmetaobject)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
private
|
|
88
|
+
|
|
89
|
+
def sender
|
|
90
|
+
T.qobject_cast(_sender)
|
|
91
|
+
end
|
|
86
92
|
end
|
|
87
93
|
qlass.class_eval(&blk)
|
|
88
94
|
end
|
data/lib/qt6/configuration.rb
CHANGED
|
@@ -5,7 +5,7 @@ module RubyQt6
|
|
|
5
5
|
def self.initialize!(mod)
|
|
6
6
|
mod.constants.each do |const|
|
|
7
7
|
next if const.match?("VERSION")
|
|
8
|
-
Object.const_set(const, mod.const_get(const)) if const.start_with?("Q")
|
|
8
|
+
Object.const_set(const, mod.const_get(const)) if const.start_with?("Q", "K")
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
end
|
data/lib/qt6/ducktyping.rb
CHANGED
|
@@ -29,23 +29,33 @@ module RubyQt6
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def self.to_qanystringview(str)
|
|
32
|
-
return str
|
|
33
|
-
QAnyStringView.new(str)
|
|
32
|
+
return str if str.is_a?(QAnyStringView)
|
|
33
|
+
return QAnyStringView.new(str) if str.is_a?(String) || str.is_a?(QString)
|
|
34
|
+
raise ArgumentError, "Expected type QAnyStringView, but got #{str.class}"
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
def self.to_qbytearray(str)
|
|
37
|
-
return str
|
|
38
|
-
QByteArray.new(str)
|
|
38
|
+
return str if str.is_a?(QByteArray)
|
|
39
|
+
return QByteArray.new(str) if str.is_a?(String)
|
|
40
|
+
raise ArgumentError, "Expected type QByteArray, but got #{str.class}"
|
|
39
41
|
end
|
|
40
42
|
|
|
41
43
|
def self.to_qstr(str)
|
|
42
|
-
return str
|
|
43
|
-
QString.new(str)
|
|
44
|
+
return str if str.is_a?(QString)
|
|
45
|
+
return QString.new(str) if str.is_a?(String)
|
|
46
|
+
raise ArgumentError, "Expected type QString, but got #{str.class}"
|
|
44
47
|
end
|
|
45
48
|
|
|
46
49
|
def self.to_qkeysequence(key)
|
|
47
|
-
return key
|
|
48
|
-
QKeySequence.new(key)
|
|
50
|
+
return key if key.is_a?(QKeySequence)
|
|
51
|
+
return QKeySequence.new(key) if key.is_a?(String) || key.is_a?(QString) || key.is_a?(Integer) || key.is_a?(QKeySequence::StandardKey)
|
|
52
|
+
raise ArgumentError, "Expected type QKeySequence, but got #{key.class}"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.to_qurl(url)
|
|
56
|
+
return url if url.is_a?(QUrl)
|
|
57
|
+
return QUrl.new(url) if url.is_a?(String) || url.is_a?(QString)
|
|
58
|
+
raise ArgumentError, "Expected type QUrl, but got #{url.class}"
|
|
49
59
|
end
|
|
50
60
|
|
|
51
61
|
def self.to_qvariantlist(array)
|
|
@@ -57,13 +67,16 @@ module RubyQt6
|
|
|
57
67
|
end
|
|
58
68
|
|
|
59
69
|
def self.to_qflags(enum_or_flags)
|
|
60
|
-
return enum_or_flags unless enum_or_flags.respond_to?(:to_qflags)
|
|
61
70
|
enum_or_flags.to_qflags
|
|
62
71
|
end
|
|
63
72
|
|
|
64
|
-
def self.
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
def self.qobject_cast(object)
|
|
74
|
+
raise ArgumentError, "Expected type QObject, but got #{object.class}" unless object.is_a?(QObject)
|
|
75
|
+
|
|
76
|
+
klass = QtCore::Private.inflector.constantize(object.meta_object.class_name)
|
|
77
|
+
return object if klass.nil? # Defined in C++, but not yet in Ruby
|
|
78
|
+
return object._ruby_value if klass.method_defined?(:_ruby_value) # RubyQt6::Bando::Q..., etc.
|
|
79
|
+
klass._qobject_cast(object) # QObject, QWidget, etc.
|
|
67
80
|
end
|
|
68
81
|
|
|
69
82
|
def self.inspect_struct(object, **attributes)
|