mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More compatibility fixes for PyQt 5.5
This commit is contained in:
parent
0de1cf661d
commit
8f75f2d5ad
@ -101,7 +101,7 @@ def drag_data(self):
|
||||
selected = self.get_selected_ids()
|
||||
ids = ' '.join(map(str, selected))
|
||||
md = QMimeData()
|
||||
md.setData('application/calibre+from_library', ids)
|
||||
md.setData('application/calibre+from_library', ids.encode('utf-8'))
|
||||
fmt = prefs['output_format']
|
||||
|
||||
def url_for_id(i):
|
||||
|
@ -55,11 +55,11 @@ class UpdateEditorGeometry(object):
|
||||
# Now get the size of the combo/spinner arrows and add them to the needed width
|
||||
if isinstance(editor, (QComboBox, QDateTimeEdit)):
|
||||
r = style.subControlRect(QStyle.CC_ComboBox, QStyleOptionComboBox(),
|
||||
QStyle.SC_ComboBoxArrow)
|
||||
QStyle.SC_ComboBoxArrow, editor)
|
||||
new_width += r.width()
|
||||
elif isinstance(editor, (QSpinBox, QDoubleSpinBox)):
|
||||
r = style.subControlRect(QStyle.CC_SpinBox, QStyleOptionSpinBox(),
|
||||
QStyle.SC_SpinBoxUp)
|
||||
QStyle.SC_SpinBoxUp, editor)
|
||||
new_width += r.width()
|
||||
|
||||
# Compute the maximum we can show if we consume the entire viewport
|
||||
|
@ -1098,7 +1098,7 @@ class DeviceBooksView(BooksView): # {{{
|
||||
rows = self.selectionModel().selectedRows()
|
||||
paths = [force_unicode(p, enc=filesystem_encoding) for p in m.paths(rows) if p]
|
||||
md = QMimeData()
|
||||
md.setData('application/calibre+from_device', 'dummy')
|
||||
md.setData('application/calibre+from_device', b'dummy')
|
||||
md.setUrls([QUrl.fromLocalFile(p) for p in paths])
|
||||
drag = QDrag(self)
|
||||
drag.setMimeData(md)
|
||||
|
Loading…
x
Reference in New Issue
Block a user