当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QPushButton方法代码示例

本文整理汇总了Python中pyqtgraph.Qt.QtGui.QPushButton方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QPushButton方法的具体用法?Python QtGui.QPushButton怎么用?Python QtGui.QPushButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqtgraph.Qt.QtGui的用法示例。


在下文中一共展示了QtGui.QPushButton方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: config_dialog

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def config_dialog(self):
        self.config = True
        win = QtGui.QDialog()

        layout = QtGui.QVBoxLayout()

        keys = self.cc.keys()
        keys.sort()

        for cc in keys:
            label = "CC " + str(cc)
            button = QtGui.QPushButton(label)
            func = lambda cc=cc: self.midi.send_cc(0, cc, random.randint(0, 127))
            button.pressed.connect(func)
            layout.addWidget(button)

        finishButton = QtGui.QPushButton('Finished')
        layout.addWidget(finishButton)
        finishButton.clicked.connect(win.accept)

        win.setLayout(layout)

        win.exec_()
        self.config = False 
开发者ID:strfry,项目名称:OpenNFB,代码行数:26,代码来源:midicontrol.py

示例2: initUIControls

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def initUIControls(self):
        self.uiConrolsWidget = QtGui.QWidget()
        buttonBarWidgetLayout = QtGui.QHBoxLayout(spacing=0)
        buttonBarWidgetLayout.setContentsMargins(0, 0, 0, 0)
        buttonBarWidgetLayout.setSpacing(0)
        self.uiConrolsWidget.setLayout(buttonBarWidgetLayout)
        
        def addButton(label, widget=None, function=None):
            button = QtGui.QPushButton(label)
            if function is None:
                button.clicked.connect(lambda: widget.setVisible(widget.isHidden()))
            else:
                button.clicked.connect(function)
            button.setStyleSheet('QPushButton {'
                                 'border-color: black;'
                                 'border-width: 5px;}')
            buttonBarWidgetLayout.addWidget(button)
            return button

        addButton('Info', function=self.toggleInfoViews)
        self.toggleSeparationButton = addButton(self.separationOnIconString, function=self.toggleSeparation)
        self.playPauseButton = addButton(self.playIconString, function=self.togglePlay) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:24,代码来源:gccNMFInterface.py

示例3: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Form()
        self.cw = QtGui.QWidget()
        self.setCentralWidget(self.cw)
        self.ui.setupUi(self.cw)

        self.codeBtn = QtGui.QPushButton('Run Edited Code')
        self.codeLayout = QtGui.QGridLayout()
        self.ui.codeView.setLayout(self.codeLayout)
        self.codeLayout.addItem(QtGui.QSpacerItem(100,100,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding), 0, 0)
        self.codeLayout.addWidget(self.codeBtn, 1, 1)
        self.codeBtn.hide()

        global examples
        self.itemCache = []
        self.populateTree(self.ui.exampleTree.invisibleRootItem(), examples)
        self.ui.exampleTree.expandAll()

        self.resize(1000,500)
        self.show()
        self.ui.splitter.setSizes([250,750])
        self.ui.loadBtn.clicked.connect(self.loadFile)
        self.ui.exampleTree.currentItemChanged.connect(self.showFile)
        self.ui.exampleTree.itemDoubleClicked.connect(self.loadFile)
        self.ui.codeView.textChanged.connect(self.codeEdited)
        self.codeBtn.clicked.connect(self.runEditedCode) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:29,代码来源:__main__.py

示例4: callback_properties_changed

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def callback_properties_changed(self, *args, **kwargs):
        self.curve.opts['symbol'] = self.mkr.marker
        self.curve.opts['pen'] = self.btn.color()
        try:
            self.curve.opts['symbolSize'] = int(self.ln.text())
            print('set size finished to ', self.curve.opts['symbolSize'])
        except:
            d = QtGui.QDialog('Input Error')
            b1 = QtGui.QPushButton("ok",d)
            d.setWindowModality(QtCore.Qt.ApplicationModal)
            d.exec_()
        # update graph and items in plot list pane
        self.sigCurveChanged.emit(True) 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:15,代码来源:widgets.py

示例5: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def __init__(self, params_data, changed_params_data, *args, **kwargs):
        self.params_data = params_data
        self.params_data_show = list(self.params_data.keys())
        self.changed_params_data = changed_params_data
        super().__init__(*args, **kwargs)
        self.resize(QtCore.QSize(500,500))
        self.params_table = QtGui.QTableWidget()
        self.choose_item_lineEdit = QtGui.QLineEdit(self)
        self.choose_item_lineEdit.setPlaceholderText('filter by data name')
        self.choose_item_lineEdit.textChanged.connect(self.callback_filter)
        self.btn_changed_filter = QtGui.QPushButton('Changed')
        self.btn_changed_filter.clicked.connect(self.btn_changed_filter_clicked) 
        w = QtGui.QWidget()
        self.vlayout = QtGui.QVBoxLayout(w)
        self.hlayout = QtGui.QHBoxLayout(self)
        self.setCentralWidget(w)
        self.centralWidget().setLayout(self.vlayout)
        self.vlayout.addWidget(self.params_table)
        self.vlayout.addLayout(self.hlayout)
        self.hlayout.addWidget(self.btn_changed_filter)
        self.hlayout.addWidget(self.choose_item_lineEdit)
        self.params_table.setEditTriggers(QtGui.QAbstractItemView.DoubleClicked | 
                                                     QtGui.QAbstractItemView.SelectedClicked)
        self.params_table.setSortingEnabled(False)
        self.params_table.horizontalHeader().setStretchLastSection(True)
        self.params_table.resizeColumnsToContents()
        self.params_table.setColumnCount(2)
        self.params_table.setColumnWidth(0, 120)
        self.params_table.setColumnWidth(1, 50)
        self.params_table.setHorizontalHeaderLabels(['Name', 'value'])
        self.show_all_params = True
        self.filtertext = ''
        self.update_table() 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:35,代码来源:widgets.py

示例6: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def __init__(self, inLblToolTip, parent=None):
        super(QtGui.QPushButton, self).__init__(parent)
        self.lblToolTip = inLblToolTip 
开发者ID:Florian455,项目名称:Astibot,代码行数:5,代码来源:UIWidgets.py

示例7: set_buttons

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QPushButton [as 别名]
def set_buttons(self):
    self.button_layout = QtGui.QHBoxLayout()
    self.prev_button = QtGui.QPushButton('Previous Event')
    self.next_button = QtGui.QPushButton('Next Event')
    # self.catalog_button = QtGui.QPushButton("Save Catalog")
    self.next_button.clicked.connect(self.next_event)
    self.prev_button.clicked.connect(self.prev_event)
    # self.catalog_button.clicked.connect(self.save_catalog)

    self.button_layout.addWidget(self.prev_button)
    self.button_layout.addWidget(self.next_button)
    # self.button_layout.addWidget(self.catalog_button)

    self.layout.addLayout(self.button_layout) 
开发者ID:tperol,项目名称:ConvNetQuake,代码行数:16,代码来源:label_events.py


注:本文中的pyqtgraph.Qt.QtGui.QPushButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。