[PyQt] Huge text under macOS as soon as QGLWidget is used?

Elvis Stansvik elvstone at gmail.com
Sat Feb 2 20:12:15 GMT 2019


Hi all,

(This may not be PyQt-specific.)

I was debugging a problem with huge text when mixing PyQt and VTK.

Minimal test case:

import sys

from PyQt5.QtWidgets import QApplication, QMainWindow, \
        QPushButton, QVBoxLayout, QWidget
from PyQt5.QtOpenGL import QGLWidget

app = QApplication(sys.argv)

# Case 1: No QGLWidget
win1 = QMainWindow()
widget1 = QWidget()
layout1 = QVBoxLayout()
layout1.addWidget(QPushButton('Hello 1'))
widget1.setLayout(layout1)
win1.setCentralWidget(widget1)
win1.show()

# Case 2: QGLWidget
win2 = QMainWindow()
widget2 = QWidget()
layout2 = QVBoxLayout()
layout2.addWidget(QPushButton('Hello 2'))
layout2.addWidget(QGLWidget())
widget2.setLayout(layout2)
win2.setCentralWidget(widget2)
win2.show()

exit(app.exec_())

See attached screenshot for result (using latest PyQt wheel from PyPI).

How come in the second main window, the QPushButton has become huge,
just because a QGLWidget was added. Anyone know?

Many thanks in advance,
Elvis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: huge.png
Type: image/png
Size: 62773 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190202/608fc619/attachment-0001.png>


More information about the PyQt mailing list