I have trying to create an application where the QGraphicsScene and View are full screen.<br>I can make an Qwidget full screen and get it's size but I am unable to get the <br>QGraphicsview to become full screen. The best I have managed is 3/4 size.<br>
<br>My latest example code is here:<br><br>import sys<br><br>from PyQt4 import QtCore, QtGui, QtOpenGL<br><br><br>app = QtGui.QApplication(sys.argv)<br><br>test = QtGui.QWidget()<br>test.showFullScreen()<br><br>scene = QtGui.QGraphicsScene()<br>
#scene.setBackgroundBrush(QtGui.QBrush(QtCore.Qt.blue))<br>#scene.setBackgroundBrush(QtGui.QBrush(QtCore.Qt.transparent))<br>#view1 = scene.addText("Hello, world!", QtGui.QFont("Times", 10, QtGui.QFont.Bold));<br>
<br>item1 = QtGui.QGraphicsPixmapItem()<br>item1.setPixmap(QtGui.QPixmap("<<Image file goes here>>>"))<br>scene.addItem(item1)<br><br>item2 = QtGui.QGraphicsTextItem()<br>item2.setFont(QtGui.QFont("Times", 50, QtGui.QFont.Bold))<br>
item2.setPlainText("Hello, world!")#, ;<br>scene.addItem(item2)<br><br>view = QtGui.QGraphicsView(scene, test)<br>view.setBackgroundBrush(QtGui.QBrush(QtCore.Qt.transparent))<br>view.setRenderHint(QtGui.QPainter.Antialiasing & QtGui.QPainter.SmoothPixmapTransform)<br>
view.setSceneRect(QtCore.QRectF(QtCore.QPointF(0, 0), QtCore.QSizeF(1280, 1024)))<br>print view.maximumViewportSize()<br>print scene.sceneRect()<br>print view.sceneRect()<br>print view.isFullScreen()<br>view.setViewport(QtOpenGL.QGLWidget())<br>
<br>#view.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)<br>#view.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)<br>view.setViewportUpdateMode(QtGui.QGraphicsView.FullViewportUpdate)<br>view.setFrameStyle(0);<br>
view.showFullScreen()<br>print view.isFullScreen()<br><br>sys.exit(app.exec_())<br><br><br>Also does anyone know why the <b>view.setSceneRect </b>is required to see the TextItem over the image.<br><br>Many Thanks <br clear="all">
<br>-- <br>Tim and Alison Bentley<br>Home@TRARBentley.net<br>
<img style="border: medium none ; position: absolute; z-index: 2147483647; opacity: 0.6; display: none;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADsElEQVR4nK2VTW9VVRSGn33OPgWpYLARbKWhQlCHTogoSkjEkQwclEQcNJEwlfgD/AM6NBo1xjhx5LyJ0cYEDHGkJqhtBGKUpm3SFii3vb2956wPB/t+9raEgSs52fuus89613rftdcNH8/c9q9++oe/Vzb5P+3McyNcfm2CcPj9af9w6gwjTwzvethx3Bx3x8xwd1wNM8dMcTNUHTfFLPnX6nVmZpeIYwf3cWD/PhbrvlPkblAzVFurKS6GmmGqqComaS+qmBoTI0Ncu3mXuGvWnrJ+ZSxweDgnkHf8ndVTdbiT3M7cQp2Z31dRTecHAfqydp4ejhwazh6Zezfnu98E1WIQwB3crEuJ2Y45PBTAQUVR9X4At66AppoEVO1Q8sgAOKJJjw6Am6OquDmvHskZ3R87gW+vlHz98zpmiqphkkRVbQtsfPTOC30lJKFbFTgp83bWh7Zx/uX1B6w3hI3NkkZTqEpBRDBRzG2AQHcwcYwEkOGkTERREbLQ/8HxJwuW7zdYrzfZ2iopy4qqEspKaDYravVm33k1R91Q69FA1VBRzFIVvXbx5AgXT44A8MWP81yfu0utIR2aVK3vfCnGrcUNxp8a7gKYKiLCvY2SUvo/aNtnM3e49ucK9S3p0aDdaT0UAVsKi2tVi6IWwNL9JvdqTdihaz79/l+u/rHMxmaJVMLkS2OoKKLWacdeE3IsSxctc2D5Qcl6vUlVVgNt+fkPPcFFmTw1xruvT7SCd7nuVhDQvECzJH90h0azRKoKFRkAmP5lKTWAGRdefoZL554FQNUxB92WvYeA5UN4PtSqwB2phKqsqMpBgAunRhFR3j49zuU3jnX8k6fHEQKXzh1jbmGDuYU6s4t1rt6socUeLLZHhYO2AHSHmzt19ihTZ48O8Hzl/AmunD/BjTvrvPfNX3hWsNpwJCvwYm+ngug4UilSCSq6k8YP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