當前位置: 首頁>>代碼示例>>Python>>正文


Python QtGui.QMenuBar方法代碼示例

本文整理匯總了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) 
開發者ID:reza-arjmandi,項目名稱:rpi-course,代碼行數:24,代碼來源:gui_switch.py

示例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) 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:31,代碼來源:calculatorWinUI.py

示例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) 
開發者ID:diego0020,項目名稱:tutorial-vtk-pyqt,代碼行數:51,代碼來源:glyph_ui.py


注:本文中的PyQt4.QtGui.QMenuBar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。