<?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[How to Enable Python Type Hints in Qt Creator?]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I’m new to developing applications with Qt and I’d like to use Python (via PyQt/PySide) inside Qt Creator. My main issue is that Qt Creator doesn’t show me any type hints or autocomplete for Python code.</p>
<p dir="auto">Could anyone walk me through the steps required to set up proper type‑hint support in Qt Creator? Any tips on configuring the IDE, installing the necessary plugins, or adjusting project settings would be greatly appreciated.</p>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://forum.qt.io/topic/164382/how-to-enable-python-type-hints-in-qt-creator</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 06:37:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164382.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Mar 2026 18:16:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:53:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
<code>encode</code> works on <em>strings</em>, <code>str</code> or <code>QString</code>.  <code>decode</code> works on <em>bytes</em>, <code>bytes</code> or <code>QByteArray</code>.  That may explain <code>&lt;unavailable&gt;</code> on <code>text().decode()</code>.  I told you I didn't understand :)  If you had stuck to <code>Hello world!</code> we wouldn't be having this discussion ;-)</p>
]]></description><link>https://forum.qt.io/post/836909</link><guid isPermaLink="true">https://forum.qt.io/post/836909</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:53:23 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:38:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/836898">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto">Since (unlike C++) you can put pretty much any Python <em>expression</em> into <strong>Expressions</strong>, you might get it with <em>something like</em> <code>label.text().encode('utf-8')</code>, or <code>label.text().decode('utf-8')</code> if it's decoding rather than encoding, don't ask me about encodings!).  In both PyQt and PySide all <code>QString</code>s are translated into Python <code>str</code>s, which are those 16-bit encoding thingies.</p>
</blockquote>
<p dir="auto"><code>label.text().decode('utf-8')</code> results in  <code>&lt;unavailable&gt;</code>.</p>
<p dir="auto">🤷🏻‍♂️</p>
]]></description><link>https://forum.qt.io/post/836903</link><guid isPermaLink="true">https://forum.qt.io/post/836903</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:24:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/836898">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto">I didn't notice you were printing a duck/swan thing, wth is that? :)</p>
</blockquote>
<p dir="auto">🐍 <a href="https://emojipedia.org/snake" target="_blank" rel="noopener noreferrer nofollow ugc">https://emojipedia.org/snake</a></p>
]]></description><link>https://forum.qt.io/post/836899</link><guid isPermaLink="true">https://forum.qt.io/post/836899</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:31:11 GMT]]></title><description><![CDATA[<p dir="auto">I didn't notice you were printing a duck/swan thing, wth is that? :)</p>
<p dir="auto">Since (unlike C++) you can put pretty much any Python <em>expression</em> into <strong>Expressions</strong>, you might get it with <em>something like</em> <code>label.text().encode('utf-8')</code>, or <code>label.text().decode('utf-8')</code> if it's decoding rather than encoding, don't ask me about encodings!).  In both PyQt and PySide all <code>QString</code>s are translated into Python <code>str</code>s, which are those 16-bit encoding thingies.</p>
<p dir="auto">Just while we are here, I would give a limb if <strong>gdb</strong>/C++ Creator debugging would allow expressions to be evaluated in the <strong>Expressions</strong> pane.  I understand the issue with C++ versus Python for expression evaluation, but it's the single most irritating thing when debugging C++.... :(</p>
]]></description><link>https://forum.qt.io/post/836898</link><guid isPermaLink="true">https://forum.qt.io/post/836898</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:31:11 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:20:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/836896">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
Alternatively as a workaround and still using the debugger panes rather than putting in a <code>qDebug()</code> statement, did you try putting <code>label.text()</code> into the bottom right <strong>Expressions</strong> pane?</p>
</blockquote>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/b22b52f9-553b-4026-92a7-605dc18db695.png" alt="qt-creator-18-debugger-expression.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Worked. I didn't give me <code>Hello 🐍</code> but <code>Hello =\d</code> but I guess that's due to the missing UTF-8 encoding.</p>
]]></description><link>https://forum.qt.io/post/836897</link><guid isPermaLink="true">https://forum.qt.io/post/836897</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:20:34 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:15:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
Alternatively as a workaround and still using the debugger panes rather than putting in a <code>qDebug()</code> statement, did you try putting <code>label.text()</code> into the bottom right <strong>Expressions</strong> pane?</p>
]]></description><link>https://forum.qt.io/post/836896</link><guid isPermaLink="true">https://forum.qt.io/post/836896</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:15:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:06:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a> said in <a href="/post/836891">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto">I've opened up <a href="https://qt-project.atlassian.net/browse/QTCREATORBUG-34195" target="_blank" rel="noopener noreferrer nofollow ugc">QTCREATORBUG-34195: Python debugging not having pretty printers for Pyside6 Qt types</a>.</p>
</blockquote>
<p dir="auto">And as workaround for the missing debugger, is the <code>qDebug()</code> trace:</p>
<pre><code class="language-python">from PySide6.QtCore import Qt, qDebug

