I am trying to create a GraphicView() window to open in "maximized" state in order to fill the entire screen. But I didn't find so far any clue in PyQtGraph's documentation on how to do it
I managed to use resize(1420,820) to get it to work on my screen but I was wondering it was possible to use a keyword e.g. "maximized" to do it on any screen size.
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
app = QtGui.QApplication([])
view = pg.GraphicsView()
layout = pg.GraphicsLayout()
view.setCentralItem(layout)
view.resize(1420,820)
view.show()
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
I am using Python on Windows 7.
This is a Qt question, not specific to PyQtGraph. See:
Thanks to Luke's answer, here is the working code:
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
app = QtGui.QApplication([])
view = pg.GraphicsView()
layout = pg.GraphicsLayout()
view.setCentralItem(layout)
view.showMaximized()
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With