+ Reply to Thread
Results 1 to 4 of 4

Thread: "ambiguous base" error

  1. #1
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default "ambiguous base" error

    Hi,

    I'm porting a co-worker's code to Qt4. It controls a huge vat of great-tasting lemonade. I think great-tasting lemonade should be controlled by a great-looking GUI. That's why I'm going to Qt4.

    It compiles great with Qt3, but when I use Qt4 I get this error:

    lemonDiag.C:590: error: 'QObject' is an ambiguous base of 'CHWController'
    The line causing the problem looks like this:

    Qt Code:
    1. QObject::connect(hwc,SIGNAL(ph_off_balance(double)),temp1A,SLOT(setValue(double)));
    To copy to clipboard, switch view to plain text mode 

    And the constructor looks like this:

    Qt Code:
    1. class CHWController: public QObject, public QThread
    To copy to clipboard, switch view to plain text mode 

    Could the dual inheritance be a problem? Is there a simple fix?
    What should I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "ambiguous base" error

    In Qt4 QThread inherits QObject. In Qt3 it is a really bad idea to mix threads and signals.

  3. The following user says thank you to jacek for this useful post:

    mhoover (13th June 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: "ambiguous base" error

    Oh ... Interesting.

    So could I then declare his class without explicitly inheriting from QObject?

    Qt Code:
    1. class CHWController: public QThread
    To copy to clipboard, switch view to plain text mode 

    Or would a more drastic solution be in order?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "ambiguous base" error

    Quote Originally Posted by mhoover
    So could I then declare his class without explicitly inheriting from QObject?
    Yes, because QObject is already there.

+ Reply to Thread

Similar Threads

  1. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  2. Unable to execute in Debug Mode
    By Kapil in forum Installation and Deployment
    Replies: 38
    Last Post: 5th April 2006, 07:27
  3. Fed up with M$ Window$ !!! Why is Tux leaving me alone???
    By fullmetalcoder in forum General Discussion
    Replies: 35
    Last Post: 18th March 2006, 12:57
  4. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54
  5. qmake_image_collection.cpp gives me a compiling error
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2006, 01:42

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