Results 1 to 4 of 4

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

Threaded View

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

    Red face Simple chat example. How can I make a list of participants?

    Hi everyone!
    I need to make a chat. On your site I found an example. But there's no list of participants. How can I do?

    Do I understand that the data on a server need to send in that format?
    And if the server receives GRTNG, it verifies the existence of party with the same name and save it.?

    Qt Code:
    1. QByteArray arrBlock;
    2. QDataStream out (& arrBlock, QIODevice:: WriteOnly);
    3. out.setVersion (QDataStream:: Qt_4_5);
    4. out <<quint16 (0) << QString("GRTNG") << nick->text ();
    5. out.device () -> seek (0);
    6. out <<quint16 (arrBlock.size () - sizeof (quint16));
    7. socket-> write (arrBlock);
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. QByteArray arrBlock;
    2. QDataStream out (& arrBlock, QIODevice:: WriteOnly);
    3. out.setVersion (QDataStream:: Qt_4_5);
    4. out <<quint16 (0) << QString("MSG") << message->text ();
    5. out.device () -> seek (0);
    6. out <<quint16 (arrBlock.size () - sizeof (quint16));
    7. socket-> write (arrBlock);
    To copy to clipboard, switch view to plain text mode 

    I am sorry for my bad English. I hope you understand me.
    Last edited by Luga; 5th June 2009 at 17:48.

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.