<div dir="ltr">You are getting it wrong: there can be only one central widget, and obviously setting it for a QGraphicsProxyWidget doesn't make any sense.<div>Use the QGraphicsView as the central widget, then add the Browser_Widget to its scene.<br>This has some drawbacks, expecially in your case: the widget will not have direct access to the main window (and vice versa), which is most important for layout and size reasons.</div><div>A partial solution might be to set the minimum size of the QGraphicsView viewport to the minimumSizeHint of the Browser_Widget and implement the resizeEvent of the QGraphicsView to notify the QGraphicsProxyWidget about the size changes.<br>To prevent graphics, layout and alignment problems, set the frameShape of the QGraphicsView to NoFrame and the scrollbar policy to scrollBarAlwaysOff.</div><div>Also, be aware that subclasses of QAbstractScrollArea (expecially item views such as QListView, etc) have issues when used within a proxy widget, most of them regarding mouse events. In my experience I had to reimplement wheel events, some QHeaderView methods and other things related to mouse hovering. And remember that popup widgets like QComboBoxes will show their views within the scene, so if you have popup views that go outside the "main" widget margins, they will be outside the graphics scene, thus will not be completely shown.</div><div><br></div><div>Good luck! ;-)</div><div>Maurizio</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-11 11:37 GMT+02:00 Rob <span dir="ltr"><<a href="mailto:rob@pixelinspiration.net" target="_blank">rob@pixelinspiration.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
For mad reasons I've been asked to see if I can get an app to toggle itself<br>
by 180 degrees. Bit of googling came up with these two posts (in C++):<br>
<br>
<a href="http://daringfireball.org/blog/rotating-qt-apps-in-literally-6-lines-of-code.html" rel="noreferrer" target="_blank">daringfireball.org/blog/<wbr>rotating-qt-apps-in-literally-<wbr>6-lines-of-code.html</a><br>
<a href="https://forum.qt.io/topic/30230/solved-rotating-a-whole-ui/3" rel="noreferrer" target="_blank">https://forum.qt.io/topic/<wbr>30230/solved-rotating-a-whole-<wbr>ui/3</a><br>
<br>
Which both suggest the same approach using QGraphicsProxyWidget,<br>
QGraphicsScene and QGraphicsView which I've tried to implement like this<br>
(very cut down code):<br>
<br>
class MainWindow(QMainWindow):<br>
def __init__(self, url):<br>
<br>
self.browserWidget = Browser_Widget(self, url)<br>
self.setCentralWidget(self.<wbr>browserWidget)<br>
<br>
self.scene = QGraphicsScene()<br>
self.view = QGraphicsView(self)<br>
self.proxy = self.scene.addWidget(self.<wbr>centralWidget())<br>
self.view.setScene(self.scene)<br>
self.view.show()<br>
self.view.rotate(180)<br>
<br>
Which gives me this small white rectangle at the top left:<br>
<<a href="http://python.6.x6.nabble.com/file/t380167/pyqt1.jpg" rel="noreferrer" target="_blank">http://python.6.x6.nabble.<wbr>com/file/t380167/pyqt1.jpg</a>> <br>
<br>
Thanks for any thoughts.<br>
<br>
Cheers,<br>
Rob<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://python.6.x6.nabble.com/PyQt-f1792048.html" rel="noreferrer" target="_blank">http://python.6.x6.nabble.com/<wbr>PyQt-f1792048.html</a><br>
______________________________<wbr>_________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.<wbr>riverbankcomputing.com/<wbr>mailman/listinfo/pyqt</a></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>
</div>