ruby-qt6-qtcore 2.0.0 → 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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/ext/qt6/qtcore/qeventloop-rb.cpp +33 -0
  3. data/ext/qt6/qtcore/qeventloop-rb.hpp +5 -0
  4. data/ext/qt6/qtcore/qlocale-rb.cpp +0 -16
  5. data/ext/qt6/qtcore/qobject-rb.cpp +1 -0
  6. data/ext/qt6/qtcore/qprocess-rb.cpp +123 -0
  7. data/ext/qt6/qtcore/qprocess-rb.hpp +5 -0
  8. data/ext/qt6/qtcore/qprocessenvironment-rb.cpp +32 -0
  9. data/ext/qt6/qtcore/qprocessenvironment-rb.hpp +5 -0
  10. data/ext/qt6/qtcore/qregularexpression-rb.cpp +1 -7
  11. data/ext/qt6/qtcore/qtcore-rb.cpp +8 -0
  12. data/ext/qt6/qtcore/qtimer-rb.cpp +0 -2
  13. data/ext/qt6/qtcore/qurlquery-rb.cpp +33 -0
  14. data/ext/qt6/qtcore/qurlquery-rb.hpp +5 -0
  15. data/ext/qt6/qtcore/t-qtcore-rb.cpp +4 -0
  16. data/lib/qt6/bando/dsl.rb +2 -2
  17. data/lib/qt6/configuration.rb +4 -9
  18. data/lib/qt6/ducktyping.rb +14 -14
  19. data/lib/qt6/qtcore/private/metaobject.rb +2 -2
  20. data/lib/qt6/qtcore/private/signalmanager.rb +4 -4
  21. data/lib/qt6/qtcore/qdate.rb +1 -1
  22. data/lib/qt6/qtcore/qdatetime.rb +1 -1
  23. data/lib/qt6/qtcore/qdir.rb +5 -0
  24. data/lib/qt6/qtcore/qeventloop.rb +17 -0
  25. data/lib/qt6/qtcore/qfile.rb +5 -0
  26. data/lib/qt6/qtcore/qfileinfo.rb +5 -0
  27. data/lib/qt6/qtcore/qiodevice.rb +2 -2
  28. data/lib/qt6/qtcore/qitemselection.rb +1 -1
  29. data/lib/qt6/qtcore/qline.rb +1 -1
  30. data/lib/qt6/qtcore/qlinef.rb +1 -1
  31. data/lib/qt6/qtcore/qmargins.rb +1 -1
  32. data/lib/qt6/qtcore/qmarginsf.rb +1 -1
  33. data/lib/qt6/qtcore/qobject.rb +5 -5
  34. data/lib/qt6/qtcore/qpoint.rb +1 -1
  35. data/lib/qt6/qtcore/qpointf.rb +1 -1
  36. data/lib/qt6/qtcore/qprocess.rb +50 -0
  37. data/lib/qt6/qtcore/qprocessenvironment.rb +11 -0
  38. data/lib/qt6/qtcore/qrect.rb +1 -1
  39. data/lib/qt6/qtcore/qrectf.rb +1 -1
  40. data/lib/qt6/qtcore/qregularexpression.rb +17 -1
  41. data/lib/qt6/qtcore/qsettings.rb +4 -4
  42. data/lib/qt6/qtcore/qsize.rb +1 -1
  43. data/lib/qt6/qtcore/qsizef.rb +1 -1
  44. data/lib/qt6/qtcore/qstring.rb +8 -0
  45. data/lib/qt6/qtcore/qt/qvariant.rb +2 -2
  46. data/lib/qt6/qtcore/qtime.rb +1 -1
  47. data/lib/qt6/qtcore/qurl.rb +3 -3
  48. data/lib/qt6/qtcore/qurlquery.rb +41 -0
  49. data/lib/qt6/qtcore/qvariant.rb +18 -18
  50. data/lib/qt6/qtcore/qvariantlist.rb +7 -7
  51. data/lib/qt6/qtcore/qvariantmap.rb +2 -2
  52. data/lib/qt6/qtcore/version.rb +1 -1
  53. data/lib/qt6/qtcore.rb +6 -0
  54. data/lib/qt6/refinements/kernel.rb +2 -2
  55. metadata +15 -3
@@ -36,7 +36,7 @@ module RubyQt6
36
36
 
37
37
  # @!visibility private
38
38
  def to_s
39
- _to_string(QtCore::Qt::RFC2822Date).to_s
39
+ _to_string(Qt::RFC2822Date).to_s
40
40
  end
41
41
 
