Note that there are some explanatory texts on larger screens.

plurals
  1. POQWidget showFullScreen produces multiple resizeEvents
    primarykey
    data
    text
    <p>I have a QT application written in python using PySide and I stumbled across a little problem regarding the showFullScreen method of the QGLWidget (although the problem occurs with every other widget too):</p> <p>The problem is, that the widget doesn't have its 'final' resolution after the program returns from showFullScreen. The switch seems to be triggered asynchronously between 5 and 10 milliseconds later.</p> <p>This is a problem for me because I have to do some layout calculations which depend on the widget's size after it is shown.</p> <p>Below is a little reproducer which subclasses QGLWidget. Using this reproducer you will take notice, that resizeEvent will be called twice after showFullScreen.</p> <p>I'm looking for a convinient way of knowing which resizeEvent is the 'final' one, or a way of knowing, when the widget really is in fullscreen mode. Is there maybe any signals I could connect to?</p> <p>Thanks a lot for any help on this.</p> <pre class="lang-py prettyprint-override"><code>#!/usr/bin/python import sys from PySide.QtGui import QApplication from PySide.QtCore import QTimer from PySide.QtOpenGL import QGLWidget class TestWidget(QGLWidget): def __init__(self, parent=None): super(TestWidget, self).__init__(parent) self._timer = QTimer() self._timer.setInterval(5) self._timer.timeout.connect(self.showsize) self._timer.start() def resizeEvent(self, event): print "Resize event:", event.size().width(), event.size().height() def showsize(self): w = widget.size().width() print "Timer: ", w, widget.size().height() if w == 1680: self._timer.stop() if __name__ == "__main__": app = QApplication(sys.argv) widget = TestWidget() widget.showFullScreen() print "After showFullScreen:", widget.size().width(), widget.size().height() # this will always be 640 480...1680 1050 is what I'm expecting app.exec_() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload