Sunday, July 6th 2008, 1:33am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Posts: 5

Location: New Zealand

Occupation: high school student and part time grape picker

1

Tuesday, April 15th 2008, 5:25am

Using a pointer to QTextStream segfaults my app

Okay I'm in a tricky spot here.
I have a class for handling a KTextEditer, QTStream and misc other things.
The problem is though that there are two ways to implement file writing
support.

1: Write into the class's private section that there is a stream and then initialize
the stream in the class's constructor. This won't compile with g++.

2: In the class constructor Declare the stream and have in the private section
a pointer (which is then given the address of the real stream in the constructor.
This seamed good in theory but the line: streamPtr->operator<<( editField->text() );
caused a seg fault.

Can somebody explain the correct approach please?
---
Iwasapenguin
  • Go to the top of the page

Rate this thread