Class: QML::Engine

Inherits:
QtObjectBase show all
Defined in:
lib/qml/engine.rb,
lib/qml/engine.rb

Overview

Engine provides a QML engine.

See Also:

Instance Attribute Summary

Attributes inherited from QtObjectBase

#pointer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from QtObjectBase

#inspect, #managed=, #managed?, #prefer_managed, #qml_eval

Methods included from Reactive::Object

included, #properties, #property, #signal, #signals

Methods included from Reactive::Object::ClassMethods

#alias_property, #alias_signal, #instance_properties, #instance_property, #instance_signal, #instance_signals, #on, #on_changed, #property, #signal, #variadic_signal

Methods included from Dispatchable

#later

Constructor Details

#initializeEngine

Returns a new instance of Engine.



22
23
24
25
# File 'lib/qml/engine.rb', line 22

def initialize
  super()
  @extension = Plugins.core.createEngineExtension(self)
end

Class Method Details

.instanceEngine

Returns the instance of QML::Engine.

Returns:

See Also:



13
14
15
# File 'lib/qml/engine.rb', line 13

def self.instance
  Kernel.engine
end

.newObject

Note:

This method cannot be called because QML::Engine is singleton.



18
19
20
# File 'lib/qml/engine.rb', line 18

def self.new
  fail EngineError, "cannot create Engine instance manually"
end

Instance Method Details

#add_image_provider(id, provider) ⇒ ImageProvider

Adds an ImageProvider to the QML::Engine.

Parameters:

Returns:

See Also:



42
43
44
45
# File 'lib/qml/engine.rb', line 42

def add_image_provider(id, provider)
  @extension.add_image_provider(id, provider.qt_image_provider)
  provider
end

#collect_garbageObject

Starts garbage collection on the QML::Engine.



33
34
35
# File 'lib/qml/engine.rb', line 33

def collect_garbage
  @extension.collect_garbage
end

#contextContext

Returns the root Context the QML::Engine.

Returns:



28
29
30
# File 'lib/qml/engine.rb', line 28

def context
  @extension.rootContext
end