42
42
  # @!visibility private
@@ -29,6 +29,11 @@ module RubyQt6
29
29
  T.args_nth_to_qstr(args, 1)
30
30
  _initialize(*args)
31
31
  end
32
+
33
+ # @!visibility private
34
+ def inspect
35
+ T.inspect_struct(self, absolute_path: absolute_path.to_s)
36
+ end
32
37
  end
33
38
  end
34
39
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyQt6
4
+ module QtCore
5
+ # @see https://doc.qt.io/qt-6/qeventloop.html
6
+ class QEventLoop < RubyQt6::QtCore::QObject
7
+ # @!parse class ProcessEventsFlag ; end
8
+ # @!parse class ProcessEventsFlags; end
9
+ rubyqt6_declare_enum_under QEventLoop, QEventLoop::ProcessEventsFlag
10
+ rubyqt6_declare_qflags QEventLoop::ProcessEventsFlags, QEventLoop::ProcessEventsFlag
11
+
12
+ # @!parse
13
+ q_object do
14
+ end
15
+ end
16
+ end
17
+ end
@@ -16,6 +16,11 @@ module RubyQt6
16
16
  def initialize(name)
17
17
  _initialize(T.to_qstr(name))
18
18
  end
19
+
20
+ # @!visibility private
21
+ def inspect
22
+ T.inspect_struct(self, file_name: file_name.to_s)
23
+ end
19
24
  end
20
25
  end
21
26
  end
@@ -25,6 +25,11 @@ module RubyQt6
25
25
  T.args_nth_to_qstr(args, 1)
26
26
  _initialize(*args)
27
27
  end
28
+
29
+ # @!visibility private
30
+ def inspect
31
+ T.inspect_struct(self, absolute_file_path: absolute_file_path.to_s)
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -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 = QtCore::QIODeviceBase::OpenModeFlag
9
- OpenMode = QtCore::QIODeviceBase::OpenMode
8
+ OpenModeFlag = QIODeviceBase::OpenModeFlag
9
+ OpenMode = QIODeviceBase::OpenMode
10
10
 
11
11
  # @!parse
