本文整理匯總了Python中qtpy.QtWidgets.QFrame.setFrameStyle方法的典型用法代碼示例。如果您正苦於以下問題:Python QFrame.setFrameStyle方法的具體用法?Python QFrame.setFrameStyle怎麽用?Python QFrame.setFrameStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtpy.QtWidgets.QFrame
的用法示例。
在下文中一共展示了QFrame.setFrameStyle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup_toolbar
# 需要導入模塊: from qtpy.QtWidgets import QFrame [as 別名]
# 或者: from qtpy.QtWidgets.QFrame import setFrameStyle [as 別名]
def setup_toolbar(self):
"""Setup the toolbar"""
savefig_btn = create_toolbutton(
self, icon=ima.icon('filesave'),
tip=_("Save Image As..."),
triggered=self.save_figure)
saveall_btn = create_toolbutton(
self, icon=ima.icon('save_all'),
tip=_("Save All Images..."),
triggered=self.save_all_figures)
copyfig_btn = create_toolbutton(
self, icon=ima.icon('editcopy'),
tip=_("Copy plot to clipboard as image (%s)" %
get_shortcut('plots', 'copy')),
triggered=self.copy_figure)
closefig_btn = create_toolbutton(
self, icon=ima.icon('editclear'),
tip=_("Remove image"),
triggered=self.close_figure)
closeall_btn = create_toolbutton(
self, icon=ima.icon('filecloseall'),
tip=_("Remove all images from the explorer"),
triggered=self.close_all_figures)
vsep1 = QFrame()
vsep1.setFrameStyle(53)
goback_btn = create_toolbutton(
self, icon=ima.icon('ArrowBack'),
tip=_("Previous Figure ({})".format(
get_shortcut('plots', 'previous figure'))),
triggered=self.go_previous_thumbnail)
gonext_btn = create_toolbutton(
self, icon=ima.icon('ArrowForward'),
tip=_("Next Figure ({})".format(
get_shortcut('plots', 'next figure'))),
triggered=self.go_next_thumbnail)
vsep2 = QFrame()
vsep2.setFrameStyle(53)
zoom_out_btn = create_toolbutton(
self, icon=ima.icon('zoom_out'),
tip=_("Zoom out (Ctrl + mouse-wheel-down)"),
triggered=self.zoom_out)
zoom_in_btn = create_toolbutton(
self, icon=ima.icon('zoom_in'),
tip=_("Zoom in (Ctrl + mouse-wheel-up)"),
triggered=self.zoom_in)
self.zoom_disp = QSpinBox()
self.zoom_disp.setAlignment(Qt.AlignCenter)
self.zoom_disp.setButtonSymbols(QSpinBox.NoButtons)
self.zoom_disp.setReadOnly(True)
self.zoom_disp.setSuffix(' %')
self.zoom_disp.setRange(0, 9999)
self.zoom_disp.setValue(100)
self.figviewer.sig_zoom_changed.connect(self.zoom_disp.setValue)
zoom_pan = QWidget()
layout = QHBoxLayout(zoom_pan)
layout.setSpacing(0)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(zoom_out_btn)
layout.addWidget(zoom_in_btn)
layout.addWidget(self.zoom_disp)
return [savefig_btn, saveall_btn, copyfig_btn, closefig_btn,
closeall_btn, vsep1, goback_btn, gonext_btn, vsep2, zoom_pan]