C++ (Qt)enum PT {View, find, edit} PT MyClass::getType(){return PT::View;}}
C++ (Qt)enum PT {View, find, edit}; PT MyClass::getType(){return PT::View;}}
C++ (Qt)class PluginType {public: enum PT { High, Low, VeryHigh, VeryLow }; };
Creating library file: ..\Loader\debug\libRecordViewer.adebug/recordviewer.o: In function `ZN8QPointerI7QObjectEaSEPS0_':c:/Qt/2009.03/qt/include/QtCore/../../src/corelib/kernel/qpointer.h:(.text$_ZN7IModuleD2Ev[IModule::~IModule()]+0xb): undefined reference to `vtable for IModule'c:/Qt/2009.03/qt/include/QtCore/../../src/corelib/kernel/qpointer.h:(.text$_ZN7IModuleC2Ev[IModule::IModule()]+0x8): undefined reference to `vtable for IModule'collect2: ld returned 1 exit statusmingw32-make[2]: *** [..\Loader\debug\RecordViewer.dll] Error 1mingw32-make[1]: *** [debug] Error 2mingw32-make: *** [sub-RecordViewer-make_default] Error 2Завершено с кодом возврата 2.Ошибка во время сборки проекта QProjectВо время выполнения сборки на этапе 'Make'
C++ (Qt)enum PluginType { PluginTypeView, PluginTypeEdit }; class PluginBase{ public: ... virtual PluginType type() const = 0;};
C++ (Qt)#include <pluginbase.h> class PluginView : public PluginBase{ public: ... virtual PluginType type() const { return PluginTypeView; }};
C++ (Qt)// грузим плагины тутPluginBase *plugin = PluginLoader::instance()->load("...../view.so"); PluginType t = plugin->type(); if(t == PluginTypeView){ // вставляем туда-то}else if (t == PluginTypeEdit){ ....}else if...
C++ (Qt) // fakeenum PluginType { PluginTypeView=0, PluginTypeEdit, PluginTypeOther };