python - QPainter::begin: Paint device returned engine == 0, type: 0 -
i started watching tutorials python , qt (https://www.youtube.com/watch?v=eq7__6y0jwo&index=3&list=pl19dciiwvefyqxldtwlxq4lnzdpw6_r-q) i'm getting error "qpainter::begin: paint device returned engine == 0, type: 0" , can't figure out why. idea want have window works in 3dsmax, modo , maybe standalone (both 3dsmax , modo come pyside).
any ideas?
here code:
from pyside import qtcore, qtgui import sys class palettelistmodel (qtcore.qabstractlistmodel): def __init__(self, colors=[], parent=none): qtcore.qabstractlistmodel.__init__(self, parent) self._colors = colors if __name__ == '__main__': app = qtgui.qapplication(sys.argv) listview = qtgui.qlistview() listview.show() red = qtgui.qcolor(255, 0, 0) green = qtgui.qcolor(0, 255, 0) blue = qtgui.qcolor(0, 0, 255) model = palettelistmodel([red, green, blue]) listview.setmodel(model) sys.exit(app.exec_())
thanks,
nick
the thing see wrong code inheriting qabstractlistmodel without implementing abstract methods.
from documentation here: http://doc.qt.io/qt-5/qabstractlistmodel.html#details
when subclassing qabstractlistmodel, must provide implementations of rowcount() , data() functions. behaved models provide headerdata() implementation.
are leaving out code? ever create qpainter object?
Comments
Post a Comment