Results 1 to 2 of 2

Thread: QtPlugin and not-pure virtual functions

  1. #1
    Join Date
    Apr 2015
    Posts
    9
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QtPlugin and not-pure virtual functions

    For creating a Qt Plugin the doc states that i have to "Define a set of interfaces (classes with only pure virtual functions) used to talk to the plugins." I do have some (not-pure) virtual functions (those with a body and not declared with "=0"). This is quite handy, because if a plugin function does nothing, the plugin does not need to implement it. It works quite well untill now, but I am afraid of caveats. Are there any?




    Define a set of interfaces (classes with only pure virtual functions) used to talk to the plugins.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QtPlugin and not-pure virtual functions

    Hi,

    if you define the interface it does not matter if you have pure virtual or only virtual functions. There are no caveats. With pure virtual functions, however, you can force the plug-in to define something but that's a pure architectural question.

Similar Threads

  1. Pure virtual class with singals and slots
    By rubikon in forum Newbie
    Replies: 2
    Last Post: 31st August 2012, 10:32
  2. Replies: 2
    Last Post: 26th November 2011, 04:52
  3. Replies: 16
    Last Post: 13th March 2008, 17:46
  4. Cost of pure virtual
    By ShaChris23 in forum General Programming
    Replies: 4
    Last Post: 4th November 2007, 18:20
  5. inheritance, pure virtual
    By TheKedge in forum General Programming
    Replies: 2
    Last Post: 18th January 2007, 11:20

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.