C++ (Qt)class SHARED Modules: public QHash<QString, IModule*>{public: Modules(QString path); }; Modules::Modules(QString path){ QDir pluginDir(path); foreach (QString fileName, pluginDir.entryList(QDir::Files)) { QHash<QString, IModule*> h; QPluginLoader loader(pluginDir.absoluteFilePath(fileName)); if (IModule *interface = qobject_cast<IModule *>(loader.instance())) { [b]insert(interface->getTitle(), interface);[/b] // Правильно??? } }}
C++ (Qt)Modules m(QApplication::applicationDirPath()); m["asd"].
C++ (Qt)class IModule{ public: virtual ~IModule(){} virtual QString getTitle() = 0; virtual QString getDescription() = 0; virtual int Execut() = 0;};