Hi, I'm getting the following issue on OSX 10.10 and 10.11, but not on 10.12.
I have a legacy application that uses PyQt4 and PyQtGraph.
If I have a second/external monitor attached to the Mac, as well as using the integrated monitor of the Mac itself, the widgets on the application disappear from view when the application is moved into the second screen (they are replaced by a blank area in the layout).
It's easy enough to restore the widgets, by just clicking on any other application that happens to be open, e.g. Finder, browser. I guess this forces a repaint.
It seems to affect only PyQt widgets: PyQtGraph widgets in the application don't disappear from view.
Below is a small example that exhibits this behaviour.
(It may be necessary to move the application right to the edge of the second screen, or to move it back to the first screen, in order to see the behaviour.)
Note that this example does not even use PyQtGraph. But when pyqtgraph is imported, the behaviour occurs. When the import is commented out, it doesn't.
It may well be a purely PyQt issue, but it's only triggered by the use of pyqtgraph. Any suggestions would be great...!
import sys
from PyQt4 import QtGui
import pyqtgraph as pg # Activate this line to break it
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
central_widget = QtGui.QWidget()
central_layout = QtGui.QGridLayout(central_widget)
self.setCentralWidget(central_widget)
central_layout.addWidget(QtGui.QLabel('BROKEN'), 0, 0, 1, 1)
def main():
app = QtGui.QApplication(sys.argv)
win = MainWindow()
win.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()