class Bindgen::Processor::Qt

Overview

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

Defined in:

bindgen/processor/qt.cr

Constant Summary

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 Method Summary

Instance methods inherited from class Bindgen::Processor::Base

inherited_rules(class_name : String, & : TypeDatabase::TypeConfig -> TypeDatabase::KeepAlive) : TypeDatabase::KeepAlive inherited_rules, process(graph : Graph::Container, doc : Parser::Document) process, unmatched_patterns(klass : Graph::Class, rules : TypeDatabase::KeepAlive) : Array(Regex) unmatched_patterns

Constructor methods inherited from class Bindgen::Processor::Base

new(config : Configuration, db : TypeDatabase) new

Instance methods inherited from module Bindgen::Graph::Visitor

visit_alias(alias_name) visit_alias, visit_children(container : Container) visit_children, visit_class(klass) visit_class, visit_constant(constant) visit_constant, visit_enum(enumeration) visit_enum, visit_library(library) visit_library, visit_method(method) visit_method, visit_namespace(ns) visit_namespace, visit_node(node : Node) visit_node, visit_node?(node : Node) visit_node?, visit_platform_specific(specific) visit_platform_specific, visit_struct(structure) visit_struct, visit_union(structure) visit_union

Instance Method Detail

def visit_class(klass) #
Description copied from module Bindgen::Graph::Visitor

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


[View source]