Class: QML::Engine
- Inherits:
-
QtObjectBase
- Object
- QtObjectBase
- QML::Engine
- Defined in:
- lib/qml/engine.rb,
lib/qml/engine.rb
Overview
Engine provides a QML engine.
Instance Attribute Summary
Attributes inherited from QtObjectBase
Class Method Summary collapse
-
.instance ⇒ Engine
The instance of Engine.
- .new ⇒ Object
Instance Method Summary collapse
-
#add_image_provider(id, provider) ⇒ ImageProvider
Adds an ImageProvider to the Engine.
-
#add_import_path(path) ⇒ Object
Adds a QML import path to the Engine.
-
#collect_garbage ⇒ Object
Starts garbage collection on the Engine.
- #context ⇒ Context
-
#import_paths ⇒ Array
Gets an array of QML import paths.
-
#initialize ⇒ Engine
constructor
A new instance of Engine.
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
Constructor Details
Class Method Details
.instance ⇒ Engine
Returns the instance of QML::Engine.
13 14 15 |
# File 'lib/qml/engine.rb', line 13 def self.instance Kernel.engine end |
.new ⇒ Object
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.
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 |
#add_import_path(path) ⇒ Object
Adds a QML import path to the QML::Engine.
50 51 52 |
# File 'lib/qml/engine.rb', line 50 def add_import_path(path) @extension.add_import_path(path) end |
#collect_garbage ⇒ Object
Starts garbage collection on the QML::Engine.
33 34 35 |
# File 'lib/qml/engine.rb', line 33 def collect_garbage @extension.collect_garbage end |
#context ⇒ Context
Returns the root Context the QML::Engine.
28 29 30 |
# File 'lib/qml/engine.rb', line 28 def context @extension.rootContext end |
#import_paths ⇒ Array
Gets an array of QML import paths.
57 58 59 |
# File 'lib/qml/engine.rb', line 57 def import_paths() @extension.import_paths() end |