本文整理汇总了Python中matplotlibwidget.MatplotlibWidget.setContextMenuPolicy方法的典型用法代码示例。如果您正苦于以下问题:Python MatplotlibWidget.setContextMenuPolicy方法的具体用法?Python MatplotlibWidget.setContextMenuPolicy怎么用?Python MatplotlibWidget.setContextMenuPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlibwidget.MatplotlibWidget
的用法示例。
在下文中一共展示了MatplotlibWidget.setContextMenuPolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_MainWindow
# 需要导入模块: from matplotlibwidget import MatplotlibWidget [as 别名]
# 或者: from matplotlibwidget.MatplotlibWidget import setContextMenuPolicy [as 别名]
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(883, 616)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.tabWidget = QtGui.QTabWidget(self.centralwidget)
self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
self.chartTab = QtGui.QWidget()
self.chartTab.setObjectName(_fromUtf8("chartTab"))
self.verticalLayout_3 = QtGui.QVBoxLayout(self.chartTab)
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.oneDayToolButton = QtGui.QToolButton(self.chartTab)
self.oneDayToolButton.setCheckable(True)
self.oneDayToolButton.setObjectName(_fromUtf8("oneDayToolButton"))
self.buttonGroup = QtGui.QButtonGroup(MainWindow)
self.buttonGroup.setObjectName(_fromUtf8("buttonGroup"))
self.buttonGroup.addButton(self.oneDayToolButton)
self.horizontalLayout_2.addWidget(self.oneDayToolButton)
self.fiveDayToolButton = QtGui.QToolButton(self.chartTab)
self.fiveDayToolButton.setCheckable(True)
self.fiveDayToolButton.setObjectName(_fromUtf8("fiveDayToolButton"))
self.buttonGroup.addButton(self.fiveDayToolButton)
self.horizontalLayout_2.addWidget(self.fiveDayToolButton)
self.oneMonthToolButton = QtGui.QToolButton(self.chartTab)
self.oneMonthToolButton.setCheckable(True)
self.oneMonthToolButton.setObjectName(_fromUtf8("oneMonthToolButton"))
self.buttonGroup.addButton(self.oneMonthToolButton)
self.horizontalLayout_2.addWidget(self.oneMonthToolButton)
self.threeMonthToolButton = QtGui.QToolButton(self.chartTab)
self.threeMonthToolButton.setCheckable(True)
self.threeMonthToolButton.setObjectName(_fromUtf8("threeMonthToolButton"))
self.buttonGroup.addButton(self.threeMonthToolButton)
self.horizontalLayout_2.addWidget(self.threeMonthToolButton)
self.sixMonthToolButton = QtGui.QToolButton(self.chartTab)
self.sixMonthToolButton.setCheckable(True)
self.sixMonthToolButton.setObjectName(_fromUtf8("sixMonthToolButton"))
self.buttonGroup.addButton(self.sixMonthToolButton)
self.horizontalLayout_2.addWidget(self.sixMonthToolButton)
self.oneYearToolButton = QtGui.QToolButton(self.chartTab)
self.oneYearToolButton.setCheckable(True)
self.oneYearToolButton.setObjectName(_fromUtf8("oneYearToolButton"))
self.buttonGroup.addButton(self.oneYearToolButton)
self.horizontalLayout_2.addWidget(self.oneYearToolButton)
self.twoYearToolButton = QtGui.QToolButton(self.chartTab)
self.twoYearToolButton.setCheckable(True)
self.twoYearToolButton.setObjectName(_fromUtf8("twoYearToolButton"))
self.buttonGroup.addButton(self.twoYearToolButton)
self.horizontalLayout_2.addWidget(self.twoYearToolButton)
self.fiveYearToolButton = QtGui.QToolButton(self.chartTab)
self.fiveYearToolButton.setCheckable(True)
self.fiveYearToolButton.setObjectName(_fromUtf8("fiveYearToolButton"))
self.buttonGroup.addButton(self.fiveYearToolButton)
self.horizontalLayout_2.addWidget(self.fiveYearToolButton)
self.maxToolButton = QtGui.QToolButton(self.chartTab)
self.maxToolButton.setCheckable(True)
self.maxToolButton.setChecked(True)
self.maxToolButton.setObjectName(_fromUtf8("maxToolButton"))
self.buttonGroup.addButton(self.maxToolButton)
self.horizontalLayout_2.addWidget(self.maxToolButton)
self.line_2 = QtGui.QFrame(self.chartTab)
self.line_2.setFrameShape(QtGui.QFrame.VLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName(_fromUtf8("line_2"))
self.horizontalLayout_2.addWidget(self.line_2)
self.styleToolButton = QtGui.QToolButton(self.chartTab)
self.styleToolButton.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.styleToolButton.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.styleToolButton.setPopupMode(QtGui.QToolButton.InstantPopup)
self.styleToolButton.setArrowType(QtCore.Qt.NoArrow)
self.styleToolButton.setObjectName(_fromUtf8("styleToolButton"))
self.horizontalLayout_2.addWidget(self.styleToolButton)
self.line_3 = QtGui.QFrame(self.chartTab)
self.line_3.setFrameShape(QtGui.QFrame.VLine)
self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
self.line_3.setObjectName(_fromUtf8("line_3"))
self.horizontalLayout_2.addWidget(self.line_3)
self.indicatorToolButton = QtGui.QToolButton(self.chartTab)
self.indicatorToolButton.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.indicatorToolButton.setPopupMode(QtGui.QToolButton.InstantPopup)
self.indicatorToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
self.indicatorToolButton.setObjectName(_fromUtf8("indicatorToolButton"))
self.horizontalLayout_2.addWidget(self.indicatorToolButton)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.loadQuoteButton = QtGui.QPushButton(self.chartTab)
self.loadQuoteButton.setObjectName(_fromUtf8("loadQuoteButton"))
self.horizontalLayout_2.addWidget(self.loadQuoteButton)
self.pushButton = QtGui.QPushButton(self.chartTab)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.horizontalLayout_2.addWidget(self.pushButton)
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
self.matplotlibWidget = MatplotlibWidget(self.chartTab)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
#.........这里部分代码省略.........