01-04-2022, 09:36 AM | #46 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No idea, I've never used user types with QtableWidgetItems. IIRC its needed to disable some builtin functionality, so that the custom types are treated specially by Qt.
|
01-04-2022, 10:43 AM | #47 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Unless someone comes up with a good reason not to I think, from now on, I'll just go with the simple option, i.e Code:
QTableWidgetItem.__init__(self, text) |
|
Advert | |
|
01-04-2022, 10:47 AM | #48 |
Grand Sorcerer
Posts: 6,497
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
I found a minor issue in beta 5.99.1. When looking at the log for a running job the scroll bar keeps jumping back to the beginning of the log whenever it is updated.
|
01-04-2022, 11:23 AM | #49 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
In the Editor when trying to use
Tools > Remove unused CC > [See what changed?] button I get these 2 errors: Code:
calibre 5.99.1 Portable embedded-python: True Windows-10-10.0.19042 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19042') Python 3.10.1 Windows: ('10', '10.0.19042', '', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: EpubMetadata (0, 0, 6) && EpubXCustomMetadata (0, 0, 7) && JS_Editor_Tools (0, 3, 16) && JS_Editor_Utils (0, 0, 9) && KePub Input (3, 4, 3) && KoboTouchExtended (3, 5, 4) && ScrambleEbook (0, 5, 1) && Smart_Device_App_CSSAdd (0, 0, 12) && TTS to MP3 (0, 5, 10) Traceback (most recent call last): File "calibre\gui2\tweak_book\diff\view.py", line 358, in paintEvent TypeError: QPainter.drawText(): arguments did not match any overloaded call: overload 1: argument 1 has unexpected type 'int' overload 2: argument 1 has unexpected type 'int' overload 3: argument 1 has unexpected type 'int' overload 4: argument 1 has unexpected type 'int' overload 5: argument 1 has unexpected type 'int' overload 6: argument 2 has unexpected type 'float' overload 7: argument 2 has unexpected type 'float' Code:
calibre 5.99.1 Portable embedded-python: True Windows-10-10.0.19042 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19042') Python 3.10.1 Windows: ('10', '10.0.19042', '', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: EpubMetadata (0, 0, 6) && EpubXCustomMetadata (0, 0, 7) && JS_Editor_Tools (0, 3, 16) && JS_Editor_Utils (0, 0, 9) && KePub Input (3, 4, 3) && KoboTouchExtended (3, 5, 4) && ScrambleEbook (0, 5, 1) && Smart_Device_App_CSSAdd (0, 0, 12) && TTS to MP3 (0, 5, 10) Traceback (most recent call last): File "calibre\gui2\tweak_book\diff\view.py", line 481, in paintEvent TypeError: QPainter.boundingRect(): arguments did not match any overloaded call: overload 1: argument 1 has unexpected type 'int' overload 2: argument 1 has unexpected type 'int' overload 3: argument 1 has unexpected type 'int' overload 4: argument 2 has unexpected type 'float' |
01-04-2022, 11:49 AM | #50 |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Holy moly, it was a bit difficult, but my plugins are Qt6 compatible.
Work, perfectly good. Here my Qt 5-6 compatibility workarounds, I let you judge if it is necessary to add a global retro-compatibility. Ask me for detail. Code:
try: ## PyQt6 QtItemFlags = Qt.ItemFlag QPolicy = QSizePolicy.Policy QShape = QFrame.Shape QShadow = QFrame.Shadow QSizeConstraint = QLayout.SizeConstraint QTableWidgetType = QTableWidgetItem.ItemType.UserType except: ## PyQt5 QtItemFlags = Qt.ItemFlags QPolicy = QSizePolicy QShape = QFrame QShadow = QFrame QSizeConstraint = QLayout QTableWidgetType = QTableWidgetItem.UserType QTableWidgetType = 1000 QSizePolicy => QSizePolicy.Policy ✅ (for enum values: Minimum, Maximum...) QFrame => QFrame.Shape ✅ (for enum values: NoFrame, HLine...) QFrame => QFrame.Shadow ✅ (for enum values: Sunken, Plain...) QLayout => QLayout.SizeConstraint ✅ (for enum values: SetMinimumSize...) QTableWidgetItem.UserType => QTableWidgetItem.ItemType.UserType ❌ Theoretically, QTableWidgetItem.ItemType.UserType should be the new valid value, but apparently not (throw a error). Fortunately, it's just a numerical constant, so I hard-coded its value to what it should be. Spoiler:
QTableWidgetType is used in a inherited class from QTableWidgetItem: Code:
class ReadOnlyTableWidgetItem(QTableWidgetItem): def __init__(self, text): if text is None: text = '' QTableWidgetItem.__init__(self, text, QTableWidgetType) self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled) For fix the QTableWidgetItem.ItemType.UserType issue, use this code: Code:
try:
QTableWidgetType = QTableWidgetItem.ItemType.UserType.value
except:
QTableWidgetType = QTableWidgetItem.UserType
Last edited by un_pogaz; 01-04-2022 at 02:00 PM. |
Advert | |
|
01-04-2022, 12:14 PM | #51 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
If it is ok to report non plugin issues, on macOS switching between light and dark mode has issues. Currently in light mode and text on many controls, e.g. buttons, is white as if it did not properly switch to light.
Last edited by democrite; 01-04-2022 at 12:15 PM. Reason: ed |
01-04-2022, 02:26 PM | #52 |
Plugin Developer
Posts: 6,328
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Just to remind myself and everybody else, Qt5 came in with Calibre v2. Past thread.
|
01-04-2022, 03:14 PM | #53 | |
Grand Sorcerer
Posts: 6,497
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
Those making similar changes to their plugins might want to either update the minimum calibre version supported or do additional coding for backward compatibility. |
|
01-04-2022, 10:49 PM | #54 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
01-04-2022, 10:57 PM | #55 | ||
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
Looking at the examples I have, that isn't going to happen. Most set flags and the data and don't do anything else. |
||
01-04-2022, 10:57 PM | #56 | |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
01-04-2022, 11:10 PM | #57 | |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
01-04-2022, 11:16 PM | #58 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@un_pogaz: Itemglags and QFrame enums should already be compatible. I have added QSizePolicy and QLayout compatibility layers.
|
01-05-2022, 03:05 AM | #59 | |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
01-05-2022, 04:09 AM | #60 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Released version 5.99.2 with fixes for all reported issues.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion for PI Devs | BetterRed | Plugins | 11 | 09-27-2020 06:18 PM |
Attn plugin devs: porting to python 3 | kovidgoyal | Plugins | 129 | 06-16-2020 01:31 AM |
Attention All Plugin Devs: Remove vestiges from python 2? | KevinH | Plugins | 11 | 05-29-2020 03:16 PM |
Plugin Devs: Should we include a License or COPYING file? | KevinH | Plugins | 3 | 08-15-2017 01:09 PM |
New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 02:48 PM |