本文整理汇总了Python中PyQt5.Qt.QScrollArea类的典型用法代码示例。如果您正苦于以下问题:Python QScrollArea类的具体用法?Python QScrollArea怎么用?Python QScrollArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QScrollArea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test(scale=0.5):
from PyQt5.Qt import QLabel, QApplication, QPixmap, QMainWindow, QWidget, QScrollArea, QGridLayout
app = QApplication([])
mi = Metadata('xxx', ['Kovid Goyal', 'John Q. Doe', 'Author'])
mi.series = 'A series of styles'
m = QMainWindow()
sa = QScrollArea(m)
w = QWidget(m)
sa.setWidget(w)
l = QGridLayout(w)
w.setLayout(l), l.setSpacing(30)
labels = []
for r, color in enumerate(sorted(default_color_themes)):
for c, style in enumerate(sorted(all_styles())):
mi.series_index = c + 1
mi.title = 'An algorithmic cover [%s]' % color
prefs = override_prefs(cprefs, override_color_theme=color, override_style=style)
for x in ('cover_width', 'cover_height', 'title_font_size', 'subtitle_font_size', 'footer_font_size'):
prefs[x] = int(scale * prefs[x])
img = generate_cover(mi, prefs=prefs, as_qimage=True)
la = QLabel()
la.setPixmap(QPixmap.fromImage(img))
l.addWidget(la, r, c)
labels.append(la)
m.setCentralWidget(sa)
w.resize(w.sizeHint())
m.show()
app.exec_()
示例2: test
def test(scale=0.25):
from PyQt5.Qt import QLabel, QPixmap, QMainWindow, QWidget, QScrollArea, QGridLayout
from calibre.gui2 import Application
app = Application([])
mi = Metadata('Unknown', ['Kovid Goyal', 'John & Doe', 'Author'])
mi.series = 'A series & styles'
m = QMainWindow()
sa = QScrollArea(m)
w = QWidget(m)
sa.setWidget(w)
l = QGridLayout(w)
w.setLayout(l), l.setSpacing(30)
scale *= w.devicePixelRatioF()
labels = []
for r, color in enumerate(sorted(default_color_themes)):
for c, style in enumerate(sorted(all_styles())):
mi.series_index = c + 1
mi.title = 'An algorithmic cover [%s]' % color
prefs = override_prefs(cprefs, override_color_theme=color, override_style=style)
scale_cover(prefs, scale)
img = generate_cover(mi, prefs=prefs, as_qimage=True)
img.setDevicePixelRatio(w.devicePixelRatioF())
la = QLabel()
la.setPixmap(QPixmap.fromImage(img))
l.addWidget(la, r, c)
labels.append(la)
m.setCentralWidget(sa)
w.resize(w.sizeHint())
m.show()
app.exec_()
示例3: __init__
def __init__(self, parent_dialog, plugin_action):
self.parent_dialog = parent_dialog
self.plugin_action = plugin_action
QWidget.__init__(self)
self.l = QVBoxLayout()
self.setLayout(self.l)
label = QLabel(_("If you have custom columns defined, they will be listed below. Choose how you would like these columns handled."))
label.setWordWrap(True)
self.l.addWidget(label)
self.l.addSpacing(5)
scrollable = QScrollArea()
scrollcontent = QWidget()
scrollable.setWidget(scrollcontent)
scrollable.setWidgetResizable(True)
self.l.addWidget(scrollable)
self.sl = QVBoxLayout()
scrollcontent.setLayout(self.sl)
self.custcol_dropdowns = {}
custom_columns = self.plugin_action.gui.library_view.model().custom_columns
grid = QGridLayout()
self.sl.addLayout(grid)
row=0
for key, column in custom_columns.iteritems():
if column['datatype'] in permitted_values:
# print("\n============== %s ===========\n"%key)
# for (k,v) in column.iteritems():
# print("column['%s'] => %s"%(k,v))
label = QLabel('%s(%s)'%(column['name'],key))
label.setToolTip(_("Set this %s column on new merged books...")%column['datatype'])
grid.addWidget(label,row,0)
dropdown = QComboBox(self)
dropdown.addItem('','none')
for md in permitted_values[column['datatype']]:
# tags-like column also 'text'
if md == 'union' and not column['is_multiple']:
continue
if md == 'concat' and column['is_multiple']:
continue
dropdown.addItem(titleLabels[md],md)
self.custcol_dropdowns[key] = dropdown
if key in prefs['custom_cols']:
dropdown.setCurrentIndex(dropdown.findData(prefs['custom_cols'][key]))
dropdown.setToolTip(_("How this column will be populated by default."))
grid.addWidget(dropdown,row,1)
row+=1
self.sl.insertStretch(-1)
示例4: __init__
def __init__(self, parent_dialog, plugin_action):
QWidget.__init__(self)
self.parent_dialog = parent_dialog
self.plugin_action = plugin_action
self.l = QVBoxLayout()
self.setLayout(self.l)
label = QLabel(_('Searches to use for:'))
label.setWordWrap(True)
self.l.addWidget(label)
#self.l.addSpacing(5)
scrollable = QScrollArea()
scrollcontent = QWidget()
scrollable.setWidget(scrollcontent)
scrollable.setWidgetResizable(True)
self.l.addWidget(scrollable)
self.sl = QVBoxLayout()
scrollcontent.setLayout(self.sl)
self.sl.addWidget(QLabel(_("Search for Duplicated Books:")))
self.checkdups_search = QLineEdit(self)
self.sl.addWidget(self.checkdups_search)
self.checkdups_search.setText(prefs['checkdups_search'])
self.checkdups_search.setToolTip(_('Default is %s')%default_prefs['checkdups_search'])
self.sl.addSpacing(5)
self.sl.addWidget(QLabel(_("Deleted Books (not in Library):")))
self.checknotinlibrary_search = QLineEdit(self)
self.sl.addWidget(self.checknotinlibrary_search)
self.checknotinlibrary_search.setText(prefs['checknotinlibrary_search'])
self.checknotinlibrary_search.setToolTip(_('Default is %s')%default_prefs['checknotinlibrary_search'])
self.sl.addSpacing(5)
self.sl.addWidget(QLabel(_("Added Books (not on Device):")))
self.checknotondevice_search = QLineEdit(self)
self.sl.addWidget(self.checknotondevice_search)
self.checknotondevice_search.setText(prefs['checknotondevice_search'])
self.checknotondevice_search.setToolTip(_('Default is %s')%default_prefs['checknotondevice_search'])
self.sl.insertStretch(-1)
self.l.addSpacing(15)
restore_defaults_button = QPushButton(_('Restore Defaults'), self)
restore_defaults_button.setToolTip(_('Revert all searches to the defaults.'))
restore_defaults_button.clicked.connect(self.restore_defaults_button)
self.l.addWidget(restore_defaults_button)
示例5: __init__
def __init__(self, *args, **kw):
ConfigWidgetBase.__init__(self, *args, **kw)
self.l = l = QVBoxLayout(self)
l.setContentsMargins(0, 0, 0, 0)
self.tabs_widget = t = QTabWidget(self)
l.addWidget(t)
self.main_tab = m = MainTab(self)
t.addTab(m, _('&Main'))
m.start_server.connect(self.start_server)
m.stop_server.connect(self.stop_server)
m.test_server.connect(self.test_server)
m.show_logs.connect(self.view_server_logs)
self.opt_autolaunch_server = m.opt_autolaunch_server
self.users_tab = ua = Users(self)
t.addTab(ua, _('&User accounts'))
self.advanced_tab = a = AdvancedTab(self)
sa = QScrollArea(self)
sa.setWidget(a), sa.setWidgetResizable(True)
t.addTab(sa, _('&Advanced'))
self.custom_list_tab = clt = CustomList(self)
sa = QScrollArea(self)
sa.setWidget(clt), sa.setWidgetResizable(True)
t.addTab(sa, _('Book &list template'))
for tab in self.tabs:
if hasattr(tab, 'changed_signal'):
tab.changed_signal.connect(self.changed_signal.emit)
示例6: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
self.sa = QScrollArea(self)
self.lw = QWidget(self)
self.l = QVBoxLayout(self.lw)
self.sa.setWidget(self.lw), self.sa.setWidgetResizable(True)
self.gl = gl = QVBoxLayout(self)
self.la = QLabel(_(
'Add new locations to search for books or authors using the "Search the internet" feature'
' of the Content server. The URLs should contain {author} which will be'
' replaced by the author name and, for book URLs, {title} which will'
' be replaced by the book title.'))
self.la.setWordWrap(True)
gl.addWidget(self.la)
self.h = QHBoxLayout()
gl.addLayout(self.h)
self.add_url_button = b = QPushButton(QIcon(I('plus.png')), _('&Add URL'))
b.clicked.connect(self.add_url)
self.h.addWidget(b)
self.export_button = b = QPushButton(_('Export URLs'))
b.clicked.connect(self.export_urls)
self.h.addWidget(b)
self.import_button = b = QPushButton(_('Import URLs'))
b.clicked.connect(self.import_urls)
self.h.addWidget(b)
self.clear_button = b = QPushButton(_('Clear'))
b.clicked.connect(self.clear)
self.h.addWidget(b)
self.h.addStretch(10)
gl.addWidget(self.sa, stretch=10)
self.items = []
示例7: setupUi
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.swap_title_author_shortcut = s = QShortcut(self)
s.setKey(QKeySequence('Alt+Down', QKeySequence.PortableText))
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.comments_edit_state_at_apply = {self.comments:None}
self.do_layout()
geom = gprefs.get('metasingle_window_geometry3', None)
if geom is not None:
self.restoreGeometry(bytes(geom))
示例8: __init__
def __init__(self, parent=None):
QScrollArea.__init__(self, parent)
self.setWidgetResizable(True)
category_map, category_names = {}, {}
for plugin in preferences_plugins():
if plugin.category not in category_map:
category_map[plugin.category] = plugin.category_order
if category_map[plugin.category] < plugin.category_order:
category_map[plugin.category] = plugin.category_order
if plugin.category not in category_names:
category_names[plugin.category] = (plugin.gui_category if
plugin.gui_category else plugin.category)
self.category_names = category_names
categories = list(category_map.keys())
categories.sort(key=lambda x: category_map[x])
self.category_map = OrderedDict()
for c in categories:
self.category_map[c] = []
for plugin in preferences_plugins():
self.category_map[plugin.category].append(plugin)
for plugins in self.category_map.values():
plugins.sort(key=lambda x: x.name_order)
self.widgets = []
self._layout = QVBoxLayout()
self.container = QWidget(self)
self.container.setLayout(self._layout)
self.setWidget(self.container)
for name, plugins in self.category_map.items():
w = Category(name, plugins, self.category_names[name], parent=self)
self.widgets.append(w)
self._layout.addWidget(w)
w.plugin_activated.connect(self.show_plugin.emit)
self._layout.addStretch(1)
示例9: __init__
def __init__(self, gui, icon, do_user_config):
QDialog.__init__(self, gui)
self.gui = gui
self.do_user_config = do_user_config
self.db = gui.current_db
self.l = QVBoxLayout()
self.setLayout(self.l)
self.setWindowTitle('Wiki Reader')
self.setWindowIcon(icon)
self.helpl = QLabel(
'Enter the URL of a wikipedia article below. '
'It will be downloaded and converted into an ebook.')
self.helpl.setWordWrap(True)
self.l.addWidget(self.helpl)
self.w = QWidget(self)
self.sa = QScrollArea(self)
self.l.addWidget(self.sa)
self.w.l = QVBoxLayout()
self.w.setLayout(self.w.l)
self.sa.setWidget(self.w)
self.sa.setWidgetResizable(True)
self.title = Title(self)
self.w.l.addWidget(self.title)
self.urls = [URL(self)]
self.w.l.addWidget(self.urls[0])
self.add_more_button = QPushButton(
QIcon(I('plus.png')), 'Add another URL')
self.l.addWidget(self.add_more_button)
self.bb = QDialogButtonBox(self)
self.bb.setStandardButtons(self.bb.Ok | self.bb.Cancel)
self.bb.accepted.connect(self.accept)
self.bb.rejected.connect(self.reject)
self.l.addWidget(self.bb)
self.book_button = b = self.bb.addButton(
'Convert a Wiki&Book', self.bb.ActionRole)
b.clicked.connect(self.wiki_book)
self.add_more_button.clicked.connect(self.add_more)
self.finished.connect(self.download)
self.setMinimumWidth(500)
self.resize(self.sizeHint())
self.single_url = None
示例10: get_notes_mail_widget
def get_notes_mail_widget(self):
"""
Return QWidget with notes and email areas and edition buttons
:return: notes and email QWidget
:rtype: QWidget
"""
notes_widget = QWidget()
notes_layout = QGridLayout(notes_widget)
# Notes title and button
notes_label = QLabel(_('Notes:'))
notes_label.setObjectName('subtitle')
notes_layout.addWidget(notes_label, 0, 0, 1, 1)
notes_btn = QPushButton()
notes_btn.setIcon(QIcon(settings.get_image('edit')))
notes_btn.setToolTip(_("Edit your notes."))
notes_btn.setFixedSize(32, 32)
notes_btn.clicked.connect(lambda: self.patch_data('notes'))
notes_layout.addWidget(notes_btn, 0, 2, 1, 1)
# Notes scroll area
self.labels['notes'].setText(data_manager.database['user'].data['notes'])
self.labels['notes'].setWordWrap(True)
self.labels['notes'].setTextInteractionFlags(Qt.TextSelectableByMouse)
notes_scrollarea = QScrollArea()
notes_scrollarea.setWidget(self.labels['notes'])
notes_scrollarea.setWidgetResizable(True)
notes_scrollarea.setObjectName('notes')
notes_layout.addWidget(notes_scrollarea, 1, 0, 1, 3)
# Mail
mail_label = QLabel(_('Email:'))
mail_label.setObjectName('subtitle')
notes_layout.addWidget(mail_label, 2, 0, 1, 1)
self.labels['email'].setObjectName('edit')
notes_layout.addWidget(self.labels['email'], 2, 1, 1, 1)
mail_btn = QPushButton()
mail_btn.setIcon(QIcon(settings.get_image('edit')))
mail_btn.setFixedSize(32, 32)
mail_btn.clicked.connect(lambda: self.patch_data('email'))
notes_layout.addWidget(mail_btn, 2, 2, 1, 1)
notes_layout.setAlignment(Qt.AlignTop)
return notes_widget
示例11: __init__
def __init__(self, parent, book_settings):
QDialog.__init__(self, parent)
self.resize(500, 500)
self.setWindowTitle('title - author')
self._index = 0
self._book_settings = book_settings
v_layout = QVBoxLayout(self)
# add ASIN and Goodreads url text boxes and update buttons
asin_browser_button, goodreads_browser_button = self._initialize_general(v_layout)
# add scrollable area for aliases
v_layout.addWidget(QLabel('Aliases:'))
self._scroll_area = QScrollArea()
v_layout.addWidget(self._scroll_area)
# add status box
self._status = QLabel('')
v_layout.addWidget(self._status)
previous_button = next_button = None
if len(self._book_settings) > 1:
previous_button = QPushButton('Previous')
previous_button.setEnabled(False)
previous_button.setFixedWidth(100)
next_button = QPushButton('Next')
next_button.setFixedWidth(100)
previous_button.clicked.connect(lambda: self.previous_clicked(previous_button, next_button,
asin_browser_button, goodreads_browser_button))
next_button.clicked.connect(lambda: self.next_clicked(previous_button, next_button,
asin_browser_button, goodreads_browser_button))
self._initialize_navigation_buttons(v_layout, previous_button, next_button)
self.setLayout(v_layout)
self.show_book_prefs(asin_browser_button, goodreads_browser_button)
self.show()
示例12: get_last_check_widget
def get_last_check_widget(self):
"""
Return QWidget with last check data
:return: widget with last check data
:rtype: QWidget
"""
widget = QWidget()
layout = QGridLayout()
widget.setLayout(layout)
# Title
check_title = QLabel(_('My last check'))
check_title.setObjectName('itemtitle')
check_title.setFixedHeight(30)
layout.addWidget(check_title, 0, 0, 1, 2)
# When last check
when_title = QLabel(_("When:"))
when_title.setObjectName('title')
layout.addWidget(when_title, 2, 0, 1, 1)
layout.addWidget(self.labels['ls_last_check'], 2, 1, 1, 1)
# Output
output_title = QLabel(_("Output"))
output_title.setObjectName('title')
layout.addWidget(output_title, 3, 0, 1, 1)
self.labels['ls_output'].setWordWrap(True)
self.labels['ls_output'].setTextInteractionFlags(Qt.TextSelectableByMouse)
output_scrollarea = QScrollArea()
output_scrollarea.setWidget(self.labels['ls_output'])
output_scrollarea.setWidgetResizable(True)
output_scrollarea.setObjectName('output')
layout.addWidget(output_scrollarea, 3, 1, 1, 1)
return widget
示例13: MetadataSingleDialogBase
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, editing_multiple=False):
self.db = db
self.changed = set()
self.books_to_refresh = set()
self.rows_to_refresh = set()
self.metadata_before_fetch = None
self.editing_multiple = editing_multiple
self.comments_edit_state_at_apply = {}
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.swap_title_author_shortcut = s = QShortcut(self)
s.setKey(QKeySequence('Alt+Down', QKeySequence.PortableText))
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.comments_edit_state_at_apply = {self.comments:None}
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 = RightClickButton(self)
b.setToolTip('<p>' +
_('Automatically create the author sort entry based on the current '
#.........这里部分代码省略.........
示例14: __init__
def __init__(self, parent_dialog, plugin_action):
QWidget.__init__(self)
self.parent_dialog = parent_dialog
self.plugin_action = plugin_action
self.l = QVBoxLayout()
self.setLayout(self.l)
self.editmetadata = QCheckBox(_('Edit Metadata for New Book(s)'),self)
self.editmetadata.setToolTip(_('Show Edit Metadata Dialog after creating each new book entry, but <i>before</i> EPUB is created.<br>Allows for downloading metadata and ensures EPUB has updated metadata.'))
self.editmetadata.setChecked(prefs['editmetadata'])
self.l.addWidget(self.editmetadata)
self.show_checkedalways = QCheckBox(_("Show 'Always Include' Checkboxes"),self)
self.show_checkedalways.setToolTip(_('If enabled, a checkbox will appear for each section.')+' '+
_('Checked sections will be included in <i>all</i> split books.<br>Default title will still be taken from the first <i>selected</i> section, and section order will remain as shown.'))
self.show_checkedalways.setChecked(prefs['show_checkedalways'])
self.l.addWidget(self.show_checkedalways)
self.l.addSpacing(5)
label = QLabel(_('When making a new Epub, the metadata from the source book will be copied or not as you choose below.'))
label.setWordWrap(True)
self.l.addWidget(label)
scrollable = QScrollArea()
scrollcontent = QWidget()
scrollable.setWidget(scrollcontent)
scrollable.setWidgetResizable(True)
self.l.addWidget(scrollable)
self.sl = QVBoxLayout()
scrollcontent.setLayout(self.sl)
self.copytoctitle = QCheckBox(_('Title from First Included TOC'),self)
self.copytoctitle.setToolTip(_('Copy Title from the the first Table of Contents entry included in the Split Epub.\nSupersedes Copy Title below.'))
self.copytoctitle.setChecked(prefs['copytoctitle'])
self.sl.addWidget(self.copytoctitle)
self.copytitle = QCheckBox(_('Copy Title'),self)
self.copytitle.setToolTip(_('Copy Title from the source Epub to the Split Epub. Adds "Split" to the title.'))
self.copytitle.setChecked(prefs['copytitle'])
self.sl.addWidget(self.copytitle)
self.copyauthors = QCheckBox(_('Copy Authors'),self)
self.copyauthors.setToolTip(_('Copy Authors from the source Epub to the Split Epub.'))
self.copyauthors.setChecked(prefs['copyauthors'])
self.sl.addWidget(self.copyauthors)
self.copyseries = QCheckBox(_('Copy Series'),self)
self.copyseries.setToolTip(_('Copy Series from the source Epub to the Split Epub.'))
self.copyseries.setChecked(prefs['copyseries'])
self.sl.addWidget(self.copyseries)
self.copycover = QCheckBox(_('Copy Cover'),self)
self.copycover.setToolTip(_('Copy Cover from the source Epub to the Split Epub.'))
self.copycover.setChecked(prefs['copycover'])
self.sl.addWidget(self.copycover)
self.copyrating = QCheckBox(_('Copy Rating'),self)
self.copyrating.setToolTip(_('Copy Rating from the source Epub to the Split Epub.'))
self.copyrating.setChecked(prefs['copyrating'])
self.sl.addWidget(self.copyrating)
self.copytags = QCheckBox(_('Copy Tags'),self)
self.copytags.setToolTip(_('Copy Tags from the source Epub to the Split Epub.'))
self.copytags.setChecked(prefs['copytags'])
self.sl.addWidget(self.copytags)
self.copyidentifiers = QCheckBox(_('Copy Identifiers'),self)
self.copyidentifiers.setToolTip(_('Copy Identifiers from the source Epub to the Split Epub.'))
self.copyidentifiers.setChecked(prefs['copyidentifiers'])
self.sl.addWidget(self.copyidentifiers)
self.copydate = QCheckBox(_('Copy Date'),self)
self.copydate.setToolTip(_('Copy Date from the source Epub to the Split Epub.'))
self.copydate.setChecked(prefs['copydate'])
self.sl.addWidget(self.copydate)
self.copypubdate = QCheckBox(_('Copy Published Date'),self)
self.copypubdate.setToolTip(_('Copy Published Date from the source Epub to the Split Epub.'))
self.copypubdate.setChecked(prefs['copypubdate'])
self.sl.addWidget(self.copypubdate)
self.copypublisher = QCheckBox(_('Copy Publisher'),self)
self.copypublisher.setToolTip(_('Copy Publisher from the source Epub to the Split Epub.'))
self.copypublisher.setChecked(prefs['copypublisher'])
self.sl.addWidget(self.copypublisher)
self.copylanguages = QCheckBox(_('Copy Languages'),self)
self.copylanguages.setToolTip(_('Copy Languages from the source Epub to the Split Epub.'))
self.copylanguages.setChecked(prefs['copylanguages'])
self.sl.addWidget(self.copylanguages)
self.copycomments = QCheckBox(_('Copy Comments'),self)
self.copycomments.setToolTip(_('Copy Comments from the source Epub to the Split Epub. Adds "Split from:" to the comments.'))
self.copycomments.setChecked(prefs['copycomments'])
self.sl.addWidget(self.copycomments)
self.sl.insertStretch(-1)
#.........这里部分代码省略.........
示例15: get_notes_output_widget
def get_notes_output_widget(self):
"""
Return QWidget with output and notes data
:return: widget with host output and notes
:rtype: QWidget
"""
widget = QWidget()
layout = QGridLayout()
widget.setLayout(layout)
# Output
output_title = QLabel(_("Output"))
output_title.setObjectName('title')
layout.addWidget(output_title, 0, 0, 1, 1)
self.labels['ls_output'].setWordWrap(True)
self.labels['ls_output'].setTextInteractionFlags(Qt.TextSelectableByMouse)
output_scrollarea = QScrollArea()
output_scrollarea.setWidget(self.labels['ls_output'])
output_scrollarea.setWidgetResizable(True)
output_scrollarea.setObjectName('output')
layout.addWidget(output_scrollarea, 1, 0, 1, 2)
# Notes
notes_title = QLabel(_("Notes:"))
notes_title.setObjectName('title')
layout.addWidget(notes_title, 0, 2, 1, 1)
notes_btn = QPushButton()
notes_btn.setIcon(QIcon(settings.get_image('edit')))
notes_btn.setToolTip(_("Edit host notes."))
notes_btn.setFixedSize(32, 32)
notes_btn.clicked.connect(self.patch_data)
layout.addWidget(notes_btn, 0, 3, 1, 1)
self.labels['notes'].setWordWrap(True)
self.labels['notes'].setTextInteractionFlags(Qt.TextSelectableByMouse)
notes_scrollarea = QScrollArea()
notes_scrollarea.setWidget(self.labels['notes'])
notes_scrollarea.setWidgetResizable(True)
notes_scrollarea.setObjectName('notes')
layout.addWidget(notes_scrollarea, 1, 2, 1, 2)
return widget