ruby-qt6-qtcore 1.0.0 → 2.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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/Rakefile +4 -0
  4. data/ext/qt6/qtcore/{bando-rb.cpp → bando-core-rb.cpp} +4 -2
  5. data/ext/qt6/qtcore/bando-core-rb.hpp +5 -0
  6. data/ext/qt6/qtcore/bando-qobject-rb.cpp +3 -3
  7. data/ext/qt6/qtcore/bando-qobject-rb.hpp +4 -3
  8. data/ext/qt6/qtcore/extconf.rb +4 -12
  9. data/ext/qt6/qtcore/qabstractitemmodel-rb.cpp +31 -31
  10. data/ext/qt6/qtcore/qabstractitemmodel-rb.hpp +4 -3
  11. data/ext/qt6/qtcore/qanystringview-rb.cpp +3 -3
  12. data/ext/qt6/qtcore/qanystringview-rb.hpp +4 -3
  13. data/ext/qt6/qtcore/qbasictimer-rb.cpp +3 -3
  14. data/ext/qt6/qtcore/qbasictimer-rb.hpp +4 -3
  15. data/ext/qt6/qtcore/qbytearray-rb.cpp +30 -3
  16. data/ext/qt6/qtcore/qbytearray-rb.hpp +4 -3
  17. data/ext/qt6/qtcore/qchar-rb.cpp +3 -3
  18. data/ext/qt6/qtcore/qchar-rb.hpp +4 -3
  19. data/ext/qt6/qtcore/qcoreapplication-rb.cpp +14 -14
  20. data/ext/qt6/qtcore/qcoreapplication-rb.hpp +4 -3
  21. data/ext/qt6/qtcore/qcoreevent-rb.cpp +6 -7
  22. data/ext/qt6/qtcore/qcoreevent-rb.hpp +4 -3
  23. data/ext/qt6/qtcore/qdatetime-rb.cpp +5 -5
  24. data/ext/qt6/qtcore/qdatetime-rb.hpp +4 -3
  25. data/ext/qt6/qtcore/qdir-rb.cpp +3 -3
  26. data/ext/qt6/qtcore/qdir-rb.hpp +4 -3
  27. data/ext/qt6/qtcore/qfile-rb.cpp +3 -3
  28. data/ext/qt6/qtcore/qfile-rb.hpp +4 -3
  29. data/ext/qt6/qtcore/qfiledevice-rb.cpp +3 -3
  30. data/ext/qt6/qtcore/qfiledevice-rb.hpp +4 -3
  31. data/ext/qt6/qtcore/qfileinfo-rb.cpp +3 -3
  32. data/ext/qt6/qtcore/qfileinfo-rb.hpp +4 -3
  33. data/ext/qt6/qtcore/qiodevice-rb.cpp +10 -10
  34. data/ext/qt6/qtcore/qiodevice-rb.hpp +4 -3
  35. data/ext/qt6/qtcore/qiodevicebase-rb.cpp +3 -3
  36. data/ext/qt6/qtcore/qiodevicebase-rb.hpp +4 -3
  37. data/ext/qt6/qtcore/qitemselection-rb.cpp +4 -4
  38. data/ext/qt6/qtcore/qitemselection-rb.hpp +4 -3
  39. data/ext/qt6/qtcore/qitemselectionmodel-rb.cpp +9 -9
  40. data/ext/qt6/qtcore/qitemselectionmodel-rb.hpp +4 -3
  41. data/ext/qt6/qtcore/qlibraryinfo-rb.cpp +3 -3
  42. data/ext/qt6/qtcore/qlibraryinfo-rb.hpp +4 -3
  43. data/ext/qt6/qtcore/qline-rb.cpp +4 -4
  44. data/ext/qt6/qtcore/qline-rb.hpp +4 -3
  45. data/ext/qt6/qtcore/qlocale-rb.cpp +3 -3
  46. data/ext/qt6/qtcore/qlocale-rb.hpp +4 -3
  47. data/ext/qt6/qtcore/qmargins-rb.cpp +4 -4
  48. data/ext/qt6/qtcore/qmargins-rb.hpp +4 -3
  49. data/ext/qt6/qtcore/qmetaclassinfo-rb.cpp +3 -3
  50. data/ext/qt6/qtcore/qmetaclassinfo-rb.hpp +4 -3
  51. data/ext/qt6/qtcore/qmetamethod-rb.cpp +3 -3
  52. data/ext/qt6/qtcore/qmetamethod-rb.hpp +4 -3
  53. data/ext/qt6/qtcore/qmetaobject-rb.cpp +4 -4
  54. data/ext/qt6/qtcore/qmetaobject-rb.hpp +4 -3
  55. data/ext/qt6/qtcore/qmetaobjectbuilder-rb.cpp +6 -6
  56. data/ext/qt6/qtcore/qmetaobjectbuilder-rb.hpp +4 -3
  57. data/ext/qt6/qtcore/qmetatype-rb.cpp +3 -3
  58. data/ext/qt6/qtcore/qmetatype-rb.hpp +4 -3
  59. data/ext/qt6/qtcore/qmimetype-rb.cpp +28 -0
  60. data/ext/qt6/qtcore/qmimetype-rb.hpp +5 -0
  61. data/ext/qt6/qtcore/qmodelindex-rb.cpp +3 -3
  62. data/ext/qt6/qtcore/qmodelindex-rb.hpp +4 -3
  63. data/ext/qt6/qtcore/qobject-rb.cpp +7 -8
  64. data/ext/qt6/qtcore/qobject-rb.hpp +4 -3
  65. data/ext/qt6/qtcore/qpoint-rb.cpp +4 -4
  66. data/ext/qt6/qtcore/qpoint-rb.hpp +4 -3
  67. data/ext/qt6/qtcore/qrect-rb.cpp +8 -4
  68. data/ext/qt6/qtcore/qrect-rb.hpp +4 -3
  69. data/ext/qt6/qtcore/qregularexpression-rb.cpp +16 -4
  70. data/ext/qt6/qtcore/qregularexpression-rb.hpp +4 -3
  71. data/ext/qt6/qtcore/qresource-rb.cpp +3 -3
  72. data/ext/qt6/qtcore/qresource-rb.hpp +4 -3
  73. data/ext/qt6/qtcore/qsettings-rb.cpp +3 -3
  74. data/ext/qt6/qtcore/qsettings-rb.hpp +4 -3
  75. data/ext/qt6/qtcore/qsignalmapper-rb.cpp +7 -7
  76. data/ext/qt6/qtcore/qsignalmapper-rb.hpp +4 -3
  77. data/ext/qt6/qtcore/qsize-rb.cpp +4 -4
  78. data/ext/qt6/qtcore/qsize-rb.hpp +4 -3
  79. data/ext/qt6/qtcore/qstandardpaths-rb.cpp +61 -0
  80. data/ext/qt6/qtcore/qstandardpaths-rb.hpp +5 -0
  81. data/ext/qt6/qtcore/qstring-rb.cpp +5 -3
  82. data/ext/qt6/qtcore/qstring-rb.hpp +4 -3
  83. data/ext/qt6/qtcore/qstringlist-rb.cpp +5 -41
  84. data/ext/qt6/qtcore/qstringlist-rb.hpp +4 -3
  85. data/ext/qt6/qtcore/qt-enum-af-rb.cpp +2 -2
  86. data/ext/qt6/qtcore/qt-enum-af-rb.hpp +4 -3
  87. data/ext/qt6/qtcore/qt-enum-gl-rb.cpp +2 -2
  88. data/ext/qt6/qtcore/qt-enum-gl-rb.hpp +4 -3
  89. data/ext/qt6/qtcore/qt-enum-mr-rb.cpp +2 -2
  90. data/ext/qt6/qtcore/qt-enum-mr-rb.hpp +4 -3
  91. data/ext/qt6/qtcore/qt-enum-sz-rb.cpp +2 -2
  92. data/ext/qt6/qtcore/qt-enum-sz-rb.hpp +4 -3
  93. data/ext/qt6/qtcore/qt-flags-al-rb.cpp +2 -2
  94. data/ext/qt6/qtcore/qt-flags-al-rb.hpp +4 -3
  95. data/ext/qt6/qtcore/qt-flags-mz-rb.cpp +2 -2
  96. data/ext/qt6/qtcore/qt-flags-mz-rb.hpp +4 -3
  97. data/ext/qt6/qtcore/qtcore-rb.cpp +18 -8
  98. data/ext/qt6/qtcore/qtcore-rb.hpp +1 -1
  99. data/ext/qt6/qtcore/qtcoreversion-rb.cpp +2 -2
  100. data/ext/qt6/qtcore/qtcoreversion-rb.hpp +4 -3
  101. data/ext/qt6/qtcore/qtextstream-rb.cpp +3 -3
  102. data/ext/qt6/qtcore/qtextstream-rb.hpp +4 -3
  103. data/ext/qt6/qtcore/qtimer-rb.cpp +4 -4
  104. data/ext/qt6/qtcore/qtimer-rb.hpp +4 -3
  105. data/ext/qt6/qtcore/qtranslator-rb.cpp +3 -3
  106. data/ext/qt6/qtcore/qtranslator-rb.hpp +4 -3
  107. data/ext/qt6/qtcore/qurl-rb.cpp +10 -6
  108. data/ext/qt6/qtcore/qurl-rb.hpp +4 -3
  109. data/ext/qt6/qtcore/quuid-rb.cpp +3 -3
  110. data/ext/qt6/qtcore/quuid-rb.hpp +4 -3
  111. data/ext/qt6/qtcore/qvariant-rb.cpp +6 -3
  112. data/ext/qt6/qtcore/qvariant-rb.hpp +4 -3
  113. data/ext/qt6/qtcore/qvariantlist-rb.cpp +16 -0
  114. data/ext/qt6/qtcore/qvariantlist-rb.hpp +5 -0
  115. data/ext/qt6/qtcore/qvariantmap-rb.cpp +16 -0
  116. data/ext/qt6/qtcore/qvariantmap-rb.hpp +5 -0
  117. data/ext/qt6/qtcore/t-qtcore-rb.cpp +14 -6
  118. data/ext/qt6/qtcore/t-qtcore-rb.hpp +4 -3
  119. data/lib/qt6/ducktyping.rb +10 -3
  120. data/lib/qt6/qtcore/private/metamethod.rb +1 -1
  121. data/lib/qt6/qtcore/private/metaobject.rb +5 -4
  122. data/lib/qt6/qtcore/qabstractitemmodel.rb +2 -2
  123. data/lib/qt6/qtcore/qanystringview.rb +0 -6
  124. data/lib/qt6/qtcore/qbytearray.rb +13 -0
  125. data/lib/qt6/qtcore/qcoreapplication.rb +31 -3
  126. data/lib/qt6/qtcore/qdate.rb +1 -1
  127. data/lib/qt6/qtcore/qdatetime.rb +2 -2
  128. data/lib/qt6/qtcore/qitemselection.rb +6 -1
  129. data/lib/qt6/qtcore/qlocale.rb +1 -1
  130. data/lib/qt6/qtcore/qmimetype.rb +9 -0
  131. data/lib/qt6/qtcore/qobject.rb +13 -2
  132. data/lib/qt6/qtcore/qregularexpression.rb +1 -1
  133. data/lib/qt6/qtcore/qregularexpressionmatchiterator.rb +9 -0
  134. data/lib/qt6/qtcore/qstandardpaths.rb +15 -0
  135. data/lib/qt6/qtcore/qstring.rb +7 -6
  136. data/lib/qt6/qtcore/qstringlist.rb +45 -2
  137. data/lib/qt6/qtcore/qtime.rb +1 -1
  138. data/lib/qt6/qtcore/qtimer.rb +1 -1
  139. data/lib/qt6/qtcore/qurl.rb +25 -0
  140. data/lib/qt6/qtcore/quuid.rb +1 -1
  141. data/lib/qt6/qtcore/qvariant.rb +5 -1
  142. data/lib/qt6/qtcore/qvariantlist.rb +60 -0
  143. data/lib/qt6/qtcore/qvariantmap.rb +47 -0
  144. data/lib/qt6/qtcore/version.rb +1 -1
  145. data/lib/qt6/qtcore.rb +6 -0
  146. data/lib/qt6/refinements/kernel.rb +22 -5
  147. data/lib/qt6/refinements/object.rb +15 -0
  148. data/lib/qt6/refinements/symbol.rb +8 -0
  149. metadata +25 -10
  150. data/ext/qt6/qtcore/bando-rb.hpp +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1abc9ebd688f0672fad16e7474202b4b5f8fca6d1ccd130749a6dacf423248a
