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. QGraphicsObject uses multiple inheritance?
Forum Updated to NodeBB v4.3 + New Features

QGraphicsObject uses multiple inheritance?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.2k 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.
  • M Offline
    M Offline
    MaQzma
    wrote on last edited by
    #1

    That is the question, in the documentation appear this: "QGraphicsObject":http://qt-project.org/doc/qt-4.8/qgraphicsobject.html - Inherits: QObject and QGraphicsItem.

    Mario.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      Yes, what's wrong with this?

      [quote author="Mariø™" date="1340064631"]That is the question, in the documentation appear this: "QGraphicsObject":http://qt-project.org/doc/qt-4.8/qgraphicsobject.html - Inherits: QObject and QGraphicsItem.[/quote]

      BYW, many other class use multiple inheritance too. such as
      @
      class QWidget : public QObject, public QPaintDevice
      @

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        The multiple inheritance restriction in Qt only applies to QObject, which means that you cannot directly or indirectly inherit from multiple QObject classes.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MaQzma
          wrote on last edited by
          #4

          1+1=2, Lukas Geyer Thks!

          I did read about multiple inheritance, and a lot of people says that is not good use it. But I think that If you know how to use, you can use it. Qt Framework is an example of this argument.

          Mario.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            Multiple inheritance is not bad at all, it just requires that you know what you are doing.

            But this is true for a lot of other stuff in C++ as well ;-)

            1 Reply Last reply
            0

            • Login

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