Results 1 to 5 of 5

Thread: multiinherit trouble? ....template QList

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    3

    Default multiinherit trouble? ....template QList

    hello every,
    I hope that A inherit from QListBox and QPopupMenu ,but there 's something wrong with it :

    souce code :

    Qt Code:
    1. class spinxList :public QListBox ,public QPopupMenu
    2. {
    3. Q_OBJECT public :
    4. ..........
    5. }
    To copy to clipboard, switch view to plain text mode 

    error :
    'QObject ' is an ambiguous base of 'spinxList ',
    what can i do to solve this problem ?

    another problem :
    I learn about that QList is a template class ,it 's items can be of any type .
    but I could't find the class QList from QT referrence document ,
    is there the template class ?

    thank you for your reply !
    Last edited by wysota; 27th October 2006 at 11:04. Reason: missing [code] tags
    It is the same old story of not being grateful for what we have until we lose it..........

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 80 Times in 74 Posts

    Default Re: multiinherit trouble? ....template QList

    I learn about that QList is a template class ,it 's items can be of any type .
    but I could't find the class QList from QT referrence document ,
    is there the template class ?
    In Qt3 its called QPtrList (pointer based) and QValueList (value based).

  3. #3
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    3

    Default Re: multiinherit trouble? ....template QList

    Thank you for your rapid reply!
    It is the same old story of not being grateful for what we have until we lose it..........

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: multiinherit trouble? ....template QList

    Quote Originally Posted by bigbigmoon View Post
    I hope that A inherit from QListBox and QPopupMenu ,but there 's something wrong with it :

    souce code :

    class spinxList ublic QListBox ,public QPopupMenu
    {
    Q_OBJECT public :
    ..........
    }

    error :
    'QObject ' is an ambiguous base of 'spinxList ',
    what can i do to solve this problem ?
    Both base classes, QListBox and QPopupMenu are QObjects. Multiple inheritance of QObject is not supported.

    As Volker from Trolltech has said:
    Some of the QObject concepts, i.e. parent/child ownership, don't make a
    whole lot of sense in a multi-inheritance class hierarchy. Hence this is
    not supported (technically it is a documented limitation of the meta
    object system).
    J-P Nurmi

  5. #5
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    3

    Default Re: multiinherit trouble? ....template QList

    Thank you for your reply
    It is the same old story of not being grateful for what we have until we lose it..........

Similar Threads

  1. Accessing QList Objects
    By magikalpnoi in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2006, 21:43

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
  •  
Qt is a trademark of The Qt Company.