1

So i have a QFile and QTextStream member as part of my class... trying to init. them together in my constructor:

Class.h:

QFile _file;
QTextStream _textstrm;

Class.cpp:

_file = QFile (/*file name*/);
_file.open(/*set stuff*/);
_textstrm = QTextTream ( &_file );

And the comp error i get, C2248, says the objects to have access to the operators in their own class..

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Mike
  • 190
  • 7

1 Answers1

2

The problem is that you are creating a new object and you are adding an attribute that has no access, you must use the functions provided by the object.

_file.setFileName(/*file name*/);
_file.open(/*set stuff*/);
_textstrm.setDevice( &_file );
eyllanesc
  • 235,170
  • 19
  • 170
  • 241