From: Darren D. <dsd...@gm...> - 2011-02-27 21:02:09
|
On Sun, Feb 27, 2011 at 3:27 PM, Darren Dale <dsd...@gm...> wrote: > Hi Pierre, > > Are you still maintaining the qt4 plot editor dialog? It doesn't > appear to be working properly: setting the marker and linestyle > options does not effect the plot (tested on Ubuntu Natty alpha, with > the v1.0.x branch on python-2.7 and PyQt4-4.8.3). Sorry, I think this was a mistake on my part... > I have a really hard > time following the code. ... but I do have a really hard time understanding the code. > Also, the dialog makes the qt4 backend > unusable with PyQt4's API v2, which does not provide a QString object. This can be addressed with the following change, which I just @@ -56,9 +56,9 @@ from PyQt4.QtGui import (QWidget, QLineEdit, QComboBox, QLabel QPixmap, QTabWidget, QApplication, QStackedWidget, QDateEdit, QDateTimeEdit, QFont, QFontComboBox, QFontDatabase, QGridLayout) -from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QSize, QString, +from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QObject, QSize, pyqtSignature, pyqtProperty) import datetime class ColorButton(QPushButton): @@ -102,7 +102,8 @@ def text_to_qcolor(text): Avoid warning from Qt when an invalid QColor is instantiated """ color = QColor() - if isinstance(text, QString): + if isinstance(text, QObject): + # actually a QString, which is not provided by the new PyQt4 API: text = str(text) if not isinstance(text, (unicode, str)): return color |