4
- data.tar.gz: 57658f78d3ee54fbd063ec59e6d4a4a7a859f4176882fd968feb74007e28822f
3
+ metadata.gz: 7986e32744ab5746e42c264d85013dc7a839fb49c4e90d491ebfee1874f00293
4
+ data.tar.gz: dac74a4ef3a27495c418075ec7731e50c1d0c289b9b7623baa946b9a3e3ac963
5
5
  SHA512:
6
- metadata.gz: 27e108c9bad5f12ee9a1bcce10550fb3ca44fda6a4a137637befa0bc18d1f9cce7b72041b52f5440928b1768a2fde0a1c3908726276e69fbecb6d233e5b78c25
7
- data.tar.gz: 8f60bb8187bf126f3a5755f9850dfed76a3e50a79fbf53d1d1501ef02caa80d90f4ec6745bdf98eaee0e619ebc867aea5cf68e26b44b38d0fdb2ae36ee0d461a
6
+ metadata.gz: 58af64dfd6a6b70661bb75af287ed037c5ce4b100c02986d00de7657ee2c97192f2d5a1829d0c1bf66406d34afcae5da7f72e50d3d2d3963784d1e0b5048a65f
7
+ data.tar.gz: 5b97b6a54317f556c5e15fedf6ea4b618b7b5a32de68dc069f5c3a9621d92eb344f21c31de37e36532445100eed4e832e61766b29bc8ddf775d91e0411c4d276
data/.rubocop.yml CHANGED
@@ -11,4 +11,5 @@ AllCops:
11
11
 
