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


Python QtWidgets.QToolBar方法代碼示例

本文整理匯總了Python中PySide2.QtWidgets.QToolBar方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QToolBar方法的具體用法?Python QtWidgets.QToolBar怎麽用?Python QtWidgets.QToolBar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PySide2.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QToolBar方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: qtoolbar

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QToolBar [as 別名]
def qtoolbar(self):
        if self._cached is not None:
            return self._cached

        toolbar = QToolBar(self.name, self.window)

        for action in self.actions:
            if action in self._cached_actions:
                act = self._cached_actions[action]
            else:
                act = self._translate_element(toolbar, action)
                if act is not None:
                    self._cached_actions[action] = act

        toolbar.setIconSize(QSize(16, 16))

        self._cached = toolbar
        return toolbar 
開發者ID:angr,項目名稱:angr-management,代碼行數:20,代碼來源:toolbar.py

示例2: CreateToolBars

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QToolBar [as 別名]
def CreateToolBars(self):
        self.mainToolBar = self.addToolBar('Main')
        #Main action bar
        self.mainToolBar.addAction(self.openAction)
        self.mainToolBar.addAction(self.saveAction)
        self.mainToolBar.addAction(self.saveAsAction)
        self.mainToolBar.addSeparator()
        self.mainToolBar.addAction(self.selectAction)
        self.mainToolBar.addAction(self.addAction)
        self.mainToolBar.addAction(self.addBondAction)
        self.mainToolBar.addAction(self.replaceAction)
        self.mainToolBar.addAction(self.rsAction)
        self.mainToolBar.addAction(self.ezAction)
        self.mainToolBar.addAction(self.increaseChargeAction)
        self.mainToolBar.addAction(self.decreaseChargeAction)
        self.mainToolBar.addSeparator()
        self.mainToolBar.addAction(self.cleanCoordinatesAction)

        self.mainToolBar.addSeparator()
        self.mainToolBar.addAction(self.removeAction)
        self.mainToolBar.addAction(self.clearCanvasAction)
        #Bond types TODO are they necessary as can be toggled??
        self.mainToolBar.addSeparator()
        self.mainToolBar.addAction(self.undoAction)
        #Side Toolbar
        self.sideToolBar = QtWidgets.QToolBar(self)
        self.addToolBar(QtCore.Qt.LeftToolBarArea, self.sideToolBar)
        self.sideToolBar.addAction(self.singleBondAction)
        self.sideToolBar.addAction(self.doubleBondAction)
        self.sideToolBar.addAction(self.tripleBondAction)
        self.sideToolBar.addSeparator()
        for action in self.atomActions:
            self.sideToolBar.addAction(action)
        self.sideToolBar.addAction(self.openPtableAction) 
開發者ID:EBjerrum,項目名稱:rdeditor,代碼行數:36,代碼來源:rdEditor.py

示例3: __init__

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QToolBar [as 別名]
def __init__(self, window, name):
        self.window = window
        self.name = name

        self.actions = []
        self._cached = None  # type: QToolBar
        self._cached_actions = { } 
開發者ID:angr,項目名稱:angr-management,代碼行數:9,代碼來源:toolbar.py

示例4: setupUi

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QToolBar [as 別名]
def setupUi(self, GisWindow):
        GisWindow.setObjectName("GisWindow")
        GisWindow.resize(938, 577)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icons/icons/map.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        GisWindow.setWindowIcon(icon)
        self.centralwidget = QtWidgets.QWidget(GisWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.webFrame = QtWidgets.QFrame(self.centralwidget)
        self.webFrame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.webFrame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.webFrame.setObjectName("webFrame")
        self.verticalLayout.addWidget(self.webFrame)
        GisWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(GisWindow)
        self.statusbar.setObjectName("statusbar")
        GisWindow.setStatusBar(self.statusbar)
        self.toolBar = QtWidgets.QToolBar(GisWindow)
        self.toolBar.setMovable(False)
        self.toolBar.setFloatable(False)
        self.toolBar.setObjectName("toolBar")
        GisWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionSave_map = QtWidgets.QAction(GisWindow)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/savec.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionSave_map.setIcon(icon1)
        self.actionSave_map.setObjectName("actionSave_map")
        self.toolBar.addAction(self.actionSave_map)

        self.retranslateUi(GisWindow)
        QtCore.QMetaObject.connectSlotsByName(GisWindow) 
開發者ID:SanPen,項目名稱:GridCal,代碼行數:35,代碼來源:gui.py

示例5: setupUi

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QToolBar [as 別名]
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.splitter = QtWidgets.QSplitter(self.centralwidget)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setHandleWidth(2)
        self.splitter.setObjectName("splitter")
        self.treeWidget = QtWidgets.QTreeWidget(self.splitter)
        self.treeWidget.setObjectName("treeWidget")
        self.treeWidget.headerItem().setText(0, "1")
        self.treeWidget.header().setVisible(False)
        self.tabWidget = QtWidgets.QTabWidget(self.splitter)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
        self.tabWidget.setSizePolicy(sizePolicy)
        self.tabWidget.setDocumentMode(True)
        self.tabWidget.setTabsClosable(True)
        self.tabWidget.setMovable(True)
        self.tabWidget.setObjectName("tabWidget")
        self.verticalLayout.addWidget(self.splitter)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar()
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtWidgets.QToolBar(MainWindow)
        self.toolBar.setIconSize(QtCore.QSize(18, 18))
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionOpenFile = QtWidgets.QAction(MainWindow)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionOpenFile.setIcon(icon)
        self.actionOpenFile.setObjectName("actionOpenFile")
        self.actionCompareFiles = QtWidgets.QAction(MainWindow)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionCompareFiles.setIcon(icon1)
        self.actionCompareFiles.setObjectName("actionCompareFiles")
        self.menuFile.addAction(self.actionOpenFile)
        self.menuFile.addAction(self.actionCompareFiles)
        self.menubar.addAction(self.menuFile.menuAction())
        self.toolBar.addAction(self.actionOpenFile)
        self.toolBar.addAction(self.actionCompareFiles)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
開發者ID:yukiarrr,項目名稱:Il2cppSpy,代碼行數:62,代碼來源:ui_mainwindow.py


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