Results 1 to 4 of 4

Thread: Class name mismatch for plugin

  1. #1
    Join Date
    Aug 2008
    Location
    Cherry Hill, NJ USA
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Class name mismatch for plugin

    I'm using an evaluation version of Qt 4.4.0. I made a plugin that, other than creating a render area viewer instead of an examiner, is the same as SoQtWidgetPlugin.

    Designer complains when this plugin is selected from the Widget Box:

    "A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class SoQtRenderAreaWidgetPlugin. It returned a widget of class SoQtWrapper."

    Any ideas? The SoQtWidgetPlugin also returns a class SoQtWrapper, with no problem.

    Thanks in advance for any help,
    Martin

  2. #2
    Join Date
    Aug 2008
    Location
    Cherry Hill, NJ USA
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Class name mismatch for plugin

    I've only been using Qt a few days. I just realized that I can turn off the decoration for the viewer. But I still may want to make plugins for other purposes...

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Class name mismatch for plugin

    The class declaration of the custom widget probably misses the necessary Q_OBJECT macro, thus Qt's meta object system is unable to detect correct class name but gets the base class name instead.
    J-P Nurmi

  4. #4
    Join Date
    Aug 2008
    Location
    Cherry Hill, NJ USA
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Class name mismatch for plugin

    Thanks for the suggestion. The declaration does contain Q_OBJECT; here is some more information about the problem.

    The plugins actually almost work. I have one that's an examiner viewer that, when dragged onto the main widow generates the error message but works. The other one is a render area viewer. This one generates an error but then also creates an examiner viewer.

    The strange thing is the the examiner plugin is Mercury's with the class/methods renamed, and the render area version is different by only one line - the SoQtWrapper is defaulted to RENDER_AREA instead of EXAMINER in the constructor.

Similar Threads

  1. class in the class
    By baray98 in forum General Programming
    Replies: 2
    Last Post: 23rd July 2008, 08:01
  2. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 08:57
  3. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 08:07
  4. Creating object of other class in Run() method
    By santosh.kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 16:05
  5. Replies: 2
    Last Post: 4th May 2006, 20:17

Tags for this Thread

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.