本文整理汇总了Python中calibre.gui2.widgets.HistoryLineEdit.setSizePolicy方法的典型用法代码示例。如果您正苦于以下问题:Python HistoryLineEdit.setSizePolicy方法的具体用法?Python HistoryLineEdit.setSizePolicy怎么用?Python HistoryLineEdit.setSizePolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calibre.gui2.widgets.HistoryLineEdit
的用法示例。
在下文中一共展示了HistoryLineEdit.setSizePolicy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_Form
# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setSizePolicy [as 别名]
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(430, 74)
Form.setWindowTitle(_("Form"))
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.msg = QtGui.QLabel(Form)
self.msg.setText(_("TextLabel"))
self.msg.setWordWrap(True)
self.msg.setObjectName(_fromUtf8("msg"))
self.verticalLayout.addWidget(self.msg)
self.edit = HistoryLineEdit(Form)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(100)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.edit.sizePolicy().hasHeightForWidth())
self.edit.setSizePolicy(sizePolicy)
self.edit.setMinimumSize(QtCore.QSize(350, 0))
self.edit.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
self.edit.setMinimumContentsLength(30)
self.edit.setObjectName(_fromUtf8("edit"))
self.verticalLayout.addWidget(self.edit)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
self.button = QtGui.QToolButton(Form)
self.button.setToolTip(_("Use a wizard to help construct the Regular expression"))
self.button.setText(_("..."))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("wizard.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.button.setIcon(icon)
self.button.setIconSize(QtCore.QSize(40, 40))
self.button.setObjectName(_fromUtf8("button"))
self.gridLayout.addWidget(self.button, 0, 1, 1, 1)
self.msg.setBuddy(self.edit)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
pass
示例2: Ui_Dialog
# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setSizePolicy [as 别名]
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(872, 610)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("store.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
Dialog.setSizeGripEnabled(True)
self.verticalLayout_5 = QtGui.QVBoxLayout(Dialog)
self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
self.top_layout = QtGui.QHBoxLayout()
self.top_layout.setObjectName(_fromUtf8("top_layout"))
self.label = QtGui.QLabel(Dialog)
self.label.setObjectName(_fromUtf8("label"))
self.top_layout.addWidget(self.label)
self.adv_search_button = QtGui.QToolButton(Dialog)
self.adv_search_button.setObjectName(_fromUtf8("adv_search_button"))
self.top_layout.addWidget(self.adv_search_button)
self.search_edit = HistoryLineEdit(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_edit.sizePolicy().hasHeightForWidth())
self.search_edit.setSizePolicy(sizePolicy)
self.search_edit.setObjectName(_fromUtf8("search_edit"))
self.top_layout.addWidget(self.search_edit)
self.search = QtGui.QPushButton(Dialog)
self.search.setObjectName(_fromUtf8("search"))
self.top_layout.addWidget(self.search)
self.verticalLayout_5.addLayout(self.top_layout)
self.store_splitter = QtGui.QSplitter(Dialog)
self.store_splitter.setOrientation(QtCore.Qt.Horizontal)
self.store_splitter.setObjectName(_fromUtf8("store_splitter"))
self.groupBox = QtGui.QGroupBox(self.store_splitter)
self.groupBox.setObjectName(_fromUtf8("groupBox"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox)
self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.store_list = QtGui.QScrollArea(self.groupBox)
self.store_list.setWidgetResizable(True)
self.store_list.setObjectName(_fromUtf8("store_list"))
self.scrollAreaWidgetContents = QtGui.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 193, 127))
self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
self.store_list.setWidget(self.scrollAreaWidgetContents)
self.verticalLayout_2.addWidget(self.store_list)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.select_all_stores = QtGui.QPushButton(self.groupBox)
self.select_all_stores.setObjectName(_fromUtf8("select_all_stores"))
self.verticalLayout.addWidget(self.select_all_stores)
self.select_invert_stores = QtGui.QPushButton(self.groupBox)
self.select_invert_stores.setObjectName(_fromUtf8("select_invert_stores"))
self.verticalLayout.addWidget(self.select_invert_stores)
self.select_none_stores = QtGui.QPushButton(self.groupBox)
self.select_none_stores.setObjectName(_fromUtf8("select_none_stores"))
self.verticalLayout.addWidget(self.select_none_stores)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.verticalLayoutWidget = QtGui.QWidget(self.store_splitter)
self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
self.verticalLayout_4 = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout_4.setMargin(0)
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.results_view = ResultsView(self.verticalLayoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.results_view.sizePolicy().hasHeightForWidth())
self.results_view.setSizePolicy(sizePolicy)
self.results_view.setMinimumSize(QtCore.QSize(0, 0))
self.results_view.setAlternatingRowColors(True)
self.results_view.setIconSize(QtCore.QSize(32, 32))
self.results_view.setRootIsDecorated(False)
self.results_view.setUniformRowHeights(False)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setStretchLastSection(False)
self.verticalLayout_4.addWidget(self.results_view)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.configure = QtGui.QToolButton(self.verticalLayoutWidget)
self.configure.setObjectName(_fromUtf8("configure"))
self.horizontalLayout.addWidget(self.configure)
self.open_external = QtGui.QCheckBox(self.verticalLayoutWidget)
self.open_external.setObjectName(_fromUtf8("open_external"))
self.horizontalLayout.addWidget(self.open_external)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.verticalLayout_4.addLayout(self.horizontalLayout)
self.verticalLayout_5.addWidget(self.store_splitter)
self.bottom_layout = QtGui.QHBoxLayout()
self.bottom_layout.setObjectName(_fromUtf8("bottom_layout"))
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.bottom_layout.addWidget(self.label_2)
self.total = QtGui.QLabel(Dialog)
#.........这里部分代码省略.........
示例3: Ui_Dialog
# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setSizePolicy [as 别名]
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(691, 614)
Dialog.setWindowTitle(_("Dialog"))
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label = QtGui.QLabel(Dialog)
self.label.setText(_("&Query:"))
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout_2.addWidget(self.label)
self.adv_search_button = QtGui.QToolButton(Dialog)
self.adv_search_button.setText(_("..."))
self.adv_search_button.setObjectName(_fromUtf8("adv_search_button"))
self.horizontalLayout_2.addWidget(self.adv_search_button)
self.search_query = HistoryLineEdit(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_query.sizePolicy().hasHeightForWidth())
self.search_query.setSizePolicy(sizePolicy)
self.search_query.setObjectName(_fromUtf8("search_query"))
self.horizontalLayout_2.addWidget(self.search_query)
self.search_button = QtGui.QPushButton(Dialog)
self.search_button.setText(_("Search"))
self.search_button.setObjectName(_fromUtf8("search_button"))
self.horizontalLayout_2.addWidget(self.search_button)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.results_view = QtGui.QTreeView(Dialog)
self.results_view.setAlternatingRowColors(True)
self.results_view.setRootIsDecorated(False)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setCascadingSectionResizes(False)
self.verticalLayout.addWidget(self.results_view)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setText(_("Books:"))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout.addWidget(self.label_2)
self.total = QtGui.QLabel(Dialog)
self.total.setText(_("0"))
self.total.setObjectName(_fromUtf8("total"))
self.horizontalLayout.addWidget(self.total)
spacerItem = QtGui.QSpacerItem(308, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.close_button = QtGui.QPushButton(Dialog)
self.close_button.setText(_("Close"))
self.close_button.setObjectName(_fromUtf8("close_button"))
self.horizontalLayout.addWidget(self.close_button)
self.verticalLayout.addLayout(self.horizontalLayout)
self.label.setBuddy(self.search_query)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.close_button, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.accept)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
pass
示例4: Ui_MetadataBulkDialog
# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setSizePolicy [as 别名]
#.........这里部分代码省略.........
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)
self.tag_editor_button.setIcon(icon1)
self.tag_editor_button.setObjectName(_fromUtf8("tag_editor_button"))
self.gridLayout.addWidget(self.tag_editor_button, 5, 2, 1, 1)
self.label = QtGui.QLabel(self.tabWidgetPage1)
self.label.setText(_("&Remove tags:"))
self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 6, 0, 1, 1)
self.remove_tags = EditWithComplete(self.tabWidgetPage1)
self.remove_tags.setToolTip(_("Comma separated list of tags to remove from the books. "))
self.remove_tags.setObjectName(_fromUtf8("remove_tags"))
self.gridLayout.addWidget(self.remove_tags, 6, 1, 1, 1)
self.remove_all_tags = QtGui.QCheckBox(self.tabWidgetPage1)
self.remove_all_tags.setToolTip(_("Check this box to remove all tags from the books."))
self.remove_all_tags.setText(_("Remove &all"))
self.remove_all_tags.setObjectName(_fromUtf8("remove_all_tags"))
self.gridLayout.addWidget(self.remove_all_tags, 6, 2, 1, 1)
self.label_7 = QtGui.QLabel(self.tabWidgetPage1)
self.label_7.setText(_("&Series:"))
self.label_7.setTextFormat(QtCore.Qt.PlainText)
self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_7.setObjectName(_fromUtf8("label_7"))
self.gridLayout.addWidget(self.label_7, 7, 0, 1, 1)
self.series = EditWithComplete(self.tabWidgetPage1)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.series.sizePolicy().hasHeightForWidth())
self.series.setSizePolicy(sizePolicy)
self.series.setToolTip(_("List of known series. You can add new series."))
self.series.setWhatsThis(_("List of known series. You can add new series."))
self.series.setEditable(True)
self.series.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
self.series.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
self.series.setMinimumContentsLength(40)
self.series.setObjectName(_fromUtf8("series"))
self.gridLayout.addWidget(self.series, 7, 1, 1, 1)
self.clear_series = QtGui.QCheckBox(self.tabWidgetPage1)
self.clear_series.setToolTip(_("If checked, the series will be cleared"))
self.clear_series.setText(_("&Clear series"))
self.clear_series.setObjectName(_fromUtf8("clear_series"))
self.gridLayout.addWidget(self.clear_series, 7, 2, 1, 1)
self.HLayout_3 = QtGui.QHBoxLayout()
self.HLayout_3.setObjectName(_fromUtf8("HLayout_3"))
self.autonumber_series = QtGui.QCheckBox(self.tabWidgetPage1)
self.autonumber_series.setEnabled(False)
self.autonumber_series.setToolTip(_("If not checked, the series number for the books will be set to 1.\n"
"If checked, selected books will be automatically numbered, in the order\n"
"you selected them. So if you selected Book A and then Book B,\n"
"Book A will have series number 1 and Book B series number 2."))
self.autonumber_series.setText(_("&Automatically number books in this series"))
self.autonumber_series.setObjectName(_fromUtf8("autonumber_series"))
self.HLayout_3.addWidget(self.autonumber_series)
self.series_numbering_restarts = QtGui.QCheckBox(self.tabWidgetPage1)
self.series_numbering_restarts.setEnabled(False)
self.series_numbering_restarts.setToolTip(_("Series will normally be renumbered from the highest number in the database\n"
"for that series. Checking this box will tell calibre to start numbering\n"
"from the value in the box"))
self.series_numbering_restarts.setText(_("&Force numbers to start with:"))
self.series_numbering_restarts.setObjectName(_fromUtf8("series_numbering_restarts"))
self.HLayout_3.addWidget(self.series_numbering_restarts)
示例5: Ui_Form
# 需要导入模块: from calibre.gui2.widgets import HistoryLineEdit [as 别名]
# 或者: from calibre.gui2.widgets.HistoryLineEdit import setSizePolicy [as 别名]
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(610, 553)
self.verticalLayout = QtGui.QVBoxLayout(Form)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout.addWidget(self.label)
self.adv_search_builder = QtGui.QToolButton(Form)
self.adv_search_builder.setObjectName(_fromUtf8("adv_search_builder"))
self.horizontalLayout.addWidget(self.adv_search_builder)
self.query = HistoryLineEdit(Form)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.query.sizePolicy().hasHeightForWidth())
self.query.setSizePolicy(sizePolicy)
self.query.setObjectName(_fromUtf8("query"))
self.horizontalLayout.addWidget(self.query)
self.search = QtGui.QPushButton(Form)
self.search.setObjectName(_fromUtf8("search"))
self.horizontalLayout.addWidget(self.search)
self.verticalLayout.addLayout(self.horizontalLayout)
self.results_view = ResultsView(Form)
self.results_view.setAlternatingRowColors(True)
self.results_view.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.results_view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.results_view.setRootIsDecorated(False)
self.results_view.setUniformRowHeights(True)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setStretchLastSection(False)
self.verticalLayout.addWidget(self.results_view)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label_2 = QtGui.QLabel(Form)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout_2.addWidget(self.label_2)
self.enable_all = QtGui.QPushButton(Form)
self.enable_all.setObjectName(_fromUtf8("enable_all"))
self.horizontalLayout_2.addWidget(self.enable_all)
self.enable_none = QtGui.QPushButton(Form)
self.enable_none.setObjectName(_fromUtf8("enable_none"))
self.horizontalLayout_2.addWidget(self.enable_none)
self.enable_invert = QtGui.QPushButton(Form)
self.enable_invert.setObjectName(_fromUtf8("enable_invert"))
self.horizontalLayout_2.addWidget(self.enable_invert)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(_("Form"))
self.label.setText(_("Query:"))
self.adv_search_builder.setText(_("..."))
self.search.setText(_("Search"))
self.label_2.setText(_("Enable"))
self.enable_all.setText(_("All"))
self.enable_none.setText(_("None"))
self.enable_invert.setText(_("Invert"))