12
12
  [
@@ -5,7 +5,7 @@ module RubyQt6
5
5
  # @see https://doc.qt.io/qt-6/qitemselection.html
6
6
  class QItemSelection
7
7
  # @!parse
8
- QtCore::QVariant.register(
8
+ QVariant.register(
9
9
  _qvariant_register_metatype,
10
10
  method(:_qvariant_from_value),
11
11
  method(:_qvariant_to_value),
@@ -29,7 +29,7 @@ module RubyQt6
29
29
 
30
30
  # @!visibility private
31
31
  def ==(other)
32
- return false unless other.is_a?(QtCore::QLine) || other.is_a?(QtCore::QLineF)
32
+ return false unless other.is_a?(QLine) || other.is_a?(QLineF)
33
33
  self.class._operator_equal(self, other)
34
34
  end
35
35
 
@@ -29,7 +29,7 @@ module RubyQt6
29
29
 
30
30
  # @!visibility private
31
31
  def ==(other)
32
- return false unless other.is_a?(QtCore::QLine) || other.is_a?(QtCore::QLineF)
32
+ return false unless other.is_a?(QLine) || other.is_a?(QLineF)
33
33
  self.class._operator_equal(self, other)
34
34
  end
35
35
 
@@ -25,7 +25,7 @@ module RubyQt6
25
25
 
26
26
  # @!visibility private
27
27
  def ==(other)
28
- return false unless other.is_a?(QtCore::QMargins) || other.is_a?(QtCore::QMarginsF)
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
 
@@ -25,7 +25,7 @@ module RubyQt6
25
25
 
26
26
  # @!visibility private
27
27
  def ==(other)
28
- return false unless other.is_a?(QtCore::QMargins) || other.is_a?(QtCore::QMarginsF)
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
 
@@ -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 = QtCore::QMetaType.from_name(meth.return_type)
31
- QtCore::QVariant.new(r, qmetatype)
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 ||= QtCore::Qt::FindChildrenRecursively
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 ||= QtCore::Qt::FindChildrenRecursively
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
- QtCore::QCoreApplication.translate(context, source_text, disambiguation, n)
104
+ QCoreApplication.translate(context, source_text, disambiguation, n)
105
105
  end
106
106
 
107
107
  private
@@ -23,7 +23,7 @@ module RubyQt6
23
23
 
24
24
  # @!visibility private
25
25
  def ==(other)
26
- return false unless other.is_a?(QtCore::QPoint) || other.is_a?(QtCore::QPointF)
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
 
@@ -23,7 +23,7 @@ module RubyQt6
23
23
 
24
24
  # @!visibility private
25
25
  def ==(other)
26
- return false unless other.is_a?(QtCore::QPoint) || other.is_a?(QtCore::QPointF)
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
 
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyQt6
4
+ module QtCore
5
+ # @see https://doc.qt.io/qt-6/qprocess.html
6
+ class QProcess < RubyQt6::QtCore::QIODevice
7
+ # @!parse class ExitStatus ; end
8
+ # @!parse class InputChannelMode ; end
9
+ # @!parse class ProcessChannel ; end
10
+ # @!parse class ProcessChannelMode; end
11
+ # @!parse class ProcessError ; end
12
+ # @!parse class ProcessState ; end
13
+ rubyqt6_declare_enum_under QProcess, QProcess::ExitStatus
14
+ rubyqt6_declare_enum_under QProcess, QProcess::InputChannelMode
15
+ rubyqt6_declare_enum_under QProcess, QProcess::ProcessChannel
16
+ rubyqt6_declare_enum_under QProcess, QProcess::ProcessChannelMode
17
+ rubyqt6_declare_enum_under QProcess, QProcess::ProcessError
18
+ rubyqt6_declare_enum_under QProcess, QProcess::ProcessState
19
+
20
+ # @!parse
21
+ q_object do
22
+ signal "errorOccurred(QProcess::ProcessError)"
23
+ signal "finished(int,QProcess::ExitStatus)"
24
+ signal "finished(int)"
25
+ signal "readyReadStandardError()"
26
+ signal "readyReadStandardOutput()"
27
+ signal "started()"
28
+ signal "stateChanged(QProcess::ProcessState)"
29
+ slot "kill()"
30
+ slot "terminate()"
31
+ end
32
+
33
+ # @!visibility private
34
+ def self.execute(program, arguments = nil)
35
+ arguments ||= QStringList.new
36
+ _execute(T.to_qstr(program), arguments)
37
+ end
38
+
39
+ # @!visibility private
40
+ alias_method :_initialize, :initialize
41
+
42
+ # @param parent [QObject]
43
+ # @return [QProcess]
44
+ def initialize(parent = nil)
45
+ _initialize(parent)
46
+ _take_ownership_from_ruby(self)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyQt6
4
+ module QtCore
5
+ # @see https://doc.qt.io/qt-6/qprocessenvironment.html
6
+ class QProcessEnvironment
7
+ # @!parse class Initialization; end
8
+ rubyqt6_declare_enum_under QProcessEnvironment, QProcessEnvironment::Initialization
9
+ end
10
+ end
11
+ end
@@ -33,7 +33,7 @@ module RubyQt6
33
33
 
34
34
  # @!visibility private
35
35
  def ==(other)
36
- return false unless other.is_a?(QtCore::QRect) || other.is_a?(QtCore::QRectF)
36
+ return false unless other.is_a?(QRect) || other.is_a?(QRectF)
37
37
  self.class._operator_equal(self, other)
38
38
  end
39
39
 
@@ -33,7 +33,7 @@ module RubyQt6
33
33
 
34
34
  # @!visibility private
35
35
  def ==(other)
36
- return false unless other.is_a?(QtCore::QRect) || other.is_a?(QtCore::QRectF)
36
+ return false unless other.is_a?(QRect) || other.is_a?(QRectF)
37
37
  self.class._operator_equal(self, other)
38
38
  end
39
39
 
@@ -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 ||= QtCore::QRegularExpression::NoPatternOption
45
+ options ||= QRegularExpression::NoPatternOption
30
46
  _initialize(T.to_qstr(pattern), T.to_qflags(options))
31
47
  end
32
48
  end
@@ -22,8 +22,8 @@ module RubyQt6
22
22
  # @param application [QString]
23
23
  # @return [QSettings]
24
24
  def initialize(organization, application)
25
- format = QtCore::QSettings.default_format
26
- scope = QtCore::QSettings::Scope::UserScope
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 = QtCore::QVariant.new(value)
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 QtCore::QStringList then QtCore::QVariant.to_qstringlist(qvariant)
67
+ when QStringList then QVariant.to_qstringlist(qvariant)
68
68
  else qvariant.value
69
69
  end
70
70
  end
@@ -23,7 +23,7 @@ module RubyQt6
23
23
 
24
24
  # @!visibility private
25
25
  def ==(other)
26
- return false unless other.is_a?(QtCore::QSize) || other.is_a?(QtCore::QSizeF)
26
+ return false unless other.is_a?(QSize) || other.is_a?(QSizeF)
27
27
  self.class._operator_equal(self, other)
28
28
  end
29
29
 
@@ -23,7 +23,7 @@ module RubyQt6
23
23
 
24
24
  # @!visibility private
25
25
  def ==(other)
26
- return false unless other.is_a?(QtCore::QSize) || other.is_a?(QtCore::QSizeF)
26
+ return false unless other.is_a?(QSize) || other.is_a?(QSizeF)
27
27
  self.class._operator_equal(self, other)
28
28
  end
29
29
 
@@ -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 = QtCore::QMetaType.new(id)
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 = QtCore::QMetaType.infer(object) if qmetatype.nil?
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
@@ -31,7 +31,7 @@ module RubyQt6
31
31
 
32
32
  # @!visibility private
33
33
  def to_s
34
- _to_string(QtCore::Qt::RFC2822Date).to_s
34
+ _to_string(Qt::RFC2822Date).to_s
35
35
  end
36
36
 
37
37
  # @!visibility private
@@ -24,7 +24,7 @@ module RubyQt6
24
24
  rubyqt6_declare_qflags QUrl::UserInputResolutionOptions, QUrl::UserInputResolutionOption
25
25
 
26
26
  # @!parse
27
- QtCore::QVariant.register(
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 ||= QtCore::QUrl::DefaultResolution
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 ||= QtCore::QUrl::ComponentFormattingOption::PrettyDecoded
65
+ options ||= QUrl::PrettyDecoded
66
66
  _to_string(options.to_i)
67
67
  end
68
68
 
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyQt6
4
+ module QtCore
5
+ # @see https://doc.qt.io/qt-6/qurlquery.html
6
+ class QUrlQuery
7
+ # @!visibility private
8
+ alias_method :_initialize, :initialize
9
+
10
+ # @return [QUrlQuery]
11
+ def initialize
12
+ _initialize
13
+ end
14
+
15
+ # @!visibility private
16
+ def add_query_item(key, value)
17
+ _add_query_item(T.to_qstr(key), T.to_qstr(value))
18
+ end
19
+
20
+ # @!visibility private
21
+ def has_query_item(key)
22
+ _has_query_item(T.to_qstr(key))
23
+ end
24
+
25
+ # @!visibility private
26
+ def remove_all_query_items(key)
27
+ _remove_all_query_items(T.to_qstr(key))
28
+ end
29
+
30
+ # @!visibility private
31
+ def remove_query_item(key)
32
+ _remove_query_item(T.to_qstr(key))
33
+ end
34
+
35
+ # @!visibility private
36
+ def set_query(query)
37
+ _set_query(T.to_qstr(query))
38
+ end
39
+ end
40
+ end
41
+ end
@@ -29,24 +29,24 @@ module RubyQt6
29
29
  private_class_method :to_qobject
30
30
 
31
31
  # @!parse
32
- register(QtCore::QMetaType::Type::Bool, method(:from_bool), method(:to_bool), from: [TrueClass, FalseClass])
33
- register(QtCore::QMetaType::Type::Int, method(:from_int), method(:to_int), from: Integer)
34
- register(QtCore::QMetaType::Type::Double, method(:from_double), method(:to_double), from: Float)
35
- register(QtCore::QMetaType::Type::QString, method(:from_qstring), method(:to_qstring), from: [String, QtCore::QString])
36
- register(QtCore::QMetaType::Type::QByteArray, method(:from_qbytearray), method(:to_qbytearray), from: QtCore::QByteArray)
37
- register(QtCore::QMetaType::Type::QDateTime, method(:from_qdatetime), method(:to_qdatetime), from: QtCore::QDateTime)
38
- register(QtCore::QMetaType::Type::QDate, method(:from_qdate), method(:to_qdate), from: QtCore::QDate)
39
- register(QtCore::QMetaType::Type::QTime, method(:from_qtime), method(:to_qtime), from: QtCore::QTime)
40
- register(QtCore::QMetaType::Type::QLine, method(:from_qline), method(:to_qline), from: QtCore::QLine)
41
- register(QtCore::QMetaType::Type::QLineF, method(:from_qlinef), method(:to_qlinef), from: QtCore::QLineF)
42
- register(QtCore::QMetaType::Type::QPoint, method(:from_qpoint), method(:to_qpoint), from: QtCore::QPoint)
43
- register(QtCore::QMetaType::Type::QPointF, method(:from_qpointf), method(:to_qpointf), from: QtCore::QPointF)
44
- register(QtCore::QMetaType::Type::QRect, method(:from_qrect), method(:to_qrect), from: QtCore::QRect)
45
- register(QtCore::QMetaType::Type::QRectF, method(:from_qrectf), method(:to_qrectf), from: QtCore::QRectF)
46
- register(QtCore::QMetaType::Type::QSize, method(:from_qsize), method(:to_qsize), from: QtCore::QSize)
47
- register(QtCore::QMetaType::Type::QSizeF, method(:from_qsizef), method(:to_qsizef), from: QtCore::QSizeF)
48
- register(QtCore::QMetaType::Type::QStringList, method(:from_qstringlist), method(:to_qstringlist), from: QtCore::QStringList)
49
- register(QtCore::QMetaType::Type::QObjectStar, method(:from_qobject), method(:to_qobject), from: QtCore::QObject)
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(QtCore::QVariant.new(args[0]))
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?(QtCore::QVariant.new(element))
25
+ _include?(QVariant.new(element))
26
26
  end
27
27
 
28
28
  # @!visibility private
29
29
  def index(element)
30
- _index(QtCore::QVariant.new(element))
30
+ _index(QVariant.new(element))
31
31
  end
32
32
 
33
33
  # @!visibility private
34
34
  def insert(index, element)
35
- _insert(index, QtCore::QVariant.new(element))
35
+ _insert(index, QVariant.new(element))
36
36
  end
37
37
 
38
38
  # @!visibility private
39
39
  def push(element)
40
- _push(QtCore::QVariant.new(element))
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(QtCore::QVariant.new(element))
46
+ _delete(QVariant.new(element))
47
47
  end
48
48
 
49
49
  # @!visibility private
50
50
  def []=(index, element)
51
- __send__("_[]=", index, QtCore::QVariant.new(element))
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?(QtCore::QVariant.new(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), QtCore::QVariant.new(value))
27
+ _insert(T.to_qstr(key), QVariant.new(value))
28
28
  end
29
29
  alias_method :[]=, :insert
30
30
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyQt6
4
4
  module QtCore
5
- QTCORE_RUBYGEM_VERSION = "2.0.0"
5
+ QTCORE_RUBYGEM_VERSION = "2.1.0"
6
6
  end
7
7
  end
data/lib/qt6/qtcore.rb CHANGED
@@ -55,6 +55,7 @@ require_relative "qtcore/qmarginsf"
55
55
  require_relative "qtcore/qmodelindex"
56
56
  require_relative "qtcore/qpoint"
57
57
  require_relative "qtcore/qpointf"
58
+ require_relative "qtcore/qprocessenvironment"
58
59
  require_relative "qtcore/qrect"
59
60
  require_relative "qtcore/qrectf"
60
61
  require_relative "qtcore/qregularexpression"
@@ -66,6 +67,7 @@ require_relative "qtcore/qsizef"
66
67
  require_relative "qtcore/qstandardpaths"
67
68
  require_relative "qtcore/qtextstream"
68
69
  require_relative "qtcore/qurl"
70
+ require_relative "qtcore/qurlquery"
69
71
  require_relative "qtcore/quuid"
70
72
  require_relative "qtcore/qvariant"
71
73
 
@@ -74,9 +76,11 @@ require_relative "qtcore/qabstractitemmodel"
74
76
  require_relative "qtcore/qabstractlistmodel"
75
77
  require_relative "qtcore/qabstracttablemodel"
76
78
  require_relative "qtcore/qcoreapplication"
79
+ require_relative "qtcore/qeventloop"
77
80
  require_relative "qtcore/qiodevice"
78
81
  require_relative "qtcore/qfiledevice"
79
82
  require_relative "qtcore/qfile"
83
+ require_relative "qtcore/qprocess"
80
84
  require_relative "qtcore/qitemselectionmodel"
81
85
  require_relative "qtcore/qsettings"
82
86
  require_relative "qtcore/qsignalmapper"
@@ -90,3 +94,5 @@ require_relative "qtcore/qvariantmap"
90
94
 
91
95
  require_relative "bando/dsl"
92
96
  require_relative "bando/qobject"
97
+
98
+ RubyQt6.initialize!(RubyQt6::QtCore)
@@ -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) { RubyQt6::QtCore::QVariant.from_int(value.to_int).tap { |qvariant| qvariant.convert(RubyQt6::QtCore::QMetaType.new(qmetatype_id)) } },
24
- ->(qvariant) { enum.from_int(RubyQt6::QtCore::QVariant.to_int(qvariant)) },
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