Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 6731

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtemporaryfile.cpp -->
  <title>Qt 4.8: QTemporaryFile Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QTemporaryFile</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QTemporaryFile Class Reference</h1>
<!-- $$$QTemporaryFile-brief -->
<p>The QTemporaryFile class is an I/O device that operates on temporary files. <a href="#details">More...</a></p>
<!-- @@@QTemporaryFile -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QTemporaryFile&gt;</span></pre><p><b>Inherits: </b><a href="qfile.html">QFile</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qtemporaryfile-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#QTemporaryFile">QTemporaryFile</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#QTemporaryFile-2">QTemporaryFile</a></b> ( const QString &amp; <i>templateName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#QTemporaryFile-3">QTemporaryFile</a></b> ( QObject * <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#QTemporaryFile-4">QTemporaryFile</a></b> ( const QString &amp; <i>templateName</i>, QObject * <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#dtor.QTemporaryFile">~QTemporaryFile</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#autoRemove">autoRemove</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#fileName">fileName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#fileTemplate">fileTemplate</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#open">open</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#setAutoRemove">setAutoRemove</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#setFileTemplate">setFileTemplate</a></b> ( const QString &amp; <i>name</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qfile.html#public-functions">QFile</a></li>
<li class="fn">33 public functions inherited from <a href="qiodevice.html#public-functions">QIODevice</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QTemporaryFile * </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#createLocalFile">createLocalFile</a></b> ( QFile &amp; <i>file</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTemporaryFile * </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#createLocalFile-2">createLocalFile</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
</table>
<ul>
<li class="fn">14 static public members inherited from <a href="qfile.html#static-public-members">QFile</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtemporaryfile.html#open-2">open</a></b> ( OpenMode <i>flags</i> )</td></tr>
</table>
<ul>
<li class="fn">3 protected functions inherited from <a href="qfile.html#protected-functions">QFile</a></li>
<li class="fn">5 protected functions inherited from <a href="qiodevice.html#protected-functions">QIODevice</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">4 signals inherited from <a href="qiodevice.html#signals">QIODevice</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">3 protected functions inherited from <a href="qfile.html#protected-functions">QFile</a></li>
<li class="fn">5 protected functions inherited from <a href="qiodevice.html#protected-functions">QIODevice</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTemporaryFile-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTemporaryFile class is an I/O device that operates on temporary files.</p>
<p>QTemporaryFile is used to create unique temporary files safely. The file itself is created by calling <a href="qtemporaryfile.html#open">open</a>(). The name of the temporary file is guaranteed to be unique (i.e&#x2e;, you are guaranteed to not overwrite an existing file), and the file will subsequently be removed upon destruction of the QTemporaryFile object. This is an important technique that avoids data corruption for applications that store data in temporary files. The file name is either auto-generated, or created based on a template, which is passed to QTemporaryFile's constructor.</p>
<p>Example:</p>
<pre class="cpp">     <span class="comment">// Within a function/method...</span>

     <span class="type">QTemporaryFile</span> file;
     <span class="keyword">if</span> (file<span class="operator">.</span>open()) {
         <span class="comment">// file.fileName() returns the unique file name</span>
     }

     <span class="comment">// The QTemporaryFile destructor removes the temporary file</span>
     <span class="comment">// as it goes out of scope.</span></pre>
<p>Reopening a QTemporaryFile after calling <a href="qfile.html#close">close</a>() is safe. For as long as the QTemporaryFile object itself is not destroyed, the unique temporary file will exist and be kept open internally by QTemporaryFile.</p>
<p>The file name of the temporary file can be found by calling <a href="qtemporaryfile.html#fileName">fileName</a>(). Note that this is only defined after the file is first opened; the function returns an empty string before this.</p>
<p>A temporary file will have some static part of the name and some part that is calculated to be unique. The default filename <tt>qt_temp</tt> will be placed into the temporary path as returned by <a href="qdir.html#tempPath">QDir::tempPath</a>(). If you specify your own filename, a relative file path will not be placed in the temporary directory by default, but be relative to the current working directory.</p>
<p>Specified filenames can contain the following template <tt>XXXXXX</tt> (six upper case &quot;X&quot; characters), which will be replaced by the auto-generated portion of the filename. Note that the template is case sensitive. If the template is not present in the filename, QTemporaryFile appends the generated part to the filename given.</p>
</div>
<p><b>See also </b><a href="qdir.html#tempPath">QDir::tempPath</a>() and <a href="qfile.html">QFile</a>.</p>
<!-- @@@QTemporaryFile -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTemporaryFile[overload1]$$$QTemporaryFile -->
<h3 class="fn"><a name="QTemporaryFile"></a>QTemporaryFile::<span class="name">QTemporaryFile</span> ()</h3>
<p>Constructs a <a href="qtemporaryfile.html">QTemporaryFile</a> in <a href="qdir.html#tempPath">QDir::tempPath</a>(), using the file template &quot;qt_temp.XXXXXX&quot;. The file is stored in the system's temporary directory.</p>
<p><b>See also </b><a href="qtemporaryfile.html#setFileTemplate">setFileTemplate</a>() and <a href="qdir.html#tempPath">QDir::tempPath</a>().</p>
<!-- @@@QTemporaryFile -->
<!-- $$$QTemporaryFile$$$QTemporaryFileconstQString& -->
<h3 class="fn"><a name="QTemporaryFile-2"></a>QTemporaryFile::<span class="name">QTemporaryFile</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>templateName</i> )</h3>
<p>Constructs a <a href="qtemporaryfile.html">QTemporaryFile</a> with a template filename of <i>templateName</i>. Upon opening the temporary file this will be used to create a unique filename.</p>
<p>If the <i>templateName</i> does not contain XXXXXX it will automatically be appended and used as the dynamic portion of the filename.</p>
<p>If <i>templateName</i> is a relative path, the path will be relative to the current working directory. You can use <a href="qdir.html#tempPath">QDir::tempPath</a>() to construct <i>templateName</i> if you want use the system's temporary directory.</p>
<p><b>See also </b><a href="qtemporaryfile.html#open">open</a>() and <a href="qtemporaryfile.html#fileTemplate">fileTemplate</a>().</p>
<!-- @@@QTemporaryFile -->
<!-- $$$QTemporaryFile$$$QTemporaryFileQObject* -->
<h3 class="fn"><a name="QTemporaryFile-3"></a>QTemporaryFile::<span class="name">QTemporaryFile</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> )</h3>
<p>Constructs a <a href="qtemporaryfile.html">QTemporaryFile</a> (with the given <i>parent</i>) in <a href="qdir.html#tempPath">QDir::tempPath</a>(), using the file template &quot;qt_temp.XXXXXX&quot;.</p>
<p><b>See also </b><a href="qtemporaryfile.html#setFileTemplate">setFileTemplate</a>().</p>
<!-- @@@QTemporaryFile -->
<!-- $$$QTemporaryFile$$$QTemporaryFileconstQString&QObject* -->
<h3 class="fn"><a name="QTemporaryFile-4"></a>QTemporaryFile::<span class="name">QTemporaryFile</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>templateName</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> )</h3>
<p>Constructs a <a href="qtemporaryfile.html">QTemporaryFile</a> with a template filename of <i>templateName</i> and the specified <i>parent</i>. Upon opening the temporary file this will be used to create a unique filename.</p>
<p>If the <i>templateName</i> does not contain XXXXXX it will automatically be appended and used as the dynamic portion of the filename.</p>
<p>If <i>templateName</i> is a relative path, the path will be relative to the current working directory. You can use <a href="qdir.html#tempPath">QDir::tempPath</a>() to construct <i>templateName</i> if you want use the system's temporary directory.</p>
<p><b>See also </b><a href="qtemporaryfile.html#open">open</a>() and <a href="qtemporaryfile.html#fileTemplate">fileTemplate</a>().</p>
<!-- @@@QTemporaryFile -->
<!-- $$$~QTemporaryFile[overload1]$$$~QTemporaryFile -->
<h3 class="fn"><a name="dtor.QTemporaryFile"></a>QTemporaryFile::<span class="name">~QTemporaryFile</span> ()</h3>
<p>Destroys the temporary file object, the file is automatically closed if necessary and if in auto remove mode it will automatically delete the file.</p>
<p><b>See also </b><a href="qtemporaryfile.html#autoRemove">autoRemove</a>().</p>
<!-- @@@~QTemporaryFile -->
<!-- $$$autoRemove[overload1]$$$autoRemove -->
<h3 class="fn"><a name="autoRemove"></a><span class="type">bool</span> QTemporaryFile::<span class="name">autoRemove</span> () const</h3>
<p>Returns true if the <a href="qtemporaryfile.html">QTemporaryFile</a> is in auto remove mode. Auto-remove mode will automatically delete the filename from disk upon destruction. This makes it very easy to create your <a href="qtemporaryfile.html">QTemporaryFile</a> object on the stack, fill it with data, read from it, and finally on function return it will automatically clean up after itself.</p>
<p>Auto-remove is on by default.</p>
<p><b>See also </b><a href="qtemporaryfile.html#setAutoRemove">setAutoRemove</a>() and <a href="qfile.html#remove">remove</a>().</p>
<!-- @@@autoRemove -->
<!-- $$$createLocalFile[overload1]$$$createLocalFileQFile& -->
<h3 class="fn"><a name="createLocalFile"></a><span class="type">QTemporaryFile</span> * QTemporaryFile::<span class="name">createLocalFile</span> ( <span class="type"><a href="qfile.html">QFile</a></span> &amp; <i>file</i> )<tt> [static]</tt></h3>
<p>If <i>file</i> is not on a local disk, a temporary file is created on a local disk, <i>file</i> is copied into the temporary local file, and a pointer to the temporary local file is returned. If <i>file</i> is already on a local disk, a copy is not created and 0 is returned.</p>
<!-- @@@createLocalFile -->
<!-- $$$createLocalFile$$$createLocalFileconstQString& -->
<h3 class="fn"><a name="createLocalFile-2"></a><span class="type">QTemporaryFile</span> * QTemporaryFile::<span class="name">createLocalFile</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Works on the given <i>fileName</i> rather than an existing <a href="qfile.html">QFile</a> object.</p>
<!-- @@@createLocalFile -->
<!-- $$$fileName[overload1]$$$fileName -->
<h3 class="fn"><a name="fileName"></a><span class="type"><a href="qstring.html">QString</a></span> QTemporaryFile::<span class="name">fileName</span> () const</h3>
<p>Returns the complete unique filename backing the <a href="qtemporaryfile.html">QTemporaryFile</a> object. This string is null before the <a href="qtemporaryfile.html">QTemporaryFile</a> is opened, afterwards it will contain the <a href="qtemporaryfile.html#fileTemplate">fileTemplate</a>() plus additional characters to make it unique.</p>
<p><b>See also </b><a href="qtemporaryfile.html#fileTemplate">fileTemplate</a>().</p>
<!-- @@@fileName -->
<!-- $$$fileTemplate[overload1]$$$fileTemplate -->
<h3 class="fn"><a name="fileTemplate"></a><span class="type"><a href="qstring.html">QString</a></span> QTemporaryFile::<span class="name">fileTemplate</span> () const</h3>
<p>Returns the set file template. The default file template will be called qt_temp and be placed in <a href="qdir.html#tempPath">QDir::tempPath</a>().</p>
<p><b>See also </b><a href="qtemporaryfile.html#setFileTemplate">setFileTemplate</a>().</p>
<!-- @@@fileTemplate -->
<!-- $$$open[overload1]$$$open -->
<h3 class="fn"><a name="open"></a><span class="type">bool</span> QTemporaryFile::<span class="name">open</span> ()</h3>
<p>A <a href="qtemporaryfile.html">QTemporaryFile</a> will always be opened in <a href="qiodevice.html#OpenModeFlag-enum">QIODevice::ReadWrite</a> mode, this allows easy access to the data in the file. This function will return true upon success and will set the <a href="qtemporaryfile.html#fileName">fileName</a>() to the unique filename used.</p>
<p><b>See also </b><a href="qtemporaryfile.html#fileName">fileName</a>().</p>
<!-- @@@open -->
<!-- $$$open$$$openOpenMode -->
<h3 class="fn"><a name="open-2"></a><span class="type">bool</span> QTemporaryFile::<span class="name">open</span> ( <span class="type"><a href="qiodevice.html#OpenModeFlag-enum">OpenMode</a></span> <i>flags</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qiodevice.html#open">QIODevice::open</a>().</p>
<p>Creates a unique file name for the temporary file, and opens it. You can get the unique name later by calling <a href="qtemporaryfile.html#fileName">fileName</a>(). The file is guaranteed to have been created by this function (i.e&#x2e;, it has never existed before).</p>
<!-- @@@open -->
<!-- $$$setAutoRemove[overload1]$$$setAutoRemovebool -->
<h3 class="fn"><a name="setAutoRemove"></a><span class="type">void</span> QTemporaryFile::<span class="name">setAutoRemove</span> ( <span class="type">bool</span> <i>b</i> )</h3>
<p>Sets the <a href="qtemporaryfile.html">QTemporaryFile</a> into auto-remove mode if <i>b</i> is true.</p>
<p>Auto-remove is on by default.</p>
<p><b>See also </b><a href="qtemporaryfile.html#autoRemove">autoRemove</a>() and <a href="qfile.html#remove">remove</a>().</p>
<!-- @@@setAutoRemove -->
<!-- $$$setFileTemplate[overload1]$$$setFileTemplateconstQString& -->
<h3 class="fn"><a name="setFileTemplate"></a><span class="type">void</span> QTemporaryFile::<span class="name">setFileTemplate</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Sets the static portion of the file name to <i>name</i>. If the file template ends in XXXXXX that will automatically be replaced with the unique part of the filename, otherwise a filename will be determined automatically based on the static portion specified.</p>
<p>If <i>name</i> contains a relative file path, the path will be relative to the current working directory. You can use <a href="qdir.html#tempPath">QDir::tempPath</a>() to construct <i>name</i> if you want use the system's temporary directory.</p>
<p><b>See also </b><a href="qtemporaryfile.html#fileTemplate">fileTemplate</a>().</p>
<!-- @@@setFileTemplate -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>