ruby-qt6-qtcore 2.0.1 → 2.1.1
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/qdir-rb.cpp +4 -4
- data/ext/qt6/qtcore/qfileinfo-rb.cpp +1 -0
- data/ext/qt6/qtcore/qlocale-rb.cpp +0 -16
- data/ext/qt6/qtcore/qprocess-rb.cpp +2 -2
- data/ext/qt6/qtcore/qprocessenvironment-rb.cpp +4 -5
- data/ext/qt6/qtcore/qregularexpression-rb.cpp +1 -7
- data/ext/qt6/qtcore/qstring-rb.cpp +1 -0
- 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 +21 -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 +11 -5
- data/lib/qt6/qtcore/qpoint.rb +1 -1
- data/lib/qt6/qtcore/qpointf.rb +1 -1
- data/lib/qt6/qtcore/qprocess.rb +7 -1
- data/lib/qt6/qtcore/qprocessenvironment.rb +20 -0
- data/lib/qt6/qtcore/qrect.rb +1 -1
- data/lib/qt6/qtcore/qrectf.rb +1 -1
- data/lib/qt6/qtcore/qregularexpression.rb +22 -1
- data/lib/qt6/qtcore/qsettings.rb +8 -6
- data/lib/qt6/qtcore/qsize.rb +1 -1
- data/lib/qt6/qtcore/qsizef.rb +1 -1
- data/lib/qt6/qtcore/qstring.rb +15 -1
- 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: f9816cbe48c65da78617a04fea9ac06a06dd4bbcfca21c3f2ec953df383d2515
|
|
4
|
+
data.tar.gz: 3bc996d8cdfa02eb63c413eaa08737a0e985bb7061675d59c3fbe3843a65eb63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f2c0acd29970391ea32175d012d0a0f1ca178f2b249f9eb9628c02c7229d91a6f5d0fea84b29433c8a3489ddae2efa8208de035067d5f9ea32922438d53399e
|
|
7
|
+
data.tar.gz: 146d9642fbaf1553fc69b8c06321ce7c4cc1a14cbd7868e3787d3f688a9399e6d5a1b540cdfe7eee7bdee4c33a1a9499d1cc01e5f18e7096fc9c3a76cb9d85fe
|
data/ext/qt6/qtcore/qdir-rb.cpp
CHANGED
|
@@ -19,7 +19,7 @@ void Init_qdir(Module rb_mQt6QtCore)
|
|
|
19
19
|
.define_constructor(Constructor<QDir, const QString &>(), Arg("path"))
|
|
20
20
|
.define_constructor(Constructor<QDir, const QString &, const QString &>(), Arg("path"), Arg("name_filter"))
|
|
21
21
|
// Public Functions
|
|
22
|
-
.define_method("
|
|
22
|
+
.define_method("_absolute_file_path", &QDir::absoluteFilePath, Arg("file_name"))
|
|
23
23
|
.define_method("absolute_path", &QDir::absolutePath)
|
|
24
24
|
.define_method("canonical_path", &QDir::canonicalPath)
|
|
25
25
|
.define_method("cd", &QDir::cd, Arg("dir_name"))
|
|
@@ -30,9 +30,9 @@ void Init_qdir(Module rb_mQt6QtCore)
|
|
|
30
30
|
.define_method<QFileInfoList (QDir::*)(const QStringList &, QDir::Filters, QDir::SortFlags) const>("entry_info_list", &QDir::entryInfoList, Arg("name_filters"), Arg("filters") = static_cast<QDir::Filters>(QDir::Filter::NoFilter), Arg("sort") = static_cast<QDir::SortFlags>(QDir::SortFlag::NoSort))
|
|
31
31
|
.define_method<QStringList (QDir::*)(QDir::Filters, QDir::SortFlags) const>("entry_list", &QDir::entryList, Arg("filters") = static_cast<QDir::Filters>(QDir::Filter::NoFilter), Arg("sort") = static_cast<QDir::SortFlags>(QDir::SortFlag::NoSort))
|
|
32
32
|
.define_method<QStringList (QDir::*)(const QStringList &, QDir::Filters, QDir::SortFlags) const>("entry_list", &QDir::entryList, Arg("name_filters"), Arg("filters") = static_cast<QDir::Filters>(QDir::Filter::NoFilter), Arg("sort") = static_cast<QDir::SortFlags>(QDir::SortFlag::NoSort))
|
|
33
|
-
.define_method<bool (QDir::*)() const>("
|
|
34
|
-
.define_method<bool (QDir::*)(const QString &) const>("
|
|
35
|
-
.define_method("
|
|
33
|
+
.define_method<bool (QDir::*)() const>("_exists", &QDir::exists)
|
|
34
|
+
.define_method<bool (QDir::*)(const QString &) const>("_exists", &QDir::exists, Arg("name"))
|
|
35
|
+
.define_method("_file_path", &QDir::filePath, Arg("file_name"))
|
|
36
36
|
.define_method("filesystem_absolute_path", &QDir::filesystemAbsolutePath)
|
|
37
37
|
.define_method("filesystem_canonical_path", &QDir::filesystemCanonicalPath)
|
|
38
38
|
.define_method("filesystem_path", &QDir::filesystemPath)
|
|
@@ -18,6 +18,7 @@ void Init_qfileinfo(Module rb_mQt6QtCore)
|
|
|
18
18
|
.define_constructor(Constructor<QFileInfo, const QString &>(), Arg("file"))
|
|
19
19
|
.define_constructor(Constructor<QFileInfo, const QFileDevice &>(), Arg("file"))
|
|
20
20
|
.define_constructor(Constructor<QFileInfo, const QDir &, const QString &>(), Arg("dir"), Arg("file"))
|
|
21
|
+
.define_constructor(Constructor<QFileInfo, const QFileInfo &>(), Arg("other"))
|
|
21
22
|
// Public Functions
|
|
22
23
|
.define_method("absolute_dir", &QFileInfo::absoluteDir)
|
|
23
24
|
.define_method("absolute_file_path", &QFileInfo::absoluteFilePath)
|
|
@@ -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))
|
|
@@ -50,8 +50,8 @@ void Init_qprocess(Module rb_mQt6QtCore)
|
|
|
50
50
|
.define_method("set_standard_output_file", &QProcess::setStandardOutputFile, Arg("file_name"), Arg("mode") = static_cast<QIODeviceBase::OpenMode>(QIODeviceBase::Truncate))
|
|
51
51
|
.define_method("set_standard_output_process", &QProcess::setStandardOutputProcess, Arg("destination"))
|
|
52
52
|
.define_method("set_working_directory", &QProcess::setWorkingDirectory, Arg("dir"))
|
|
53
|
-
.define_method<void (QProcess::*)(QIODeviceBase::OpenMode)>("
|
|
54
|
-
.define_method<void (QProcess::*)(const QString &, const QStringList &, QIODeviceBase::OpenMode)>("
|
|
53
|
+
.define_method<void (QProcess::*)(QIODeviceBase::OpenMode)>("_start", &QProcess::start, Arg("mode") = static_cast<QIODeviceBase::OpenMode>(QIODeviceBase::ReadWrite))
|
|
54
|
+
.define_method<void (QProcess::*)(const QString &, const QStringList &, QIODeviceBase::OpenMode)>("_start", &QProcess::start, Arg("program"), Arg("arguments") = static_cast<const QStringList &>(QStringList {}), Arg("mode") = static_cast<QIODeviceBase::OpenMode>(QIODeviceBase::ReadWrite))
|
|
55
55
|
.define_method("start_command", &QProcess::startCommand, Arg("command"), Arg("mode") = static_cast<QIODeviceBase::OpenMode>(QIODeviceBase::ReadWrite))
|
|
56
56
|
.define_method<bool (QProcess::*)(qint64 *)>("start_detached", &QProcess::startDetached, Arg("pid") = static_cast<qint64 *>(nullptr))
|
|
57
57
|
.define_method("state", &QProcess::state)
|
|
@@ -13,15 +13,14 @@ void Init_qprocessenvironment(Module rb_mQt6QtCore)
|
|
|
13
13
|
define_class_under<QProcessEnvironment>(rb_mQt6QtCore, "QProcessEnvironment")
|
|
14
14
|
// Public Functions
|
|
15
15
|
.define_method("clear", &QProcessEnvironment::clear)
|
|
16
|
-
.define_method("
|
|
16
|
+
.define_method("_contains", &QProcessEnvironment::contains, Arg("name"))
|
|
17
17
|
.define_method("inherits_from_parent", &QProcessEnvironment::inheritsFromParent)
|
|
18
|
-
.define_method<void (QProcessEnvironment::*)(const QString &, const QString &)>("
|
|
19
|
-
.define_method<void (QProcessEnvironment::*)(const QProcessEnvironment &)>("insert", &QProcessEnvironment::insert, Arg("e"))
|
|
18
|
+
.define_method<void (QProcessEnvironment::*)(const QString &, const QString &)>("_insert", &QProcessEnvironment::insert, Arg("name"), Arg("value"))
|
|
20
19
|
.define_method("empty?", &QProcessEnvironment::isEmpty)
|
|
21
20
|
.define_method("keys", &QProcessEnvironment::keys)
|
|
22
|
-
.define_method("
|
|
21
|
+
.define_method("_remove", &QProcessEnvironment::remove, Arg("name"))
|
|
23
22
|
.define_method("to_string_list", &QProcessEnvironment::toStringList)
|
|
24
|
-
.define_method("
|
|
23
|
+
.define_method("_value", &QProcessEnvironment::value, Arg("name"), Arg("default_value") = static_cast<const QString &>(QString()))
|
|
25
24
|
// Static Public Members
|
|
26
25
|
.define_singleton_function("system_environment", &QProcessEnvironment::systemEnvironment);
|
|
27
26
|
|
|
@@ -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)
|
|
@@ -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>("_ends_with", &QString::endsWith, Arg("s"), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
65
66
|
.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))
|
|
66
67
|
.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))
|
|
67
68
|
.define_method<QStringList (QString::*)(const QString &, Qt::SplitBehavior, Qt::CaseSensitivity) const>("_split", &QString::split, Arg("sep"), Arg("behavior") = static_cast<Qt::SplitBehavior>(Qt::KeepEmptyParts), Arg("cs") = static_cast<Qt::CaseSensitivity>(Qt::CaseSensitive))
|
|
@@ -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
|
@@ -29,6 +29,27 @@ module RubyQt6
|
|
|
29
29
|
T.args_nth_to_qstr(args, 1)
|
|
30
30
|
_initialize(*args)
|
|
31
31
|
end
|
|
32
|
+
|
|
33
|
+
# @!visibility private
|
|
34
|
+
def absolute_file_path(file_name)
|
|
35
|
+
_absolute_file_path(T.to_qstr(file_name))
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @!visibility private
|
|
39
|
+
def exists(*args)
|
|
40
|
+
T.args_nth_to_qstr(args, 0)
|
|
41
|
+
_exists(*args)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @!visibility private
|
|
45
|
+
def file_path(file_name)
|
|
46
|
+
_file_path(T.to_qstr(file_name))
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @!visibility private
|
|
50
|
+
def inspect
|
|
51
|
+
T.inspect_struct(self, absolute_path: absolute_path.to_s)
|
|
52
|
+
end
|
|
32
53
|
end
|
|
33
54
|
end
|
|
34
55
|
end
|
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,13 @@ 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
|
+
end
|
|
106
|
+
|
|
107
|
+
# @!visibility private
|
|
108
|
+
def ==(other)
|
|
109
|
+
return false unless other.is_a?(QObject)
|
|
110
|
+
_qobject_ptr == other._qobject_ptr
|
|
105
111
|
end
|
|
106
112
|
|
|
107
113
|
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
|
@@ -32,7 +32,7 @@ module RubyQt6
|
|
|
32
32
|
|
|
33
33
|
# @!visibility private
|
|
34
34
|
def self.execute(program, arguments = nil)
|
|
35
|
-
arguments ||=
|
|
35
|
+
arguments ||= QStringList.new
|
|
36
36
|
_execute(T.to_qstr(program), arguments)
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -45,6 +45,12 @@ module RubyQt6
|
|
|
45
45
|
_initialize(parent)
|
|
46
46
|
_take_ownership_from_ruby(self)
|
|
47
47
|
end
|
|
48
|
+
|
|
49
|
+
# @!visibility private
|
|
50
|
+
def start(*args)
|
|
51
|
+
T.args_nth_to_qstr(args, 0)
|
|
52
|
+
_start(*args)
|
|
53
|
+
end
|
|
48
54
|
end
|
|
49
55
|
end
|
|
50
56
|
end
|
|
@@ -6,6 +6,26 @@ module RubyQt6
|
|
|
6
6
|
class QProcessEnvironment
|
|
7
7
|
# @!parse class Initialization; end
|
|
8
8
|
rubyqt6_declare_enum_under QProcessEnvironment, QProcessEnvironment::Initialization
|
|
9
|
+
|
|
10
|
+
# @!visibility private
|
|
11
|
+
def contains(name)
|
|
12
|
+
_contains(T.to_qstr(name))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @!visibility private
|
|
16
|
+
def insert(name, value)
|
|
17
|
+
_insert(T.to_qstr(name), T.to_qstr(value))
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @!visibility private
|
|
21
|
+
def remove(name)
|
|
22
|
+
_remove(T.to_qstr(name))
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @!visibility private
|
|
26
|
+
def value(name, default_value = "")
|
|
27
|
+
_value(T.to_qstr(name), T.to_qstr(default_value))
|
|
28
|
+
end
|
|
9
29
|
end
|
|
10
30
|
end
|
|
11
31
|
end
|
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,9 +42,14 @@ 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
|
|
48
|
+
|
|
49
|
+
# @!visibility private
|
|
50
|
+
def inspect
|
|
51
|
+
T.inspect_struct(self, pattern: pattern.to_s)
|
|
52
|
+
end
|
|
32
53
|
end
|
|
33
54
|
end
|
|
34
55
|
end
|
data/lib/qt6/qtcore/qsettings.rb
CHANGED
|
@@ -21,9 +21,11 @@ module RubyQt6
|
|
|
21
21
|
# @param organization [QString]
|
|
22
22
|
# @param application [QString]
|
|
23
23
|
# @return [QSettings]
|
|
24
|
-
def initialize(organization, application)
|
|
25
|
-
format =
|
|
26
|
-
scope =
|
|
24
|
+
def initialize(organization = nil, application = nil)
|
|
25
|
+
format = QSettings.default_format
|
|
26
|
+
scope = QSettings::Scope::UserScope
|
|
27
|
+
organization ||= QApplication.organization_name
|
|
28
|
+
application ||= QApplication.application_name
|
|
27
29
|
_initialize(format, scope, T.to_qstr(organization), T.to_qstr(application))
|
|
28
30
|
end
|
|
29
31
|
|
|
@@ -54,17 +56,17 @@ module RubyQt6
|
|
|
54
56
|
|
|
55
57
|
# @!visibility private
|
|
56
58
|
def set_value(key, value)
|
|
57
|
-
qvariant =
|
|
59
|
+
qvariant = QVariant.new(value)
|
|
58
60
|
_set_value(T.to_qanystringview(key), qvariant)
|
|
59
61
|
end
|
|
60
62
|
|
|
61
63
|
# @!visibility private
|
|
62
|
-
def value(key, default
|
|
64
|
+
def value(key, default)
|
|
63
65
|
qvariant = _value(T.to_qanystringview(key))
|
|
64
66
|
return default unless qvariant.valid?
|
|
65
67
|
|
|
66
68
|
case default
|
|
67
|
-
when
|
|
69
|
+
when QStringList then QVariant.to_qstringlist(qvariant)
|
|
68
70
|
else qvariant.value
|
|
69
71
|
end
|
|
70
72
|
end
|
data/lib/qt6/qtcore/qsize.rb
CHANGED
data/lib/qt6/qtcore/qsizef.rb
CHANGED
data/lib/qt6/qtcore/qstring.rb
CHANGED
|
@@ -11,7 +11,7 @@ module RubyQt6
|
|
|
11
11
|
|
|
12
12
|
# @param str [String]
|
|
13
13
|
# @return [QString]
|
|
14
|
-
def initialize(str)
|
|
14
|
+
def initialize(str = "")
|
|
15
15
|
_initialize(str)
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -21,6 +21,12 @@ module RubyQt6
|
|
|
21
21
|
_contains(*args)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# @!visibility private
|
|
25
|
+
def ends_with(*args)
|
|
26
|
+
T.args_nth_to_qstr(args, 0)
|
|
27
|
+
_ends_with(*args)
|
|
28
|
+
end
|
|
29
|
+
|
|
24
30
|
# @!visibility private
|
|
25
31
|
def index_of(*args)
|
|
26
32
|
T.args_nth_to_qstr(args, 0)
|
|
@@ -50,6 +56,14 @@ module RubyQt6
|
|
|
50
56
|
to_str <=> other.to_str
|
|
51
57
|
end
|
|
52
58
|
|
|
59
|
+
# @!visibility private
|
|
60
|
+
alias_method :eql?, :==
|
|
61
|
+
|
|
62
|
+
# @!visibility private
|
|
63
|
+
def hash
|
|
64
|
+
to_str.hash
|
|
65
|
+
end
|
|
66
|
+
|
|
53
67
|
# @!visibility private
|
|
54
68
|
def inspect
|
|
55
69
|
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.
|
|
4
|
+
version: 2.1.1
|
|
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
|