mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix QListView::Flow
This commit is contained in:
parent
fe45cb1111
commit
0c389a57ba
@ -699,7 +699,7 @@ class GridView(QListView):
|
||||
setup_dnd_interface(self)
|
||||
self.setUniformItemSizes(True)
|
||||
self.setWrapping(True)
|
||||
self.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
self.setFlow(QListView.Flow.LeftToRight)
|
||||
# We cannot set layout mode to batched, because that breaks
|
||||
# restore_vpos()
|
||||
# self.setLayoutMode(self.Batched)
|
||||
|
@ -80,7 +80,7 @@ class ConfigWidget(QWidget):
|
||||
g.setContentsMargins(0, 0, 0, 0)
|
||||
self.fields_view = v = FieldsList(self)
|
||||
g.addWidget(v)
|
||||
v.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
v.setFlow(QListView.Flow.LeftToRight)
|
||||
v.setWrapping(True)
|
||||
v.setResizeMode(v.Adjust)
|
||||
self.fields_model = FieldsModel(self.plugin)
|
||||
|
@ -769,7 +769,7 @@ class CoversView(QListView): # {{{
|
||||
self.m = CoversModel(current_cover, self)
|
||||
self.setModel(self.m)
|
||||
|
||||
self.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
self.setFlow(QListView.Flow.LeftToRight)
|
||||
self.setWrapping(True)
|
||||
self.setResizeMode(self.Adjust)
|
||||
self.setGridSize(QSize(190, 260))
|
||||
|
@ -52,7 +52,7 @@ class ListView(QListView):
|
||||
f.setBold(True)
|
||||
self.setFont(f)
|
||||
self.setIconSize(QSize(48, 48))
|
||||
self.setFlow(self.TopToBottom)
|
||||
self.setFlow(QListView.Flow.TopToBottom)
|
||||
self.setSpacing(10)
|
||||
|
||||
def currentChanged(self, cur, prev):
|
||||
|
@ -9,7 +9,7 @@ import glob, os, shutil
|
||||
from functools import partial
|
||||
from PyQt5.Qt import (
|
||||
QDialog, QVBoxLayout, QListWidget, QListWidgetItem, Qt, QIcon,
|
||||
QApplication, QSize, QDialogButtonBox, QTimer, QLabel, QAbstractItemView)
|
||||
QApplication, QSize, QDialogButtonBox, QTimer, QLabel, QAbstractItemView, QListView)
|
||||
|
||||
from calibre.constants import config_dir
|
||||
from calibre.gui2 import choose_files, error_dialog
|
||||
@ -47,7 +47,7 @@ class TextureChooser(QDialog):
|
||||
il.itemDoubleClicked.connect(self.accept, type=Qt.ConnectionType.QueuedConnection)
|
||||
il.setIconSize(QSize(256, 256))
|
||||
il.setViewMode(il.IconMode)
|
||||
il.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
il.setFlow(QListView.Flow.LeftToRight)
|
||||
il.setSpacing(20)
|
||||
il.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
|
||||
il.itemSelectionChanged.connect(self.update_remove_state)
|
||||
|
@ -591,7 +591,7 @@ class CharView(QListView):
|
||||
self.delegate = CharDelegate(self)
|
||||
self.setResizeMode(self.Adjust)
|
||||
self.setItemDelegate(self.delegate)
|
||||
self.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
self.setFlow(QListView.Flow.LeftToRight)
|
||||
self.setWrapping(True)
|
||||
self.setMouseTracking(True)
|
||||
self.setSpacing(2)
|
||||
|
@ -215,7 +215,7 @@ class InsertImage(Dialog):
|
||||
|
||||
self.view = v = QListView(self)
|
||||
v.setViewMode(v.IconMode)
|
||||
v.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
v.setFlow(QListView.Flow.LeftToRight)
|
||||
v.setSpacing(4)
|
||||
v.setResizeMode(v.Adjust)
|
||||
v.setUniformItemSizes(True)
|
||||
|
@ -11,7 +11,7 @@ from itertools import groupby
|
||||
from operator import attrgetter, itemgetter
|
||||
|
||||
from PyQt5.Qt import (
|
||||
Qt, QObject, QSize, QVBoxLayout, QStackedLayout, QWidget, QLineEdit,
|
||||
Qt, QObject, QSize, QVBoxLayout, QStackedLayout, QWidget, QLineEdit, QListView,
|
||||
QToolButton, QIcon, QHBoxLayout, QPushButton, QListWidget, QListWidgetItem,
|
||||
QGridLayout, QPlainTextEdit, QLabel, QFrame, QDialog, QDialogButtonBox)
|
||||
|
||||
@ -486,7 +486,7 @@ class EditSnippet(QWidget):
|
||||
add_row(_('&Template:'), t)
|
||||
|
||||
self.types = t = QListWidget(self)
|
||||
t.setFlow(Qt.LayoutDirection.LeftToRight)
|
||||
t.setFlow(QListView.Flow.LeftToRight)
|
||||
t.setWrapping(True), t.setResizeMode(t.Adjust), t.setSpacing(5)
|
||||
fm = t.fontMetrics()
|
||||
t.setMaximumHeight(2*(fm.ascent() + fm.descent()) + 25)
|
||||
|
@ -16,7 +16,7 @@ from copy import copy, deepcopy
|
||||
|
||||
from PyQt5.Qt import (
|
||||
QDialog, QGridLayout, QStackedWidget, QDialogButtonBox, QListWidget,
|
||||
QListWidgetItem, QIcon, QWidget, QSize, QFormLayout, Qt, QSpinBox,
|
||||
QListWidgetItem, QIcon, QWidget, QSize, QFormLayout, Qt, QSpinBox, QListView,
|
||||
QCheckBox, pyqtSignal, QDoubleSpinBox, QComboBox, QLabel, QFont, QApplication,
|
||||
QFontComboBox, QPushButton, QSizePolicy, QHBoxLayout, QGroupBox, QAbstractItemView,
|
||||
QToolButton, QVBoxLayout, QSpacerItem, QTimer, QRadioButton)
|
||||
@ -733,7 +733,7 @@ class Preferences(QDialog):
|
||||
cl.currentRowChanged.connect(self.stacks.setCurrentIndex)
|
||||
cl.clearPropertyFlags()
|
||||
cl.setViewMode(cl.IconMode)
|
||||
cl.setFlow(cl.TopToBottom)
|
||||
cl.setFlow(QListView.Flow.TopToBottom)
|
||||
cl.setMovement(cl.Static)
|
||||
cl.setWrapping(False)
|
||||
cl.setSpacing(15)
|
||||
|
Loading…
x
Reference in New Issue
Block a user