Class: QML::PluginLoader
- Inherits:
-
Object
- Object
- QML::PluginLoader
- Defined in:
- lib/qml/plugin_loader.rb
Overview
PluginLoader loads Qt C++ plugins and enables you to use your Qt C++ codes from Ruby easily.
Class Method Summary collapse
-
.lib_filename(libname) ⇒ String
Platform-dependent library file name.
Instance Method Summary collapse
-
#initialize(path, libname = nil) ⇒ PluginLoader
constructor
A new instance of PluginLoader.
-
#instance ⇒ QtObjectBase
Loads the plugin and returns the instance of the plugin.
Constructor Details
#initialize(path) ⇒ PluginLoader #initialize(dir, libname) ⇒ PluginLoader
Returns a new instance of PluginLoader.
21 22 23 24 |
# File 'lib/qml/plugin_loader.rb', line 21 def initialize(path, libname = nil) path = Pathname(path) + self.class.lib_filename(libname) if libname initialize_orig(path.to_s) end |
Class Method Details
.lib_filename(libname) ⇒ String
Returns platform-dependent library file name.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/qml/plugin_loader.rb', line 35 def self.lib_filename(libname) case when Platform::windows? "#{libname}.dll" when Platform::mac? "lib#{libname}.dylib" else "lib#{libname}.so" end end |
Instance Method Details
#instance ⇒ QtObjectBase
Loads the plugin and returns the instance of the plugin.
|
# File 'lib/qml/plugin_loader.rb', line 26
|