本文整理汇总了Python中PyQt4.Qt.QToolButton.setWhatsThis方法的典型用法代码示例。如果您正苦于以下问题:Python QToolButton.setWhatsThis方法的具体用法?Python QToolButton.setWhatsThis怎么用?Python QToolButton.setWhatsThis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QToolButton
的用法示例。
在下文中一共展示了QToolButton.setWhatsThis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MetadataSingleDialogBase
# 需要导入模块: from PyQt4.Qt import QToolButton [as 别名]
# 或者: from PyQt4.Qt.QToolButton import setWhatsThis [as 别名]
class MetadataSingleDialogBase(ResizableDialog):
view_format = pyqtSignal(object, object)
cc_two_column = tweaks['metadata_single_use_2_cols_for_custom_fields']
one_line_comments_toolbar = False
use_toolbutton_for_config_metadata = True
def __init__(self, db, parent=None):
self.db = db
self.changed = set()
self.books_to_refresh = set()
self.rows_to_refresh = set()
ResizableDialog.__init__(self, parent)
def setupUi(self, *args): # {{{
self.resize(990, 670)
self.download_shortcut = QShortcut(self)
self.download_shortcut.setKey(QKeySequence('Ctrl+D',
QKeySequence.PortableText))
p = self.parent()
if hasattr(p, 'keyboard'):
kname = u'Interface Action: Edit Metadata (Edit Metadata) : menu action : download'
sc = p.keyboard.keys_map.get(kname, None)
if sc:
self.download_shortcut.setKey(sc[0])
self.button_box = bb = QDialogButtonBox(self)
self.button_box.accepted.connect(self.accept)
self.button_box.rejected.connect(self.reject)
self.next_button = QPushButton(QIcon(I('forward.png')), _('Next'),
self)
self.next_button.setShortcut(QKeySequence('Alt+Right'))
self.next_button.clicked.connect(self.next_clicked)
self.prev_button = QPushButton(QIcon(I('back.png')), _('Previous'),
self)
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
self.button_box.addButton(self.prev_button, bb.ActionRole)
self.button_box.addButton(self.next_button, bb.ActionRole)
self.prev_button.clicked.connect(self.prev_clicked)
bb.setStandardButtons(bb.Ok|bb.Cancel)
bb.button(bb.Ok).setDefault(True)
self.scroll_area = QScrollArea(self)
self.scroll_area.setFrameShape(QScrollArea.NoFrame)
self.scroll_area.setWidgetResizable(True)
self.central_widget = QTabWidget(self)
self.scroll_area.setWidget(self.central_widget)
self.l = QVBoxLayout(self)
self.setLayout(self.l)
self.l.addWidget(self.scroll_area)
ll = self.button_box_layout = QHBoxLayout()
self.l.addLayout(ll)
ll.addSpacing(10)
ll.addWidget(self.button_box)
self.setWindowIcon(QIcon(I('edit_input.png')))
self.setWindowTitle(BASE_TITLE)
self.create_basic_metadata_widgets()
if len(self.db.custom_column_label_map):
self.create_custom_metadata_widgets()
self.do_layout()
geom = gprefs.get('metasingle_window_geometry3', None)
if geom is not None:
self.restoreGeometry(bytes(geom))
# }}}
def create_basic_metadata_widgets(self): # {{{
self.basic_metadata_widgets = []
self.languages = LanguagesEdit(self)
self.basic_metadata_widgets.append(self.languages)
self.title = TitleEdit(self)
self.title.textChanged.connect(self.update_window_title)
self.deduce_title_sort_button = QToolButton(self)
self.deduce_title_sort_button.setToolTip(
_('Automatically create the title sort entry based on the current '
'title entry.\nUsing this button to create title sort will '
'change title sort from red to green.'))
self.deduce_title_sort_button.setWhatsThis(
self.deduce_title_sort_button.toolTip())
self.title_sort = TitleSortEdit(self, self.title,
self.deduce_title_sort_button, self.languages)
self.basic_metadata_widgets.extend([self.title, self.title_sort])
self.deduce_author_sort_button = b = QToolButton(self)
b.setToolTip('<p>' +
_('Automatically create the author sort entry based on the current '
'author entry. Using this button to create author sort will '
'change author sort from red to green. There is a menu of '
'functions available under this button. Click and hold '
'on the button to see it.') + '</p>')
b.m = m = QMenu()
ac = m.addAction(QIcon(I('forward.png')), _('Set author sort from author'))
#.........这里部分代码省略.........
示例2: PM_Dialog
# 需要导入模块: from PyQt4.Qt import QToolButton [as 别名]
# 或者: from PyQt4.Qt.QToolButton import setWhatsThis [as 别名]
#.........这里部分代码省略.........
return
self.headerIcon.setPixmap(getpixmap(iconPath))
def _createSponsorButton(self):
"""
Creates the Property Manager sponsor button, which contains
a QPushButton inside of a QGridLayout inside of a QFrame.
The sponsor logo image is not loaded here.
"""
# Sponsor button (inside a frame)
self.sponsorButtonContainer = QWidget(self)
SponsorFrameGrid = QGridLayout(self.sponsorButtonContainer)
SponsorFrameGrid.setMargin(PM_SPONSOR_FRAME_MARGIN)
SponsorFrameGrid.setSpacing(PM_SPONSOR_FRAME_SPACING) # Has no effect.
self.sponsor_btn = QToolButton(self.sponsorButtonContainer)
self.sponsor_btn.setAutoRaise(True)
self.connect(self.sponsor_btn,
SIGNAL("clicked()"),
self.open_sponsor_homepage)
SponsorFrameGrid.addWidget(self.sponsor_btn, 0, 0, 1, 1)
self.vBoxLayout.addWidget(self.sponsorButtonContainer)
button_whatsthis_widget = self.sponsor_btn
#bruce 070615 bugfix -- put tooltip & whatsthis on self.sponsor_btn,
# not self.
# [self.sponsorButtonContainer might be another possible place to put them.]
button_whatsthis_widget.setWhatsThis("""<b>Sponsor Button</b>
<p>When clicked, this sponsor logo will display a short
description about a NanoEngineer-1 sponsor. This can
be an official sponsor or credit given to a contributor
that has helped code part or all of this command.
A link is provided in the description to learn more
about this sponsor.</p>""")
button_whatsthis_widget.setToolTip("NanoEngineer-1 Sponsor Button")
return
def _createTopRowBtns(self):
"""
Creates the Done, Cancel, Preview, Restore Defaults and What's This
buttons row at the top of the Property Manager.
"""
topBtnSize = QSize(22, 22) # button images should be 16 x 16, though.
# Main "button group" widget (but it is not a QButtonGroup).
self.pmTopRowBtns = QHBoxLayout()
# This QHBoxLayout is (probably) not necessary. Try using just the frame
# for the foundation. I think it should work. Mark 2007-05-30
# Horizontal spacer
horizontalSpacer = QSpacerItem(1, 1,
QSizePolicy.Expanding,
QSizePolicy.Minimum)
# Widget containing all the buttons.
self.topRowBtnsContainer = QWidget()
# Create Hbox layout for main frame.