12
12
  Style/GlobalVars:
13
13
  AllowedVariables:
14
+ - '$qApp_argv'
14
15
  - '$qApp'
data/Rakefile CHANGED
@@ -8,6 +8,10 @@ Rake::ExtensionTask.new("qtcore", GEMSPEC) do |ext|
8
8
  ext.ext_dir = "ext/qt6/qtcore"
9
9
  ext.lib_dir = "lib/qt6/qtcore"
10
10
  end
11
+ Rake::Task["rake:compile"].enhance do
12
+ mkdir_p Pathname.new(GEMSPEC.gem_build_complete_path).parent
13
+ touch GEMSPEC.gem_build_complete_path
14
+ end
11
15
 
12
16
  require "rubocop/rake_task"
13
17
  RuboCop::RakeTask.new
@@ -1,8 +1,10 @@
1
- #include "bando-rb.hpp"
1
+ #include "bando-core-rb.hpp"
2
2
  #include <bando/common.hpp>
3
3
  #include <rice/qt6/qenum.hpp>
4
4
 
5
- void Init_bando(Rice::Module rb_mQt6Bando)
5
+ RICE4RUBYQT6_USE_NAMESPACE
6
+
7
+ void Init_bando_core(Module rb_mQt6Bando)
6
8
  {
7
9
  Data_Type<bando_FunctionName> rb_cBandoFunctionName =
8
10
  define_class_under<bando_FunctionName>(rb_mQt6Bando, "FunctionName");
@@ -0,0 +1,5 @@
1
+ #include <rice/qt6.hpp>
2
+
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_bando_core(Module rb_mQt6Bando);
@@ -3,13 +3,13 @@
3
3
 
4
4
  #include <QObject>
5
5
 
6
- using namespace Rice;
6
+ RICE4RUBYQT6_USE_NAMESPACE
7
7
 
8
8
  using Bando_QObject = BandoQObject<QObject, QObject *>;
9
9
 
10
- Rice::Class rb_mBando_cQObject;
10
+ Class rb_mBando_cQObject;
11
11
 
12
- void Init_bando_qobject(Rice::Module rb_mQt6Bando)
12
+ void Init_bando_qobject(Module rb_mQt6Bando)
13
13
  {
14
14
  rb_mBando_cQObject =
15
15
  define_bando_qobject_under<Bando_QObject, QObject>(rb_mQt6Bando, "QObject")
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_bando_qobject(Rice::Module rb_mQt6Bando);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_bando_qobject(Module rb_mQt6Bando);
@@ -1,18 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- RUBYQT6_RICE_LIB_PATH = File.join(__dir__, "../../../../rice/lib")
4
- if File.exist?(RUBYQT6_RICE_LIB_PATH)
5
- require File.join(RUBYQT6_RICE_LIB_PATH, "mkmf-rubyqt6.rb")
6
- else
7
- require "mkmf-rubyqt6"
8
- end
3
+ RUBYQT6_RICE_GEM_PATH = Gem::Specification.find_by_name("ruby-qt6-rice").full_gem_path
4
+ require File.join(RUBYQT6_RICE_GEM_PATH, "lib/mkmf-rubyqt6.rb")
9
5
 
10
- includedir = qt_install_headers
11
- includedir_private = Dir["#{includedir}/QtCore/*.*.*"][0]
12
- append_cppflags("-I#{includedir}")
13
- append_cppflags("-I#{includedir}/QtCore")
6
+ includedir_private = Dir["#{qt_install_headers}/QtCore/*.*.*"][0]
14
7
  append_cppflags("-I#{includedir_private}")
15
8
  append_cppflags("-I#{includedir_private}/QtCore")
16
- abort "libQt6Core is missing, please install qt6-base" unless have_library("Qt6Core")
17
9
 
18
- create_makefile("qt6/qtcore/qtcore")
10
+ rubyqt6_extconf("QtCore", depends: [])
@@ -5,13 +5,13 @@
5
5
  #include <QMimeData>
6
6
  #include <QSize>
7
7
 
8
- using namespace Rice;
8
+ RICE4RUBYQT6_USE_NAMESPACE
9
9
 
10
- Rice::Class rb_cQAbstractItemModel;
11
- Rice::Class rb_cQAbstractTableModel;
12
- Rice::Class rb_cQAbstractListModel;
10
+ Class rb_cQAbstractItemModel;
11
+ Class rb_cQAbstractTableModel;
12
+ Class rb_cQAbstractListModel;
13
13
 
14
- void Init_qabstractitemmodel(Rice::Module rb_mQt6QtCore)
14
+ void Init_qabstractitemmodel(Module rb_mQt6QtCore)
15
15
  {
16
16
  rb_cQAbstractItemModel =
17
17
  // RubyQt6::QtCore::QAbstractItemModel
@@ -63,33 +63,26 @@ void Init_qabstractitemmodel(Rice::Module rb_mQt6QtCore)
63
63
  .define_method("supported_drop_actions", &QAbstractItemModel::supportedDropActions)
64
64
  // Public Slots
65
65
  .define_method("revert", &QAbstractItemModel::revert)
66
- .define_method("submit", &QAbstractItemModel::submit)
66
+ .define_method("submit", &QAbstractItemModel::submit);
67
67
  // Signals
68
- .define_method("columns_about_to_be_inserted", &QAbstractItemModel::columnsAboutToBeInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
69
- .define_method("columns_about_to_be_moved", &QAbstractItemModel::columnsAboutToBeMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_column"), Arg("_"))
70
- .define_method("columns_about_to_be_removed", &QAbstractItemModel::columnsAboutToBeRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
71
- .define_method("columns_inserted", &QAbstractItemModel::columnsInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
72
- .define_method("columns_moved", &QAbstractItemModel::columnsMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_column"), Arg("_"))
73
- .define_method("columns_removed", &QAbstractItemModel::columnsRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
74
- .define_method("data_changed", &QAbstractItemModel::dataChanged, Arg("top_left"), Arg("bottom_right"), Arg("roles") = static_cast<const QList<int> &>(QList<int>()))
75
- .define_method("header_data_changed", &QAbstractItemModel::headerDataChanged, Arg("orientation"), Arg("first"), Arg("last"))
76
- .define_method("layout_about_to_be_changed", &QAbstractItemModel::layoutAboutToBeChanged, Arg("parents") = static_cast<const QList<QPersistentModelIndex> &>(QList<QPersistentModelIndex>()), Arg("hint") = static_cast<QAbstractItemModel::LayoutChangeHint>(QAbstractItemModel::NoLayoutChangeHint))
77
- .define_method("layout_changed", &QAbstractItemModel::layoutChanged, Arg("parents") = static_cast<const QList<QPersistentModelIndex> &>(QList<QPersistentModelIndex>()), Arg("hint") = static_cast<QAbstractItemModel::LayoutChangeHint>(QAbstractItemModel::NoLayoutChangeHint))
78
- .define_method("model_about_to_be_reset", &QAbstractItemModel::modelAboutToBeReset, Arg("_"))
79
- .define_method("model_reset", &QAbstractItemModel::modelReset, Arg("_"))
80
- .define_method("rows_about_to_be_inserted", &QAbstractItemModel::rowsAboutToBeInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
81
- .define_method("rows_about_to_be_moved", &QAbstractItemModel::rowsAboutToBeMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_row"), Arg("_"))
82
- .define_method("rows_about_to_be_removed", &QAbstractItemModel::rowsAboutToBeRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
83
- .define_method("rows_inserted", &QAbstractItemModel::rowsInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
84
- .define_method("rows_moved", &QAbstractItemModel::rowsMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_row"), Arg("_"))
85
- .define_method("rows_removed", &QAbstractItemModel::rowsRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"));
86
-
87
- Data_Type<QAbstractItemModel::LayoutChangeHint> rb_cQAbstractItemModelLayoutChangeHint =
88
- // RubyQt6::QtCore::QAbstractItemModel::LayoutChangeHint
89
- define_qenum_under<QAbstractItemModel::LayoutChangeHint>(rb_cQAbstractItemModel, "LayoutChangeHint");
90
- define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "NoLayoutChangeHint", QAbstractItemModel::LayoutChangeHint::NoLayoutChangeHint);
91
- define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "VerticalSortHint", QAbstractItemModel::LayoutChangeHint::VerticalSortHint);
92
- define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "HorizontalSortHint", QAbstractItemModel::LayoutChangeHint::HorizontalSortHint);
68
+ // .define_method("columns_about_to_be_inserted", &QAbstractItemModel::columnsAboutToBeInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
69
+ // .define_method("columns_about_to_be_moved", &QAbstractItemModel::columnsAboutToBeMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_column"), Arg("_"))
70
+ // .define_method("columns_about_to_be_removed", &QAbstractItemModel::columnsAboutToBeRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
71
+ // .define_method("columns_inserted", &QAbstractItemModel::columnsInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
72
+ // .define_method("columns_moved", &QAbstractItemModel::columnsMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_column"), Arg("_"))
73
+ // .define_method("columns_removed", &QAbstractItemModel::columnsRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
74
+ // .define_method("data_changed", &QAbstractItemModel::dataChanged, Arg("top_left"), Arg("bottom_right"), Arg("roles") = static_cast<const QList<int> &>(QList<int>()))
75
+ // .define_method("header_data_changed", &QAbstractItemModel::headerDataChanged, Arg("orientation"), Arg("first"), Arg("last"))
76
+ // .define_method("layout_about_to_be_changed", &QAbstractItemModel::layoutAboutToBeChanged, Arg("parents") = static_cast<const QList<QPersistentModelIndex> &>(QList<QPersistentModelIndex>()), Arg("hint") = static_cast<QAbstractItemModel::LayoutChangeHint>(QAbstractItemModel::NoLayoutChangeHint))
77
+ // .define_method("layout_changed", &QAbstractItemModel::layoutChanged, Arg("parents") = static_cast<const QList<QPersistentModelIndex> &>(QList<QPersistentModelIndex>()), Arg("hint") = static_cast<QAbstractItemModel::LayoutChangeHint>(QAbstractItemModel::NoLayoutChangeHint))
78
+ // .define_method("model_about_to_be_reset", &QAbstractItemModel::modelAboutToBeReset, Arg("_"))
79
+ // .define_method("model_reset", &QAbstractItemModel::modelReset, Arg("_"))
80
+ // .define_method("rows_about_to_be_inserted", &QAbstractItemModel::rowsAboutToBeInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
81
+ // .define_method("rows_about_to_be_moved", &QAbstractItemModel::rowsAboutToBeMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_row"), Arg("_"))
82
+ // .define_method("rows_about_to_be_removed", &QAbstractItemModel::rowsAboutToBeRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
83
+ // .define_method("rows_inserted", &QAbstractItemModel::rowsInserted, Arg("parent"), Arg("first"), Arg("last"), Arg("_"))
84
+ // .define_method("rows_moved", &QAbstractItemModel::rowsMoved, Arg("source_parent"), Arg("source_start"), Arg("source_end"), Arg("destination_parent"), Arg("destination_row"), Arg("_"))
85
+ // .define_method("rows_removed", &QAbstractItemModel::rowsRemoved, Arg("parent"), Arg("first"), Arg("last"), Arg("_"));
93
86
 
94
87
  Data_Type<QAbstractItemModel::CheckIndexOption> rb_cQAbstractItemModelCheckIndexOption =
95
88
  // RubyQt6::QtCore::QAbstractItemModel::CheckIndexOption
@@ -99,6 +92,13 @@ void Init_qabstractitemmodel(Rice::Module rb_mQt6QtCore)
99
92
  define_qenum_value_under(rb_cQAbstractItemModelCheckIndexOption, "DoNotUseParent", QAbstractItemModel::CheckIndexOption::DoNotUseParent);
100
93
  define_qenum_value_under(rb_cQAbstractItemModelCheckIndexOption, "ParentIsInvalid", QAbstractItemModel::CheckIndexOption::ParentIsInvalid);
101
94
 
95
+ Data_Type<QAbstractItemModel::LayoutChangeHint> rb_cQAbstractItemModelLayoutChangeHint =
96
+ // RubyQt6::QtCore::QAbstractItemModel::LayoutChangeHint
97
+ define_qenum_under<QAbstractItemModel::LayoutChangeHint>(rb_cQAbstractItemModel, "LayoutChangeHint");
98
+ define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "NoLayoutChangeHint", QAbstractItemModel::LayoutChangeHint::NoLayoutChangeHint);
99
+ define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "VerticalSortHint", QAbstractItemModel::LayoutChangeHint::VerticalSortHint);
100
+ define_qenum_value_under(rb_cQAbstractItemModelLayoutChangeHint, "HorizontalSortHint", QAbstractItemModel::LayoutChangeHint::HorizontalSortHint);
101
+
102
102
  rb_cQAbstractTableModel =
103
103
  // RubyQt6::QtCore::QAbstractTableModel
104
104
  define_class_under<QAbstractTableModel, QAbstractItemModel>(rb_mQt6QtCore, "QAbstractTableModel")
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qabstractitemmodel(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qabstractitemmodel(Module rb_mQt6QtCore);
@@ -3,11 +3,11 @@
3
3
 
4
4
  #include <QString>
5
5
 
6
- using namespace Rice;
6
+ RICE4RUBYQT6_USE_NAMESPACE
7
7
 
8
- Rice::Class rb_cQAnyStringView;
8
+ Class rb_cQAnyStringView;
9
9
 
10
- void Init_qanystringview(Rice::Module rb_mQt6QtCore)
10
+ void Init_qanystringview(Module rb_mQt6QtCore)
11
11
  {
12
12
  rb_cQAnyStringView =
13
13
  // RubyQt6::QtCore::QAnyStringView
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qanystringview(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qanystringview(Module rb_mQt6QtCore);
@@ -1,11 +1,11 @@
1
1
  #include "qbasictimer-rb.hpp"
2
2
  #include <qbasictimer.h>
3
3
 
4
- using namespace Rice;
4
+ RICE4RUBYQT6_USE_NAMESPACE
5
5
 
6
- Rice::Class rb_cQBasicTimer;
6
+ Class rb_cQBasicTimer;
7
7
 
8
- void Init_qbasictimer(Rice::Module rb_mQt6QtCore)
8
+ void Init_qbasictimer(Module rb_mQt6QtCore)
9
9
  {
10
10
  rb_cQBasicTimer =
11
11
  // RubyQt6::QtCore::QBasicTimer
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qbasictimer(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qbasictimer(Module rb_mQt6QtCore);
@@ -1,17 +1,44 @@
1
1
  #include "qbytearray-rb.hpp"
2
2
  #include <qbytearray.h>
3
3
 
4
- using namespace Rice;
4
+ RICE4RUBYQT6_USE_NAMESPACE
5
5
 
6
- Rice::Class rb_cQByteArray;
6
+ Class rb_cQByteArray;
7
7
 
8
- void Init_qbytearray(Rice::Module rb_mQt6QtCore)
8
+ std::optional<QByteArray> QByteArray_slice(QByteArray *self, qsizetype start, qsizetype length)
9
+ {
10
+ if (start < 0) {
11
+ start = start + self->size();
12
+ if (start < 0) return std::nullopt;
13
+ } else if (start >= self->size()) {
14
+ return std::nullopt;
15
+ }
16
+
17
+ if (length < 0) {
18
+ return std::nullopt;
19
+ } else if (start + length > self->size()) {
20
+ return self->sliced(start);
21
+ } else {
22
+ return self->sliced(start, length);
23
+ }
24
+ }
25
+
26
+ void Init_qbytearray(Module rb_mQt6QtCore)
9
27
  {
10
28
  rb_cQByteArray =
11
29
  // RubyQt6::QtCore::QByteArray
12
30
  define_class_under<QByteArray>(rb_mQt6QtCore, "QByteArray")
31
+ // RubyQt6-Defined Functions
32
+ .define_method("[]", QByteArray_slice, Arg("start"), Arg("length") = static_cast<qsizetype>(1))
33
+ .define_singleton_function("_operator_compare", [](QByteArray *lhs, QByteArray *rhs) -> int { return lhs->compare(*rhs); }, Arg("lhs"), Arg("rhs"))
13
34
  // Constructor
14
35
  .define_constructor(Constructor<QByteArray, const char *>(), Arg("data"))
15
36
  // Public Functions
37
+ .define_method("capacity", &QByteArray::capacity)
38
+ .define_method("empty?", &QByteArray::isEmpty)
39
+ .define_method("length", &QByteArray::length)
40
+ .define_method("max_size", &QByteArray::max_size)
41
+ .define_method("reserve", &QByteArray::reserve, Arg("size"))
42
+ .define_method("shrink_to_fit", &QByteArray::shrink_to_fit)
16
43
  .define_method("to_std_string", &QByteArray::toStdString);
17
44
  }
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qbytearray(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qbytearray(Module rb_mQt6QtCore);
@@ -4,11 +4,11 @@
4
4
 
5
5
  #include <QString>
6
6
 
7
- using namespace Rice;
7
+ RICE4RUBYQT6_USE_NAMESPACE
8
8
 
9
- Rice::Class rb_cQChar;
9
+ Class rb_cQChar;
10
10
 
11
- void Init_qchar(Rice::Module rb_mQt6QtCore)
11
+ void Init_qchar(Module rb_mQt6QtCore)
12
12
  {
13
13
  rb_cQChar =
14
14
  // RubyQt6::QtCore::QChar
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qchar(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qchar(Module rb_mQt6QtCore);
@@ -5,19 +5,20 @@
5
5
  #include <QPermission>
6
6
  #include <QTranslator>
7
7
 
8
- using namespace Rice;
8
+ RICE4RUBYQT6_USE_NAMESPACE
9
9
 
10
- Rice::Class rb_cQCoreApplication;
10
+ Class rb_cQCoreApplication;
11
11
 
12
- void Init_qcoreapplication(Rice::Module rb_mQt6QtCore)
12
+ void Init_qcoreapplication(Module rb_mQt6QtCore)
13
13
  {
14
14
  rb_cQCoreApplication =
15
15
  // RubyQt6::QtCore::QCoreApplication
16
16
  define_class_under<QCoreApplication, QObject>(rb_mQt6QtCore, "QCoreApplication")
17
17
  // RubyQt6-Defined Functions
18
+ .define_singleton_function("application_pid", []() -> qint64 { return QCoreApplication::applicationPid(); })
18
19
  .define_singleton_function("_static_meta_object", []() -> const QMetaObject * { return &QCoreApplication::staticMetaObject; })
19
20
  // Constructor
20
- .define_constructor(Constructor<QCoreApplication, int &, char **>(), Arg("argc"), Arg("argv").setBuffer())
21
+ .define_constructor(Constructor<QCoreApplication, int &, char **>(), Arg("argc"), ArgBuffer("argv"))
21
22
  // Public Functions
22
23
  .define_method("check_permission", &QCoreApplication::checkPermission, Arg("permission"))
23
24
  .define_method("install_native_event_filter", &QCoreApplication::installNativeEventFilter, Arg("filter_obj"))
@@ -27,17 +28,16 @@ void Init_qcoreapplication(Rice::Module rb_mQt6QtCore)
27
28
  .define_singleton_function("exit", &QCoreApplication::exit, Arg("retcode") = static_cast<int>(0))
28
29
  .define_singleton_function("quit", &QCoreApplication::quit)
29
30
  // Signals
30
- .define_method("about_to_quit", &QCoreApplication::aboutToQuit)
31
- .define_method("application_name_changed", &QCoreApplication::applicationNameChanged)
32
- .define_method("application_version_changed", &QCoreApplication::applicationVersionChanged)
33
- .define_method("organization_domain_changed", &QCoreApplication::organizationDomainChanged)
34
- .define_method("organization_name_changed", &QCoreApplication::organizationNameChanged)
31
+ // .define_method("about_to_quit", &QCoreApplication::aboutToQuit)
32
+ // .define_method("application_name_changed", &QCoreApplication::applicationNameChanged)
33
+ // .define_method("application_version_changed", &QCoreApplication::applicationVersionChanged)
34
+ // .define_method("organization_domain_changed", &QCoreApplication::organizationDomainChanged)
35
+ // .define_method("organization_name_changed", &QCoreApplication::organizationNameChanged)
35
36
  // Static Public Members
36
37
  .define_singleton_function("add_library_path", &QCoreApplication::addLibraryPath, Arg("path"))
37
38
  .define_singleton_function("application_dir_path", &QCoreApplication::applicationDirPath)
38
39
  .define_singleton_function("application_file_path", &QCoreApplication::applicationFilePath)
39
40
  .define_singleton_function("application_name", &QCoreApplication::applicationName)
40
- .define_singleton_function("application_pid", &QCoreApplication::applicationPid)
41
41
  .define_singleton_function("application_version", &QCoreApplication::applicationVersion)
42
42
  .define_singleton_function("arguments", &QCoreApplication::arguments)
43
43
  .define_singleton_function("closing_down", &QCoreApplication::closingDown)
@@ -59,13 +59,13 @@ void Init_qcoreapplication(Rice::Module rb_mQt6QtCore)
59
59
  .define_singleton_function("remove_translator", &QCoreApplication::removeTranslator, Arg("message_file"))
60
60
  .define_singleton_function("send_event", &QCoreApplication::sendEvent, Arg("receiver"), Arg("event"))
61
61
  .define_singleton_function("send_posted_events", &QCoreApplication::sendPostedEvents, Arg("receiver") = static_cast<QObject *>(nullptr), Arg("event_type") = static_cast<int>(0))
62
- .define_singleton_function("set_application_name", &QCoreApplication::setApplicationName, Arg("application"))
63
- .define_singleton_function("set_application_version", &QCoreApplication::setApplicationVersion, Arg("version"))
62
+ .define_singleton_function("_set_application_name", &QCoreApplication::setApplicationName, Arg("name"))
63
+ .define_singleton_function("_set_application_version", &QCoreApplication::setApplicationVersion, Arg("version"))
64
64
  .define_singleton_function("set_attribute", &QCoreApplication::setAttribute, Arg("attribute"), Arg("on") = static_cast<bool>(true))
65
65
  .define_singleton_function("set_event_dispatcher", &QCoreApplication::setEventDispatcher, Arg("event_dispatcher"))
66
66
  .define_singleton_function("set_library_paths", &QCoreApplication::setLibraryPaths, Arg("path"))
67
- .define_singleton_function("set_organization_domain", &QCoreApplication::setOrganizationDomain, Arg("org_domain"))
68
- .define_singleton_function("set_organization_name", &QCoreApplication::setOrganizationName, Arg("org_name"))
67
+ .define_singleton_function("_set_organization_domain", &QCoreApplication::setOrganizationDomain, Arg("org_domain"))
68
+ .define_singleton_function("_set_organization_name", &QCoreApplication::setOrganizationName, Arg("org_name"))
69
69
  .define_singleton_function("set_quit_lock_enabled", &QCoreApplication::setQuitLockEnabled, Arg("enabled"))
70
70
  .define_singleton_function("set_setuid_allowed", &QCoreApplication::setSetuidAllowed, Arg("allow"))
71
71
  .define_singleton_function("starting_up", &QCoreApplication::startingUp)
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qcoreapplication(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qcoreapplication(Module rb_mQt6QtCore);
@@ -2,21 +2,20 @@
2
2
  #include <qcoreevent.h>
3
3
  #include <rice/qt6/qenum.hpp>
4
4
 
5
- using namespace Rice;
5
+ RICE4RUBYQT6_USE_NAMESPACE
6
6
 
7
- Rice::Class rb_cQEvent;
8
- Rice::Class rb_cQChildEvent;
9
- Rice::Class rb_cQTimerEvent;
10
- Rice::Class rb_cQDynamicPropertyChangeEvent;
7
+ Class rb_cQEvent;
8
+ Class rb_cQChildEvent;
9
+ Class rb_cQTimerEvent;
10
+ Class rb_cQDynamicPropertyChangeEvent;
11
11
 
12
- void Init_qcoreevent(Rice::Module rb_mQt6QtCore)
12
+ void Init_qcoreevent(Module rb_mQt6QtCore)
13
13
  {
14
14
  rb_cQEvent =
15
15
  // RubyQt6::QtCore::QEvent
16
16
  define_class_under<QEvent>(rb_mQt6QtCore, "QEvent")
17
17
  // Public Functions
18
18
  .define_method("accept", &QEvent::accept)
19
- .define_method("clone", &QEvent::clone)
20
19
  .define_method("ignore", &QEvent::ignore)
21
20
  .define_method("accepted?", &QEvent::isAccepted)
22
21
  .define_method("input_event?", &QEvent::isInputEvent)
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qcoreevent(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qcoreevent(Module rb_mQt6QtCore);
@@ -4,11 +4,11 @@
4
4
 
5
5
  #include <QTimeZone>
6
6
 
7
- using namespace Rice;
7
+ RICE4RUBYQT6_USE_NAMESPACE
8
8
 
9
- Rice::Class rb_cQDateTime;
10
- Rice::Class rb_cQDate;
11
- Rice::Class rb_cQTime;
9
+ Class rb_cQDateTime;
10
+ Class rb_cQDate;
11
+ Class rb_cQTime;
12
12
 
13
13
  int QDateTime_operator_compare(QDateTime *lhs, QDateTime *rhs)
14
14
  {
@@ -31,7 +31,7 @@ int QTime_operator_compare(QTime *lhs, QTime *rhs)
31
31
  return 0;
32
32
  }
33
33
 
34
- void Init_qdatetime(Rice::Module rb_mQt6QtCore)
34
+ void Init_qdatetime(Module rb_mQt6QtCore)
35
35
  {
36
36
  rb_cQDateTime =
37
37
  // RubyQt6::QtCore::QDateTime
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qdatetime(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qdatetime(Module rb_mQt6QtCore);
@@ -3,11 +3,11 @@
3
3
  #include <rice/qt6/qenum.hpp>
4
4
  #include <rice/qt6/qflags.hpp>
5
5
 
6
- using namespace Rice;
6
+ RICE4RUBYQT6_USE_NAMESPACE
7
7
 
8
- Rice::Class rb_cQDir;
8
+ Class rb_cQDir;
9
9
 
10
- void Init_qdir(Rice::Module rb_mQt6QtCore)
10
+ void Init_qdir(Module rb_mQt6QtCore)
11
11
  {
12
12
  rb_cQDir =
13
13
  // RubyQt6::QtCore::QDir
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qdir(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qdir(Module rb_mQt6QtCore);
@@ -1,11 +1,11 @@
1
1
  #include "qfile-rb.hpp"
2
2
  #include <qfile.h>
3
3
 
4
- using namespace Rice;
4
+ RICE4RUBYQT6_USE_NAMESPACE
5
5
 
6
- Rice::Class rb_cQFile;
6
+ Class rb_cQFile;
7
7
 
8
- void Init_qfile(Rice::Module rb_mQt6QtCore)
8
+ void Init_qfile(Module rb_mQt6QtCore)
9
9
  {
10
10
  rb_cQFile =
11
11
  // RubyQt6::QtCore::QFile
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qfile(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qfile(Module rb_mQt6QtCore);
@@ -5,11 +5,11 @@
5
5
 
6
6
  #include <QDateTime>
7
7
 
8
- using namespace Rice;
8
+ RICE4RUBYQT6_USE_NAMESPACE
9
9
 
10
- Rice::Class rb_cQFileDevice;
10
+ Class rb_cQFileDevice;
11
11
 
12
- void Init_qfiledevice(Rice::Module rb_mQt6QtCore)
12
+ void Init_qfiledevice(Module rb_mQt6QtCore)
13
13
  {
14
14
  rb_cQFileDevice =
15
15
  // RubyQt6::QtCore::QFileDevice
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qfiledevice(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qfiledevice(Module rb_mQt6QtCore);
@@ -4,11 +4,11 @@
4
4
  #include <QDir>
5
5
  #include <QFileDevice>
6
6
 
7
- using namespace Rice;
7
+ RICE4RUBYQT6_USE_NAMESPACE
8
8
 
9
- Rice::Class rb_cQFileInfo;
9
+ Class rb_cQFileInfo;
10
10
 
11
- void Init_qfileinfo(Rice::Module rb_mQt6QtCore)
11
+ void Init_qfileinfo(Module rb_mQt6QtCore)
12
12
  {
13
13
  rb_cQFileInfo =
14
14
  // RubyQt6::QtCore::QFileInfo
@@ -1,4 +1,5 @@
1
- #include <rice/rice.hpp>
2
- #include <rice/stl.hpp>
1
+ #include <rice/qt6.hpp>
3
2
 
4
- void Init_qfileinfo(Rice::Module rb_mQt6QtCore);
3
+ RICE4RUBYQT6_USE_NAMESPACE
4
+
5
+ void Init_qfileinfo(Module rb_mQt6QtCore);