Results 1 to 5 of 5

Thread: Need to use standard socket 'connect' and not QObject::connect!

  1. #1
    Join Date
    Sep 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Need to use standard socket 'connect' and not QObject::connect!

    Hi,
    I have to use standard C++ socket instead of QT QSocket object.
    So I've used this code:

    Qt Code:
    1. if (connect(socketDescriptor,
    2. (struct sockaddr *) &serverAddress,
    3. sizeof(serverAddress)) < 0) {
    4. cerr << "cannot connect\n";
    5. exit(1);
    6. }
    To copy to clipboard, switch view to plain text mode 

    but this conflicts with a "QObject::connect" I use in an other part of my code.

    So I have this error:

    Qt Code:
    1. qtnclient.cpp: In member function ‘QString DeviceConfiguration::getValueFromServer(QString&, int&, QString&, DeviceConfiguration::configDatabyModule&)’:
    2. qtnclient.cpp:484: error: no matching function for call to ‘DeviceConfiguration::connect(int&, sockaddr*, unsigned int)’
    3. /usr/include/qt3/qobject.h:116: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*)
    4. /usr/include/qt3/qobject.h:226: note: bool QObject::connect(const QObject*, const char*, const char*) const
    To copy to clipboard, switch view to plain text mode 

    I need to use "QObject::connect" in a part of my program but I need also to use the standard C/C++ "connect" in another part of my program...

    Any help?
    Thanks,
    the_bis

  2. #2
    Join Date
    Jun 2006
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Need to use standard socket 'connect' and not QObject::connect!

    this->connect() ?

  3. #3
    Join Date
    Sep 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Need to use standard socket 'connect' and not QObject::connect!

    Same problem!
    I'm using the same source file.
    This source file begins like this:

    #include <qapplication.h>
    #include <qdatetimeedit.h>
    #include <qdatetime.h>
    #include <qobject.h>

    #include <netdb.h>
    #include <netinet/in.h>
    #include <unistd.h>
    #include <iostream>

    Please help,
    the_bis

  4. #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: Need to use standard socket 'connect' and not QObject::connect!

    Try:
    Qt Code:
    1. ::connect( ... );
    To copy to clipboard, switch view to plain text mode 

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

    the_bis (10th November 2006)

  6. #5
    Join Date
    Sep 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Need to use standard socket 'connect' and not QObject::connect!

    Quote Originally Posted by jacek View Post
    Try:
    Qt Code:
    1. ::connect( ... );
    To copy to clipboard, switch view to plain text mode 
    Yes!
    It works!
    Thank you very much,
    the_bis

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.