Guest User

Untitled

a guest
Feb 18th, 2011
483
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "plugin_test_plugin.h"
  2. #include<QDebug>
  3.  
  4. A::A(QDeclarativeItem *parent)
  5. : QDeclarativeItem(parent){}
  6.  
  7. void A::printThis()
  8. {
  9.     qDebug()<< "A: "<<(int)this;
  10. }
  11.  
  12. B::B(QDeclarativeItem *parent)
  13. : QDeclarativeItem(parent){}
  14.  
  15. void B::printThis()
  16. {
  17.     qDebug()<< "B: "<<(int)this;
  18. }
  19.  
  20.  
  21. void B::printA(A* p_a)
  22. {
  23.     qDebug()<< "A: "<<(int)p_a;
  24. }
  25.  
  26. void plugin_testPlugin::registerTypes(const char *uri)
  27. {
  28.     qmlRegisterType<A>(uri, 1, 0, "A");
  29.     qmlRegisterType<B>(uri, 1, 0, "B");
  30. }
  31.  
  32. Q_EXPORT_PLUGIN2(plugin_test, plugin_testPlugin)
RAW Paste Data