<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello, <br>
<br>
I think I found a bug, test program:<br>
<br>
============================================================<br>
<font color="#006600" face="monospace">#!/usr/bin/python3<br>
# -*- coding: utf-8 -*-<br>
<br>
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal,
Q_ENUMS<br>
<br>
<br>
class Foo(QObject):<br>
propertyChanged = pyqtSignal()<br>
<br>
class EEEEE:<br>
A = 0<br>
B = 1<br>
C = 2<br>
D = 3<br>
E = 4<br>
<br>
Q_ENUMS(EEEEE)<br>
<br>
def __init__(self):<br>
super().__init__()<br>
<br>
# @pyqtProperty(int)<br>
@pyqtProperty(int, notify = propertyChanged)<br>
def foo(self):<br>
return 1<br>
<br>
print("About 3 out of 10 times, ", end = "")<br>
f = Foo()<br>
print("""this program will fail with<br>
'TypeError: an integer is required (got type str)' or<br>
'TypeError: an integer is required (got type
getset_descriptor)'<br>
<br>
Removing 'notify = ???' fixes the problem<br>
Removing 'Q_ENUM' also fixes the problem.<br>
""")<br>
</font><br>
============================================================<br>
<br>
Tested under Archlinux x64 with Python 3.4.1, PyQt 5.3.1.<br>
<br>
It looks like pyqtProperty doesn't wait for the extra loading time
of "Q_ENUMS" and "notify", causing TypeError.<br>
<br>
<br>
Thanks in advance,<br>
Xinkai<br>
<br>
</body>
</html>