Hi all,
This is my first post here so please bear with me. I am trying to get my QGraphicsView widget to output as an image. I have the following code.

def outputImg(self,dir=None):
    if dir == None:
        dir = os.getcwd()
    img = QtGui.QImage(self.size())
    print img.isNull() # This == True
    painter = QtGui.QPainter(img); # Error here when init calls the begin() method
    self.render(painter);
    img.save(os.path.join(dir,'img.png'));

The error i get is the following:
QPainter::begin: Paint device returned engine == 0, type: 3

I realize this is because img.isNull() == True from doing some research I'm just not sure how to correct it. Thanks for any and all help!

-Rogersjw

Any ideas? Need more information?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.