Results 1 to 2 of 2

Thread: Create QTextStream

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Create QTextStream

    First of all, I want to create a QTextStream (in an object) that I should connect to a QTcpSocket. I wonder, what is best, to create one QTextStream that I do all read/write to, or to crate a new QTextStream eveytime I want to read/write?
    Any performance hits or other problems?

    If I want to have only one QTextStream in my object , what should I do to create it? Will it work with

    QTextStream ts; // put in .h file

    and in the cpp directly after the socket is created:

    QTextStream.setDevice(my_little_socket);

    Then the docs seems to say something about setString() but I'm unclear on what to call that function with? The openmode should be readwrite, but what is the string? And what will that do?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Create QTextStream

    Creating an object always yields a small overhead so if you can do with a single stream object, it should be your first choice.

Similar Threads

  1. reading from QTextStream
    By matyi52 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 14th December 2006, 08:26
  2. how to create resource fork & data fork
    By jyoti in forum General Discussion
    Replies: 4
    Last Post: 28th November 2006, 18:20
  3. Replies: 1
    Last Post: 24th October 2006, 17:40
  4. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 17:18
  5. create file in another directory
    By raphaelf in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 11:04

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.