[Qt-interest] How to use QFile with = operator?
Jesús Fernández Prieto
jsfdez at gmail.com
Fri Apr 24 09:27:17 CEST 2009
Because QFile hasn't a copy constructor.
You need to use this:
QFile file;
if(!file.open(filenameSettings)) *error*...
...
if(!file.open(filenameResults)) *error*...
On Fri, Apr 24, 2009 at 9:20 AM, Matthias Pospiech <matthias.pospiech at gmx.de
> wrote:
> I want to do the following:
>
> QString filenameSettings = m_strSaveFilename.remove(".txt") +
> "-settings.txt";
> QFile file;
> file = QFile(filenameSettings);
> ...
> file = QFile(filenameResults);
> ...
>
>
> However that is not possible:
>
> 1> error C2248: "QFile::operator =": Kein Zugriff auf private Member,
> dessen Deklaration in der QFile-Klasse erfolgte.
> 1>
>
> c:\programme\qt\msvc\4.5.0\include\qtcore\../../src/corelib/io/qfile.h(195):
> Siehe Deklaration von 'QFile::operator ='
> 1>
> c:\programme\qt\msvc\4.5.0\include\qtcore\../../src/corelib/io/qfile.h(62):
> Siehe Deklaration von 'QFile'
>
> The same error appears with
>
> out = QTextStream(&file);
>
> Any reason why this happens?
>
> Matthias
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090424/77a755e9/attachment.html
More information about the Qt-interest-old
mailing list