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

List:       pykde
Subject:    Re: [PyQt] PyQt5 bug in QPropertyAnimation on Windows
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2015-07-31 22:20:35
Message-ID: 33d7ab867e9a509f47860fd02ef83c91 () riverbankcomputing ! com
[Download RAW message or body]

On 31/07/2015 10:35 pm, Trilarion wrote:
> Hi,
> 
> I have a problem of PyQt5 not recognizing the second parameter of the
> constructor of QPropertyAnimation as string on Python 3 and Windows.
> It should be a bug.
> 
> Example code:
> 
> from PyQt5.QtWidgets import QProgressBar, QApplication
> from PyQt5.QtCore import QPropertyAnimation
> 
> app = QApplication([])
> 
> pbar = QProgressBar()
> pbar.show()
> 
> animation = QPropertyAnimation(pbar, "value")
> animation.start()
> 
> app.exec_()
> 
> Error:
> 
> line 9, in <module>
> animation = QPropertyAnimation(pbar, "value")
> TypeError: arguments did not match any overloaded call:
> QPropertyAnimation(QObject parent=None): too many arguments
> QPropertyAnimation(QObject, QByteArray, QObject parent=None): argument
> 2 has unexpected type 'str'
> 
> System:
> 
> Python 3.4.2 64 bit on Windows 7 64 bit
> + PyQt5-5.5-gpl-Py3.4-Qt5.5.0-x64.exe (downloaded on 07-26-2015)

It's not a bug. As of PyQt v5.5 (and deprecated in v5.4) Python strings 
do not get automatically converted to a QByteArray because the codec is 
not known. Pass a bytes object instead of a string.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

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