×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    66

    how to export class in plugin

    i write a class in plugin ,how to export?
    class Alipay : public QObject
    {
    Q_OBJECT
    public:
    explicit Alipay(QObject *parent = 0);
    int Pay(int index);
    const char* PayInfor(const char *uri);
    virtual ~Alipay();
    signals:

    public slots:

    private:
    // Q_DISABLE_COPY(Alipay)
    };

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: how to export class in plugin


  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    66

    Re: how to export class in plugin

    Q_EXPORT_PLUGIN2(Aliplugin, AlipluginPlugin)
    //Q_EXPORT_PLUGIN2(Aliplugin, Alipay) ///if i write two Q_EXPORT_PLUGIN2, the compiler will report error

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: how to export class in plugin

    Quote Originally Posted by hsany330 View Post
    Q_EXPORT_PLUGIN2(Aliplugin, AlipluginPlugin)
    //Q_EXPORT_PLUGIN2(Aliplugin, Alipay) ///if i write two Q_EXPORT_PLUGIN2, the compiler will report error
    Which error, can you write ?

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    66

    Re: how to export class in plugin

    alipay.cpp:23: error: expected constructor, destructor, or type conversion before '(' token
    make: *** [obj/alipay.o] Error 1

  6. #6
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: how to export class in plugin

    Are you using semicolon ( ; ) at the end, remove it.

    or show us code, with EXPORT plugin line.
    Last edited by rahulvala; 2011-12-05 at 15:14.

  7. #7
    Registered User
    Join Date
    Nov 2007
    Posts
    66

    Re: how to export class in plugin

    // interface

    QT_BEGIN_HEADER

    QT_BEGIN_NAMESPACE

    class QAliInterface
    {

    public:
    virtual ~QAliInterface()
    {
    }
    virtual int Pay(int index)=0;
    virtual const char* PayInfor(const char *uri)=0;
    };

    Q_DECLARE_INTERFACE(QAliInterface, "com.Qt.QAliInterface/1.0")

    QT_END_NAMESPACE

    QT_END_HEADER

    //child class .h

    class Alipay : public QObject,public QAliInterface
    {
    Q_OBJECT
    Q_INTERFACES(QAliInterface)
    public:
    explicit Alipay(QObject *parent = 0);
    int Pay(int index);
    const char* PayInfor(const char *uri);
    virtual ~Alipay();
    signals:

    public slots:

    private:
    Q_DISABLE_COPY(Alipay);
    };

    ///.cpp

    Alipay::Alipay(QObject *parent) :
    QObject(parent)
    {
    }

    const char * Alipay::PayInfor(const char *uri)
    {
    return uri;
    }


    int Alipay::Pay(int index)
    {
    return index;
    }

    Alipay::~Alipay()
    {
    }

    Q_EXPORT_PLUGIN2(Aliplugin, Alipay) //error: expected constructor, destructor, or type conversion before '(' token

    Q_EXPORT_PLUGIN2(Aliplugin, AlipluginPlugin) //this is another class ,i want export too.

Similar Threads

  1. ABL -> export for dll
    By gacon in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2010-04-27, 16:30
  2. Replies: 1
    Last Post: 2010-02-11, 10:16
  3. HTTP class missing in any export library?
    By stenlik in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-03-28, 16:20
  4. Carbide developer wont import EXPORT commands from EXPORT.MAKE
    By jimgilmour1 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2006-10-26, 06:27
  5. Ethernet Plugin for Nokia 6600 Camera Plugin
    By chenfi in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-12-19, 11:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •