Results 1 to 2 of 2

Thread: problem with interface Class - Error:undefined interface

  1. #1
    Join Date
    May 2012
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default problem with interface Class - Error:undefined interface

    im trying to test a plugin based application... so as u know i have an interface and then a plug-in which manipulate the interface... i think everything is OK but i face with this error>>
    ( error: Undefined interface)
    . here is my code... how knows wahts the problem

    Qt Code:
    1. //// pro file
    2. #-------------------------------------------------
    3. #
    4. # Project created by QtCreator 2012-08-11T13:34:07
    5. #
    6. #-------------------------------------------------
    7.  
    8. QT += core
    9.  
    10. QT -= gui
    11.  
    12. TARGET = CAlPlugin_Based
    13. CONFIG += console
    14. CONFIG -= app_bundle
    15.  
    16.  
    17.  
    18. TEMPLATE = app
    19.  
    20.  
    21. SOURCES += main.cpp
    22.  
    23. HEADERS += \
    24. EvaluateInterface.h\
    25. Evaluate.h
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. //// Evaluate.h file
    2. #ifndef EVALUATE_H
    3. #define EVALUATE_H
    4.  
    5. #include<EvaluateInterface.h>
    6.  
    7. class evaluate : public evaluateInterface
    8. {
    9. Q_OBJECT
    10. Q_INTERFACES(evaluateInterface)
    11.  
    12. public:
    13. QString name1() const;
    14. int evaluate1(int num1, int num2) const;
    15. };
    16.  
    17. #endif // EVALUATE_H
    To copy to clipboard, switch view to plain text mode 
    /
    Qt Code:
    1. /// EvaluateInterface.h
    2.  
    3. #ifndef EVALUATEINTERFACE_H
    4. #define EVALUATEINTERFACE_H
    5.  
    6.  
    7.  
    8. class evaluateInterface
    9. {
    10. public:
    11. virtual ~evaluateInterface(){}
    12.  
    13. virtual QString name1() const=0;
    14. virtual int evaluate1(int num1,int num2) const=0;
    15. };
    16. Q_DECLARE_INTERFACE(evaluateInterface,"CaaaalInterface/1.0")
    17.  
    18. #endif // EVALUATEINTERFACE_H
    To copy to clipboard, switch view to plain text mode 



    Whats the problem then... thank u alll
    Last edited by high_flyer; 12th August 2012 at 17:14. Reason: code tags

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: problem with interface Class - Error:undefined interface

    Have class evaluate subclass QObject as well.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Problem with my C++ library that uses a interface class
    By maxoreli in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2012, 15:33
  2. Replies: 9
    Last Post: 25th March 2011, 22:40
  3. Replies: 1
    Last Post: 17th January 2011, 05:18
  4. separate class using an interface
    By qt_gotcha in forum Newbie
    Replies: 7
    Last Post: 3rd March 2010, 22:54
  5. Undefined interface
    By mero in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2009, 17:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.