<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Why QFile::close() call QIODevice::close() directly instead of call QFileDevice::close()]]></title><description><![CDATA[<p dir="auto">When I debugged the Qt source code, I found that QFile::close() call QIODevice::close() directly instead of call QFileDevice::close().<br />
<img src="https://ddgobkiprc33d.cloudfront.net/62b91a08-8b3e-425e-bc5e-c5002eb02604.png" alt="362a3988-2320-4564-8362-bc06e226175b-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://ddgobkiprc33d.cloudfront.net/1db2f73a-23b6-4791-8658-113ac3dbd7ac.png" alt="8fc61ed1-69e3-4582-abb2-187b99311791-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/145188/why-qfile-close-call-qiodevice-close-directly-instead-of-call-qfiledevice-close</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 10:43:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145188.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 May 2023 02:43:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why QFile::close() call QIODevice::close() directly instead of call QFileDevice::close() on Thu, 18 May 2023 05:48:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisw67">@<bdi>ChrisW67</bdi></a> I made a breakpoint at QFileDevice::close(),but the debugger never goes in.And only the QFileDevice::close() calls the  QIODevice::close().How I found about this, because I found the file is still occupied after calls QFileDevice::close().But when not call close() explicitly and in QFile dctor call QFileDevice::close()  implicit, the file will not be occupied.And this is only happend in my computer.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/7bb32226-2708-4fb8-b39c-7490e37c97f7.png" alt="e1ccc069-709c-4429-88e3-8803e12d9f98-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/758528</link><guid isPermaLink="true">https://forum.qt.io/post/758528</guid><dc:creator><![CDATA[Hanson]]></dc:creator><pubDate>Thu, 18 May 2023 05:48:21 GMT</pubDate></item><item><title><![CDATA[Reply to Why QFile::close() call QIODevice::close() directly instead of call QFileDevice::close() on Thu, 18 May 2023 03:44:02 GMT]]></title><description><![CDATA[<p dir="auto">AFAICT QFile does not override QFileDevice::close() so QFile::close() <em>is</em> QFileDevice::close().   QFileDevice::close() calls QIODevice::close() after flush().</p>
<p dir="auto">Perhaps you can identify where the QFile source code calls QIODevice::close() directly.</p>
]]></description><link>https://forum.qt.io/post/758526</link><guid isPermaLink="true">https://forum.qt.io/post/758526</guid><dc:creator><![CDATA[ChrisW67]]></dc:creator><pubDate>Thu, 18 May 2023 03:44:02 GMT</pubDate></item></channel></rss>