[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Fwd: PyQTProperty Error
From:       Ketan Dama <ketandama070 () gmail ! com>
Date:       2021-03-04 14:38:56
Message-ID: CA+NZv7TGqNVrJrv-dg_-LB27WkOboyp_5ywU5T=-5wkeTBjsuw () mail ! gmail ! com
[Download RAW message or body]

---------- Forwarded message ---------
From: Ketan Dama <ketandama070@gmail.com>
Date: Thu, 4 Mar 2021, 7:51 pm
Subject: Re: PyQTProperty Error
To: Phil Thompson <phil@riverbankcomputing.com>


Yes Phil, it works fine in the latest version, but the script is causing
error in Python 3.4 / PyQt 5.7.1 / Qt 5.4 / Windows 7 & 10.

Since, this is the setup I've used in the past for most of my development,
I need help in solving the problem.


Thanks,
Ketan.

On Thu, 4 Mar 2021, 7:42 pm Phil Thompson, <phil@riverbankcomputing.com>
wrote:

> On 04/03/2021 12:56, Ketan Dama wrote:
> > Hello, any update on this?
>
> Your original email didn't seem to make it to the mailing list.
>
> It works fine for me with the current version.
>
> Phil
>
> > On Mon, 1 Mar 2021, 12:27 pm Ketan Dama, <ketandama070@gmail.com>
> > wrote:
> >
> >> Hello, Getting the error "AttributeError: 'Bug1PyQTProperty' object
> >> has no
> >> attribute 'yAxis'"
> >>
> >> TRACEBACK: The above exception was the direct cause of the following
> >> exception:
> >>
> >> Traceback (most recent call last):
> >>   File "..\Bug1PyQTProperty.py", line 33, in <module>
> >>     ex = Bug1PyQTProperty();
> >>   File "..\Bug1PyQTProperty.py", line 20, in __init__
> >>     self.ui.setupUi(self)
> >>   File "D:\ui_Bug1PyQTProperty.py", line 24, in setupUi
> >>     QtCore.QMetaObject.connectSlotsByName(Bug1PyQTProperty)
> >> SystemError: <built-in function connectSlotsByName> returned a result
> >> with
> >> an error set
> >>
> >> Please note that the error is replicated only on Python 3.6 / PyQt
> >> 5.12.3
> >> / Qt 5.12.3 Windows 7 & 10,
> >> while the script is working on Python 3.4 / PyQt 5.7.1 / Qt 5.4 /
> >> Windows
> >> 7 & 10
> >>
> >> Kindly let me know why the script works in the version of PyQT while
> >> it
> >> fails in another version?
> >>
> >>
> >> Script: Bug1PyQTProperty.py:
> >>
> >> import sys
> >> sys.dont_write_bytecode = True
> >>
> >> from PyQt5 import QtCore, QtGui, QtWidgets
> >> from PyQt5.QtCore import (pyqtProperty, pyqtSignal, pyqtSlot)
> >>
> >>
> >> from ui_Bug1PyQTProperty import Ui_Bug1PyQTProperty
> >>
> >> class Bug1PyQTProperty(QtWidgets.QWidget):
> >> def __init__(self, parent=None):
> >> super(Bug1PyQTProperty, self).__init__(parent)
> >> self.ui=Ui_Bug1PyQTProperty()
> >> self.ui.setupUi(self)
> >> self._yAxis=0
> >>
> >> @pyqtProperty(bool)
> >> def yAxis(self):
> >> return self._yAxis
> >>
> >> @yAxis.setter
> >> def yAxis(self,arg):
> >> self._yAxis=arg
> >>
> >> if __name__ == '__main__':
> >> app = QtWidgets.QApplication(sys.argv);
> >> ex = Bug1PyQTProperty();
> >> ex.show();
> >> sys.exit(app.exec_())
> >>
> >>
> >> Script: ui_Bug1PyQTProperty.py
> >>
> >> from PyQt5 import QtCore, QtGui, QtWidgets
> >>
> >> class Ui_Bug1PyQTProperty(object):
> >>     def setupUi(self, Bug1PyQTProperty):
> >>         Bug1PyQTProperty.setObjectName("Bug1PyQTProperty")
> >>         Bug1PyQTProperty.resize(400, 300)
> >>         Bug1PyQTProperty.setStyleSheet("background-color: rgb(255,
> >> 255,
> >> 0);")
> >>         self.pushbutton = QPushButton(Bug1PyQTProperty)
> >>         self.pushbutton.setGeometry(QtCore.QRect(150, 70, 32, 23))
> >>         self.pushbutton.setStyleSheet("background-color: rgb(255, 0,
> >> 127);")
> >>         self.pushbutton.setObjectName("pushbutton")
> >>
> >>         self.retranslateUi(Bug1PyQTProperty)
> >>         QtCore.QMetaObject.connectSlotsByName(Bug1PyQTProperty)
> >>
> >>     def retranslateUi(self, Bug1PyQTProperty):
> >>         _translate = QtCore.QCoreApplication.translate
> >>         Bug1PyQTProperty.setWindowTitle(_translate("Bug1PyQTProperty",
> >> "Screen"))
> >>
> >> Script: Bug1PyQTProperty.ui
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <ui version="4.0">
> >>  <class>Bug1PyQTProperty</class>
> >>  <widget class="QWidget" name="Bug1PyQTProperty">
> >>   <property name="geometry">
> >>    <rect>
> >>     <x>0</x>
> >>     <y>0</y>
> >>     <width>400</width>
> >>     <height>300</height>
> >>    </rect>
> >>   </property>
> >>   <property name="windowTitle">
> >>    <string>Screen</string>
> >>   </property>
> >>   <property name="styleSheet">
> >>    <string notr="true">background-color: rgb(255, 255, 0);</string>
> >>   </property>
> >>   <widget class="QPushButton" name="pushbutton">
> >>    <property name="geometry">
> >>     <rect>
> >>      <x>150</x>
> >>      <y>70</y>
> >>      <width>32</width>
> >>      <height>23</height>
> >>     </rect>
> >>    </property>
> >>    <property name="styleSheet">
> >>     <string notr="true">background-color: rgb(255, 0, 127);</string>
> >>    </property>
> >>   </widget>
> >>  </widget>
> >>
> >>  <resources/>
> >>  <connections/>
> >> </ui>
> >>
>

[Attachment #3 (text/html)]

<div dir="auto"><div dir="auto"></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">---------- Forwarded message ---------<br>From: <strong \
class="gmail_sendername" dir="auto">Ketan Dama</strong> <span dir="auto">&lt;<a \
href="mailto:ketandama070@gmail.com" target="_blank" \
rel="noreferrer">ketandama070@gmail.com</a>&gt;</span><br>Date: Thu, 4 Mar 2021, 7:51 \
pm<br>Subject: Re: PyQTProperty Error<br>To: Phil Thompson &lt;<a \
href="mailto:phil@riverbankcomputing.com" target="_blank" \
rel="noreferrer">phil@riverbankcomputing.com</a>&gt;<br></div><br><br><div \
dir="auto">Yes Phil, it works fine in the latest version, but the script is causing \
error in  <span style="font-family:sans-serif;font-size:12.8px">Python 3.4 / PyQt \
5.7.1 / Qt 5.4 / Windows 7 &amp; 10.</span><div dir="auto"><span \
style="font-family:sans-serif;font-size:12.8px"><br></span></div><div \
dir="auto"><span style="font-family:sans-serif;font-size:12.8px">Since, this is the \
setup I&#39;ve used in the past for most of my development, I need help in solving \
the problem.</span></div><div dir="auto"><span \
style="font-family:sans-serif;font-size:12.8px"><br></span></div><div \
dir="auto"><span style="font-family:sans-serif;font-size:12.8px"><br></span></div><div \
dir="auto"><span style="font-family:sans-serif;font-size:12.8px">Thanks,</span></div><div \
dir="auto"><span style="font-family:sans-serif;font-size:12.8px">Ketan.</span></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 4 Mar 2021, 7:42 pm \
Phil Thompson, &lt;<a href="mailto:phil@riverbankcomputing.com" rel="noreferrer \
noreferrer" target="_blank">phil@riverbankcomputing.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On 04/03/2021 12:56, Ketan Dama \
wrote:<br> &gt; Hello, any update on this?<br>
<br>
Your original email didn&#39;t seem to make it to the mailing list.<br>
<br>
It works fine for me with the current version.<br>
<br>
Phil<br>
<br>
&gt; On Mon, 1 Mar 2021, 12:27 pm Ketan Dama, &lt;<a \
href="mailto:ketandama070@gmail.com" rel="noreferrer noreferrer noreferrer" \
target="_blank">ketandama070@gmail.com</a>&gt; <br> &gt; wrote:<br>
&gt; <br>
&gt;&gt; Hello, Getting the error &quot;AttributeError: &#39;Bug1PyQTProperty&#39; \
object <br> &gt;&gt; has no<br>
&gt;&gt; attribute &#39;yAxis&#39;&quot;<br>
&gt;&gt; <br>
&gt;&gt; TRACEBACK: The above exception was the direct cause of the following<br>
&gt;&gt; exception:<br>
&gt;&gt; <br>
&gt;&gt; Traceback (most recent call last):<br>
&gt;&gt;     File &quot;..\Bug1PyQTProperty.py&quot;, line 33, in &lt;module&gt;<br>
&gt;&gt;        ex = Bug1PyQTProperty();<br>
&gt;&gt;     File &quot;..\Bug1PyQTProperty.py&quot;, line 20, in __init__<br>
&gt;&gt;        self.ui.setupUi(self)<br>
&gt;&gt;     File &quot;D:\ui_Bug1PyQTProperty.py&quot;, line 24, in setupUi<br>
&gt;&gt;        QtCore.QMetaObject.connectSlotsByName(Bug1PyQTProperty)<br>
&gt;&gt; SystemError: &lt;built-in function connectSlotsByName&gt; returned a result \
<br> &gt;&gt; with<br>
&gt;&gt; an error set<br>
&gt;&gt; <br>
&gt;&gt; Please note that the error is replicated only on Python 3.6 / PyQt <br>
&gt;&gt; 5.12.3<br>
&gt;&gt; / Qt 5.12.3 Windows 7 &amp; 10,<br>
&gt;&gt; while the script is working on Python 3.4 / PyQt 5.7.1 / Qt 5.4 / <br>
&gt;&gt; Windows<br>
&gt;&gt; 7 &amp; 10<br>
&gt;&gt; <br>
&gt;&gt; Kindly let me know why the script works in the version of PyQT while <br>
&gt;&gt; it<br>
&gt;&gt; fails in another version?<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; Script: Bug1PyQTProperty.py:<br>
&gt;&gt; <br>
&gt;&gt; import sys<br>
&gt;&gt; sys.dont_write_bytecode = True<br>
&gt;&gt; <br>
&gt;&gt; from PyQt5 import QtCore, QtGui, QtWidgets<br>
&gt;&gt; from PyQt5.QtCore import (pyqtProperty, pyqtSignal, pyqtSlot)<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; from ui_Bug1PyQTProperty import Ui_Bug1PyQTProperty<br>
&gt;&gt; <br>
&gt;&gt; class Bug1PyQTProperty(QtWidgets.QWidget):<br>
&gt;&gt; def __init__(self, parent=None):<br>
&gt;&gt; super(Bug1PyQTProperty, self).__init__(parent)<br>
&gt;&gt; self.ui=Ui_Bug1PyQTProperty()<br>
&gt;&gt; self.ui.setupUi(self)<br>
&gt;&gt; self._yAxis=0<br>
&gt;&gt; <br>
&gt;&gt; @pyqtProperty(bool)<br>
&gt;&gt; def yAxis(self):<br>
&gt;&gt; return self._yAxis<br>
&gt;&gt; <br>
&gt;&gt; @yAxis.setter<br>
&gt;&gt; def yAxis(self,arg):<br>
&gt;&gt; self._yAxis=arg<br>
&gt;&gt; <br>
&gt;&gt; if __name__ == &#39;__main__&#39;:<br>
&gt;&gt; app = QtWidgets.QApplication(sys.argv);<br>
&gt;&gt; ex = Bug1PyQTProperty();<br>
&gt;&gt; ex.show();<br>
&gt;&gt; sys.exit(app.exec_())<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; Script: ui_Bug1PyQTProperty.py<br>
&gt;&gt; <br>
&gt;&gt; from PyQt5 import QtCore, QtGui, QtWidgets<br>
&gt;&gt; <br>
&gt;&gt; class Ui_Bug1PyQTProperty(object):<br>
&gt;&gt;        def setupUi(self, Bug1PyQTProperty):<br>
&gt;&gt;              \
Bug1PyQTProperty.setObjectName(&quot;Bug1PyQTProperty&quot;)<br> &gt;&gt;             \
Bug1PyQTProperty.resize(400, 300)<br> &gt;&gt;              \
Bug1PyQTProperty.setStyleSheet(&quot;background-color: rgb(255, <br> &gt;&gt; \
255,<br> &gt;&gt; 0);&quot;)<br>
&gt;&gt;              self.pushbutton = QPushButton(Bug1PyQTProperty)<br>
&gt;&gt;              self.pushbutton.setGeometry(QtCore.QRect(150, 70, 32, 23))<br>
&gt;&gt;              self.pushbutton.setStyleSheet(&quot;background-color: rgb(255, \
0,<br> &gt;&gt; 127);&quot;)<br>
&gt;&gt;              self.pushbutton.setObjectName(&quot;pushbutton&quot;)<br>
&gt;&gt; <br>
&gt;&gt;              self.retranslateUi(Bug1PyQTProperty)<br>
&gt;&gt;              QtCore.QMetaObject.connectSlotsByName(Bug1PyQTProperty)<br>
&gt;&gt; <br>
&gt;&gt;        def retranslateUi(self, Bug1PyQTProperty):<br>
&gt;&gt;              _translate = QtCore.QCoreApplication.translate<br>
&gt;&gt;              \
Bug1PyQTProperty.setWindowTitle(_translate(&quot;Bug1PyQTProperty&quot;,<br> &gt;&gt; \
&quot;Screen&quot;))<br> &gt;&gt; <br>
&gt;&gt; Script: Bug1PyQTProperty.ui<br>
&gt;&gt; <br>
&gt;&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&gt;&gt; &lt;ui version=&quot;4.0&quot;&gt;<br>
&gt;&gt;   &lt;class&gt;Bug1PyQTProperty&lt;/class&gt;<br>
&gt;&gt;   &lt;widget class=&quot;QWidget&quot; \
name=&quot;Bug1PyQTProperty&quot;&gt;<br> &gt;&gt;     &lt;property \
name=&quot;geometry&quot;&gt;<br> &gt;&gt;      &lt;rect&gt;<br>
&gt;&gt;        &lt;x&gt;0&lt;/x&gt;<br>
&gt;&gt;        &lt;y&gt;0&lt;/y&gt;<br>
&gt;&gt;        &lt;width&gt;400&lt;/width&gt;<br>
&gt;&gt;        &lt;height&gt;300&lt;/height&gt;<br>
&gt;&gt;      &lt;/rect&gt;<br>
&gt;&gt;     &lt;/property&gt;<br>
&gt;&gt;     &lt;property name=&quot;windowTitle&quot;&gt;<br>
&gt;&gt;      &lt;string&gt;Screen&lt;/string&gt;<br>
&gt;&gt;     &lt;/property&gt;<br>
&gt;&gt;     &lt;property name=&quot;styleSheet&quot;&gt;<br>
&gt;&gt;      &lt;string notr=&quot;true&quot;&gt;background-color: rgb(255, 255, \
0);&lt;/string&gt;<br> &gt;&gt;     &lt;/property&gt;<br>
&gt;&gt;     &lt;widget class=&quot;QPushButton&quot; \
name=&quot;pushbutton&quot;&gt;<br> &gt;&gt;      &lt;property \
name=&quot;geometry&quot;&gt;<br> &gt;&gt;        &lt;rect&gt;<br>
&gt;&gt;         &lt;x&gt;150&lt;/x&gt;<br>
&gt;&gt;         &lt;y&gt;70&lt;/y&gt;<br>
&gt;&gt;         &lt;width&gt;32&lt;/width&gt;<br>
&gt;&gt;         &lt;height&gt;23&lt;/height&gt;<br>
&gt;&gt;        &lt;/rect&gt;<br>
&gt;&gt;      &lt;/property&gt;<br>
&gt;&gt;      &lt;property name=&quot;styleSheet&quot;&gt;<br>
&gt;&gt;        &lt;string notr=&quot;true&quot;&gt;background-color: rgb(255, 0, \
127);&lt;/string&gt;<br> &gt;&gt;      &lt;/property&gt;<br>
&gt;&gt;     &lt;/widget&gt;<br>
&gt;&gt;   &lt;/widget&gt;<br>
&gt;&gt; <br>
&gt;&gt;   &lt;resources/&gt;<br>
&gt;&gt;   &lt;connections/&gt;<br>
&gt;&gt; &lt;/ui&gt;<br>
&gt;&gt; <br>
</blockquote></div>
</div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic