[Interest] QTemporaryFile::open()
Mike Chinander
chinander at gmail.com
Fri Feb 17 21:57:10 CET 2017
See: http://doc.qt.io/qt-5/qtemporaryfile.html#open
"A QTemporaryFile will always be opened in QIODevice::ReadWrite mode, this
allows easy access to the data in the file. This function will return true
upon success and will set the fileName() to the unique filename used."
On Fri, Feb 17, 2017 at 2:49 PM, Larry Martell <larry.martell at gmail.com>
wrote:
> When I call QTemporaryFile::open() with any OpenMode flags I get an error.
>
> Code:
>
> QTemporaryFile wi_file;
> if (wi_file.open(QIODevice::WriteOnly)) {
>
>
> Error:
>
> /Users/lmartell/ia/cap/workItem.cpp:877:15: error: 'open' is a
> protected member of 'QTemporaryFile'
> if (wi_file.open(QIODevice::WriteOnly)) {
> ~~~~~~~~^~~~
>
> /usr/local/Qt-5.5.1/lib/QtCore.framework/Headers/qtemporaryfile.h:88:10:
> note: declared protected here
> bool open(OpenMode flags) Q_DECL_OVERRIDE;
>
> If I do not pass in any args it complies fine. From the docs it seems
> I can pass in an OpenMode. What am I missing or doing wrong?
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170217/c441f2f3/attachment.html>
More information about the Interest
mailing list