Hello everyone.
I managed to add a QSvgWidget to a sub window and I was pleasantly surprised how easy it was -- with a ready svg file loaded and displayed (the svg picture/diagram was created with another Python script).
ex13MDITable.jpg
{...}
self.
svgPane = QtSvg.
QSvgWidget('/media/vault/docs/softdev/python/pyqt/zetcode/SIDexmp.svg')subWindow01 = mdiBox.addSubWindow(self.svgPane)
subWindow01.setWindowTitle('Svg pane')
{...}
{...}
self.svgPane = QtSvg.QSvgWidget('/media/vault/docs/softdev/python/pyqt/zetcode/SIDexmp.svg')
subWindow01 = mdiBox.addSubWindow(self.svgPane)
subWindow01.setWindowTitle('Svg pane')
{...}
To copy to clipboard, switch view to plain text mode
A button for the zooming was added, however I hit the dead end. I tried zooming with
qrec
= QRect(20,
20,
300,
200)self.svgRenderer.setViewBox(qrec)
qrec = QRect(20, 20, 300, 200)
self.svgRenderer.setViewBox(qrec)
To copy to clipboard, switch view to plain text mode
but it does nothing, but making the region qrec white.
What to do to make it actually zoom? In the end I would like to zoom the diagram with the mouse wheel, with a slider, or with +/- buttons.
I'll be grateful for any help or pointing to resources.
Best regards.
Bookmarks