Results 1 to 4 of 4

Thread: Also i need more guidance on issue of differentiating data read from different socket

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: Also i need more guidance on issue of differentiating data read from different so

    You should cast the QObject pointer to an appropriate type.
    Eg.
    Qt Code:
    1. QTcpSocket* socket = dynamic_cast<QTcpSocket*>(sender());
    2. if (socket)
    3. {
    4. // do something
    5. }
    To copy to clipboard, switch view to plain text mode 

    And how about something like this for the data storage:
    Qt Code:
    1. QHash<int, HistoryData>
    2. // where int is QTcpSocket::socketDescriptor()
    3. // and HistoryData is any storage you decide to use, eg. QStringList
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    quickNitin (4th July 2006)

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.