How to make the background color the same as the form background?
问题 In PyQt5 I'm getting some unexpected behavior from QTabWidget, the background seems to be white instead of the default form color (roughly light gray). Here is an example: # QTabWidget2.py from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QHBoxLayout, QVBoxLayout, QTabWidget, \ QGraphicsView, QFrame, QGridLayout from PyQt5.QtGui import QPalette from PyQt5.Qt import Qt def main(): app = QApplication([]) mainForm = MainForm() mainForm.show() app.exec() # end main class