View Single Post
Old 08-25-2024, 06:32 AM   #1
feuille
Connoisseur
feuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enough
 
Posts: 62
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
Value for QSpinBox in calibre/src/calibre/gui2/metadata/config.py

Hello Kovid,

in calibre/src/calibre/gui2/metadata/config.py the max value for the number option (spin box) is not set:

Code:
class ConfigWidget(QWidget):
...
def create_widgets(self, opt):
        val = self.plugin.prefs[opt.name]
        if opt.type == 'number':
            c = QSpinBox if isinstance(opt.default, numbers.Integral) else QDoubleSpinBox
            widget = c(self)
            widget.setValue(val)
So the max value, that is visible in the generated config GUI, is set to the default value for QSpinBox (99), as indicated in the Qt docs (https://doc.qt.io/qtforpython-5/PySi.../QSpinBox.html).

Could you please add the statement:
Code:
            widget.setMaximum(val)
to let the user increase the default value?

Thanks!
feuille is offline   Reply With Quote