Hi,

I was trying to fit my image to the view in my qgraphicsview
application. But i didn't get the logic of it or i am doing something
wrong. 

What i do is first opening a pdf:

self.doc = QtPoppler.Poppler.Document.load(self.fileName)
page = self.doc.page(self.currentPage)

rendering it to a scale: 
self.pdfImage =
self.pdfimage=page.renderToImage(root.graphicsView.width()/self.xscaling,root.graphicsView.width()/self.yscaling)

converting the scaled page to a pixmap:
pixmap=QtGui.QPixmap.fromImage(self.pdfImage)
self.pixmap=self.scene.addPixmap(pixmap)

and then viewing it:

rect=root.graphicsView.sceneRect()
root.graphicsView.setSceneRect(rect)

What i want is to fit the view in the screen (graphicsview's scene). I tried 
fitInView with different x,y,w,h parameters, by calling the graphicsview's 
sceneRect func but never managed to fit the view 
(root.graphicsView.fitInView(root.graphicsView.sceneRect().x(), 
root.graphicsView.sceneRect().y(), root.graphicsView.width(), 
root.graphicsView.sceneRect().width())). 
The thing is i am doing all those things after i rotated the graphicsview 90 
degress counter clock wise. What should i call to fit the view after rotating?

Thanx.

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to