<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=Qt%2FFile</id>
		<title>Qt/File - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=Qt%2FFile"/>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=Qt/File&amp;action=history"/>
		<updated>2026-06-15T10:35:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://programmingexamples.net/w/index.php?title=Qt/File&amp;diff=640&amp;oldid=prev</id>
		<title>Daviddoria: Created page with '==File.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt;  #include &lt;QFile&gt;  int main(int, char *[]) {   QFile myFile(&quot;test.txt&quot;);   if(myFile.exists())     {     std::cout &lt;&lt; &quot;File e…'</title>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=Qt/File&amp;diff=640&amp;oldid=prev"/>
				<updated>2011-02-06T18:57:34Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;==File.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt;  #include &amp;lt;QFile&amp;gt;  int main(int, char *[]) {   QFile myFile(&amp;quot;test.txt&amp;quot;);   if(myFile.exists())     {     std::cout &amp;lt;&amp;lt; &amp;quot;File e…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==File.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QFile&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int, char *[])&lt;br /&gt;
{&lt;br /&gt;
  QFile myFile(&amp;quot;test.txt&amp;quot;);&lt;br /&gt;
  if(myFile.exists())&lt;br /&gt;
    {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;File exists&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    }&lt;br /&gt;
  else&lt;br /&gt;
    {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;File does not exist&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  if(myFile.open(QIODevice::ReadOnly))&lt;br /&gt;
    {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;opened successfully&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    }&lt;br /&gt;
  else&lt;br /&gt;
    {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;failed to open&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
&lt;br /&gt;
PROJECT(File)&lt;br /&gt;
&lt;br /&gt;
FIND_PACKAGE(Qt4 REQUIRED)&lt;br /&gt;
INCLUDE(${QT_USE_FILE})&lt;br /&gt;
&lt;br /&gt;
include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})&lt;br /&gt;
&lt;br /&gt;
ADD_EXECUTABLE(File File.cpp)&lt;br /&gt;
TARGET_LINK_LIBRARIES(File ${QT_LIBRARIES})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>