Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Warning: Class implements the interface QGraphicsItem but does not list it in Q_INTERFACES
Forum Updated to NodeBB v4.3 + New Features

[Solved] Warning: Class implements the interface QGraphicsItem but does not list it in Q_INTERFACES

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 9.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xtingray
    wrote on 25 Feb 2011, 21:38 last edited by
    #1

    Currently I am studying some code that I didn't write and when I compile it I got the warning message of the subject.
    I was checking some documents about plugins but I couldn't find nothing conclusive about it.
    I'm just curious what that means? How can I avoid it?

    Thanks for any hint.


    Qt Developer

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on 26 Feb 2011, 14:17 last edited by
      #2

      You can check how its used in Qt sources or you could also lookup Q_INTERFACES in the Qt Assistant which says,

      bq.
      @
      class BasicToolsPlugin : public QObject,
      public BrushInterface,
      public ShapeInterface,
      public FilterInterface
      {
      Q_OBJECT
      Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)

      public:
      ...
      };
      @

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xtingray
        wrote on 26 Feb 2011, 21:12 last edited by
        #3

        Finally I figured out what is going on here. It seems that this Warning shows up when a class inherits from both QObject AND QGraphicsItem, like this:

        @
        class KControlNode : public QObject, public QGraphicsItem
        @

        I think so, because when I changed it for:

        @
        class KControlNode : public QGraphicsItem
        @

        and compile the source code again, the Warning disappears :)


        Qt Developer

        1 Reply Last reply
        0

        1/3

        25 Feb 2011, 21:38

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved