Sunday, July 6th 2008, 1:44am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, January 31st 2008, 7:56am

Multi Inheritence in QT

I tried to inherit from two classes one was derived from QObject and the other from QWidget - thus creating the "dreaded diamond".
Qt Throwed a warning:
trace.h:85: Warning: Class MyTracer inherits from two QObject subclasses QWidget and TracerInterface. This is not supported!

virtual inheritence didnt work so I changed my architucture and now everything is A'Ok.
My question is what is the risk in inheriting from two QObjects?

This post has been edited 1 times, last edit by "ManicQin" (Jan 31st 2008, 10:43am)

  • Go to the top of the page

mikolajS

Beginner

Posts: 4

Location: Gdansk

2

Friday, February 8th 2008, 10:45am

Do you want have a textbox witch being a button at the same time? I think it may be possible create such library but it'd be very difficult.
  • Go to the top of the page

3

Friday, February 8th 2008, 11:24am

Something like that at the end I just used composition...
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

4

Sunday, February 17th 2008, 10:14pm

Quoted

Originally posted by mikolajS
Do you want have a textbox witch being a button at the same time? I think it may be possible create such library but it'd be very difficult.

will try and let know. :)

composition would not yield the same result. maybe it was to have a qwidget 'within' a qobject right?
  • Go to the top of the page

5

Thursday, May 1st 2008, 4:22pm

RE: Multi Inheritence in QT

The references would be ambiguous and you would need to call items like

Object1::setTimer
Object2::setTimer
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

6

Wednesday, May 14th 2008, 12:35pm

RE: Multi Inheritence in QT

Quoted

Originally posted by KingMike
The references would be ambiguous and you would need to call items like

Object1::setTimer
Object2::setTimer

EXPLAIN
  • Go to the top of the page

mikolajS

Beginner

Posts: 4

Location: Gdansk

7

Saturday, May 17th 2008, 7:04pm

KingMike, in theory of course, but do you ever tried compile class inherit from two classes QT? It returns error.
What about signals? How library can know which base class made signal?

This post has been edited 1 times, last edit by "mikolajS" (May 17th 2008, 7:06pm)

  • Go to the top of the page

Rate this thread