0
需要設置什麼QGroupBox屬性來隱藏其邊框?Python:如何使QGroupBox無邊界
from PyQt4 import QtGui, QtCore
import sys, os
class Dialog_01(QtGui.QMainWindow):
def __init__(self):
super(QtGui.QMainWindow,self).__init__()
mainWidget=QtGui.QWidget()
self.setCentralWidget(mainWidget)
mainLayout = QtGui.QVBoxLayout()
mainWidget.setLayout(mainLayout)
tabWidget = QtGui.QTabWidget()
mainLayout.addWidget(tabWidget)
WidgetA = QtGui.QWidget()
LayoutA = QtGui.QVBoxLayout()
WidgetA.setLayout(LayoutA)
GroupBox1 = QtGui.QGroupBox('Goupbox 1')
Layout1 = QtGui.QHBoxLayout()
GroupBox1.setLayout(Layout1)
LayoutA.addWidget(GroupBox1)
GroupBox2 = QtGui.QGroupBox('Goupbox 2')
Layout2 = QtGui.QHBoxLayout()
GroupBox2.setLayout(Layout2)
Layout1.addWidget(GroupBox2)
GroupBox3 = QtGui.QGroupBox('Goupbox 3')
Layout3 = QtGui.QHBoxLayout()
GroupBox3.setLayout(Layout3)
Layout2.addWidget(GroupBox3)
tabWidget.addTab(WidgetA,'A')
tabWidget.addTab(QtGui.QWidget(),'B')
tabWidget.addTab(QtGui.QWidget(),'C')
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
dialog_1 = Dialog_01()
dialog_1.show()
dialog_1.resize(480,320)
sys.exit(app.exec_())
setFlat(True)很棒!謝謝! – alphanumeric