ruby-qt6-qtcore 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.rubocop.yml +14 -0
- data/LICENSE +185 -0
- data/README.md +3 -0
- data/Rakefile +19 -0
- data/ext/qt6/qtcore/bando-qobject-rb.cpp +17 -0
- data/ext/qt6/qtcore/bando-qobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/bando-rb.cpp +37 -0
- data/ext/qt6/qtcore/bando-rb.hpp +4 -0
- data/ext/qt6/qtcore/extconf.rb +18 -0
- data/ext/qt6/qtcore/qabstractitemmodel-rb.cpp +123 -0
- data/ext/qt6/qtcore/qabstractitemmodel-rb.hpp +4 -0
- data/ext/qt6/qtcore/qanystringview-rb.cpp +19 -0
- data/ext/qt6/qtcore/qanystringview-rb.hpp +4 -0
- data/ext/qt6/qtcore/qbasictimer-rb.cpp +24 -0
- data/ext/qt6/qtcore/qbasictimer-rb.hpp +4 -0
- data/ext/qt6/qtcore/qbytearray-rb.cpp +17 -0
- data/ext/qt6/qtcore/qbytearray-rb.hpp +4 -0
- data/ext/qt6/qtcore/qchar-rb.cpp +404 -0
- data/ext/qt6/qtcore/qchar-rb.hpp +4 -0
- data/ext/qt6/qtcore/qcoreapplication-rb.cpp +74 -0
- data/ext/qt6/qtcore/qcoreapplication-rb.hpp +4 -0
- data/ext/qt6/qtcore/qcoreevent-rb.cpp +234 -0
- data/ext/qt6/qtcore/qcoreevent-rb.hpp +4 -0
- data/ext/qt6/qtcore/qdatetime-rb.cpp +188 -0
- data/ext/qt6/qtcore/qdatetime-rb.hpp +4 -0
- data/ext/qt6/qtcore/qdir-rb.cpp +133 -0
- data/ext/qt6/qtcore/qdir-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfile-rb.cpp +52 -0
- data/ext/qt6/qtcore/qfile-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfiledevice-rb.cpp +105 -0
- data/ext/qt6/qtcore/qfiledevice-rb.hpp +4 -0
- data/ext/qt6/qtcore/qfileinfo-rb.cpp +92 -0
- data/ext/qt6/qtcore/qfileinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qiodevice-rb.cpp +71 -0
- data/ext/qt6/qtcore/qiodevice-rb.hpp +4 -0
- data/ext/qt6/qtcore/qiodevicebase-rb.cpp +33 -0
- data/ext/qt6/qtcore/qiodevicebase-rb.hpp +4 -0
- data/ext/qt6/qtcore/qitemselection-rb.cpp +51 -0
- data/ext/qt6/qtcore/qitemselection-rb.hpp +4 -0
- data/ext/qt6/qtcore/qitemselectionmodel-rb.cpp +70 -0
- data/ext/qt6/qtcore/qitemselectionmodel-rb.hpp +4 -0
- data/ext/qt6/qtcore/qlibraryinfo-rb.cpp +36 -0
- data/ext/qt6/qtcore/qlibraryinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qline-rb.cpp +84 -0
- data/ext/qt6/qtcore/qline-rb.hpp +4 -0
- data/ext/qt6/qtcore/qlocale-rb.cpp +1033 -0
- data/ext/qt6/qtcore/qlocale-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmargins-rb.cpp +53 -0
- data/ext/qt6/qtcore/qmargins-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaclassinfo-rb.cpp +16 -0
- data/ext/qt6/qtcore/qmetaclassinfo-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetamethod-rb.cpp +66 -0
- data/ext/qt6/qtcore/qmetamethod-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaobject-rb.cpp +49 -0
- data/ext/qt6/qtcore/qmetaobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetaobjectbuilder-rb.cpp +157 -0
- data/ext/qt6/qtcore/qmetaobjectbuilder-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmetatype-rb.cpp +109 -0
- data/ext/qt6/qtcore/qmetatype-rb.hpp +4 -0
- data/ext/qt6/qtcore/qmodelindex-rb.cpp +30 -0
- data/ext/qt6/qtcore/qmodelindex-rb.hpp +4 -0
- data/ext/qt6/qtcore/qobject-rb.cpp +80 -0
- data/ext/qt6/qtcore/qobject-rb.hpp +4 -0
- data/ext/qt6/qtcore/qpoint-rb.cpp +65 -0
- data/ext/qt6/qtcore/qpoint-rb.hpp +4 -0
- data/ext/qt6/qtcore/qrect-rb.cpp +162 -0
- data/ext/qt6/qtcore/qrect-rb.hpp +4 -0
- data/ext/qt6/qtcore/qregularexpression-rb.cpp +114 -0
- data/ext/qt6/qtcore/qregularexpression-rb.hpp +4 -0
- data/ext/qt6/qtcore/qresource-rb.cpp +48 -0
- data/ext/qt6/qtcore/qresource-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsettings-rb.cpp +72 -0
- data/ext/qt6/qtcore/qsettings-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsignalmapper-rb.cpp +32 -0
- data/ext/qt6/qtcore/qsignalmapper-rb.hpp +4 -0
- data/ext/qt6/qtcore/qsize-rb.cpp +81 -0
- data/ext/qt6/qtcore/qsize-rb.hpp +4 -0
- data/ext/qt6/qtcore/qstring-rb.cpp +67 -0
- data/ext/qt6/qtcore/qstring-rb.hpp +4 -0
- data/ext/qt6/qtcore/qstringlist-rb.cpp +53 -0
- data/ext/qt6/qtcore/qstringlist-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-af-rb.cpp +345 -0
- data/ext/qt6/qtcore/qt-enum-af-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-gl-rb.cpp +703 -0
- data/ext/qt6/qtcore/qt-enum-gl-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-mr-rb.cpp +159 -0
- data/ext/qt6/qtcore/qt-enum-mr-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-enum-sz-rb.cpp +390 -0
- data/ext/qt6/qtcore/qt-enum-sz-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-flags-al-rb.cpp +61 -0
- data/ext/qt6/qtcore/qt-flags-al-rb.hpp +4 -0
- data/ext/qt6/qtcore/qt-flags-mz-rb.cpp +61 -0
- data/ext/qt6/qtcore/qt-flags-mz-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtcore-rb.cpp +130 -0
- data/ext/qt6/qtcore/qtcore-rb.hpp +3 -0
- data/ext/qt6/qtcore/qtcoreversion-rb.cpp +9 -0
- data/ext/qt6/qtcore/qtcoreversion-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtextstream-rb.cpp +99 -0
- data/ext/qt6/qtcore/qtextstream-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtimer-rb.cpp +47 -0
- data/ext/qt6/qtcore/qtimer-rb.hpp +4 -0
- data/ext/qt6/qtcore/qtranslator-rb.cpp +26 -0
- data/ext/qt6/qtcore/qtranslator-rb.hpp +4 -0
- data/ext/qt6/qtcore/qurl-rb.cpp +140 -0
- data/ext/qt6/qtcore/qurl-rb.hpp +4 -0
- data/ext/qt6/qtcore/quuid-rb.cpp +60 -0
- data/ext/qt6/qtcore/quuid-rb.hpp +4 -0
- data/ext/qt6/qtcore/qvariant-rb.cpp +70 -0
- data/ext/qt6/qtcore/qvariant-rb.hpp +4 -0
- data/ext/qt6/qtcore/t-qtcore-rb.cpp +31 -0
- data/ext/qt6/qtcore/t-qtcore-rb.hpp +4 -0
- data/lib/qt6/bando/dsl.rb +91 -0
- data/lib/qt6/bando/qobject.rb +9 -0
- data/lib/qt6/configuration.rb +16 -0
- data/lib/qt6/ducktyping.rb +74 -0
- data/lib/qt6/qtcore/private/_nodoc.rb +9 -0
- data/lib/qt6/qtcore/private/inflector.rb +27 -0
- data/lib/qt6/qtcore/private/metamethod.rb +67 -0
- data/lib/qt6/qtcore/private/metaobject.rb +98 -0
- data/lib/qt6/qtcore/private/signal.rb +26 -0
- data/lib/qt6/qtcore/private/signalmanager.rb +30 -0
- data/lib/qt6/qtcore/qabstractitemmodel.rb +42 -0
- data/lib/qt6/qtcore/qabstractlistmodel.rb +12 -0
- data/lib/qt6/qtcore/qabstracttablemodel.rb +12 -0
- data/lib/qt6/qtcore/qanystringview.rb +33 -0
- data/lib/qt6/qtcore/qbasictimer.rb +16 -0
- data/lib/qt6/qtcore/qbool.rb +21 -0
- data/lib/qt6/qtcore/qbytearray.rb +22 -0
- data/lib/qt6/qtcore/qchar.rb +46 -0
- data/lib/qt6/qtcore/qchildevent.rb +9 -0
- data/lib/qt6/qtcore/qcoreapplication.rb +44 -0
- data/lib/qt6/qtcore/qdate.rb +43 -0
- data/lib/qt6/qtcore/qdatetime.rb +54 -0
- data/lib/qt6/qtcore/qdir.rb +34 -0
- data/lib/qt6/qtcore/qdynamicpropertychangeevent.rb +9 -0
- data/lib/qt6/qtcore/qevent.rb +11 -0
- data/lib/qt6/qtcore/qfile.rb +21 -0
- data/lib/qt6/qtcore/qfiledevice.rb +29 -0
- data/lib/qt6/qtcore/qfileinfo.rb +30 -0
- data/lib/qt6/qtcore/qiodevice.rb +31 -0
- data/lib/qt6/qtcore/qiodevicebase.rb +13 -0
- data/lib/qt6/qtcore/qitemselection.rb +11 -0
- data/lib/qt6/qtcore/qitemselectionmodel.rb +40 -0
- data/lib/qt6/qtcore/qitemselectionrange.rb +25 -0
- data/lib/qt6/qtcore/qlibraryinfo.rb +11 -0
- data/lib/qt6/qtcore/qline.rb +42 -0
- data/lib/qt6/qtcore/qlinef.rb +42 -0
- data/lib/qt6/qtcore/qlocale.rb +44 -0
- data/lib/qt6/qtcore/qmargins.rb +38 -0
- data/lib/qt6/qtcore/qmarginsf.rb +38 -0
- data/lib/qt6/qtcore/qmetaclassinfo.rb +13 -0
- data/lib/qt6/qtcore/qmetamethod.rb +20 -0
- data/lib/qt6/qtcore/qmetamethodbuilder.rb +12 -0
- data/lib/qt6/qtcore/qmetaobject.rb +12 -0
- data/lib/qt6/qtcore/qmetaobjectbuilder.rb +30 -0
- data/lib/qt6/qtcore/qmetatype.rb +31 -0
- data/lib/qt6/qtcore/qmodelindex.rb +16 -0
- data/lib/qt6/qtcore/qobject.rb +103 -0
- data/lib/qt6/qtcore/qpoint.rb +36 -0
- data/lib/qt6/qtcore/qpointf.rb +36 -0
- data/lib/qt6/qtcore/qrect.rb +46 -0
- data/lib/qt6/qtcore/qrectf.rb +46 -0
- data/lib/qt6/qtcore/qregularexpression.rb +34 -0
- data/lib/qt6/qtcore/qregularexpressionmatch.rb +16 -0
- data/lib/qt6/qtcore/qresource.rb +29 -0
- data/lib/qt6/qtcore/qsettings.rb +73 -0
- data/lib/qt6/qtcore/qsignalmapper.rb +33 -0
- data/lib/qt6/qtcore/qsize.rb +36 -0
- data/lib/qt6/qtcore/qsizef.rb +36 -0
- data/lib/qt6/qtcore/qstring.rb +58 -0
- data/lib/qt6/qtcore/qstringlist.rb +18 -0
- data/lib/qt6/qtcore/qt/qvariant.rb +46 -0
- data/lib/qt6/qtcore/qt.rb +226 -0
- data/lib/qt6/qtcore/qtcoreversion.rb +6 -0
- data/lib/qt6/qtcore/qtextstream.rb +32 -0
- data/lib/qt6/qtcore/qtime.rb +49 -0
- data/lib/qt6/qtcore/qtimer.rb +32 -0
- data/lib/qt6/qtcore/qtimerevent.rb +9 -0
- data/lib/qt6/qtcore/qtranslator.rb +27 -0
- data/lib/qt6/qtcore/qurl.rb +55 -0
- data/lib/qt6/qtcore/quuid.rb +47 -0
- data/lib/qt6/qtcore/qvariant.rb +48 -0
- data/lib/qt6/qtcore/version.rb +7 -0
- data/lib/qt6/qtcore.rb +86 -0
- data/lib/qt6/refinements/kernel.rb +38 -0
- data/lib/qt6/refinements/string.rb +8 -0
- metadata +244 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qresource.html
|
|
6
|
+
class QResource
|
|
7
|
+
# @!parse class Compression; end
|
|
8
|
+
rubyqt6_declare_enum_under QResource, QResource::Compression
|
|
9
|
+
|
|
10
|
+
# @!visibility private
|
|
11
|
+
alias_method :_initialize, :initialize
|
|
12
|
+
|
|
13
|
+
# @return [QResource]
|
|
14
|
+
#
|
|
15
|
+
# @overload initialize
|
|
16
|
+
#
|
|
17
|
+
# @overload initialize(file)
|
|
18
|
+
# @param file [String, QString]
|
|
19
|
+
#
|
|
20
|
+
# @overload initialize(file, locale)
|
|
21
|
+
# @param file [String, QString]
|
|
22
|
+
# @param locale [QLocale]
|
|
23
|
+
def initialize(*args)
|
|
24
|
+
T.args_nth_to_qstr(args, 0)
|
|
25
|
+
_initialize(*args)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qsettings.html
|
|
6
|
+
class QSettings < RubyQt6::QtCore::QObject
|
|
7
|
+
# @!parse class Format; end
|
|
8
|
+
# @!parse class Scope ; end
|
|
9
|
+
# @!parse class Status; end
|
|
10
|
+
rubyqt6_declare_enum_under QSettings, QSettings::Format
|
|
11
|
+
rubyqt6_declare_enum_under QSettings, QSettings::Scope
|
|
12
|
+
rubyqt6_declare_enum_under QSettings, QSettings::Status
|
|
13
|
+
|
|
14
|
+
# @!parse
|
|
15
|
+
q_object do
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @!visibility private
|
|
19
|
+
alias_method :_initialize, :initialize
|
|
20
|
+
|
|
21
|
+
# @param organization [QString]
|
|
22
|
+
# @param application [QString]
|
|
23
|
+
# @return [QSettings]
|
|
24
|
+
def initialize(organization, application)
|
|
25
|
+
format = QtCore::QSettings.default_format
|
|
26
|
+
scope = QtCore::QSettings::Scope::UserScope
|
|
27
|
+
_initialize(format, scope, T.to_qstr(organization), T.to_qstr(application))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @!visibility private
|
|
31
|
+
def begin_group(prefix)
|
|
32
|
+
_begin_group(T.to_qanystringview(prefix))
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @!visibility private
|
|
36
|
+
def begin_read_array(prefix)
|
|
37
|
+
_begin_read_array(T.to_qanystringview(prefix))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @!visibility private
|
|
41
|
+
def begin_write_array(prefix, size = -1)
|
|
42
|
+
_begin_write_array(T.to_qanystringview(prefix), size)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @!visibility private
|
|
46
|
+
def contains(key)
|
|
47
|
+
_contains(T.to_qanystringview(key))
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @!visibility private
|
|
51
|
+
def remove(key)
|
|
52
|
+
_remove(T.to_qanystringview(key))
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# @!visibility private
|
|
56
|
+
def set_value(key, value)
|
|
57
|
+
qvariant = QtCore::QVariant.new(value)
|
|
58
|
+
_set_value(T.to_qanystringview(key), qvariant)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# @!visibility private
|
|
62
|
+
def value(key, default = nil)
|
|
63
|
+
qvariant = _value(T.to_qanystringview(key))
|
|
64
|
+
return default unless qvariant.valid?
|
|
65
|
+
|
|
66
|
+
case default
|
|
67
|
+
when QtCore::QStringList then QtCore::QVariant.to_qstringlist(qvariant)
|
|
68
|
+
else qvariant.value
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qsignalmapper.html
|
|
6
|
+
class QSignalMapper < RubyQt6::QtCore::QObject
|
|
7
|
+
# @!parse
|
|
8
|
+
q_object do
|
|
9
|
+
signal "mappedInt(int)"
|
|
10
|
+
signal "mappedObject(QObject*)"
|
|
11
|
+
signal "mappedString(QString)"
|
|
12
|
+
slot "map()"
|
|
13
|
+
slot "map(QObject*)"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# @!visibility private
|
|
17
|
+
alias_method :_initialize, :initialize
|
|
18
|
+
|
|
19
|
+
# @param parent [QObject]
|
|
20
|
+
# @return [QSignalMapper]
|
|
21
|
+
def initialize(parent = nil)
|
|
22
|
+
_initialize(parent)
|
|
23
|
+
_take_ownership_from_ruby(self)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @!visibility private
|
|
27
|
+
def set_mapping(*args)
|
|
28
|
+
T.args_nth_to_qstr(args, 1)
|
|
29
|
+
_set_mapping(*args)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qsize.html
|
|
6
|
+
class QSize
|
|
7
|
+
# @!visibility private
|
|
8
|
+
alias_method :_initialize, :initialize
|
|
9
|
+
|
|
10
|
+
# @return [QSize]
|
|
11
|
+
#
|
|
12
|
+
# @overload initialize
|
|
13
|
+
#
|
|
14
|
+
# @overload initialize(width, height)
|
|
15
|
+
# @param width [Integer]
|
|
16
|
+
# @param height [Integer]
|
|
17
|
+
def initialize(*args)
|
|
18
|
+
case args.size
|
|
19
|
+
when 2 then _initialize(*args.map(&:to_i))
|
|
20
|
+
else _initialize(*args)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @!visibility private
|
|
25
|
+
def ==(other)
|
|
26
|
+
return false unless other.is_a?(QtCore::QSize) || other.is_a?(QtCore::QSizeF)
|
|
27
|
+
self.class._operator_equal(self, other)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @!visibility private
|
|
31
|
+
def inspect
|
|
32
|
+
T.inspect_struct(self, width:, height:)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qsizef.html
|
|
6
|
+
class QSizeF
|
|
7
|
+
# @!visibility private
|
|
8
|
+
alias_method :_initialize, :initialize
|
|
9
|
+
|
|
10
|
+
# @return [QSizeF]
|
|
11
|
+
#
|
|
12
|
+
# @overload initialize
|
|
13
|
+
#
|
|
14
|
+
# @overload initialize(width, height)
|
|
15
|
+
# @param width [Float]
|
|
16
|
+
# @param height [Float]
|
|
17
|
+
#
|
|
18
|
+
# @overload initialize(size)
|
|
19
|
+
# @param size [QSize]
|
|
20
|
+
def initialize(*args)
|
|
21
|
+
_initialize(*args)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @!visibility private
|
|
25
|
+
def ==(other)
|
|
26
|
+
return false unless other.is_a?(QtCore::QSize) || other.is_a?(QtCore::QSizeF)
|
|
27
|
+
self.class._operator_equal(self, other)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @!visibility private
|
|
31
|
+
def inspect
|
|
32
|
+
T.inspect_struct(self, width:, height:)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qstring.html
|
|
6
|
+
class QString
|
|
7
|
+
include Comparable
|
|
8
|
+
|
|
9
|
+
# @!visibility private
|
|
10
|
+
alias_method :_initialize, :initialize
|
|
11
|
+
|
|
12
|
+
# @!visibility private
|
|
13
|
+
def self.new(str)
|
|
14
|
+
return str if str.is_a?(self)
|
|
15
|
+
allocate.tap { |o| o.__send__(:initialize, str) }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @param str [String]
|
|
19
|
+
# @return [QString]
|
|
20
|
+
def initialize(str)
|
|
21
|
+
_initialize(str)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @!visibility private
|
|
25
|
+
def contains(*args)
|
|
26
|
+
T.args_nth_to_qstr(args, 0)
|
|
27
|
+
_contains(*args)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @!visibility private
|
|
31
|
+
def split(*args)
|
|
32
|
+
T.args_nth_to_qstr(args, 0)
|
|
33
|
+
_split(*args)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @!visibility private
|
|
37
|
+
def to_s
|
|
38
|
+
to_std_string
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @!visibility private
|
|
42
|
+
def to_str
|
|
43
|
+
to_std_string
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @!visibility private
|
|
47
|
+
def <=>(other)
|
|
48
|
+
return nil unless other.respond_to?(:to_str)
|
|
49
|
+
to_str <=> other.to_str
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @!visibility private
|
|
53
|
+
def inspect
|
|
54
|
+
T.inspect_struct(self, str: to_s)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qstringlist.html
|
|
6
|
+
class QStringList
|
|
7
|
+
# @!visibility private
|
|
8
|
+
def join(separator = "")
|
|
9
|
+
_join(T.to_qstr(separator))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# @!visibility private
|
|
13
|
+
def inspect
|
|
14
|
+
T.inspect_struct(self, ary: to_a.map(&:to_s))
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
class QVariant
|
|
6
|
+
# @!visibility private
|
|
7
|
+
def self.register(id, from_object_method, to_object_method, from:)
|
|
8
|
+
id = id.to_i
|
|
9
|
+
raise "QVariant with id `#{id}` already registered" if from_object_methods.key?(id)
|
|
10
|
+
|
|
11
|
+
from_object_methods[id] = from_object_method
|
|
12
|
+
to_object_methods[id] = to_object_method
|
|
13
|
+
|
|
14
|
+
qmetatype = QtCore::QMetaType.new(id)
|
|
15
|
+
Array(from).each do |klass|
|
|
16
|
+
klass.define_singleton_method(:default_qmetatype) do
|
|
17
|
+
qmetatype
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.from_object_methods
|
|
23
|
+
@from_object_methods ||= {}
|
|
24
|
+
end
|
|
25
|
+
private_class_method :from_object_methods
|
|
26
|
+
|
|
27
|
+
def self.from_object(object, qmetatype)
|
|
28
|
+
qmetatype = QtCore::QMetaType.infer(object) if qmetatype.nil?
|
|
29
|
+
meth = from_object_methods[qmetatype.id]
|
|
30
|
+
meth ? meth.call(object) : raise("Unsupported qmetatype `#{qmetatype.name}`")
|
|
31
|
+
end
|
|
32
|
+
private_class_method :from_object
|
|
33
|
+
|
|
34
|
+
def self.to_object_methods
|
|
35
|
+
@to_object_methods ||= {}
|
|
36
|
+
end
|
|
37
|
+
private_class_method :to_object_methods
|
|
38
|
+
|
|
39
|
+
def self.to_object(qvariant)
|
|
40
|
+
meth = to_object_methods[qvariant.type_id]
|
|
41
|
+
meth ? meth.call(qvariant) : raise("Unsupported qmetatype `#{qvariant.type_name}`")
|
|
42
|
+
end
|
|
43
|
+
private_class_method :to_object
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qt.html
|
|
6
|
+
module Qt
|
|
7
|
+
# @!parse class AlignmentFlag ; end
|
|
8
|
+
# @!parse class AnchorPoint ; end
|
|
9
|
+
# @!parse class ApplicationAttribute ; end
|
|
10
|
+
# @!parse class ApplicationState ; end
|
|
11
|
+
# @!parse class ArrowType ; end
|
|
12
|
+
# @!parse class AspectRatioMode ; end
|
|
13
|
+
# @!parse class Axis ; end
|
|
14
|
+
# @!parse class BGMode ; end
|
|
15
|
+
# @!parse class BrushStyle ; end
|
|
16
|
+
# @!parse class CaseSensitivity ; end
|
|
17
|
+
# @!parse class CheckState ; end
|
|
18
|
+
# @!parse class ChecksumType ; end
|
|
19
|
+
# @!parse class ClipOperation ; end
|
|
20
|
+
# @!parse class ConnectionType ; end
|
|
21
|
+
# @!parse class ContextMenuPolicy ; end
|
|
22
|
+
# @!parse class CoordinateSystem ; end
|
|
23
|
+
# @!parse class Corner ; end
|
|
24
|
+
# @!parse class CursorMoveStyle ; end
|
|
25
|
+
# @!parse class CursorShape ; end
|
|
26
|
+
# @!parse class DateFormat ; end
|
|
27
|
+
# @!parse class DayOfWeek ; end
|
|
28
|
+
# @!parse class DockWidgetArea ; end
|
|
29
|
+
# @!parse class DropAction ; end
|
|
30
|
+
# @!parse class Edge ; end
|
|
31
|
+
# @!parse class EnterKeyType ; end
|
|
32
|
+
# @!parse class EventPriority ; end
|
|
33
|
+
# @!parse class FillRule ; end
|
|
34
|
+
# @!parse class FindChildOption ; end
|
|
35
|
+
# @!parse class FocusPolicy ; end
|
|
36
|
+
# @!parse class FocusReason ; end
|
|
37
|
+
# @!parse class GestureFlag ; end
|
|
38
|
+
# @!parse class GestureState ; end
|
|
39
|
+
# @!parse class GestureType ; end
|
|
40
|
+
# @!parse class GlobalColor ; end
|
|
41
|
+
# @!parse class HitTestAccuracy ; end
|
|
42
|
+
# @!parse class ImageConversionFlag ; end
|
|
43
|
+
# @!parse class InputMethodHint ; end
|
|
44
|
+
# @!parse class InputMethodQuery ; end
|
|
45
|
+
# @!parse class ItemDataRole ; end
|
|
46
|
+
# @!parse class ItemFlag ; end
|
|
47
|
+
# @!parse class ItemSelectionMode ; end
|
|
48
|
+
# @!parse class ItemSelectionOperation; end
|
|
49
|
+
# @!parse class Key ; end
|
|
50
|
+
# @!parse class KeyboardModifier ; end
|
|
51
|
+
# @!parse class LayoutDirection ; end
|
|
52
|
+
# @!parse class MaskMode ; end
|
|
53
|
+
# @!parse class MatchFlag ; end
|
|
54
|
+
# @!parse class Modifier ; end
|
|
55
|
+
# @!parse class MouseButton ; end
|
|
56
|
+
# @!parse class MouseEventFlag ; end
|
|
57
|
+
# @!parse class MouseEventSource ; end
|
|
58
|
+
# @!parse class NativeGestureType ; end
|
|
59
|
+
# @!parse class NavigationMode ; end
|
|
60
|
+
# @!parse class Orientation ; end
|
|
61
|
+
# @!parse class PenCapStyle ; end
|
|
62
|
+
# @!parse class PenJoinStyle ; end
|
|
63
|
+
# @!parse class PenStyle ; end
|
|
64
|
+
# @!parse class ScreenOrientation ; end
|
|
65
|
+
# @!parse class ScrollBarPolicy ; end
|
|
66
|
+
# @!parse class ScrollPhase ; end
|
|
67
|
+
# @!parse class ShortcutContext ; end
|
|
68
|
+
# @!parse class SizeHint ; end
|
|
69
|
+
# @!parse class SizeMode ; end
|
|
70
|
+
# @!parse class SortOrder ; end
|
|
71
|
+
# @!parse class SplitBehaviorFlags ; end
|
|
72
|
+
# @!parse class TabFocusBehavior ; end
|
|
73
|
+
# @!parse class TextElideMode ; end
|
|
74
|
+
# @!parse class TextFlag ; end
|
|
75
|
+
# @!parse class TextFormat ; end
|
|
76
|
+
# @!parse class TextInteractionFlag ; end
|
|
77
|
+
# @!parse class TileRule ; end
|
|
78
|
+
# @!parse class TimeSpec ; end
|
|
79
|
+
# @!parse class TimerType ; end
|
|
80
|
+
# @!parse class ToolBarArea ; end
|
|
81
|
+
# @!parse class ToolButtonStyle ; end
|
|
82
|
+
# @!parse class TouchPointState ; end
|
|
83
|
+
# @!parse class TransformationMode ; end
|
|
84
|
+
# @!parse class UIEffect ; end
|
|
85
|
+
# @!parse class WhiteSpaceMode ; end
|
|
86
|
+
# @!parse class WidgetAttribute ; end
|
|
87
|
+
# @!parse class WindowFrameSection ; end
|
|
88
|
+
# @!parse class WindowModality ; end
|
|
89
|
+
# @!parse class WindowState ; end
|
|
90
|
+
# @!parse class WindowType ; end
|
|
91
|
+
rubyqt6_declare_enum_under Qt, Qt::AlignmentFlag
|
|
92
|
+
rubyqt6_declare_enum_under Qt, Qt::AnchorPoint
|
|
93
|
+
rubyqt6_declare_enum_under Qt, Qt::ApplicationAttribute
|
|
94
|
+
rubyqt6_declare_enum_under Qt, Qt::ApplicationState
|
|
95
|
+
rubyqt6_declare_enum_under Qt, Qt::ArrowType
|
|
96
|
+
rubyqt6_declare_enum_under Qt, Qt::AspectRatioMode
|
|
97
|
+
rubyqt6_declare_enum_under Qt, Qt::Axis
|
|
98
|
+
rubyqt6_declare_enum_under Qt, Qt::BGMode
|
|
99
|
+
rubyqt6_declare_enum_under Qt, Qt::BrushStyle
|
|
100
|
+
rubyqt6_declare_enum_under Qt, Qt::CaseSensitivity
|
|
101
|
+
rubyqt6_declare_enum_under Qt, Qt::CheckState
|
|
102
|
+
rubyqt6_declare_enum_under Qt, Qt::ChecksumType
|
|
103
|
+
rubyqt6_declare_enum_under Qt, Qt::ClipOperation
|
|
104
|
+
rubyqt6_declare_enum_under Qt, Qt::ConnectionType
|
|
105
|
+
rubyqt6_declare_enum_under Qt, Qt::ContextMenuPolicy
|
|
106
|
+
rubyqt6_declare_enum_under Qt, Qt::CoordinateSystem
|
|
107
|
+
rubyqt6_declare_enum_under Qt, Qt::Corner
|
|
108
|
+
rubyqt6_declare_enum_under Qt, Qt::CursorMoveStyle
|
|
109
|
+
rubyqt6_declare_enum_under Qt, Qt::CursorShape
|
|
110
|
+
rubyqt6_declare_enum_under Qt, Qt::DateFormat
|
|
111
|
+
rubyqt6_declare_enum_under Qt, Qt::DayOfWeek
|
|
112
|
+
rubyqt6_declare_enum_under Qt, Qt::DockWidgetArea
|
|
113
|
+
rubyqt6_declare_enum_under Qt, Qt::DropAction
|
|
114
|
+
rubyqt6_declare_enum_under Qt, Qt::Edge
|
|
115
|
+
rubyqt6_declare_enum_under Qt, Qt::EnterKeyType
|
|
116
|
+
rubyqt6_declare_enum_under Qt, Qt::EventPriority
|
|
117
|
+
rubyqt6_declare_enum_under Qt, Qt::FillRule
|
|
118
|
+
rubyqt6_declare_enum_under Qt, Qt::FindChildOption
|
|
119
|
+
rubyqt6_declare_enum_under Qt, Qt::FocusPolicy
|
|
120
|
+
rubyqt6_declare_enum_under Qt, Qt::FocusReason
|
|
121
|
+
rubyqt6_declare_enum_under Qt, Qt::GestureFlag
|
|
122
|
+
rubyqt6_declare_enum_under Qt, Qt::GestureState
|
|
123
|
+
rubyqt6_declare_enum_under Qt, Qt::GestureType
|
|
124
|
+
rubyqt6_declare_enum_under Qt, Qt::GlobalColor
|
|
125
|
+
rubyqt6_declare_enum_under Qt, Qt::HitTestAccuracy
|
|
126
|
+
rubyqt6_declare_enum_under Qt, Qt::ImageConversionFlag
|
|
127
|
+
rubyqt6_declare_enum_under Qt, Qt::InputMethodHint
|
|
128
|
+
rubyqt6_declare_enum_under Qt, Qt::InputMethodQuery
|
|
129
|
+
rubyqt6_declare_enum_under Qt, Qt::ItemDataRole
|
|
130
|
+
rubyqt6_declare_enum_under Qt, Qt::ItemFlag
|
|
131
|
+
rubyqt6_declare_enum_under Qt, Qt::ItemSelectionMode
|
|
132
|
+
rubyqt6_declare_enum_under Qt, Qt::ItemSelectionOperation
|
|
133
|
+
rubyqt6_declare_enum_under Qt, Qt::Key
|
|
134
|
+
rubyqt6_declare_enum_under Qt, Qt::KeyboardModifier
|
|
135
|
+
rubyqt6_declare_enum_under Qt, Qt::LayoutDirection
|
|
136
|
+
rubyqt6_declare_enum_under Qt, Qt::MaskMode
|
|
137
|
+
rubyqt6_declare_enum_under Qt, Qt::MatchFlag
|
|
138
|
+
rubyqt6_declare_enum_under Qt, Qt::Modifier
|
|
139
|
+
rubyqt6_declare_enum_under Qt, Qt::MouseButton
|
|
140
|
+
rubyqt6_declare_enum_under Qt, Qt::MouseEventFlag
|
|
141
|
+
rubyqt6_declare_enum_under Qt, Qt::MouseEventSource
|
|
142
|
+
rubyqt6_declare_enum_under Qt, Qt::NativeGestureType
|
|
143
|
+
rubyqt6_declare_enum_under Qt, Qt::NavigationMode
|
|
144
|
+
rubyqt6_declare_enum_under Qt, Qt::Orientation
|
|
145
|
+
rubyqt6_declare_enum_under Qt, Qt::PenCapStyle
|
|
146
|
+
rubyqt6_declare_enum_under Qt, Qt::PenJoinStyle
|
|
147
|
+
rubyqt6_declare_enum_under Qt, Qt::PenStyle
|
|
148
|
+
rubyqt6_declare_enum_under Qt, Qt::ScreenOrientation
|
|
149
|
+
rubyqt6_declare_enum_under Qt, Qt::ScrollBarPolicy
|
|
150
|
+
rubyqt6_declare_enum_under Qt, Qt::ScrollPhase
|
|
151
|
+
rubyqt6_declare_enum_under Qt, Qt::ShortcutContext
|
|
152
|
+
rubyqt6_declare_enum_under Qt, Qt::SizeHint
|
|
153
|
+
rubyqt6_declare_enum_under Qt, Qt::SizeMode
|
|
154
|
+
rubyqt6_declare_enum_under Qt, Qt::SortOrder
|
|
155
|
+
rubyqt6_declare_enum_under Qt, Qt::SplitBehaviorFlags
|
|
156
|
+
rubyqt6_declare_enum_under Qt, Qt::TabFocusBehavior
|
|
157
|
+
rubyqt6_declare_enum_under Qt, Qt::TextElideMode
|
|
158
|
+
rubyqt6_declare_enum_under Qt, Qt::TextFlag
|
|
159
|
+
rubyqt6_declare_enum_under Qt, Qt::TextFormat
|
|
160
|
+
rubyqt6_declare_enum_under Qt, Qt::TextInteractionFlag
|
|
161
|
+
rubyqt6_declare_enum_under Qt, Qt::TileRule
|
|
162
|
+
rubyqt6_declare_enum_under Qt, Qt::TimeSpec
|
|
163
|
+
rubyqt6_declare_enum_under Qt, Qt::TimerType
|
|
164
|
+
rubyqt6_declare_enum_under Qt, Qt::ToolBarArea
|
|
165
|
+
rubyqt6_declare_enum_under Qt, Qt::ToolButtonStyle
|
|
166
|
+
rubyqt6_declare_enum_under Qt, Qt::TouchPointState
|
|
167
|
+
rubyqt6_declare_enum_under Qt, Qt::TransformationMode
|
|
168
|
+
rubyqt6_declare_enum_under Qt, Qt::UIEffect
|
|
169
|
+
rubyqt6_declare_enum_under Qt, Qt::WhiteSpaceMode
|
|
170
|
+
rubyqt6_declare_enum_under Qt, Qt::WidgetAttribute
|
|
171
|
+
rubyqt6_declare_enum_under Qt, Qt::WindowFrameSection
|
|
172
|
+
rubyqt6_declare_enum_under Qt, Qt::WindowModality
|
|
173
|
+
rubyqt6_declare_enum_under Qt, Qt::WindowState
|
|
174
|
+
rubyqt6_declare_enum_under Qt, Qt::WindowType
|
|
175
|
+
|
|
176
|
+
# @!parse class Alignment ; end
|
|
177
|
+
# @!parse class ApplicationStates ; end
|
|
178
|
+
# @!parse class DockWidgetAreas ; end
|
|
179
|
+
# @!parse class DropActions ; end
|
|
180
|
+
# @!parse class Edges ; end
|
|
181
|
+
# @!parse class FindChildOptions ; end
|
|
182
|
+
# @!parse class GestureFlags ; end
|
|
183
|
+
# @!parse class ImageConversionFlags ; end
|
|
184
|
+
# @!parse class InputMethodHints ; end
|
|
185
|
+
# @!parse class InputMethodQueries ; end
|
|
186
|
+
# @!parse class ItemFlags ; end
|
|
187
|
+
# @!parse class KeyboardModifiers ; end
|
|
188
|
+
# @!parse class MatchFlags ; end
|
|
189
|
+
# @!parse class Modifiers ; end
|
|
190
|
+
# @!parse class MouseButtons ; end
|
|
191
|
+
# @!parse class MouseEventFlags ; end
|
|
192
|
+
# @!parse class Orientations ; end
|
|
193
|
+
# @!parse class ScreenOrientations ; end
|
|
194
|
+
# @!parse class SplitBehavior ; end
|
|
195
|
+
# @!parse class TextInteractionFlags ; end
|
|
196
|
+
# @!parse class ToolBarAreas ; end
|
|
197
|
+
# @!parse class TouchPointStates ; end
|
|
198
|
+
# @!parse class WindowStates ; end
|
|
199
|
+
# @!parse class WindowFlags ; end
|
|
200
|
+
rubyqt6_declare_qflags Qt::Alignment, Qt::AlignmentFlag
|
|
201
|
+
rubyqt6_declare_qflags Qt::ApplicationStates, Qt::ApplicationState
|
|
202
|
+
rubyqt6_declare_qflags Qt::DockWidgetAreas, Qt::DockWidgetArea
|
|
203
|
+
rubyqt6_declare_qflags Qt::DropActions, Qt::DropAction
|
|
204
|
+
rubyqt6_declare_qflags Qt::Edges, Qt::Edge
|
|
205
|
+
rubyqt6_declare_qflags Qt::FindChildOptions, Qt::FindChildOption
|
|
206
|
+
rubyqt6_declare_qflags Qt::GestureFlags, Qt::GestureFlag
|
|
207
|
+
rubyqt6_declare_qflags Qt::ImageConversionFlags, Qt::ImageConversionFlag
|
|
208
|
+
rubyqt6_declare_qflags Qt::InputMethodHints, Qt::InputMethodHint
|
|
209
|
+
rubyqt6_declare_qflags Qt::InputMethodQueries, Qt::InputMethodQuery
|
|
210
|
+
rubyqt6_declare_qflags Qt::ItemFlags, Qt::ItemFlag
|
|
211
|
+
rubyqt6_declare_qflags Qt::KeyboardModifier, Qt::KeyboardModifier
|
|
212
|
+
rubyqt6_declare_qflags Qt::MatchFlags, Qt::MatchFlag
|
|
213
|
+
rubyqt6_declare_qflags Qt::Modifiers, Qt::Modifier
|
|
214
|
+
rubyqt6_declare_qflags Qt::MouseButtons, Qt::MouseButton
|
|
215
|
+
rubyqt6_declare_qflags Qt::MouseEventFlags, Qt::MouseEventFlag
|
|
216
|
+
rubyqt6_declare_qflags Qt::Orientations, Qt::Orientation
|
|
217
|
+
rubyqt6_declare_qflags Qt::ScreenOrientations, Qt::ScreenOrientation
|
|
218
|
+
rubyqt6_declare_qflags Qt::SplitBehavior, Qt::SplitBehaviorFlags
|
|
219
|
+
rubyqt6_declare_qflags Qt::TextInteractionFlags, Qt::TextInteractionFlag
|
|
220
|
+
rubyqt6_declare_qflags Qt::ToolBarAreas, Qt::ToolBarArea
|
|
221
|
+
rubyqt6_declare_qflags Qt::TouchPointStates, Qt::TouchPointState
|
|
222
|
+
rubyqt6_declare_qflags Qt::WindowStates, Qt::WindowState
|
|
223
|
+
rubyqt6_declare_qflags Qt::WindowFlags, Qt::WindowType
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qtextstream.html
|
|
6
|
+
class QTextStream < RubyQt6::QtCore::QIODeviceBase
|
|
7
|
+
# @!parse class FieldAlignment ; end
|
|
8
|
+
# @!parse class NumberFlag ; end
|
|
9
|
+
# @!parse class NumberFlags ; end
|
|
10
|
+
# @!parse class RealNumberNotation; end
|
|
11
|
+
# @!parse class Status ; end
|
|
12
|
+
rubyqt6_declare_enum_under QTextStream, QTextStream::FieldAlignment
|
|
13
|
+
rubyqt6_declare_enum_under QTextStream, QTextStream::NumberFlag
|
|
14
|
+
rubyqt6_declare_enum_under QTextStream, QTextStream::RealNumberNotation
|
|
15
|
+
rubyqt6_declare_enum_under QTextStream, QTextStream::Status
|
|
16
|
+
rubyqt6_declare_qflags QTextStream::NumberFlags, QTextStream::NumberFlag
|
|
17
|
+
|
|
18
|
+
# @!visibility private
|
|
19
|
+
alias_method :_initialize, :initialize
|
|
20
|
+
|
|
21
|
+
# @return [QTextStream]
|
|
22
|
+
#
|
|
23
|
+
# @overload initialize
|
|
24
|
+
#
|
|
25
|
+
# @overload initialize(device)
|
|
26
|
+
# @param device [QIODevice]
|
|
27
|
+
def initialize(*args)
|
|
28
|
+
_initialize(*args)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qtime.html
|
|
6
|
+
class QTime
|
|
7
|
+
include Comparable
|
|
8
|
+
|
|
9
|
+
# @!visibility private
|
|
10
|
+
alias_method :_initialize, :initialize
|
|
11
|
+
|
|
12
|
+
# @return [QTime]
|
|
13
|
+
#
|
|
14
|
+
# @overload initialize(h, m)
|
|
15
|
+
# @param h [Integer]
|
|
16
|
+
# @param m [Integer]
|
|
17
|
+
#
|
|
18
|
+
# @overload initialize(h, m, s)
|
|
19
|
+
# @param h [Integer]
|
|
20
|
+
# @param m [Integer]
|
|
21
|
+
# @param s [Integer]
|
|
22
|
+
def initialize(*args)
|
|
23
|
+
_initialize(*args)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @!visibility private
|
|
27
|
+
def to_string(*args)
|
|
28
|
+
T.args_nth_to_qstr(args, 0)
|
|
29
|
+
_to_string(*args)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# @!visibility private
|
|
33
|
+
def to_s
|
|
34
|
+
_to_string(QtCore::Qt::RFC2822Date).to_s
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @!visibility private
|
|
38
|
+
def <=>(other)
|
|
39
|
+
return nil unless other.is_a?(QtCore::QTime)
|
|
40
|
+
self.class._operator_compare(self, other)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# @!visibility private
|
|
44
|
+
def inspect
|
|
45
|
+
T.inspect_struct(self, hour:, minute:, second:, msec:)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyQt6
|
|
4
|
+
module QtCore
|
|
5
|
+
# @see https://doc.qt.io/qt-6/qtimer.html
|
|
6
|
+
class QTimer < RubyQt6::QtCore::QObject
|
|
7
|
+
# @!parse
|
|
8
|
+
q_object do
|
|
9
|
+
signal "timeout()"
|
|
10
|
+
slot "start(int)"
|
|
11
|
+
slot "start()"
|
|
12
|
+
slot "stop()"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @!visibility private
|
|
16
|
+
alias_method :_initialize, :initialize
|
|
17
|
+
|
|
18
|
+
# @!visibility private
|
|
19
|
+
def self.single_shot(nsec, receiver, member)
|
|
20
|
+
metamethod = QtCore::Private::MetaObject.find_receiver_metamethod!(receiver, member)
|
|
21
|
+
_single_shot(nsec, receiver, metamethod.qsignature)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @param parent [QObject]
|
|
25
|
+
# @return [QTimer]
|
|
26
|
+
def initialize(parent = nil)
|
|
27
|
+
_initialize(parent)
|
|
28
|
+
_take_ownership_from_ruby(self)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|