Results 1 to 4 of 4

Thread: Simple chat example. How can I make a list of participants?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Simple chat example. How can I make a list of participants?

    Quote Originally Posted by kei View Post
    Have you seen this: Network Chat Example
    Yes, I have seen this example. This is not a client-server chat. And I did not understand the code. All very confusing.

  2. #2
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Thanks
    48
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Simple chat example. How can I make a list of participants?

    On the server you have:

    Qt Code:
    1. QList<QTcpSocket*> connections;
    To copy to clipboard, switch view to plain text mode 

    so pretty much you just need to make an array of usernames which is indexed by the socket ID's in the list.

    whenever the list changes because other users connected, you would need to make the server send the list to all of the clients because only the server is aware of all the client connections.

Similar Threads

  1. How to make a simple table and calculate col sums?
    By teele in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2011, 22:34
  2. How to make a list of QGraphicsItems on the scene
    By Holy in forum Qt Programming
    Replies: 8
    Last Post: 10th June 2008, 13:43
  3. which class i should used to make chat application ??
    By kunalnandi in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 09:33
  4. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 14:43
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.