Results 1 to 2 of 2

Thread: `QObject' is an ambiguous base of `ClientThread'

Threaded View

  1. #1
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default `QObject' is an ambiguous base of `ClientThread'

    I have this class

    Qt Code:
    1. #include <QTcpSocket>
    2. #include <QTextBrowser>
    3. #include "clientthread.h"
    4.  
    5. ClientThread::ClientThread(int socketDescriptor)
    6. {
    7. _socketDescriptor = socketDescriptor;
    8. textBrowser = new QTextBrowser(this);
    9. setWindowTitle("Server version 0.9 beta");
    10. setCentralWidget(textBrowser);
    11. setFixedSize(400,400);
    12. show();
    13. run();
    14.  
    15. }
    16.  
    17.  
    18. void ClientThread::run()
    19. {
    20. tcpSocket = new QTcpSocket();
    21. if(!tcpSocket->setSocketDescriptor(_socketDescriptor))
    22. textBrowser->append("Error in the connection");
    23. else
    24. textBrowser->append("Client successfully connected");
    25. iniConnection();
    26. exec();
    27. }
    28.  
    29.  
    30. void ClientThread::iniConnection()
    31. {
    32. connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readData()));
    33. }
    34.  
    35. void ClientThread::readData()
    36. {
    37.  
    38. }
    To copy to clipboard, switch view to plain text mode 


    When i try to compile it, I get this error:

    clientthread.cpp:33: error: `QObject' is an ambiguous base of `ClientThread'

    I know the error can be disabled in this lines

    Qt Code:
    1. void ClientThread::iniConnection()
    2. {
    3. connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readData()));
    4. }
    To copy to clipboard, switch view to plain text mode 

    The "connect" is the problem

    What is wrong ?
    Last edited by wysota; 7th December 2006 at 13:31. Reason: missing [code] tags

Similar Threads

  1. "ambiguous base" error
    By mhoover in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2006, 23:49

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