5

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.

jmb_louis
  • 1,055
  • 2
  • 13
  • 15

2 Answers2

4

This is a Qt question, not specific to PyQtGraph. See:

jesterjunk
  • 2,342
  • 22
  • 18
Luke
  • 11,374
  • 2
  • 48
  • 61
4

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_()
jmb_louis
  • 1,055
  • 2
  • 13
  • 15