I created a static plugin following the examples of a Qt programming book, then I included it into my gui-application.

The widget in the plugin show up fine, but I noticed that I can't access his properties in this way:
Qt Code:
  1. IconEditorPlugin *m_editor;
  2. .. // initialize m_editor..
  3. int my_first_property = m_editor->property("zoomFactor").toInt();
To copy to clipboard, switch view to plain text mode 

It simply returns nothing.

The plugin interface class is the following:
Qt Code:
  1. class IconEditorPlugin : public QObject,
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. IconEditorPlugin(QObject *parent = 0);
  7.  
  8. QString name() const;
  9. QString includeFile() const;
  10. QString group() const;
  11. QIcon icon() const;
  12. QString toolTip() const;
  13. QString whatsThis() const;
  14. bool isContainer() const;
  15. QWidget *createWidget(QWidget *parent);
  16. };
To copy to clipboard, switch view to plain text mode 

and this is the real class of the widget with the properties I am trying to access to:
Qt Code:
  1. class IconEditor : public QWidget
  2. {
  3. Q_OBJECT
  4. Q_PROPERTY(QColor penColor READ penColor WRITE setPenColor)
  5. Q_PROPERTY(QImage iconImage READ iconImage WRITE setIconImage)
  6. Q_PROPERTY(int zoomFactor READ zoomFactor WRITE setZoomFactor)
  7.  
  8. public:
  9. IconEditor(QWidget *parent = 0);
  10.  
  11. void setPenColor(const QColor &newColor);
  12. QColor penColor() const { return curColor; }
  13. void setZoomFactor(int newZoom);
  14. int zoomFactor() const { return zoom; }
  15. void setIconImage(const QImage &newImage);
  16. QImage iconImage() const { return image; }
  17. QSize sizeHint() const;
  18.  
  19. protected:
  20. void mousePressEvent(QMouseEvent *event);
  21. void mouseMoveEvent(QMouseEvent *event);
  22. void paintEvent(QPaintEvent *event);
  23.  
  24. private:
  25. void setImagePixel(const QPoint &pos, bool opaque);
  26. QRect pixelRect(int i, int j) const;
  27.  
  28. QColor curColor;
  29. QImage image;
  30. int zoom;
  31. };
To copy to clipboard, switch view to plain text mode 

I used the Q_PROPERTY macro as described, but now how to access them in the main application?