<?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[aboutQt() Runtime Error]]></title><description><![CDATA[<p dir="auto">I am trying to add an About Qt window to my Python Qt app but whenever the function to create it is triggered, it returns this error</p>
<pre><code>    aboutQt.aboutQt(aboutQt)
RuntimeError: libshiboken: Internal C++ object (PySide6.QtWidgets.QMessageBox) already deleted.
</code></pre>
<p dir="auto">Here is the relevant portion of my code:</p>
<pre><code>from PySide6 import QtCore, QtWidgets, QtGui
from PySide6.QtUiTools import QUiLoader
from PySide6.QtCore import QFile
from ui.ui_mainWindow import Ui_MainWindow

class mainWindow(QtWidgets.QMainWindow):
    def __init__(self):
        super(mainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

class dialogWindow(QtWidgets.QDialog):
    def __init__(self, windowFile):
        super(dialogWindow, self).__init__()
        self.ui = windowFile
        self.ui.setupUi(self, self)

def aboutQtWindow():
    global aboutQt
    aboutQt = QtWidgets.QMessageBox(dialogWindow(ui.ui_aboutQt.Ui_Dialog))
    aboutQt.aboutQt(aboutQt)

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    window = mainWindow()
    window.show()

    window.ui.actionAbout_Qt.triggered.connect(aboutQtWindow)
    sys.exit(app.exec())
</code></pre>
]]></description><link>https://forum.qt.io/topic/165020/aboutqt-runtime-error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 19:38:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/165020.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Aug 2026 14:08:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to aboutQt() Runtime Error on Tue, 18 Aug 2026 17:40:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/samuraidestroy">@<bdi>SamuraiDestroy</bdi></a><br />
I <em>believe</em> you will find:</p>
<pre><code>aboutQt = QtWidgets.QMessageBox(dialogWindow(ui.ui_aboutQt.Ui_Dialog))
</code></pre>
<p dir="auto">creates an anonymous <code>QDialog</code> temporarily, makes the <code>QMessageBox</code> have that to center on, and then destroys the <code>QDialog</code> so the message box now is to be centered on a non-existent dialog?  Might cause the message?</p>
<pre><code>aboutQt.aboutQt(aboutQt)
</code></pre>
<p dir="auto">don't know what this would do, seems to pass <code>aboutQt</code> to center on itself?  Might cause the message?</p>
<p dir="auto">The method is <a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QMessageBox.html#PySide6.QtWidgets.QMessageBox.aboutQt" target="_blank" rel="noopener noreferrer nofollow ugc">static aboutQt(parent[, title=""])</a>.  So it's static, and I believe it  creates and displays the whole "About" dialog.  Don't know what your intention to create your own about dialog is about?  (If you want to display some dialog of your own as the parent for the <code>aboutQt</code> message box you need to create and show that dialog and keep a reference to it.)</p>
<p dir="auto">I thought you were just supposed to write <em>something like</em>:</p>
<pre><code>QtWidgets.QMessageBox.aboutQt(None)
</code></pre>
<p dir="auto">No instances of anything.  No dialog of your own.</p>
<p dir="auto">To center that on the main window, if you want that,  you would pass your <code>window = mainWindow()</code>  instance as <em>parent</em>.</p>
<p dir="auto">P.S.<br />
I see there is also a convenience <a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QApplication.html#PySide6.QtWidgets.QApplication.aboutQt" target="_blank" rel="noopener noreferrer nofollow ugc">QApplication.aboutQt()</a> method.  So <code>app.aboutQt()</code> should also work.</p>
]]></description><link>https://forum.qt.io/post/839777</link><guid isPermaLink="true">https://forum.qt.io/post/839777</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Aug 2026 17:40:16 GMT</pubDate></item><item><title><![CDATA[Reply to aboutQt() Runtime Error on Wed, 19 Aug 2026 06:59:45 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/839777">aboutQt() Runtime Error</a>:</p>
<blockquote>
<p dir="auto">I thought you were just supposed to write something like:</p>
<p dir="auto">QtWidgets.QMessageBox.aboutQt(None)</p>
</blockquote>
<p dir="auto">This works perfectly, thank you</p>
]]></description><link>https://forum.qt.io/post/839786</link><guid isPermaLink="true">https://forum.qt.io/post/839786</guid><dc:creator><![CDATA[SamuraiDestroy]]></dc:creator><pubDate>Wed, 19 Aug 2026 06:59:45 GMT</pubDate></item><item><title><![CDATA[Reply to aboutQt() Runtime Error on Tue, 18 Aug 2026 17:40:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/samuraidestroy">@<bdi>SamuraiDestroy</bdi></a><br />
I <em>believe</em> you will find:</p>
<pre><code>aboutQt = QtWidgets.QMessageBox(dialogWindow(ui.ui_aboutQt.Ui_Dialog))
</code></pre>
<p dir="auto">creates an anonymous <code>QDialog</code> temporarily, makes the <code>QMessageBox</code> have that to center on, and then destroys the <code>QDialog</code> so the message box now is to be centered on a non-existent dialog?  Might cause the message?</p>
<pre><code>aboutQt.aboutQt(aboutQt)
</code></pre>
<p dir="auto">don't know what this would do, seems to pass <code>aboutQt</code> to center on itself?  Might cause the message?</p>
<p dir="auto">The method is <a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QMessageBox.html#PySide6.QtWidgets.QMessageBox.aboutQt" target="_blank" rel="noopener noreferrer nofollow ugc">static aboutQt(parent[, title=""])</a>.  So it's static, and I believe it  creates and displays the whole "About" dialog.  Don't know what your intention to create your own about dialog is about?  (If you want to display some dialog of your own as the parent for the <code>aboutQt</code> message box you need to create and show that dialog and keep a reference to it.)</p>
<p dir="auto">I thought you were just supposed to write <em>something like</em>:</p>
<pre><code>QtWidgets.QMessageBox.aboutQt(None)
</code></pre>
<p dir="auto">No instances of anything.  No dialog of your own.</p>
<p dir="auto">To center that on the main window, if you want that,  you would pass your <code>window = mainWindow()</code>  instance as <em>parent</em>.</p>
<p dir="auto">P.S.<br />
I see there is also a convenience <a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QApplication.html#PySide6.QtWidgets.QApplication.aboutQt" target="_blank" rel="noopener noreferrer nofollow ugc">QApplication.aboutQt()</a> method.  So <code>app.aboutQt()</code> should also work.</p>
]]></description><link>https://forum.qt.io/post/839777</link><guid isPermaLink="true">https://forum.qt.io/post/839777</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Aug 2026 17:40:16 GMT</pubDate></item></channel></rss>