class

Bindgen::Processor::Qt

Inherits Bindgen::Processor::Base < Bindgen::Graph::Visitor < Reference < Object

Processor for C++/Qt specific behaviour. This includes:

  • Handle Q_GADGET types
  • Adding signal connection methods, delivering in the main thread
  • Support for private signals
  • Remove Q_OBJECT internal methods in superclass wrappers
  • Keep objects given a parent alive, as the parent owns them
  • #hash from qHash, #to_s and #inspect from toString

Constants

AUTO_CONNECTION = 0_i64

Value of Qt::AutoConnection, the default connection type.

CONNECTION_HANDLE_TYPE = Parser::Type.parse("QMetaObject::Connection")

Type of the result of a Qt-sinal connect call.

CONNECTION_TYPE = Parser::Type.parse("Qt::ConnectionType")

Type of the connection type argument of the connection method. The enum has to be wrapped, by enums: in the configuration.

CONNECTION_TYPE_ARGUMENT = "type"

Name of the connection type argument, as in QObject::connect.

HASH_FUNCTION = "qHash"

The hash function of a value type, bound as a method by member_functions: [qHash], forwarded to #hash.

Log = ::Log.for(self)

Processor for C++/Qt specific behaviour. This includes:

  • Handle Q_GADGET types
  • Adding signal connection methods, delivering in the main thread
  • Support for private signals
  • Remove Q_OBJECT internal methods in superclass wrappers
  • Keep objects given a parent alive, as the parent owns them
  • #hash from qHash, #to_s and #inspect from toString
PARENT_ARGUMENTS = ["parent"]

Names of the constructor argument giving the object a parent, in the PARENT_OWNED_CLASSES.

PARENT_OWNED_CLASSES = {"QObject", "QGraphicsItem", "QGraphicsLayoutItem"}

Classes whose instances belong to their parent, which deletes them. parent_arguments: of the type rules adds others, like QTreeWidgetItem.

PRIVATE_SIGNAL = "QPrivateSignal"

Defined by Q_OBJECT, and thus in every signal-emitting class.

Q_OBJECT_IGNORED_METHODS_RX = Regex.union(/^metaObject$/, /^qt_metacast$/, /^qt_metacall$/)

Internal virtual methods generated by Q_OBJECT that will not be copied into superclass wrapper structs, nor be overridable from Crystal: Processor::QtMetaObject overrides them in the C++ subclass.

QGADGET_CHECKER = "qt_check_for_QGADGET_macro"

We'll remove all member methods of this name.

SET_PARENT_METHODS = {"setParent", "setParentItem", "setParentLayoutItem"}

Methods giving the object a new parent, or none with nullptr.

TO_STRING_METHOD = "toString"

The string conversion of a value type, forwarded to #to_s.

Instance methods

visit_class(klass)

Visits a Graph::Class. The default implementation calls #visit_children to visit all child nodes.

Source

Nested types