Results 1 to 2 of 2

Thread: Multiple inheritance problem

  1. #1
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Multiple inheritance problem

    Hi,
    recently I have been asked one question in an interview.

    if I write multiple inheritance as below.

    class B1 : public QObject {}
    class B2 : public QObject {}
    class D : public B1, public B2 {}

    is there any problem with signal slot mechanism ??

    I know ambiguity will come into picture, please let me know what is the solution for this ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multiple inheritance problem

    Such inheritance model is not possible with Qt. QObject cannot be inherited more than once.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Multiple inheritance of QObjects
    By tescrin in forum Qt Programming
    Replies: 1
    Last Post: 7th January 2013, 22:57
  2. Multiple inheritance question
    By marcvanriet in forum Newbie
    Replies: 4
    Last Post: 4th October 2010, 10:30
  3. Multiple Inheritance & Qt
    By kefeng.chen in forum Qt Programming
    Replies: 8
    Last Post: 21st March 2006, 18:37
  4. Multiple inheritance & Qt
    By dublet in forum Qt Programming
    Replies: 11
    Last Post: 8th March 2006, 08:12
  5. Multiple Inheritance
    By sunil.thaha in forum General Programming
    Replies: 4
    Last Post: 21st February 2006, 04:00

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.