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


Python HistoryLineEdit.setToolTip方法代码示例

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


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

示例1: Ui_TagListEditor

# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setToolTip [as 别名]
class Ui_TagListEditor(object):
    def setupUi(self, TagListEditor):
        TagListEditor.setObjectName(_fromUtf8("TagListEditor"))
        TagListEditor.resize(397, 335)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("chapters.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        TagListEditor.setWindowIcon(icon)
        self.gridlayout = QtGui.QGridLayout(TagListEditor)
        self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
        self.horizontalLayout_11 = QtGui.QHBoxLayout()
        self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11"))
        self.search_box = HistoryLineEdit(TagListEditor)
        self.search_box.setObjectName(_fromUtf8("search_box"))
        self.horizontalLayout_11.addWidget(self.search_box)
        self.search_button = QtGui.QToolButton(TagListEditor)
        self.search_button.setObjectName(_fromUtf8("search_button"))
        self.horizontalLayout_11.addWidget(self.search_button)
        self.gridlayout.addLayout(self.horizontalLayout_11, 0, 1, 1, 1)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.delete_button = QtGui.QToolButton(TagListEditor)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("trash.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.delete_button.setIcon(icon1)
        self.delete_button.setIconSize(QtCore.QSize(32, 32))
        self.delete_button.setObjectName(_fromUtf8("delete_button"))
        self.verticalLayout_2.addWidget(self.delete_button)
        self.rename_button = QtGui.QToolButton(TagListEditor)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(_fromUtf8(I("edit_input.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.rename_button.setIcon(icon2)
        self.rename_button.setIconSize(QtCore.QSize(32, 32))
        self.rename_button.setObjectName(_fromUtf8("rename_button"))
        self.verticalLayout_2.addWidget(self.rename_button)
        self.gridlayout.addLayout(self.verticalLayout_2, 1, 0, 1, 1)
        self.table = QtGui.QTableWidget(TagListEditor)
        self.table.setAlternatingRowColors(True)
        self.table.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.table.setObjectName(_fromUtf8("table"))
        self.table.setColumnCount(0)
        self.table.setRowCount(0)
        self.gridlayout.addWidget(self.table, 1, 1, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(TagListEditor)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.gridlayout.addWidget(self.buttonBox, 3, 0, 1, 2)

        self.retranslateUi(TagListEditor)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), TagListEditor.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), TagListEditor.reject)
        QtCore.QMetaObject.connectSlotsByName(TagListEditor)

    def retranslateUi(self, TagListEditor):
        TagListEditor.setWindowTitle(_("Category Editor"))
        self.search_box.setToolTip(_("Search for an item in the Tag column"))
        self.search_button.setText(_("Find"))
        self.search_button.setToolTip(_("Copy the selected color name to the clipboard"))
        self.delete_button.setToolTip(_("Delete item from database. This will unapply the item from all books and then remove it from the database."))
        self.delete_button.setText(_("..."))
        self.rename_button.setToolTip(_("Rename the item in every book where it is used."))
        self.rename_button.setText(_("..."))
        self.rename_button.setShortcut(_("Ctrl+S"))
开发者ID:Eksmo,项目名称:calibre,代码行数:67,代码来源:tag_list_editor_ui.py

示例2: TagBrowserWidget

# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setToolTip [as 别名]
class TagBrowserWidget(QWidget):  # {{{

    def __init__(self, parent):
        QWidget.__init__(self, parent)
        self.parent = parent
        self._layout = QVBoxLayout()
        self.setLayout(self._layout)
        self._layout.setContentsMargins(0,0,0,0)

        # Set up the find box & button
        search_layout = QHBoxLayout()
        self._layout.addLayout(search_layout)
        self.item_search = HistoryLineEdit(parent)
        self.item_search.setMinimumContentsLength(5)
        self.item_search.setSizeAdjustPolicy(self.item_search.AdjustToMinimumContentsLengthWithIcon)
        try:
            self.item_search.lineEdit().setPlaceholderText(
                                                _('Find item in tag browser'))
        except:
            pass             # Using Qt < 4.7
        self.item_search.setToolTip(_(
        'Search for items. This is a "contains" search; items containing the\n'
        'text anywhere in the name will be found. You can limit the search\n'
        'to particular categories using syntax similar to search. For example,\n'
        'tags:foo will find foo in any tag, but not in authors etc. Entering\n'
        '*foo will filter all categories at once, showing only those items\n'
        'containing the text "foo"'))
        search_layout.addWidget(self.item_search)
        ac = QAction(parent)
        parent.addAction(ac)
        parent.keyboard.register_shortcut('tag browser find box',
                _('Find item'), default_keys=(),
                action=ac, group=_('Tag Browser'))
        ac.triggered.connect(self.set_focus_to_find_box)

        self.search_button = QToolButton()
        self.search_button.setText(_('Find'))
        self.search_button.setToolTip(_('Find the first/next matching item'))
        search_layout.addWidget(self.search_button)
        ac = QAction(parent)
        parent.addAction(ac)
        parent.keyboard.register_shortcut('tag browser find button',
                _('Find button'), default_keys=(),
                action=ac, group=_('Tag Browser'))
        ac.triggered.connect(self.search_button.click)

        self.expand_button = QToolButton()
        self.expand_button.setText('-')
        self.expand_button.setToolTip(_('Collapse all categories'))
        search_layout.addWidget(self.expand_button)
        search_layout.setStretch(0, 10)
        search_layout.setStretch(1, 1)
        search_layout.setStretch(2, 1)
        ac = QAction(parent)
        parent.addAction(ac)
        parent.keyboard.register_shortcut('tag browser collapse all',
                _('Collapse all'), default_keys=(),
                action=ac, group=_('Tag Browser'))
        ac.triggered.connect(self.expand_button.clicked)

        self.current_find_position = None
        self.search_button.clicked.connect(self.find)
        self.item_search.initialize('tag_browser_search')
        self.item_search.lineEdit().returnPressed.connect(self.do_find)
        self.item_search.lineEdit().textEdited.connect(self.find_text_changed)
        self.item_search.activated[str].connect(self.do_find)
        self.item_search.completer().setCaseSensitivity(Qt.CaseSensitive)

        parent.tags_view = TagsView(parent)
        self.tags_view = parent.tags_view
        self.expand_button.clicked.connect(self.tags_view.collapseAll)
        self._layout.addWidget(parent.tags_view)

        # Now the floating 'not found' box
        l = QLabel(self.tags_view)
        self.not_found_label = l
        l.setFrameStyle(QFrame.StyledPanel)
        l.setAutoFillBackground(True)
        l.setText('<p><b>'+_('No More Matches.</b><p> Click Find again to go to first match'))
        l.setAlignment(Qt.AlignVCenter)
        l.setWordWrap(True)
        l.resize(l.sizeHint())
        l.move(10,20)
        l.setVisible(False)
        self.not_found_label_timer = QTimer()
        self.not_found_label_timer.setSingleShot(True)
        self.not_found_label_timer.timeout.connect(self.not_found_label_timer_event,
                                                   type=Qt.QueuedConnection)

        parent.alter_tb = l = QPushButton(parent)
        l.setText(_('Alter Tag Browser'))
        l.setIcon(QIcon(I('tags.png')))
        l.m = QMenu()
        l.setMenu(l.m)
        self._layout.addWidget(l)
        ac = QAction(parent)
        parent.addAction(ac)
        parent.keyboard.register_shortcut('tag browser alter',
                _('Alter tag browser'), default_keys=(),
                action=ac, group=_('Tag Browser'))
#.........这里部分代码省略.........
开发者ID:rlugojr,项目名称:calibre,代码行数:103,代码来源:ui.py

示例3: Ui_MetadataBulkDialog

# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setToolTip [as 别名]
class Ui_MetadataBulkDialog(object):
    def setupUi(self, MetadataBulkDialog):
        MetadataBulkDialog.setObjectName(_fromUtf8("MetadataBulkDialog"))
        MetadataBulkDialog.resize(962, 645)
        MetadataBulkDialog.setWindowTitle(_("Edit Meta information"))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("edit_input.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MetadataBulkDialog.setWindowIcon(icon)
        self.gridLayout_2 = QtGui.QGridLayout(MetadataBulkDialog)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.box_title = QtGui.QLabel(MetadataBulkDialog)
        self.box_title.setText(_fromUtf8(""))
        self.box_title.setAlignment(QtCore.Qt.AlignCenter)
        self.box_title.setObjectName(_fromUtf8("box_title"))
        self.gridLayout_2.addWidget(self.box_title, 0, 0, 1, 1)
        self.scrollArea = QtGui.QScrollArea(MetadataBulkDialog)
        self.scrollArea.setFrameShape(QtGui.QFrame.NoFrame)
        self.scrollArea.setLineWidth(0)
        self.scrollArea.setWidgetResizable(True)
        self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
        self.scrollAreaWidgetContents = QtGui.QWidget()
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 950, 576))
        self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.scrollAreaWidgetContents)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.central_widget = QtGui.QTabWidget(self.scrollAreaWidgetContents)
        self.central_widget.setObjectName(_fromUtf8("central_widget"))
        self.tabWidgetPage1 = QtGui.QWidget()
        self.tabWidgetPage1.setObjectName(_fromUtf8("tabWidgetPage1"))
        self.gridLayout = QtGui.QGridLayout(self.tabWidgetPage1)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.label_2 = QtGui.QLabel(self.tabWidgetPage1)
        self.label_2.setText(_("&Author(s): "))
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
        self.authors = EditWithComplete(self.tabWidgetPage1)
        self.authors.setEditable(True)
        self.authors.setObjectName(_fromUtf8("authors"))
        self.gridLayout.addWidget(self.authors, 0, 1, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.auto_author_sort = QtGui.QCheckBox(self.tabWidgetPage1)
        self.auto_author_sort.setText(_("A&utomatically set author sort"))
        self.auto_author_sort.setObjectName(_fromUtf8("auto_author_sort"))
        self.horizontalLayout_2.addWidget(self.auto_author_sort)
        self.swap_title_and_author = QtGui.QCheckBox(self.tabWidgetPage1)
        self.swap_title_and_author.setText(_("&Swap title and author"))
        self.swap_title_and_author.setObjectName(_fromUtf8("swap_title_and_author"))
        self.horizontalLayout_2.addWidget(self.swap_title_and_author)
        self.gridLayout.addLayout(self.horizontalLayout_2, 1, 1, 1, 1)
        self.label_8 = QtGui.QLabel(self.tabWidgetPage1)
        self.label_8.setText(_("Author s&ort: "))
        self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout.addWidget(self.label_8, 2, 0, 1, 1)
        self.author_sort = EnLineEdit(self.tabWidgetPage1)
        self.author_sort.setToolTip(_("Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles."))
        self.author_sort.setObjectName(_fromUtf8("author_sort"))
        self.gridLayout.addWidget(self.author_sort, 2, 1, 1, 1)
        self.label_6 = QtGui.QLabel(self.tabWidgetPage1)
        self.label_6.setText(_("&Rating:"))
        self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1)
        self.rating = QtGui.QSpinBox(self.tabWidgetPage1)
        self.rating.setToolTip(_("Rating of this book. 0-5 stars"))
        self.rating.setWhatsThis(_("Rating of this book. 0-5 stars"))
        self.rating.setButtonSymbols(QtGui.QAbstractSpinBox.PlusMinus)
        self.rating.setSpecialValueText(_("No change"))
        self.rating.setSuffix(_(" stars"))
        self.rating.setMinimum(-1)
        self.rating.setMaximum(5)
        self.rating.setProperty("value", -1)
        self.rating.setObjectName(_fromUtf8("rating"))
        self.gridLayout.addWidget(self.rating, 3, 1, 1, 1)
        self.label_3 = QtGui.QLabel(self.tabWidgetPage1)
        self.label_3.setText(_("&Publisher: "))
        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
        self.publisher = EditWithComplete(self.tabWidgetPage1)
        self.publisher.setEditable(True)
        self.publisher.setObjectName(_fromUtf8("publisher"))
        self.gridLayout.addWidget(self.publisher, 4, 1, 1, 1)
        self.label_4 = QtGui.QLabel(self.tabWidgetPage1)
        self.label_4.setText(_("Add ta&gs: "))
        self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1)
        self.tags = EditWithComplete(self.tabWidgetPage1)
        self.tags.setToolTip(_("Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas."))
        self.tags.setObjectName(_fromUtf8("tags"))
        self.gridLayout.addWidget(self.tags, 5, 1, 1, 1)
        self.tag_editor_button = QtGui.QToolButton(self.tabWidgetPage1)
        self.tag_editor_button.setToolTip(_("Open Tag Editor"))
        self.tag_editor_button.setText(_("Open Tag Editor"))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("chapters.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
#.........这里部分代码省略.........
开发者ID:yeyanchao,项目名称:calibre,代码行数:103,代码来源:metadata_bulk_ui.py


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