cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
Helper class that loads Qt plugins searching in the default cumbia plugin path and in directories listed in a proper environment variable. More...
#include <cupluginloader.h>
Public Member Functions | |
CuPluginLoader () | |
QStringList | getPluginAbsoluteFilePaths (const QString &default_plugin_path, const QRegExp &match=QRegExp(".*")) |
get a list of the absolute file paths of the plugins which name matches the regular expression match. More... | |
QString | getPluginAbsoluteFilePath (const QString &default_plugin_path, const QString &name) |
get the absolute file path of the plugin with name name. More... | |
QString | getPluginPath () const |
CuPluginLoader::getPluginPath returns the plugin path from the CUMBIA_PLUGIN_PATH environment variable. More... | |
QString | getDefaultPluginPath () const |
template<class T > | |
T * | get (const QString &name, QObject **plugin_as_qobject, const QString &default_plugin_path=QString()) |
Helper class that loads Qt plugins searching in the default cumbia plugin path and in directories listed in a proper environment variable.
Plugins can be loaded from a default cumbia plugin library directory which is defined in the cumbia-qtcontrols.pri file and passed to the compiler with a -D option. The name is:
Plugins are searched also in one of the colon separated list of directories exported through the CUMBIA_PLUGIN_PATH environment variable.
CuPluginLoader::CuPluginLoader | ( | ) |
|
inline |
References getPluginAbsoluteFilePath().
QString CuPluginLoader::getDefaultPluginPath | ( | ) | const |
QString CuPluginLoader::getPluginAbsoluteFilePath | ( | const QString & | default_plugin_path, |
const QString & | name | ||
) |
get the absolute file path of the plugin with name name.
default_plugin_path | the default cumbia plugin installation directory (CUMBIA_QTCONTROLS_PLUGIN_DIR) |
name | the exact name of the desired plugin, for example "libactions-extension-plugin.so" or "libcumbia-dbus-plugin.so" |
References getPluginAbsoluteFilePaths().
Referenced by get().
QStringList CuPluginLoader::getPluginAbsoluteFilePaths | ( | const QString & | default_plugin_path, |
const QRegExp & | match = QRegExp(".*") |
||
) |
get a list of the absolute file paths of the plugins which name matches the regular expression match.
default_plugin_path | the default cumbia plugin installation directory (e.g. CUMBIA_QTCONTROLS_PLUGIN_DIR). If empty, the default plugin path is set to CUMBIA_QTCONTROLS_PLUGIN_DIR, defined in cumbia-qtcontrols.pri |
match | a regular expression to match the desired plugin name. For example the ".*context-menu-actions\.so" can be used to find all the plugins extending the contextual menu of a cumbia-qtcontrols widget. |
Referenced by QuXtraWidgetPluginLoader::getPlugin(), getPluginAbsoluteFilePath(), and CuContextMenu::prepare().
QString CuPluginLoader::getPluginPath | ( | ) | const |
CuPluginLoader::getPluginPath returns the plugin path from the CUMBIA_PLUGIN_PATH environment variable.