Mr_S_J_Childerley | 2021-01-06 18:58:45 UTC | #1
I've used QTabWidget successfully on windows 10 in the past without an issue. However using on a mac running macOS 11.0.1 I am seeing the text of the selected tab, when it has focus, being blanked out.
The tab text (gets unblanked) only appears when the tab looses focus:
I suspect there is perhaps a style setting to fix this. However I would have expected the default to do sensible things.
Any ideas?
Version data as follows:
PYQT_VERSION = 329986
PYQT_VERSION_STR = 5.9.2
QOpenGLVersionProfile =
martin | 2021-01-06 20:17:47 UTC | #2
Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.
Hey there! I've made a little test application and ran it on macOS 10.15 (Catalina) and the tabs appear to be working correctly there.
from PyQt5.QtWidgets import QTabWidget, QApplication, QWidget
app = QApplication([])
tab = QTabWidget()
w = QWidget()
tab.addTab(w, 'Hello')
w = QWidget()
tab.addTab(w, 'Test')
w = QWidget()
tab.addTab(w, 'Another')
tab.show()
app.exec_()
...which shows the following (tested dark mode also) --
Can you try this test to rule out any issues specific to your application? If this example doesn't work I can try upgrading one of my machines to 11.0 myself. Or perhaps you can try PyQt5 5.15.2 (latest) ?
Mr_S_J_Childerley | 2021-01-06 21:01:50 UTC | #3
Thanks Martin, with your example I got the same. I'll try/attempt the upgrade to PyQt5 5.15.2
Appreciated.
Mr_S_J_Childerley | 2021-01-06 21:28:25 UTC | #4
Slightly against my better judgement I pip installed PyQt5 5.15.2 into the failing conda environment. Which fixed the issue. Not intending to make an installable version for a while, when I might regret this!
martin | 2021-01-07 08:12:06 UTC | #5
Ah great, glad that's fixed it -- I wasn't looking forward to upgrading my mac! :slight_smile:
I've leave a note that you've done this in your requirements.txt
/ docs or similar, so you don't forget when you come to build. Easy to lose hours on forgotten quick fixes!
PyQt6 Crash Course — a new tutorial in your Inbox every day
Beginner-focused crash course explaining the basics with hands-on examples.