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