Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QPluginLoader class loads a plugin at run-time. More...
Public Member Functions | |
QPluginLoader (QObject parent=null) | |
| |
QPluginLoader (string fileName, QObject parent=null) | |
| |
override void | CreateProxy () |
new string | ErrorString () |
| |
new QObject | Instance () |
| |
new bool | IsLoaded () |
| |
new bool | Load () |
| |
new QLibrary.LoadHint | loadHints () |
new void | SetLoadHints (QLibrary.LoadHint loadHints) |
new bool | Unload () |
| |
new void | Dispose () |
Public Member Functions inherited from QtCore.QObject | |
QObject (QObject parent=null) | |
| |
new bool | BlockSignals (bool b) |
| |
new System.Collections.Generic.List < QObject > | Children () |
| |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
new void | DeleteLater () |
| |
new bool | Disconnect (QObject receiver, string member=null) |
| |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
| |
new void | DumpObjectInfo () |
| |
new void | DumpObjectTree () |
| |
new System.Collections.Generic.List < QByteArray > | DynamicPropertyNames () |
| |
virtual bool | OnEvent (QEvent arg1) |
| |
virtual bool | EventFilter (QObject arg1, QEvent arg2) |
| |
new bool | Inherits (string classname) |
| |
new void | InstallEventFilter (QObject arg1) |
| |
new bool | IsWidgetType () |
| |
new void | KillTimer (int id) |
| |
new object | Property (string name) |
| |
new void | RemoveEventFilter (QObject arg1) |
| |
new bool | SetProperty (string name, object value) |
| |
new void | SetUserData (uint id, QObjectUserData data) |
new bool | SignalsBlocked () |
| |
new int | StartTimer (int interval) |
| |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
Public Member Functions inherited from QtCore.Qt | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
Static Public Member Functions | |
static System.Collections.Generic.List < QObject > | StaticInstances () |
| |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
Static Public Member Functions inherited from QtCore.QObject | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection) |
| |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
| |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
| |
static uint | RegisterUserData () |
static string | Tr (string s, string c=null) |
| |
static string | Tr (string s, string c, int n) |
| |
static string | TrUtf8 (string s, string c=null) |
| |
static string | TrUtf8 (string s, string c, int n) |
| |
Static Public Member Functions inherited from QtCore.Qt | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream arg1, QSizeF arg2) |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream arg1, QPoint arg2) |
static QDataStream | Write (QDataStream arg1, QLineF arg2) |
static QDataStream | Write (QDataStream arg1, QPointF arg2) |
static QDataStream | Write (QDataStream arg1, QChar arg2) |
static QDataStream | Write (QDataStream arg1, QByteArray arg2) |
static QDataStream | Write (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Write (QDataStream arg1, QRectF arg2) |
static QDataStream | Write (QDataStream arg1, QDateTime arg2) |
static QDataStream | Write (QDataStream arg1, QUrl arg2) |
static QDataStream | Write (QDataStream arg1, QTime arg2) |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream arg1, QBitArray arg2) |
static QDataStream | Write (QDataStream arg1, QUuid arg2) |
static QDataStream | Write (QDataStream arg1, QLine arg2) |
static QDataStream | Write (QDataStream arg1, QDate arg2) |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
static QDataStream | Write (QDataStream arg1, QRect arg2) |
static QDataStream | Write (QDataStream arg1, QSize arg2) |
static QDataStream | Write (QDataStream s, QVariant.Type p) |
static QDataStream | Write (QDataStream arg1, string arg2) |
static QDataStream | Write (QDataStream @out, System.Collections.Generic.List< string > list) |
static QDataStream | Read (QDataStream arg1, QChar arg2) |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream arg1, QRect arg2) |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream arg1, QDate arg2) |
static QDataStream | Read (QDataStream arg1, QUrl arg2) |
static QDataStream | Read (QDataStream arg1, QUuid arg2) |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream arg1, QLineF arg2) |
static QDataStream | Read (QDataStream arg1, QRectF arg2) |
static QDataStream | Read (QDataStream arg1, QPointF arg2) |
static QDataStream | Read (QDataStream arg1, QLine arg2) |
static QDataStream | Read (QDataStream arg1, QBitArray arg2) |
static QDataStream | Read (QDataStream arg1, QSize arg2) |
static QDataStream | Read (QDataStream arg1, QDateTime arg2) |
static QDataStream | Read (QDataStream arg1, QTime arg2) |
static QDataStream | Read (QDataStream arg1, QPoint arg2) |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream arg1, QByteArray arg2) |
static QDataStream | Read (QDataStream arg1, QSizeF arg2) |
static QDataStream | Read (QDataStream arg1, string arg2) |
static QDataStream | Read (QDataStream s, QVariant.Type p) |
static QDataStream | Read (QDataStream @in, System.Collections.Generic.List< string > list) |
static double | qAcos (double v) |
static void | qAddPostRoutine (System.Action arg1) |
static string | qAppName () |
static double | qAsin (double v) |
static double | qAtan (double v) |
static double | qAtan2 (double x, double y) |
static void | qBadAlloc () |
static int | qCeil (double v) |
static ushort | qChecksum (string s, uint len) |
static QByteArray | qCompress (QByteArray data) |
static QByteArray | qCompress (QByteArray data, int compressionLevel=-1) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
static double | qCos (double v) |
static double | qExp (double v) |
static double | qFabs (double v) |
static double | qFastCos (double x) |
static double | qFastSin (double x) |
static string | qFlagLocation (string method) |
static int | qFloor (double v) |
static bool | qFuzzyCompare (double p1, double p2) |
static bool | qFuzzyCompare (float p1, float p2) |
static bool | qFuzzyIsNull (double d) |
static bool | qFuzzyIsNull (float f) |
static uint | qHash (QBitArray key) |
static uint | qHash (QChar key) |
static uint | qHash (QStringRef key) |
static uint | qHash (QUrl url) |
static uint | qHash (QPersistentModelIndex index) |
static uint | qHash (QByteArray key) |
static uint | qHash (QModelIndex index) |
static uint | qHash (uint key) |
static uint | qHash (sbyte key) |
static uint | qHash (byte key) |
static uint | qHash (short key) |
static uint | qHash (NativeLong key) |
static uint | qHash (ushort key) |
static uint | qHash (long key) |
static uint | qHash (ulong key) |
static uint | qHash (int key) |
static uint | qHash (string key) |
static uint | qHash (NativeULong key) |
static double | qInf () |
static Qt.ActionQtMsgTypeString | qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1) |
static int | qIntCast (float f) |
static int | qIntCast (double f) |
static bool | qIsFinite (double d) |
static bool | qIsFinite (float f) |
static bool | qIsInf (float f) |
static bool | qIsInf (double d) |
static bool | qIsNaN (float f) |
static bool | qIsNaN (double d) |
static bool | qIsNull (float f) |
static bool | qIsNull (double d) |
static double | qLn (double v) |
static double | qPow (double x, double y) |
static double | qQNaN () |
static void | qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
static void | qRemovePostRoutine (System.Action arg1) |
static int | qRound (double d) |
static long | qRound64 (double d) |
static double | qSNaN () |
static bool | qSharedBuild () |
static double | qSin (double v) |
static double | qSqrt (double v) |
static bool | qStringComparisonHelper (QStringRef s1, string s2) |
static double | qTan (double v) |
static QByteArray | qUncompress (QByteArray data) |
static QByteArray | qUncompress (Pointer< byte > data, int nbytes) |
static string | qVersion () |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
static bool | Qputenv (string varName, QByteArray value) |
static int | Qrand () |
static void | Qsrand (uint seed) |
static int | Qstrcmp (QByteArray str1, QByteArray str2) |
static int | Qstrcmp (QByteArray str1, string str2) |
static int | Qstrcmp (string str1, QByteArray str2) |
static int | Qstrcmp (string str1, string str2) |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
static Pointer< sbyte > | Qstrdup (string arg1) |
static int | Qstricmp (string arg1, string arg2) |
static uint | Qstrlen (string str) |
static int | Qstrncmp (string str1, string str2, uint len) |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
static int | Qstrnicmp (string arg1, string arg2, uint len) |
static uint | Qstrnlen (string str, uint maxlen) |
static string | QtTrId (string id, int n=-1) |
Protected Member Functions | |
QPluginLoader (System.Type dummy) | |
Protected Member Functions inherited from QtCore.QObject | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent arg1) |
| |
virtual void | ConnectNotify (string signal) |
| |
virtual void | OnCustomEvent (QEvent arg1) |
| |
new void | OnDestroyed (QObject arg1=null) |
| |
virtual void | DisconnectNotify (string signal) |
| |
new int | Receivers (string signal) |
| |
new QObject | Sender () |
| |
new int | SenderSignalIndex () |
| |
virtual void | OnTimerEvent (QTimerEvent arg1) |
| |
Properties | |
new string | FileName [get, set] |
| |
new QLibrary.LoadHint | LoadHints [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQPluginLoaderSignals | Emit [get] |
Properties inherited from QtCore.QObject | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | Event |
| |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
| |
Slot< QObject > | DestroyedQObject |
Slot | Destroyed |
| |
new QObject | Parent [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
| |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
The QPluginLoader class loads a plugin at run-time.
QPluginLoader provides access to a Qt plugin. A Qt plugin is stored in a shared library (a DLL) and offers these benefits over shared libraries accessed using QLibrary:
QPluginLoader checks that a plugin is linked against the same version of Qt as the application.
QPluginLoader provides direct access to a root component object (instance()), instead of forcing you to resolve a C function manually.
An instance of a QPluginLoader object operates on a single shared library file, which we call a plugin. It provides access to the functionality in the plugin in a platform-independent way. To specify which plugin to load, either pass a file name in the constructor or set it with setFileName().
The most important functions are load() to dynamically load the plugin file, isLoaded() to check whether loading was successful, and instance() to access the root component in the plugin. The instance() function implicitly tries to load the plugin if it has not been loaded yet. Multiple instances of QPluginLoader can be used to access the same physical plugin.
Once loaded, plugins remain in memory until all instances of QPluginLoader has been unloaded, or until the application terminates. You can attempt to unload a plugin using unload(), but if other instances of QPluginLoader are using the same library, the call will fail, and unloading will only happen when every instance has called unload(). Right before the unloading happen, the root component will also be deleted.
In order to speed up loading and validation of plugins, some of the information that is collected during loading is cached in persistent memory (through QSettings). For instance, the result of a load operation (e.g. succeeded or failed) is stored in the cache, so that subsequent load operations don't try to load an invalid plugin. However, if the "last modified" timestamp of a plugin has changed, the plugin's cache entry is invalidated and the plugin is reloaded regardless of the values in the cache entry. The cache entry is then updated with the new result of the load operation.
This also means that the timestamp must be updated each time the plugin or any dependent resources (such as a shared library) is updated, since the dependent resources might influence the result of loading a plugin.
See How to Create Qt Plugins for more information about how to make your application extensible through plugins.
Note that the QPluginLoader cannot be used if your application is statically linked against Qt. In this case, you will also have to link to plugins statically. You can use QLibrary if you need to load dynamic libraries in a statically linked application.
Note: In Symbian the plugin stub files must be used whenever a path to plugin is needed. For the purposes of loading plugins, the stubs can be considered to have the same name as the actual plugin binary. In practice they have ".qtplugin" extension instead of ".dll", but this difference is handled transparently by QPluginLoader and QLibrary to avoid need for Symbian specific plugin handling in most Qt applications. Plugin stubs are needed because Symbian Platform Security denies all access to the directory where the actual plugin binaries are located.
See also QLibrary and Plug & Paint Example.
|
protected |
QtCore.QPluginLoader.QPluginLoader | ( | QObject | parent = null | ) |
Constructs a plugin loader with the given parent.
QtCore.QPluginLoader.QPluginLoader | ( | string | fileName, |
QObject | parent = null |
||
) |
Constructs a plugin loader with the given parent that will load the plugin specified by fileName.
To be loadable, the file's suffix must be a valid suffix for a loadable library in accordance with the platform, e.g. .so on Unix, - .dylib on Mac OS X, and .dll on Windows. The suffix can be verified with QLibrary::isLibrary().
Note: In Symbian the fileName must point to plugin stub file.
See also setFileName().
|
virtual |
Reimplemented from QtCore.QObject.
new void QtCore.QPluginLoader.Dispose | ( | ) |
new string QtCore.QPluginLoader.ErrorString | ( | ) |
Returns a text string with the description of the last error that occurred.
This function was introduced in Qt 4.2.
new QObject QtCore.QPluginLoader.Instance | ( | ) |
Returns the root component object of the plugin. The plugin is loaded if necessary. The function returns 0 if the plugin could not be loaded or if the root component object could not be instantiated.
If the root component object was destroyed, calling this function creates a new instance.
The root component, returned by this function, is not deleted when the QPluginLoader is destroyed. If you want to ensure that the root component is deleted, you should call unload() as soon you don't need to access the core component anymore. When the library is finally unloaded, the root component will automatically be deleted.
The component object is a QObject. Use qobject_cast() to access interfaces you are interested in.
See also load().
new bool QtCore.QPluginLoader.IsLoaded | ( | ) |
Returns true if the plugin is loaded; otherwise returns false.
See also load().
new bool QtCore.QPluginLoader.Load | ( | ) |
Loads the plugin and returns true if the plugin was loaded successfully; otherwise returns false. Since instance() always calls this function before resolving any symbols it is not necessary to call it explicitly. In some situations you might want the plugin loaded in advance, in which case you would use this function.
See also unload().
new QLibrary.LoadHint QtCore.QPluginLoader.loadHints | ( | ) |
new void QtCore.QPluginLoader.SetLoadHints | ( | QLibrary.LoadHint | loadHints | ) |
|
static |
Returns a list of static plugin instances (root components) held by the plugin loader.
|
static |
|
static |
|
static |
|
static |
new bool QtCore.QPluginLoader.Unload | ( | ) |
Unloads the plugin and returns true if the plugin could be unloaded; otherwise returns false.
This happens automatically on application termination, so you shouldn't normally need to call this function.
If other instances of QPluginLoader are using the same plugin, the call will fail, and unloading will only happen when every instance has called unload().
Don't try to delete the root component. Instead rely on that unload() will automatically delete it when needed.
See also instance() and load().
|
getprotected |
|
getset |
This property holds the file name of the plugin.
To be loadable, the file's suffix must be a valid suffix for a loadable library in accordance with the platform, e.g. .so on Unix, .dylib on Mac OS X, and .dll on Windows. The suffix can be verified with QLibrary::isLibrary().
If the file name does not exist, it will not be set. This property will then contain an empty string.
By default, this property contains an empty string.
Note: In Symbian the fileName must point to plugin stub file.
|
getset |
This property holds give the load() function some hints on how it should behave.
You can give hints on how the symbols in the plugin are resolved. By default, none of the hints are set.
See the documentation of QLibrary::loadHints for a complete description of how this property works.
This property was introduced in Qt 4.4.
|
staticget |