Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Multiple inheritance in qt



  • Please someone send an ex: code of multiple inheritance in Qt(full code with .cpp file and ah file) which you have.



  • Please, describe what problem you have and what inheritance you need? What is your goal?
    This means, use "smart question":http://www.catb.org/~esr/faqs/smart-questions.html



  • In first widget there are 2 lineEdits and 2 buttons. if we click 1st button we get its add: in the 2nd form.if we click the 2nd button we get its difference in 3rd form . I want to do it using inheritance.



  • I'd go for a signal/slot solution any time here... Multiple inheritance is tricky to begin with and you will probably end up with clearer code if you don't use it.



  • What do you want to inherit? You have a composit there. One widget containing others. The ├╝parent cant be a button and a line edit at the same time.
    Event inheriting from different widgets will definitly not work.



  • can anyone send an example of inheritance( full code ) pleaseeeeee



  • signal/slot system and child/parent relationships allow avoid bug-generating multiple inheritance with Qt therefore MI is very rarely used here, me don't have even one MI-class in tens of thousands lines of code





  • [quote author="Neha123" date="1307534413"]can anyone send an example of inheritance( full code ) pleaseeeeee[/quote]

    Moaning and crying for help is usually leading to no answers at all. Behave like a grown up and you will treated like a such, behave childish and you will be treated like a nasty child.

    Begging for code is childish. This is a support forum not a do-my-homework-site.

    If you have a question, write it down in a way such that others can understand it. And/or describe what you want to achieve, also in a way such that others can understand it.

    You cannot have multiple inheritance with more than one QObject based base class. Although possible, and valuable in some circumstances, multiple inheritance can be very dangerous and error prone.


Log in to reply