ruby-qt6-qtcore 2.0.1 → 2.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/ext/qt6/qtcore/qlocale-rb.cpp +0 -16
- data/ext/qt6/qtcore/qregularexpression-rb.cpp +1 -7
- data/ext/qt6/qtcore/t-qtcore-rb.cpp +4 -0
- data/lib/qt6/bando/dsl.rb +2 -2
- data/lib/qt6/configuration.rb +4 -9
- data/lib/qt6/ducktyping.rb +14 -14
- data/lib/qt6/qtcore/private/metaobject.rb +2 -2
- data/lib/qt6/qtcore/private/signalmanager.rb +4 -4
- data/lib/qt6/qtcore/qdate.rb +1 -1
- data/lib/qt6/qtcore/qdatetime.rb +1 -1
- data/lib/qt6/qtcore/qdir.rb +5 -0
- data/lib/qt6/qtcore/qfile.rb +5 -0
- data/lib/qt6/qtcore/qfileinfo.rb +5 -0
- data/lib/qt6/qtcore/qiodevice.rb +2 -2
- data/lib/qt6/qtcore/qitemselection.rb +1 -1
- data/lib/qt6/qtcore/qline.rb +1 -1
- data/lib/qt6/qtcore/qlinef.rb +1 -1
- data/lib/qt6/qtcore/qmargins.rb +1 -1
- data/lib/qt6/qtcore/qmarginsf.rb +1 -1
- data/lib/qt6/qtcore/qobject.rb +5 -5
- data/lib/qt6/qtcore/qpoint.rb +1 -1
- data/lib/qt6/qtcore/qpointf.rb +1 -1
- data/lib/qt6/qtcore/qprocess.rb +1 -1
- data/lib/qt6/qtcore/qrect.rb +1 -1
- data/lib/qt6/qtcore/qrectf.rb +1 -1
- data/lib/qt6/qtcore/qregularexpression.rb +17 -1
- data/lib/qt6/qtcore/qsettings.rb +4 -4
- data/lib/qt6/qtcore/qsize.rb +1 -1
- data/lib/qt6/qtcore/qsizef.rb +1 -1
- data/lib/qt6/qtcore/qstring.rb +8 -0
- data/lib/qt6/qtcore/qt/qvariant.rb +2 -2
- data/lib/qt6/qtcore/qtime.rb +1 -1
- data/lib/qt6/qtcore/qurl.rb +3 -3
- data/lib/qt6/qtcore/qvariant.rb +18 -18
- data/lib/qt6/qtcore/qvariantlist.rb +7 -7
- data/lib/qt6/qtcore/qvariantmap.rb +2 -2
- data/lib/qt6/qtcore/version.rb +1 -1
- data/lib/qt6/qtcore.rb +2 -0
- data/lib/qt6/refinements/kernel.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 293e494bd4d1c313d860e06950b8dfa8f3c3ed9a58e217cfaa4c298b4115bca5
|
|
4
|
+
data.tar.gz: a180f07e7a2d747cdec91f05a8fb7cd93ae9278350eefe136cf7493fba573b09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5502974f45eda419800fda383eab988c7edbcfc162b6fda2e6e088ff40f3ca2052eb921451ea97850ef3e3e8f735e08fcdb808de95bf8440daefeef78fa842ee
|
|
7
|
+
data.tar.gz: aebf08d7f6b0daa102c258779886df73b1def1212db5e2dc4d8ca4886be9e302a9f231302dee408f2866fced10111a9116a0e5b3d9d8dee6209dab876801834a
|
|
@@ -40,7 +40,6 @@ void Init_qlocale(Module rb_mQt6QtCore)
|
|
|
40
40
|
.define_method("percent", &QLocale::percent)
|
|
41
41
|
.define_method("pm_text", &QLocale::pmText)
|
|
42
42
|
.define_method("positive_sign", &QLocale::positiveSign)
|
|
43
|
-
.define_method<QString (QLocale::*)(QStringView, QLocale::QuotationStyle) const>("quote_string", &QLocale::quoteString, Arg("str"), Arg("style") = static_cast<QLocale::QuotationStyle>(QLocale::QuotationStyle::StandardQuotation))
|
|
44
43
|
.define_method<QString (QLocale::*)(const QString &, QLocale::QuotationStyle) const>("quote_string", &QLocale::quoteString, Arg("str"), Arg("style") = static_cast<QLocale::QuotationStyle>(QLocale::QuotationStyle::StandardQuotation))
|
|
45
44
|
.define_method("script", &QLocale::script)
|
|
46
45
|
.define_method("set_number_options", &QLocale::setNumberOptions, Arg("options"))
|
|
@@ -65,34 +64,23 @@ void Init_qlocale(Module rb_mQt6QtCore)
|
|
|
65
64
|
.define_method<QDateTime (QLocale::*)(const QString &, QLocale::FormatType, int) const>("to_date_time", &QLocale::toDateTime, Arg("string"), Arg("format") = static_cast<QLocale::FormatType>(QLocale::FormatType::LongFormat), Arg("base_year") = static_cast<int>(QLocale::DefaultTwoDigitBaseYear))
|
|
66
65
|
.define_method<QDateTime (QLocale::*)(const QString &, const QString &, QCalendar, int) const>("to_date_time", &QLocale::toDateTime, Arg("string"), Arg("format"), Arg("cal"), Arg("base_year") = static_cast<int>(QLocale::DefaultTwoDigitBaseYear))
|
|
67
66
|
.define_method<QDateTime (QLocale::*)(const QString &, const QString &, int) const>("to_date_time", &QLocale::toDateTime, Arg("string"), Arg("format"), Arg("base_year") = static_cast<int>(QLocale::DefaultTwoDigitBaseYear))
|
|
68
|
-
.define_method<double (QLocale::*)(QStringView, bool *) const>("to_double", &QLocale::toDouble, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
69
67
|
.define_method<double (QLocale::*)(const QString &, bool *) const>("to_double", &QLocale::toDouble, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
70
|
-
.define_method<float (QLocale::*)(QStringView, bool *) const>("to_float", &QLocale::toFloat, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
71
68
|
.define_method<float (QLocale::*)(const QString &, bool *) const>("to_float", &QLocale::toFloat, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
72
|
-
.define_method<int (QLocale::*)(QStringView, bool *) const>("to_int", &QLocale::toInt, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
73
69
|
.define_method<int (QLocale::*)(const QString &, bool *) const>("to_int", &QLocale::toInt, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
74
|
-
.define_method<long (QLocale::*)(QStringView, bool *) const>("to_long", &QLocale::toLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
75
70
|
.define_method<long (QLocale::*)(const QString &, bool *) const>("to_long", &QLocale::toLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
76
|
-
.define_method<qlonglong (QLocale::*)(QStringView, bool *) const>("to_longlong", &QLocale::toLongLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
77
71
|
.define_method<qlonglong (QLocale::*)(const QString &, bool *) const>("to_longlong", &QLocale::toLongLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
78
72
|
.define_method("to_lower", &QLocale::toLower, Arg("str"))
|
|
79
|
-
.define_method<short (QLocale::*)(QStringView, bool *) const>("to_short", &QLocale::toShort, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
80
73
|
.define_method<short (QLocale::*)(const QString &, bool *) const>("to_short", &QLocale::toShort, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
81
74
|
.define_method<QString (QLocale::*)(uint) const>("to_string", &QLocale::toString, Arg("i"))
|
|
82
75
|
.define_method<QString (QLocale::*)(ulong) const>("to_string", &QLocale::toString, Arg("i"))
|
|
83
76
|
.define_method<QString (QLocale::*)(ushort) const>("to_string", &QLocale::toString, Arg("i"))
|
|
84
77
|
.define_method<QString (QLocale::*)(QDate, QLocale::FormatType) const>("to_string", &QLocale::toString, Arg("date"), Arg("format") = static_cast<QLocale::FormatType>(QLocale::FormatType::LongFormat))
|
|
85
78
|
.define_method<QString (QLocale::*)(QDate, QLocale::FormatType, QCalendar) const>("to_string", &QLocale::toString, Arg("date"), Arg("format"), Arg("cal"))
|
|
86
|
-
.define_method<QString (QLocale::*)(QDate, QStringView) const>("to_string", &QLocale::toString, Arg("date"), Arg("format"))
|
|
87
|
-
.define_method<QString (QLocale::*)(QDate, QStringView, QCalendar) const>("to_string", &QLocale::toString, Arg("date"), Arg("format"), Arg("cal"))
|
|
88
79
|
.define_method<QString (QLocale::*)(QDate, const QString &) const>("to_string", &QLocale::toString, Arg("date"), Arg("format"))
|
|
89
80
|
.define_method<QString (QLocale::*)(QTime, QLocale::FormatType) const>("to_string", &QLocale::toString, Arg("time"), Arg("format") = static_cast<QLocale::FormatType>(QLocale::FormatType::LongFormat))
|
|
90
|
-
.define_method<QString (QLocale::*)(QTime, QStringView) const>("to_string", &QLocale::toString, Arg("time"), Arg("format"))
|
|
91
81
|
.define_method<QString (QLocale::*)(QTime, const QString &) const>("to_string", &QLocale::toString, Arg("time"), Arg("format"))
|
|
92
82
|
.define_method<QString (QLocale::*)(const QDateTime &, QLocale::FormatType) const>("to_string", &QLocale::toString, Arg("date_time"), Arg("format") = static_cast<QLocale::FormatType>(QLocale::FormatType::LongFormat))
|
|
93
83
|
.define_method<QString (QLocale::*)(const QDateTime &, QLocale::FormatType, QCalendar) const>("to_string", &QLocale::toString, Arg("date_time"), Arg("format"), Arg("cal"))
|
|
94
|
-
.define_method<QString (QLocale::*)(const QDateTime &, QStringView) const>("to_string", &QLocale::toString, Arg("date_time"), Arg("format"))
|
|
95
|
-
.define_method<QString (QLocale::*)(const QDateTime &, QStringView, QCalendar) const>("to_string", &QLocale::toString, Arg("date_time"), Arg("format"), Arg("cal"))
|
|
96
84
|
.define_method<QString (QLocale::*)(const QDateTime &, const QString &) const>("to_string", &QLocale::toString, Arg("date_time"), Arg("format"))
|
|
97
85
|
.define_method<QString (QLocale::*)(double, char, int) const>("to_string", &QLocale::toString, Arg("f"), Arg("format") = static_cast<char>('g'), Arg("precision") = static_cast<int>(6))
|
|
98
86
|
.define_method<QString (QLocale::*)(float, char, int) const>("to_string", &QLocale::toString, Arg("f"), Arg("format") = static_cast<char>('g'), Arg("precision") = static_cast<int>(6))
|
|
@@ -103,13 +91,9 @@ void Init_qlocale(Module rb_mQt6QtCore)
|
|
|
103
91
|
.define_method<QString (QLocale::*)(short) const>("to_string", &QLocale::toString, Arg("i"))
|
|
104
92
|
.define_method<QTime (QLocale::*)(const QString &, QLocale::FormatType) const>("to_time", &QLocale::toTime, Arg("string"), Arg("format") = static_cast<QLocale::FormatType>(QLocale::FormatType::LongFormat))
|
|
105
93
|
.define_method<QTime (QLocale::*)(const QString &, const QString &) const>("to_time", &QLocale::toTime, Arg("string"), Arg("format"))
|
|
106
|
-
.define_method<uint (QLocale::*)(QStringView, bool *) const>("to_uint", &QLocale::toUInt, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
107
94
|
.define_method<uint (QLocale::*)(const QString &, bool *) const>("to_uint", &QLocale::toUInt, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
108
|
-
.define_method<ulong (QLocale::*)(QStringView, bool *) const>("to_ulong", &QLocale::toULong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
109
95
|
.define_method<ulong (QLocale::*)(const QString &, bool *) const>("to_ulong", &QLocale::toULong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
110
|
-
.define_method<qulonglong (QLocale::*)(QStringView, bool *) const>("to_ulonglong", &QLocale::toULongLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
111
96
|
.define_method<qulonglong (QLocale::*)(const QString &, bool *) const>("to_ulonglong", &QLocale::toULongLong, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
112
|
-
.define_method<ushort (QLocale::*)(QStringView, bool *) const>("to_ushort", &QLocale::toUShort, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
113
97
|
.define_method<ushort (QLocale::*)(const QString &, bool *) const>("to_ushort", &QLocale::toUShort, Arg("s"), Arg("ok") = static_cast<bool *>(nullptr))
|
|
114
98
|
.define_method("to_upper", &QLocale::toUpper, Arg("str"))
|
|
115
99
|
.define_method("ui_languages", &QLocale::uiLanguages, Arg("separator") = static_cast<QLocale::TagSeparator>(QLocale::TagSeparator::Dash))
|
|
@@ -32,13 +32,9 @@ void Init_qregularexpression(Module rb_mQt6QtCore)
|
|
|
32
32
|
.define_method("set_pattern", &QRegularExpression::setPattern, Arg("pattern"))
|
|
33
33
|
.define_method("set_pattern_options", &QRegularExpression::setPatternOptions, Arg("options"))
|
|
34
34
|
// Static Public Members
|
|
35
|
-
.define_singleton_function<QString (*)(QStringView)>("anchored_pattern", &QRegularExpression::anchoredPattern, Arg("expression"))
|
|
36
35
|
.define_singleton_function<QString (*)(const QString &)>("anchored_pattern", &QRegularExpression::anchoredPattern, Arg("expression"))
|
|
37
|
-
.define_singleton_function<QString (*)(QStringView)>("escape", &QRegularExpression::escape, Arg("str"))
|
|
38
36
|
.define_singleton_function<QString (*)(const QString &)>("escape", &QRegularExpression::escape, Arg("str"))
|
|
39
|
-
.define_singleton_function("
|
|
40
|
-
.define_singleton_function<QString (*)(QStringView, QRegularExpression::WildcardConversionOptions)>("wildcard_to_regular_expression", &QRegularExpression::wildcardToRegularExpression, Arg("str"), Arg("options") = static_cast<QRegularExpression::WildcardConversionOptions>(QRegularExpression::WildcardConversionOption::DefaultWildcardConversion))
|
|
41
|
-
.define_singleton_function<QString (*)(const QString &, QRegularExpression::WildcardConversionOptions)>("wildcard_to_regular_expression", &QRegularExpression::wildcardToRegularExpression, Arg("str"), Arg("options") = static_cast<QRegularExpression::WildcardConversionOptions>(QRegularExpression::WildcardConversionOption::DefaultWildcardConversion));
|
|
37
|
+
.define_singleton_function<QString (*)(const QString &, QRegularExpression::WildcardConversionOptions)>("_wildcard_to_regular_expression", &QRegularExpression::wildcardToRegularExpression, Arg("str"), Arg("options") = static_cast<QRegularExpression::WildcardConversionOptions>(QRegularExpression::WildcardConversionOption::DefaultWildcardConversion));
|
|
42
38
|
|
|
43
39
|
Data_Type<QRegularExpression::PatternOption> rb_cQRegularExpressionPatternOption =
|
|
44
40
|
// RubyQt6::QtCore::QRegularExpression::PatternOption
|
|
@@ -101,8 +97,6 @@ void Init_qregularexpression(Module rb_mQt6QtCore)
|
|
|
101
97
|
.define_method<qsizetype (QRegularExpressionMatch::*)(QAnyStringView) const>("captured_start", &QRegularExpressionMatch::capturedStart, Arg("name"))
|
|
102
98
|
.define_method<qsizetype (QRegularExpressionMatch::*)(int) const>("captured_start", &QRegularExpressionMatch::capturedStart, Arg("nth") = static_cast<int>(0))
|
|
103
99
|
.define_method("captured_texts", &QRegularExpressionMatch::capturedTexts)
|
|
104
|
-
.define_method<QStringView (QRegularExpressionMatch::*)(QAnyStringView) const>("captured_view", &QRegularExpressionMatch::capturedView, Arg("name"))
|
|
105
|
-
.define_method<QStringView (QRegularExpressionMatch::*)(int) const>("captured_view", &QRegularExpressionMatch::capturedView, Arg("nth") = static_cast<int>(0))
|
|
106
100
|
.define_method<bool (QRegularExpressionMatch::*)(QAnyStringView) const>("has_captured", &QRegularExpressionMatch::hasCaptured, Arg("name"))
|
|
107
101
|
.define_method<bool (QRegularExpressionMatch::*)(int) const>("has_captured", &QRegularExpressionMatch::hasCaptured, Arg("nth"))
|
|
108
102
|
.define_method("has_match", &QRegularExpressionMatch::hasMatch)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include <rice/qt6/qlist.hpp>
|
|
3
3
|
#include <rice/qt6/qmap.hpp>
|
|
4
4
|
|
|
5
|
+
#include <QFileInfo>
|
|
5
6
|
#include <QItemSelectionRange>
|
|
6
7
|
#include <QModelIndex>
|
|
7
8
|
#include <QString>
|
|
@@ -16,6 +17,9 @@ void Init_t_qtcore(Module rb_mQt6T)
|
|
|
16
17
|
// QList<QByteArray>
|
|
17
18
|
define_qlist_under<QByteArray>(rb_mQt6T);
|
|
18
19
|
|
|
20
|
+
// QList<QFileInfo>
|
|
21
|
+
define_qlist_under<QFileInfo>(rb_mQt6T);
|
|
22
|
+
|
|
19
23
|
// QList<QItemSelectionRange> -> QItemSelection
|
|
20
24
|
define_qlist_under<QItemSelectionRange>(rb_mQt6T);
|
|
21
25
|
|
data/lib/qt6/bando/dsl.rb
CHANGED
|
@@ -4,7 +4,7 @@ module RubyQt6
|
|
|
4
4
|
module Bando
|
|
5
5
|
# @!visibility private
|
|
6
6
|
def self.define_bando_qobject(qlass)
|
|
7
|
-
unless qlass <= QtCore::QObject
|
|
7
|
+
unless qlass <= RubyQt6::QtCore::QObject
|
|
8
8
|
raise "Invalid superclass: macro `define_bando_qobject` " \
|
|
9
9
|
"only available for subclass of RubyQt6::QtCore::QObject"
|
|
10
10
|
end
|
|
@@ -23,7 +23,7 @@ module RubyQt6
|
|
|
23
23
|
|
|
24
24
|
# @!visibility private
|
|
25
25
|
def self.define_bando_qwidget(qlass)
|
|
26
|
-
unless qlass <= QtWidgets::QWidget
|
|
26
|
+
unless qlass <= RubyQt6::QtWidgets::QWidget
|
|
27
27
|
raise "Invalid superclass: macro `define_bando_qwidget` " \
|
|
28
28
|
"only available for subclass of RubyQt6::QtWidgets::QWidget"
|
|
29
29
|
end
|
data/lib/qt6/configuration.rb
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module RubyQt6
|
|
4
4
|
# @!visibility private
|
|
5
|
-
def self.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
mod.
|
|
9
|
-
next if const.match?("VERSION")
|
|
10
|
-
Object.const_set(const, mod.const_get(const)) if const.start_with?("Q")
|
|
11
|
-
end
|
|
5
|
+
def self.initialize!(mod)
|
|
6
|
+
mod.constants.each do |const|
|
|
7
|
+
next if const.match?("VERSION")
|
|
8
|
+
Object.const_set(const, mod.const_get(const)) if const.start_with?("Q")
|
|
12
9
|
end
|
|
13
|
-
|
|
14
|
-
true
|
|
15
10
|
end
|
|
16
11
|
end
|
data/lib/qt6/ducktyping.rb
CHANGED
|
@@ -4,56 +4,56 @@ module RubyQt6
|
|
|
4
4
|
# @!visibility private
|
|
5
5
|
module T
|
|
6
6
|
def self.args_nth_delete_qobject(args, index)
|
|
7
|
-
return unless args[index].is_a?(
|
|
7
|
+
return unless args[index].is_a?(QObject)
|
|
8
8
|
args.delete_at(index)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def self.args_nth_delete_qwidget(args, index)
|
|
12
|
-
return unless args[index].is_a?(
|
|
12
|
+
return unless args[index].is_a?(QWidget)
|
|
13
13
|
args.delete_at(index)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.args_nth_delete_qgraphicsitem(args, index)
|
|
17
|
-
return unless args[index].is_a?(
|
|
17
|
+
return unless args[index].is_a?(QGraphicsItem)
|
|
18
18
|
args.delete_at(index)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def self.args_nth_to_qanystringview(args, index)
|
|
22
|
-
return unless args[index].is_a?(String) || args[index].is_a?(
|
|
23
|
-
args[index] =
|
|
22
|
+
return unless args[index].is_a?(String) || args[index].is_a?(QString)
|
|
23
|
+
args[index] = QAnyStringView.new(args[index])
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def self.args_nth_to_qstr(args, index)
|
|
27
27
|
return unless args[index].is_a?(String)
|
|
28
|
-
args[index] =
|
|
28
|
+
args[index] = QString.new(args[index])
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def self.to_qanystringview(str)
|
|
32
|
-
return str unless str.is_a?(String) || str.is_a?(
|
|
33
|
-
|
|
32
|
+
return str unless str.is_a?(String) || str.is_a?(QString)
|
|
33
|
+
QAnyStringView.new(str)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def self.to_qbytearray(str)
|
|
37
37
|
return str unless str.is_a?(String)
|
|
38
|
-
|
|
38
|
+
QByteArray.new(str)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def self.to_qstr(str)
|
|
42
42
|
return str unless str.is_a?(String)
|
|
43
|
-
|
|
43
|
+
QString.new(str)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def self.to_qkeysequence(key)
|
|
47
|
-
return key unless key.is_a?(String) || key.is_a?(
|
|
48
|
-
|
|
47
|
+
return key unless key.is_a?(String) || key.is_a?(QString) || key.is_a?(Integer) || key.is_a?(QKeySequence::StandardKey)
|
|
48
|
+
QKeySequence.new(key)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def self.to_qvariantlist(array)
|
|
52
|
-
array.each_with_object(
|
|
52
|
+
array.each_with_object(QVariantList.new) { |e, memo| memo << QVariant.new(e) }
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def self.to_qvariantmap(hash)
|
|
56
|
-
hash.each_with_object(
|
|
56
|
+
hash.each_with_object(QVariantMap.new) { |(k, v), memo| memo[k.to_qstr] = QVariant.new(v) }
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def self.to_qflags(enum_or_flags)
|
|
@@ -56,7 +56,7 @@ module RubyQt6
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def super_class
|
|
59
|
-
return nil if @qlass ==
|
|
59
|
+
return nil if @qlass == QObject
|
|
60
60
|
@qlass.superclass._rubyqt6_metaobject
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -67,7 +67,7 @@ module RubyQt6
|
|
|
67
67
|
def to_qmetaobject
|
|
68
68
|
return @qlass._static_meta_object unless ruby?
|
|
69
69
|
|
|
70
|
-
builder =
|
|
70
|
+
builder = QMetaObjectBuilder.new
|
|
71
71
|
builder.set_class_name(@qlass.name)
|
|
72
72
|
builder.set_super_class(@qlass.superclass._qmetaobject)
|
|
73
73
|
@classinfo.each { |name, value| builder.add_class_info(name, value) }
|
|
@@ -6,12 +6,12 @@ module RubyQt6
|
|
|
6
6
|
class SignalManager
|
|
7
7
|
def self.connect(sender, signal, receiver, metamethod)
|
|
8
8
|
metamethod = QtCore::Private::MetaObject.find_receiver_metamethod!(receiver, metamethod, signal)
|
|
9
|
-
|
|
9
|
+
QObject._connect(sender, signal.qsignature, receiver, metamethod.qsignature)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def self.disconnect(sender, signal, receiver, metamethod)
|
|
13
13
|
metamethod = QtCore::Private::MetaObject.find_receiver_metamethod!(receiver, metamethod, signal)
|
|
14
|
-
|
|
14
|
+
QObject._disconnect(sender, signal.qsignature, receiver, metamethod.qsignature)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def self.emit(sender, signal, *args)
|
|
@@ -20,9 +20,9 @@ module RubyQt6
|
|
|
20
20
|
|
|
21
21
|
raise "Too many arguments" if qmetamethod.parameter_count < args.count
|
|
22
22
|
raise "Not enough arguments" if qmetamethod.parameter_count > args.count
|
|
23
|
-
args = args.map.with_index { |arg, i|
|
|
23
|
+
args = args.map.with_index { |arg, i| QVariant.new(arg, qmetamethod.parameter_meta_type(i)) }
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
QObject._emit(sender, qmetamethod, args)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
data/lib/qt6/qtcore/qdate.rb
CHANGED
data/lib/qt6/qtcore/qdatetime.rb
CHANGED
data/lib/qt6/qtcore/qdir.rb
CHANGED
data/lib/qt6/qtcore/qfile.rb
CHANGED
data/lib/qt6/qtcore/qfileinfo.rb
CHANGED
data/lib/qt6/qtcore/qiodevice.rb
CHANGED
|
@@ -5,8 +5,8 @@ module RubyQt6
|
|
|
5
5
|
# @see https://doc.qt.io/qt-6/qiodevice.html
|
|
6
6
|
class QIODevice < RubyQt6::QtCore::QObject
|
|
7
7
|
# Inherits QIODeviceBase
|
|
8
|
-
OpenModeFlag =
|
|
9
|
-
OpenMode =
|
|
8
|
+
OpenModeFlag = QIODeviceBase::OpenModeFlag
|
|
9
|
+
OpenMode = QIODeviceBase::OpenMode
|
|
10
10
|
|
|
11
11
|
# @!parse
|
|
12
12
|
[
|
data/lib/qt6/qtcore/qline.rb
CHANGED
data/lib/qt6/qtcore/qlinef.rb
CHANGED
data/lib/qt6/qtcore/qmargins.rb
CHANGED
|
@@ -25,7 +25,7 @@ module RubyQt6
|
|
|
25
25
|
|
|
26
26
|
# @!visibility private
|
|
27
27
|
def ==(other)
|
|
28
|
-
return false unless other.is_a?(
|
|
28
|
+
return false unless other.is_a?(QMargins) || other.is_a?(QMarginsF)
|
|
29
29
|
self.class._operator_equal(self, other)
|
|
30
30
|
end
|
|
31
31
|
|
data/lib/qt6/qtcore/qmarginsf.rb
CHANGED
|
@@ -25,7 +25,7 @@ module RubyQt6
|
|
|
25
25
|
|
|
26
26
|
# @!visibility private
|
|
27
27
|
def ==(other)
|
|
28
|
-
return false unless other.is_a?(
|
|
28
|
+
return false unless other.is_a?(QMargins) || other.is_a?(QMarginsF)
|
|
29
29
|
self.class._operator_equal(self, other)
|
|
30
30
|
end
|
|
31
31
|
|
data/lib/qt6/qtcore/qobject.rb
CHANGED
|
@@ -27,8 +27,8 @@ module RubyQt6
|
|
|
27
27
|
r = __send__(meth.name, *args.map(&:value))
|
|
28
28
|
next if meth.return_type.nil?
|
|
29
29
|
|
|
30
|
-
qmetatype =
|
|
31
|
-
|
|
30
|
+
qmetatype = QMetaType.from_name(meth.return_type)
|
|
31
|
+
QVariant.new(r, qmetatype)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -76,14 +76,14 @@ module RubyQt6
|
|
|
76
76
|
|
|
77
77
|
# @!visibility private
|
|
78
78
|
def find_child(name, options = nil)
|
|
79
|
-
options ||=
|
|
79
|
+
options ||= Qt::FindChildrenRecursively
|
|
80
80
|
child = _find_child(T.to_qanystringview(name), T.to_qflags(options))
|
|
81
81
|
T.bando_qobject_cast(child)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
# @!visibility private
|
|
85
85
|
def find_children(name, options = nil)
|
|
86
|
-
options ||=
|
|
86
|
+
options ||= Qt::FindChildrenRecursively
|
|
87
87
|
children = _find_children(T.to_qanystringview(name), T.to_qflags(options))
|
|
88
88
|
children.map { |child| T.bando_qobject_cast(child) }
|
|
89
89
|
end
|
|
@@ -101,7 +101,7 @@ module RubyQt6
|
|
|
101
101
|
# @!visibility private
|
|
102
102
|
def tr(source_text, disambiguation = "", n = -1)
|
|
103
103
|
context = self.class.name
|
|
104
|
-
|
|
104
|
+
QCoreApplication.translate(context, source_text, disambiguation, n)
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
private
|
data/lib/qt6/qtcore/qpoint.rb
CHANGED
|
@@ -23,7 +23,7 @@ module RubyQt6
|
|
|
23
23
|
|
|
24
24
|
# @!visibility private
|
|
25
25
|
def ==(other)
|
|
26
|
-
return false unless other.is_a?(
|
|
26
|
+
return false unless other.is_a?(QPoint) || other.is_a?(QPointF)
|
|
27
27
|
self.class._operator_equal(self, other)
|
|
28
28
|
end
|
|
29
29
|
|
data/lib/qt6/qtcore/qpointf.rb
CHANGED
|
@@ -23,7 +23,7 @@ module RubyQt6
|
|
|
23
23
|
|
|
24
24
|
# @!visibility private
|
|
25
25
|
def ==(other)
|
|
26
|
-
return false unless other.is_a?(
|
|
26
|
+
return false unless other.is_a?(QPoint) || other.is_a?(QPointF)
|
|
27
27
|
self.class._operator_equal(self, other)
|
|
28
28
|
end
|
|
29
29
|
|
data/lib/qt6/qtcore/qprocess.rb
CHANGED
data/lib/qt6/qtcore/qrect.rb
CHANGED
data/lib/qt6/qtcore/qrectf.rb
CHANGED
|
@@ -19,6 +19,22 @@ module RubyQt6
|
|
|
19
19
|
rubyqt6_declare_qflags QRegularExpression::MatchOptions, QRegularExpression::MatchOption
|
|
20
20
|
rubyqt6_declare_qflags QRegularExpression::WildcardConversionOptions, QRegularExpression::WildcardConversionOption
|
|
21
21
|
|
|
22
|
+
# @!visibility private
|
|
23
|
+
def self.from_wildcard(pattern, cs = nil, options = nil)
|
|
24
|
+
options ||= QRegularExpression::DefaultWildcardConversion
|
|
25
|
+
pattern = wildcard_to_regular_expression(T.to_qstr(pattern), options)
|
|
26
|
+
|
|
27
|
+
cs ||= Qt::CaseInsensitive
|
|
28
|
+
options = (cs == Qt::CaseSensitive) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption
|
|
29
|
+
new(pattern, options)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# @!visibility private
|
|
33
|
+
def self.wildcard_to_regular_expression(pattern, options = nil)
|
|
34
|
+
options ||= QRegularExpression::DefaultWildcardConversion
|
|
35
|
+
_wildcard_to_regular_expression(T.to_qstr(pattern), T.to_qflags(options))
|
|
36
|
+
end
|
|
37
|
+
|
|
22
38
|
# @!visibility private
|
|
23
39
|
alias_method :_initialize, :initialize
|
|
24
40
|
|
|
@@ -26,7 +42,7 @@ module RubyQt6
|
|
|
26
42
|
# @param options [QRegularExpression::PatternOptions]
|
|
27
43
|
# @return [QRegularExpression]
|
|
28
44
|
def initialize(pattern = "", options = nil)
|
|
29
|
-
options ||=
|
|
45
|
+
options ||= QRegularExpression::NoPatternOption
|
|
30
46
|
_initialize(T.to_qstr(pattern), T.to_qflags(options))
|
|
31
47
|
end
|
|
32
48
|
end
|
data/lib/qt6/qtcore/qsettings.rb
CHANGED
|
@@ -22,8 +22,8 @@ module RubyQt6
|
|
|
22
22
|
# @param application [QString]
|
|
23
23
|
# @return [QSettings]
|
|
24
24
|
def initialize(organization, application)
|
|
25
|
-
format =
|
|
26
|
-
scope =
|
|
25
|
+
format = QSettings.default_format
|
|
26
|
+
scope = QSettings::Scope::UserScope
|
|
27
27
|
_initialize(format, scope, T.to_qstr(organization), T.to_qstr(application))
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -54,7 +54,7 @@ module RubyQt6
|
|
|
54
54
|
|
|
55
55
|
# @!visibility private
|
|
56
56
|
def set_value(key, value)
|
|
57
|
-
qvariant =
|
|
57
|
+
qvariant = QVariant.new(value)
|
|
58
58
|
_set_value(T.to_qanystringview(key), qvariant)
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ module RubyQt6
|
|
|
64
64
|
return default unless qvariant.valid?
|
|
65
65
|
|
|
66
66
|
case default
|
|
67
|
-
when
|
|
67
|
+
when QStringList then QVariant.to_qstringlist(qvariant)
|
|
68
68
|
else qvariant.value
|
|
69
69
|
end
|
|
70
70
|
end
|
data/lib/qt6/qtcore/qsize.rb
CHANGED
data/lib/qt6/qtcore/qsizef.rb
CHANGED
data/lib/qt6/qtcore/qstring.rb
CHANGED
|
@@ -50,6 +50,14 @@ module RubyQt6
|
|
|
50
50
|
to_str <=> other.to_str
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
# @!visibility private
|
|
54
|
+
alias_method :eql?, :==
|
|
55
|
+
|
|
56
|
+
# @!visibility private
|
|
57
|
+
def hash
|
|
58
|
+
to_str.hash
|
|
59
|
+
end
|
|
60
|
+
|
|
53
61
|
# @!visibility private
|
|
54
62
|
def inspect
|
|
55
63
|
T.inspect_struct(self, str: to_s)
|
|
@@ -11,7 +11,7 @@ module RubyQt6
|
|
|
11
11
|
from_object_methods[id] = from_object_method
|
|
12
12
|
to_object_methods[id] = to_object_method
|
|
13
13
|
|
|
14
|
-
qmetatype =
|
|
14
|
+
qmetatype = QMetaType.new(id)
|
|
15
15
|
Array(from).each do |klass|
|
|
16
16
|
klass.define_singleton_method(:default_qmetatype) do
|
|
17
17
|
qmetatype
|
|
@@ -25,7 +25,7 @@ module RubyQt6
|
|
|
25
25
|
private_class_method :from_object_methods
|
|
26
26
|
|
|
27
27
|
def self.from_object(object, qmetatype)
|
|
28
|
-
qmetatype =
|
|
28
|
+
qmetatype = QMetaType.infer(object) if qmetatype.nil?
|
|
29
29
|
meth = from_object_methods[qmetatype.id]
|
|
30
30
|
meth ? meth.call(object) : raise("Unsupported qmetatype `#{qmetatype.name}`")
|
|
31
31
|
end
|
data/lib/qt6/qtcore/qtime.rb
CHANGED
data/lib/qt6/qtcore/qurl.rb
CHANGED
|
@@ -24,7 +24,7 @@ module RubyQt6
|
|
|
24
24
|
rubyqt6_declare_qflags QUrl::UserInputResolutionOptions, QUrl::UserInputResolutionOption
|
|
25
25
|
|
|
26
26
|
# @!parse
|
|
27
|
-
|
|
27
|
+
QVariant.register(
|
|
28
28
|
_qvariant_register_metatype,
|
|
29
29
|
method(:_qvariant_from_value),
|
|
30
30
|
method(:_qvariant_to_value),
|
|
@@ -41,7 +41,7 @@ module RubyQt6
|
|
|
41
41
|
|
|
42
42
|
# @!visibility private
|
|
43
43
|
def self.from_user_input(user_input, working_directory = "", options = nil)
|
|
44
|
-
options ||=
|
|
44
|
+
options ||= QUrl::DefaultResolution
|
|
45
45
|
_from_user_input(T.to_qstr(user_input), T.to_qstr(working_directory), T.to_qflags(options))
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -62,7 +62,7 @@ module RubyQt6
|
|
|
62
62
|
|
|
63
63
|
# @!visibility private
|
|
64
64
|
def to_string(options = nil)
|
|
65
|
-
options ||=
|
|
65
|
+
options ||= QUrl::PrettyDecoded
|
|
66
66
|
_to_string(options.to_i)
|
|
67
67
|
end
|
|
68
68
|
|
data/lib/qt6/qtcore/qvariant.rb
CHANGED
|
@@ -29,24 +29,24 @@ module RubyQt6
|
|
|
29
29
|
private_class_method :to_qobject
|
|
30
30
|
|
|
31
31
|
# @!parse
|
|
32
|
-
register(
|
|
33
|
-
register(
|
|
34
|
-
register(
|
|
35
|
-
register(
|
|
36
|
-
register(
|
|
37
|
-
register(
|
|
38
|
-
register(
|
|
39
|
-
register(
|
|
40
|
-
register(
|
|
41
|
-
register(
|
|
42
|
-
register(
|
|
43
|
-
register(
|
|
44
|
-
register(
|
|
45
|
-
register(
|
|
46
|
-
register(
|
|
47
|
-
register(
|
|
48
|
-
register(
|
|
49
|
-
register(
|
|
32
|
+
register(QMetaType::Type::Bool, method(:from_bool), method(:to_bool), from: [TrueClass, FalseClass])
|
|
33
|
+
register(QMetaType::Type::Int, method(:from_int), method(:to_int), from: Integer)
|
|
34
|
+
register(QMetaType::Type::Double, method(:from_double), method(:to_double), from: Float)
|
|
35
|
+
register(QMetaType::Type::QString, method(:from_qstring), method(:to_qstring), from: [String, QString])
|
|
36
|
+
register(QMetaType::Type::QByteArray, method(:from_qbytearray), method(:to_qbytearray), from: QByteArray)
|
|
37
|
+
register(QMetaType::Type::QDateTime, method(:from_qdatetime), method(:to_qdatetime), from: QDateTime)
|
|
38
|
+
register(QMetaType::Type::QDate, method(:from_qdate), method(:to_qdate), from: QDate)
|
|
39
|
+
register(QMetaType::Type::QTime, method(:from_qtime), method(:to_qtime), from: QTime)
|
|
40
|
+
register(QMetaType::Type::QLine, method(:from_qline), method(:to_qline), from: QLine)
|
|
41
|
+
register(QMetaType::Type::QLineF, method(:from_qlinef), method(:to_qlinef), from: QLineF)
|
|
42
|
+
register(QMetaType::Type::QPoint, method(:from_qpoint), method(:to_qpoint), from: QPoint)
|
|
43
|
+
register(QMetaType::Type::QPointF, method(:from_qpointf), method(:to_qpointf), from: QPointF)
|
|
44
|
+
register(QMetaType::Type::QRect, method(:from_qrect), method(:to_qrect), from: QRect)
|
|
45
|
+
register(QMetaType::Type::QRectF, method(:from_qrectf), method(:to_qrectf), from: QRectF)
|
|
46
|
+
register(QMetaType::Type::QSize, method(:from_qsize), method(:to_qsize), from: QSize)
|
|
47
|
+
register(QMetaType::Type::QSizeF, method(:from_qsizef), method(:to_qsizef), from: QSizeF)
|
|
48
|
+
register(QMetaType::Type::QStringList, method(:from_qstringlist), method(:to_qstringlist), from: QStringList)
|
|
49
|
+
register(QMetaType::Type::QObjectStar, method(:from_qobject), method(:to_qobject), from: QObject)
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
end
|
|
@@ -15,40 +15,40 @@ module RubyQt6
|
|
|
15
15
|
# @!visibility private
|
|
16
16
|
def count(*args)
|
|
17
17
|
case args.size
|
|
18
|
-
when 1 then _count(
|
|
18
|
+
when 1 then _count(QVariant.new(args[0]))
|
|
19
19
|
else _count(*args)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
# @!visibility private
|
|
24
24
|
def include?(element)
|
|
25
|
-
_include?(
|
|
25
|
+
_include?(QVariant.new(element))
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# @!visibility private
|
|
29
29
|
def index(element)
|
|
30
|
-
_index(
|
|
30
|
+
_index(QVariant.new(element))
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# @!visibility private
|
|
34
34
|
def insert(index, element)
|
|
35
|
-
_insert(index,
|
|
35
|
+
_insert(index, QVariant.new(element))
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
# @!visibility private
|
|
39
39
|
def push(element)
|
|
40
|
-
_push(
|
|
40
|
+
_push(QVariant.new(element))
|
|
41
41
|
end
|
|
42
42
|
alias_method :<<, :push
|
|
43
43
|
|
|
44
44
|
# @!visibility private
|
|
45
45
|
def delete(element)
|
|
46
|
-
_delete(
|
|
46
|
+
_delete(QVariant.new(element))
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# @!visibility private
|
|
50
50
|
def []=(index, element)
|
|
51
|
-
__send__("_[]=", index,
|
|
51
|
+
__send__("_[]=", index, QVariant.new(element))
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
# @!visibility private
|
|
@@ -18,13 +18,13 @@ module RubyQt6
|
|
|
18
18
|
|
|
19
19
|
# @!visibility private
|
|
20
20
|
def has_value?(value)
|
|
21
|
-
_has_value?(
|
|
21
|
+
_has_value?(QVariant.new(value))
|
|
22
22
|
end
|
|
23
23
|
alias_method :value?, :has_value?
|
|
24
24
|
|
|
25
25
|
# @!visibility private
|
|
26
26
|
def insert(key, value)
|
|
27
|
-
_insert(T.to_qstr(key),
|
|
27
|
+
_insert(T.to_qstr(key), QVariant.new(value))
|
|
28
28
|
end
|
|
29
29
|
alias_method :[]=, :insert
|
|
30
30
|
|
data/lib/qt6/qtcore/version.rb
CHANGED
data/lib/qt6/qtcore.rb
CHANGED
|
@@ -20,8 +20,8 @@ module Kernel
|
|
|
20
20
|
qmetatype_id = enum._qvariant_register_metatype
|
|
21
21
|
RubyQt6::QtCore::QVariant.register(
|
|
22
22
|
qmetatype_id,
|
|
23
|
-
->(value) {
|
|
24
|
-
->(qvariant) { enum.from_int(
|
|
23
|
+
->(value) { QVariant.from_int(value.to_int).tap { |qvariant| qvariant.convert(QMetaType.new(qmetatype_id)) } },
|
|
24
|
+
->(qvariant) { enum.from_int(QVariant.to_int(qvariant)) },
|
|
25
25
|
from: enum
|
|
26
26
|
)
|
|
27
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-qt6-qtcore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Doe
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 2.
|
|
18
|
+
version: 2.1.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 2.
|
|
25
|
+
version: 2.1.0
|
|
26
26
|
description: Ruby Bindings for Qt Core.
|
|
27
27
|
email:
|
|
28
28
|
- johndoe@example.com
|