{"id":210304,"date":"2014-01-27T21:36:03","date_gmt":"2014-01-27T17:36:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=210304"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=210304","title":{"rendered":"<span class=\"post_title\">PyQt. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0443\u0441\u043e\u0440<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ce0\/ad6\/4cd\/ce0ad64cd9047a68b80610ac14943915.png\" alt=\"image\" align=\"right\"\/><br \/>  \u0414\u0430\u0432\u043d\u044b\u043c \u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b \u044f\u0437\u044b\u043a \u0421. \u0418 \u0431\u044b\u043b\u0438 \u0432 \u043d\u0435\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u2014 malloc \u0438 free. \u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u044d\u0442\u043e \u0411\u044c\u0451\u0440\u043d \u0421\u0442\u0440\u0430\u0443\u0441\u0442\u0440\u0443\u043f \u0438 \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0449\u0435. \u0418 \u0438\u0437\u043e\u0431\u0440\u0435\u043b \u0421++. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a malloc\/free \u0442\u0430\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c new\/delete, \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, RAII, auto \u0438 shared \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u044d\u0442\u043e \u0413\u0432\u0438\u0434\u043e \u0432\u0430\u043d \u0420\u043e\u0441\u0441\u0443\u043c, \u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0421++ \u0442\u043e\u0436\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u041e\u043d \u0440\u0435\u0448\u0438\u043b \u0438\u0434\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b Python, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u0436\u0435 malloc \u0438 free \u043d\u0435\u0442.<br \/>  \u0410 \u0442\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u043e\u0440\u0432\u0435\u0436\u0441\u043a\u0438\u0435 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Qt_Development_Frameworks#History\">\u0442\u0440\u043e\u043b\u0438<\/a> \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 \u0421++ GUI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Qt, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0430\u043c\u0430 \u0438\u0445 \u0443\u0434\u0430\u043b\u044f\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u043c.<br \/>  Phil Thompson \u0440\u0430\u0441\u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f, \u0447\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Qt \u043d\u0435\u0442\u0443 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 Python. \u0418 \u0440\u0435\u0448\u0438\u043b \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c PyQt. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u043b\u0438 \u0441\u043a\u0440\u0435\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043b\u0435\u0437\u0443\u0442 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435\u2026 <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h6>*\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u044c \u0438 \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u043f\u0440\u0438\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 \u0436\u0435\u0440\u0442\u0432\u0443 \u0445\u0443\u0434\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f.<\/h6>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b PyQt \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0421++ \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0432 Python. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c-\u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439, \u0430 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u00ab\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e\u00bb C++-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<br \/>  \u0412\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0443\u043c\u0438\u0440\u0430\u044e\u0442. \u041d\u043e \u044d\u0442\u0443 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c. \u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c 3-\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:  <\/p>\n<ul>\n<li> Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u0421++\u043e\u0431\u044a\u0435\u043a\u0442- \u043d\u0435\u0442 <\/li>\n<li> \u0421\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 Python \u0443\u0434\u0430\u043b\u0438\u043b \u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <\/li>\n<li> Qt \u0443\u0434\u0430\u043b\u0438\u043b\u0430 \u043e\u0431\u044a\u0435\u043a\u0442. Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0436\u0438\u0432\u0430 <\/li>\n<\/ul>\n<h2>Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u0421++\u043e\u0431\u044a\u0435\u043a\u0442- \u043d\u0435\u0442<\/h2>\n<pre><code class=\"python\">    from PyQt4.QtCore import QObject      class MyObject(QObject):         def __init__(self):             self.field = 7      obj = MyObject()     print(obj.field)     obj.setObjectName(&quot;New object&quot;)  &gt;&gt;&gt; Traceback (most recent call last): &gt;&gt;&gt;   File &quot;pyinit.py&quot;, line 9, in &lt;module&gt; &gt;&gt;&gt;     obj.setObjectName(&quot;New object&quot;) &gt;&gt;&gt; RuntimeError: '__init__' method of object's base class (MyObject) not called. <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/hlamer\/pyqt-memory-mgmt\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 MyObject \u043c\u044b \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0441\u044f, \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c C++-\u043c\u0435\u0442\u043e\u0434 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c <i>RuntimeError<\/i> \u0441 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<br \/>  \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"python\">    ...     class MyObject(QObject):         def __init__(self):             QObject.__init__(self)     ... <\/code><\/pre>\n<h2>\u0421\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 Python \u0443\u0434\u0430\u043b\u0438\u043b \u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">    from PyQt4.QtGui import QApplication, QLabel      def createLabel():         label = QLabel(&quot;Hello, world!&quot;)         label.show()      app = QApplication([])     createLabel()      app.exec_() <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C++, \u043f\u043e\u0441\u043b\u0435 <i>app.exec_()<\/i> \u043c\u044b \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u043a\u043e\u0448\u043a\u043e c \u00abHello, world!\u00bb. \u041d\u043e, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442. \u041a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>createLabel()<\/i> \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0432 Python-\u043a\u043e\u0434\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 <i>label<\/i>, \u0438 \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u044b\u0439 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0443\u0434\u0430\u043b\u0438\u043b Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0443. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0443\u0434\u0430\u043b\u0438\u043b\u0430 C++-\u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"python\">    from PyQt4.QtGui import QApplication, QLabel      def createLabel():         label = QLabel(&quot;Hello, world!&quot;)         label.show()         return label      app = QApplication([])     label = createLabel()      app.exec_() <\/code><\/pre>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438.<\/p>\n<h2>Qt \u0443\u0434\u0430\u043b\u0438\u043b\u0430 \u043e\u0431\u044a\u0435\u043a\u0442. Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0436\u0438\u0432\u0430<\/h2>\n<p>  \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 2 \u0441\u043b\u0443\u0447\u0430\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a PyQt\/Pyside \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b. \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 Python-\u0447\u0430\u0441\u0442\u044c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Qt \u0443\u0434\u0430\u043b\u0438\u043b\u0430 C++-\u043e\u0431\u044a\u0435\u043a\u0442.<br \/>  Qt \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043e\u043a\u043d\u0430, \u0432\u044b\u0437\u043e\u0432\u0435 <i>deleteLater()<\/i> \u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Python, \u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a C++-\u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <i>RuntimeError<\/i> \u0438\u043b\u0438 <b>\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/b>.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443:  <\/p>\n<pre><code class=\"python\">    from PyQt4.QtCore import QTimer     from PyQt4.QtGui import QApplication, QWidget       app = QApplication([])      widget = QWidget()     widget.setWindowTitle(&quot;Dead widget&quot;)     widget.deleteLater()      QTimer.singleShot(0, app.quit)  # \u0414\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430     app.exec_()  #  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u043e deleteLater()      print(widget.windowTitle())  &gt;&gt;&gt; Traceback (most recent call last): &gt;&gt;&gt;   File &quot;1_basic.py&quot;, line 20, in &lt;module&gt; &gt;&gt;&gt;     print(widget.windowTitle()) &gt;&gt;&gt; RuntimeError: wrapped C\/C++ object of type QWidget has been deleted <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c QWidget, \u043f\u0440\u043e\u0441\u0438\u043c Qt \u0435\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u0412\u043e \u0432\u0440\u0435\u043c\u044f <i>app.exec_()<\/i> \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d. \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0438 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <i> windowTitle()<\/i> \u0431\u0440\u043e\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043f\u0430\u0434\u0435\u043d\u0438\u0435.<br \/>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0432\u044b\u0437\u0432\u0430\u043b <i>deleteLater()<\/i> \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e \u043e\u043d \u0441\u0430\u043c \u0438 \u0432\u0438\u043d\u043e\u0432\u0430\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0447\u0430\u0441\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439:  <\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442<\/li>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043a \u0441\u043b\u043e\u0442\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/li>\n<li>Qt \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043e\u043a\u043d\u0430<\/li>\n<li>\u0421\u043b\u043e\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u043c \u0438\u043b\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043c\u0438\u0440\u0430<\/li>\n<li>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/li>\n<\/ol>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u044b\u0439 \u043a \u0436\u0438\u0437\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">    from PyQt4.QtCore import Qt, QTimer     from PyQt4.QtGui import QApplication, QLabel, QLineEdit       def onLineEditTextChanged():         print('~~~~ Line edit text changed')      def onLabelDestroyed():         print('~~~~ C++ label object destroyed')      def changeLineEditText():         print('~~~~ Changing line edit text')         lineEdit.setText(&quot;New text&quot;)       class Label(QLabel):         def __init__(self):             QLabel.__init__(self)             self.setAttribute(Qt.WA_DeleteOnClose)             self.destroyed.connect(onLabelDestroyed)          def __del__(self):             print('~~~~ Python label obj\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f QLineEdit, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 - Label.ect destroyed')          def setText(self, text):             print('~~~~ Changing label text')             QLabel.setText(self, text)          def close(self):             print('~~~~ Closing label')             QLabel.close(self)       app = QApplication([])     app.setQuitOnLastWindowClosed(False)      label = Label()     label.show()      lineEdit = QLineEdit()     lineEdit.textChanged.connect(onLineEditTextChanged)     lineEdit.textChanged.connect(label.setText)       QTimer.singleShot(1000, label.close)   # \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043a\u0440\u044b\u043b \u043e\u0434\u043d\u043e \u0438\u0437 \u043e\u043a\u043e\u043d     QTimer.singleShot(2000, changeLineEditText)  # \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0442\u0435\u043a\u0441\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u043a\u043d\u0435. \u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.     QTimer.singleShot(3000, app.quit)      app.exec_()      print('~~~~ Application exited')  &gt;&gt;&gt; ~~~~ Closing label &gt;&gt;&gt; ~~~~ C++ label object destroyed &gt;&gt;&gt; ~~~~ Changing line edit text &gt;&gt;&gt; ~~~~ Line edit text changed &gt;&gt;&gt; ~~~~ Changing label text &gt;&gt;&gt; Traceback (most recent call last): &gt;&gt;&gt;   File &quot;2_reallife.py&quot;, line 33, in setText &gt;&gt;&gt;     QLabel.setText(self, text) &gt;&gt;&gt; RuntimeError: wrapped C\/C++ object of type Label has been deleted &gt;&gt;&gt; ~~~~ Application exited &gt;&gt;&gt; ~~~~ Python label object destroyed <\/code><\/pre>\n<p>  Label \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0441\u0438\u0433\u043d\u0430\u043b\u0443 textChanged \u043e\u0442 QLineEdit. \u0427\u0435\u0440\u0435\u0437 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 label \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0435\u0440\u0435\u0437 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 label \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0441\u044b\u043f\u043b\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043f\u0430\u0434\u0430\u0435\u0442.  <\/div>\n<\/div>\n<h4>\u041a\u043e\u0433\u0434\u0430 \u0441\u043b\u043e\u0442\u044b \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/h4>\n<p>   \u0412 \u0421++-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u043b\u043e\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e PyQt \u0438 PySide \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u00bb \u043e\u0431\u044a\u0435\u043a\u0442. \u041c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0441\u043b\u043e\u0442\u044b \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u043e\u0434\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0415\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">    PYSIDE = False     USE_SINGLESHOT = True      if PYSIDE:         from PySide.QtCore import Qt, QTimer         from PySide.QtGui import QApplication, QLineEdit     else:         from PyQt4.QtCore import Qt, QTimer         from PyQt4.QtGui import QApplication, QLineEdit       def onLineEditDestroyed():         print('~~~~ C++ lineEdit object destroyed')      def onSelectionChanged():         print('~~~~ Pure C++ method selectAll() called')       class LineEdit(QLineEdit):         def __init__(self):             QLineEdit.__init__(self)             self.setText(&quot;foo bar&quot;)              self.destroyed.connect(onLineEditDestroyed)             #self.selectionChanged.connect(onSelectionChanged)          def __del__(self):             print('~~~~ Python lineEdit object destroyed')          def clear(self):             &quot;&quot;&quot;Overridden Qt method             &quot;&quot;&quot;             print('~~~~ Overridden method clear() called')             QLineEdit.clear(self)          def purePythonMethod(self):             &quot;&quot;&quot;Pure python method.             Does not override any C++ methods             &quot;&quot;&quot;             print('~~~~ Pure Python method called')             self.windowTitle()  # generate exception       app = QApplication([])     app.setQuitOnLastWindowClosed(False)      lineEdit = LineEdit()     lineEdit.deleteLater()       if USE_SINGLESHOT:         #QTimer.singleShot(1000, lineEdit.clear)         #QTimer.singleShot(1000, lineEdit.purePythonMethod)         QTimer.singleShot(1000, lineEdit.selectAll)  # pure C++ method     else:         timer = QTimer(None)         timer.setSingleShot(True)         timer.setInterval(1000)         timer.start()          #timer.timeout.connect(lineEdit.clear)         #timer.timeout.connect(lineEdit.purePythonMethod)         timer.timeout.connect(lineEdit.selectAll)  # pure C++ method       QTimer.singleShot(2000, app.quit)      app.exec_()      print('~~~~ Application exited') <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0442\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u044b\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0433\u043a\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0432 PyQt \u0438 PySide.  <\/p>\n<table>\n<tr>\n<th>\u0422\u0438\u043f \u0441\u043b\u043e\u0442\u0430<\/th>\n<th>PyQt<\/th>\n<th>PySide<\/th>\n<\/tr>\n<tr>\n<th>\u043c\u0435\u0442\u043e\u0434 \u0421++-\u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/th>\n<td>\u0441\u043b\u043e\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>\u0441\u043b\u043e\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f<\/td>\n<\/tr>\n<tr>\n<th>\u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Python<\/th>\n<td>\u043f\u0430\u0434\u0435\u043d\u0438\u0435<\/td>\n<td>\u0441\u043b\u043e\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f<\/td>\n<\/tr>\n<tr>\n<th>\u043c\u0435\u0442\u043e\u0434 \u0421++-\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 Python-\u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439<\/th>\n<td>\u043f\u0430\u0434\u0435\u043d\u0438\u0435<\/td>\n<td>\u043f\u0430\u0434\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<\/table>\n<p>  <\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0421 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c C++-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u043e \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043d\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043a\u043e\u0440\u043e, \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u044f\u0432\u043d\u043e. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u0435\u0442\u044b:  <\/p>\n<ul>\n<li>\u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c Python-\u0441\u043b\u043e\u0442\u044b, \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438\u0437\u0432\u043d\u0435<\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b <i>QObject.destroyed<\/i>, \u043d\u043e \u043d\u0435 \u043c\u0435\u0442\u043e\u0434 <i>__del__<\/i> Python-\u043e\u0431\u0435\u0440\u0442\u043a\u0438<\/li>\n<li>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <i>QTimer.singleShot<\/i> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u0422\u0430\u043a\u043e\u0439 \u0442\u0430\u0439\u043c\u0435\u0440 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u043d\u0430\u044f \u043f\u0443\u043b\u044f, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0431\u043e\u044f\u0442\u044c\u0441\u044f PyQt\/PiSide? \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0447\u0430\u0441\u0442\u043e. \u0423 \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u0435 \u0438 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/210304\/\"> http:\/\/habrahabr.ru\/post\/210304\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ce0\/ad6\/4cd\/ce0ad64cd9047a68b80610ac14943915.png\" alt=\"image\" align=\"right\"\/><br \/>  \u0414\u0430\u0432\u043d\u044b\u043c \u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b \u044f\u0437\u044b\u043a \u0421. \u0418 \u0431\u044b\u043b\u0438 \u0432 \u043d\u0435\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u2014 malloc \u0438 free. \u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u044d\u0442\u043e \u0411\u044c\u0451\u0440\u043d \u0421\u0442\u0440\u0430\u0443\u0441\u0442\u0440\u0443\u043f \u0438 \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0449\u0435. \u0418 \u0438\u0437\u043e\u0431\u0440\u0435\u043b \u0421++. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a malloc\/free \u0442\u0430\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c new\/delete, \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, RAII, auto \u0438 shared \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u044d\u0442\u043e \u0413\u0432\u0438\u0434\u043e \u0432\u0430\u043d \u0420\u043e\u0441\u0441\u0443\u043c, \u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0421++ \u0442\u043e\u0436\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u041e\u043d \u0440\u0435\u0448\u0438\u043b \u0438\u0434\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b Python, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u0436\u0435 malloc \u0438 free \u043d\u0435\u0442.<br \/>  \u0410 \u0442\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u043e\u0440\u0432\u0435\u0436\u0441\u043a\u0438\u0435 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Qt_Development_Frameworks#History\">\u0442\u0440\u043e\u043b\u0438<\/a> \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 \u0421++ GUI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Qt, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0430\u043c\u0430 \u0438\u0445 \u0443\u0434\u0430\u043b\u044f\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u043c.<br \/>  Phil Thompson \u0440\u0430\u0441\u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f, \u0447\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Qt \u043d\u0435\u0442\u0443 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 Python. \u0418 \u0440\u0435\u0448\u0438\u043b \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c PyQt. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u043b\u0438 \u0441\u043a\u0440\u0435\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043b\u0435\u0437\u0443\u0442 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435\u2026   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-210304","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/210304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210304"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/210304\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}