# ...

    qDebug("Label text: " + label.text())
</code></pre>
]]></description><link>https://forum.qt.io/post/836895</link><guid isPermaLink="true">https://forum.qt.io/post/836895</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 15:50:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a> said in <a href="/post/836893">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto">It did mention that <code>on</code> is a <code>bool</code>, was that it?</p>
</blockquote>
<p dir="auto">That is indeed the chappie :)  It also shows the function call returns <code>None</code>, which is a type hint too.</p>
<p dir="auto">Python decided not to have types initially.  Then someone came to their senses and said "well we don't want mandatory types, but if you are finicky enough to want to type in types as <em>hints</em> we will let you do that".  And then presumably someone said "these are really useful when editing, so we'll introduce warnings when they're wrong and editors can show them if they help people". :)</p>
]]></description><link>https://forum.qt.io/post/836894</link><guid isPermaLink="true">https://forum.qt.io/post/836894</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 15:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 15:37:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/836883">How to Enable Python Type Hints in Qt Creator?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
It looks like your latest post crossed with mine!  That again is an improvement to show the parameters, good.  But still no <em>type hint</em> (the <em>type</em> expected for the <code>on</code> parameter), is that supported? :)  And I don't know whether all the Qt calls are annotated in the PySide with their types, that may require a manual step?</p>
</blockquote>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/5659a189-8b7d-459c-9d5a-1b87392a5832.png" alt="qt-creator-18-pyside-annotation.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It did mention that <code>on</code> is a <code>bool</code>, was that it?</p>
]]></description><link>https://forum.qt.io/post/836893</link><guid isPermaLink="true">https://forum.qt.io/post/836893</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 15:37:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 15:14:17 GMT]]></title><description><![CDATA[<p dir="auto">I've opened up <a href="https://qt-project.atlassian.net/browse/QTCREATORBUG-34195" target="_blank" rel="noopener noreferrer nofollow ugc">QTCREATORBUG-34195: Python debugging not having pretty printers for Pyside6 Qt types</a>.</p>
]]></description><link>https://forum.qt.io/post/836891</link><guid isPermaLink="true">https://forum.qt.io/post/836891</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 15:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 14:49:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a> Yep, getting better :)</p>
]]></description><link>https://forum.qt.io/post/836885</link><guid isPermaLink="true">https://forum.qt.io/post/836885</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 14:49:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 14:48:02 GMT]]></title><description><![CDATA[<p dir="auto">Then <code>F2</code> on <code>setAlignment</code> jumped to a file that has some declarations:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/b1a6f00d-26b8-473f-8e32-208375d43d26.png" alt="qt-creator-18-pyside6-symbol-jump.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Equivalent to jumping to a header file in C++.</p>
]]></description><link>https://forum.qt.io/post/836884</link><guid isPermaLink="true">https://forum.qt.io/post/836884</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 14:48:02 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 14:48:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
It looks like your latest post crossed with mine!  That again is an improvement to show the parameters, good.  But still no <em>type hint</em> (the <em>type</em> expected for the <code>on</code> parameter), is that supported? :)  And I don't know whether all the Qt calls are annotated in the PySide with their types, that may require a manual step?</p>
]]></description><link>https://forum.qt.io/post/836883</link><guid isPermaLink="true">https://forum.qt.io/post/836883</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 14:48:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 14:45:08 GMT]]></title><description><![CDATA[<p dir="auto">After re-opening the project Qt Creator asked me if I want to configure the LSP with type hints.</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/2f316dc2-c5a4-459f-a1b8-b56902aaf7e0.png" alt="qt-creator-18-pyside6-python-lsp.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The code completion looks different now.</p>
]]></description><link>https://forum.qt.io/post/836882</link><guid isPermaLink="true">https://forum.qt.io/post/836882</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 14:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 14:44:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a><br />
Hi Christian.  Since my time it seems that you are showing Python <em>autocompletion</em>, which is a start.  But the OP asked for "type hints", a couple of times.  Your screenshot shows nothing about that.  Does it offer that?  E.g. after you select <code>setAlignment</code> from the dropdown do you get any type hints (parameter type), like you would for C++?</p>
]]></description><link>https://forum.qt.io/post/836881</link><guid isPermaLink="true">https://forum.qt.io/post/836881</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 14:44:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 13:52:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marix">@<bdi>MariX</bdi></a> Is the screenshot below the thing that you wanted?</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/56bec227-bd5b-4acd-8930-8cde5cbc30e9.png" alt="qt-creator-18-pyside6.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">In oder to achieve this I've:</p>
<ol>
<li>
<p dir="auto">Went to <em>Preferences &gt; Python</em> where I clicked on <em>Python 3.13.12</em> then on the right the buttons: <em>Make Default</em> and then <em>Generate Kit</em>.</p>
</li>
<li>
<p dir="auto">New Project and then in <em>Application (Qt for Python)</em> selected <em>Empty Application</em></p>
</li>
<li>
<p dir="auto">Pasted the content provided by gpt-oss with the prompt <em>create a pyside6 application that has a window with a label "Hello 🐍" with a text size 18</em>.</p>
</li>
</ol>
<p dir="auto">After step 2 I've been asked by Qt Creator if I want to install Pyside6 and clicked yes, and it did its magic.</p>
<p dir="auto">I have little knowledge about Python, but it seems like code completion works.</p>
<p dir="auto">Here are the Python LSP settings:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/f50807cc-8afd-45f1-94a6-7778a67ff0c6.png" alt="qt-creator-18-python-lsp.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The debugging helpers are not that ... helpful:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/dab15ca5-9159-4d24-882d-167db0d18e6d.png" alt="qt-creator-18-python-debugging.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/836880</link><guid isPermaLink="true">https://forum.qt.io/post/836880</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Fri, 06 Mar 2026 13:52:15 GMT</pubDate></item><item><title><![CDATA[Reply to How to Enable Python Type Hints in Qt Creator? on Fri, 06 Mar 2026 16:09:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marix">@<bdi>MariX</bdi></a><br />
I wait to see whether anyone can tell you this.  My understanding (from when I used Creator + Python/PySide) was that it did not.  But I could be mistaken.  Otherwise I think you might read through <a href="https://www.reddit.com/r/QtFramework/comments/1bag8rc/ide_for_pyqtpyside/" target="_blank" rel="noopener noreferrer nofollow ugc">IDE for PyQt/PySide</a> in Reddit's <strong>r/QtFramework</strong> from a couple of years ago.  I used <strong>PyCharm</strong> for a more pleasurable developing/debugging experience, and <strong>Creator</strong>/<strong>Designer</strong> just for <code>.ui</code> files.</p>
<p dir="auto"><strong>UPDATE:</strong> For anybody reading this.  Per <a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-adam">@<bdi>cristian-adam</bdi></a>'s posts and pictures below, the reddit posts from only two years ago and my own experience with trying to use Creator with Python several years back notwithstanding, it does appear that Creator has done a lot more work integrating with PySide/Python than in my time!  So it would only be fair to give Creator/Python a go now without necessarily moving to <strong>PyCharm</strong>.</p>
]]></description><link>https://forum.qt.io/post/836819</link><guid isPermaLink="true">https://forum.qt.io/post/836819</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 06 Mar 2026 16:09:04 GMT</pubDate></item></channel></rss>