Advertisement
Guest User

Untitled

a guest
Sep 14th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1. //header file
  2. #ifndef MYPLUG_H
  3. #define MYPLUG_H
  4.  
  5. //#include <QObject>
  6. #include "qc_plugininterface.h"
  7.  
  8. class myplug : public QObject, QC_PluginInterface
  9. {
  10.     Q_OBJECT
  11.     Q_INTERFACES(QC_PluginInterface)
  12. public:
  13.     explicit myplug(QObject *parent = 0);
  14.  
  15. //    virtual QString menu() const;
  16.     virtual PluginCapabilities getCapabilities() const;
  17.     virtual QString name() const;
  18.     virtual void execComm(Document_Interface *doc, QWidget *parent, QString cmd);
  19.    
  20. signals:
  21.    
  22. public slots:
  23.    
  24. };
  25.  
  26. #endif // MYPLUG_H
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. //source file
  34. #include "myplug.h"
  35. #include <QMessageBox>
  36. #include <QString>
  37. #include "document_interface.h"
  38.  
  39. myplug::myplug(QObject *parent) :
  40.     QObject(parent)
  41. {
  42. }
  43.  
  44. QString myplug::name() const {
  45.     return (tr("My first plugin woooho."));
  46. }
  47.  
  48. //QString myplug::menu() const{
  49. //    return("Help");
  50. //}
  51.  
  52. PluginCapabilities myplug::getCapabilities() const{
  53.     PluginMenuLocation *pml =  new PluginMenuLocation("Help", "mytestplugin");
  54.     PluginCapabilities pc;
  55.     pc.menuEntryPoints.append(*pml);
  56.     return pc;
  57. }
  58.  
  59. void myplug::execComm(Document_Interface *doc, QWidget *parent, QString cmd){
  60.     Q_UNUSED(doc);
  61.     QMessageBox::information(parent, "LC rules", "this is my first plugin");
  62.  
  63. }
  64.  
  65. Q_EXPORT_PLUGIN2(myplugin, myplug);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement