class Bindgen::CallBuilder::CppQobjectConnect

Overview

Builds a QObject::connect sequence.

The connection gets a context object and a connection type, which the context-less functor overload of QObject::connect lacks: that one always calls the functor on the emitting thread, as a direct connection. The context is the application object, so an Qt::AutoConnection from a Qt thread is queued to the main thread, the only thread allowed to run Crystal code. Before there is an application, the sender is the context. The connection type is an argument of the connection method.

Defined in:

bindgen/call_builder/cpp_qobject_connect.cr

Constant Summary

CONTEXT = "QCoreApplication::instance() ? static_cast<QObject *>(QCoreApplication::instance()) : static_cast<QObject *>(_self_)"

The context object of the connection: The application, else the sender.

Constructors

Instance Method Summary

Constructor Detail

def self.new(db : TypeDatabase) #

[View source]

Instance Method Detail

def build(method : Parser::Method, proc, connection_type : String) #

Builds the connection of the signal method to the lambda proc. connection_type names the C++ argument holding the Qt::ConnectionType.


[View source]