本文整理汇总了Python中PyQt4.QtGui.QMenuBar方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QMenuBar方法的具体用法?Python QtGui.QMenuBar怎么用?Python QtGui.QMenuBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QMenuBar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QMenuBar [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(400, 240)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.checkBox = QtGui.QCheckBox(self.centralwidget)
self.checkBox.setGeometry(QtCore.QRect(130, 80, 151, 41))
font = QtGui.QFont()
font.setPointSize(32)
self.checkBox.setFont(font)
self.checkBox.setObjectName(_fromUtf8("checkBox"))
#MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 400, 21))
self.menubar.setObjectName(_fromUtf8("menubar"))
#MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
#MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
示例2: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QMenuBar [as 别名]
def setupUi(self, CalculatorWindow):
CalculatorWindow.setObjectName(_fromUtf8("CalculatorWindow"))
CalculatorWindow.resize(450, 140)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(CalculatorWindow.sizePolicy().hasHeightForWidth())
CalculatorWindow.setSizePolicy(sizePolicy)
CalculatorWindow.setMinimumSize(QtCore.QSize(0, 140))
CalculatorWindow.setMaximumSize(QtCore.QSize(16777215, 140))
self.centralwidget = QtGui.QWidget(CalculatorWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
CalculatorWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(CalculatorWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 450, 22))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menuFile = QtGui.QMenu(self.menubar)
self.menuFile.setObjectName(_fromUtf8("menuFile"))
CalculatorWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(CalculatorWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
CalculatorWindow.setStatusBar(self.statusbar)
self.actionClear = QtGui.QAction(CalculatorWindow)
self.actionClear.setObjectName(_fromUtf8("actionClear"))
self.menuFile.addAction(self.actionClear)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(CalculatorWindow)
QtCore.QMetaObject.connectSlotsByName(CalculatorWindow)
示例3: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QMenuBar [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.splitter = QtGui.QSplitter(self.centralwidget)
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter.setObjectName(_fromUtf8("splitter"))
self.frame = QtGui.QFrame(self.splitter)
self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
self.frame.setFrameShadow(QtGui.QFrame.Raised)
self.frame.setObjectName(_fromUtf8("frame"))
self.verticalLayout = QtGui.QVBoxLayout(self.frame)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(self.frame)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label)
self.threshold_slider = QtGui.QSlider(self.frame)
self.threshold_slider.setOrientation(QtCore.Qt.Horizontal)
self.threshold_slider.setObjectName(_fromUtf8("threshold_slider"))
self.verticalLayout.addWidget(self.threshold_slider)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.label_2 = QtGui.QLabel(self.frame)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout.addWidget(self.label_2)
self.vector_size = QtGui.QLabel(self.frame)
self.vector_size.setFrameShape(QtGui.QFrame.StyledPanel)
self.vector_size.setFrameShadow(QtGui.QFrame.Sunken)
self.vector_size.setObjectName(_fromUtf8("vector_size"))
self.verticalLayout.addWidget(self.vector_size)
self.vtk_panel = QtGui.QFrame(self.splitter)
self.vtk_panel.setFrameShape(QtGui.QFrame.StyledPanel)
self.vtk_panel.setFrameShadow(QtGui.QFrame.Raised)
self.vtk_panel.setObjectName(_fromUtf8("vtk_panel"))
self.horizontalLayout.addWidget(self.splitter)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 27))
self.menubar.setObjectName(_fromUtf8("menubar"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)