01-01-2022, 09:30 AM | #16 |
Guru
Posts: 929
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
I've just noticed that my plugin icons are being drawed with a lower quality then before. Also noticed a shadow on some checkboxes (why not all? ).
5.34 / 5.99(Beta) There are also some separators missing on the beta, although using the same code (m.addSeparator()) for all of them. Last edited by thiago.eec; 01-01-2022 at 09:36 AM. |
01-01-2022, 11:45 AM | #17 |
Custom User Title
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I'm not really a dev, but I do wonder what this will mean for some of DaltonST's plugins -- seeing as they've been absent for nearly a year, should the plugins be considered unmaintained at this point?
|
Advert | |
|
01-01-2022, 12:10 PM | #18 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This will fix the drop/hover event errors: https://github.com/kovidgoyal/calibr...c60100810b09e5
@thiago.eec: No clue about your icons, most likely a DPI thing. Try using larger icons. |
01-01-2022, 12:14 PM | #19 | |
Guru
Posts: 929
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
Also, what about the missing separators? |
|
01-01-2022, 12:47 PM | #20 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I'm just going to raise problems as I find them, rather than save them up for a mega post ...
I'm having a few problems with QTextBrowser widgets. Simplifying the sample code to: Code:
from qt.core import (QTextBrowser, QTextCursor, QTextEdit) self.browser = QTextBrowser() self.browser.setLineWrapMode(QTextEdit.NoWrap) self.browser.setLineWrapMode(QTextEdit.WidgetWidth) self.browser.moveCursor(QTextCursor.End) self.browser.moveCursor(QTextCursor.StartOfLine) |
Advert | |
|
01-01-2022, 12:51 PM | #21 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
I hope it will be useful to someone, so please don't hit me.
Easy quick and dirty fix for many plugins that use functions from common_utils.py). Of course, the following advice only makes sense for beta users before the plugin maintainers release new versions. 1. Edit file common_utils.py 2. Remove (twice) QRegExpValidator, QRegExp from imports 3. Delete this fragment* (if it exists): Spoiler:
[*] I haven't found a single plugin that uses this code, so it won't be a big deal. In this way, I managed to modify about 90% of the plugins that I use and now work normally in the beta version. The remaining plugins require minor or major changes, especially if they are to be backward compatible with previous versions of Calibre. |
01-01-2022, 01:48 PM | #22 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I think this may be similar to my post #20. This code for a general utility class used as part of creating a read-only table widget:
Code:
from qt.core import QTableWidgetItem class ReadOnlyTableWidgetItem(QTableWidgetItem): def __init__(self, text): if text is None: text = '' QTableWidgetItem.__init__(self, text, QTableWidgetItem.UserType) self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled) Code:
AttributeError: type object 'QTableWidgetItem' has no attribute 'UserType' Last edited by jackie_w; 01-01-2022 at 01:51 PM. |
01-01-2022, 09:32 PM | #23 | ||
Guru
Posts: 929
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
Quote:
Code:
QApplication.setHighDpiScaleFactorRoundingPolicy(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.Round) |
||
01-01-2022, 09:42 PM | #24 | |
Guru
Posts: 929
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
Code:
QTableWidgetItem.ItemType.UserType I noticed this change on setting flags, maybe this is the same case. For example, on Qt 5, you could use this: Code:
QApplication.processEvents(QtCore.QEventLoop.ExcludeUserInputEvents) Code:
QApplication.processEvents(QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents) |
|
01-01-2022, 09:51 PM | #25 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@jackie_w You need to use fully qualified names for enums in PyQt6, as thiago pointed out. I have added compatibility layers for the most common enums in calibre so they can continue to be used as before, but not for all of them.
|
01-01-2022, 09:55 PM | #26 | |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
01-01-2022, 09:59 PM | #27 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@BeckyEbook: A better fix is to use
Code:
QRegularExpressionValidator(QRegularExpression(r'(^\d*\.[\d]{1,2}$)|(^[1-9]\d*[\.]$)')) |
01-01-2022, 10:27 PM | #28 | |
Guru
Posts: 929
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
Anyway, my fix backfired, since it sets the Policy for QApplication, messing with whole calibre. I guess I'll have to change all my icons for larger versions. P.S.: The shadow on checkboxes borders happens on main calibre either. * Confirmed. Using larger images fixes the problem. Last edited by thiago.eec; 01-01-2022 at 10:44 PM. Reason: Add comments |
|
01-02-2022, 05:25 PM | #29 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
An error message from the Editor ...
Code:
calibre, version 5.99.0 ERROR: Unhandled exception: <b>TypeError</b>:int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier' calibre 5.99 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: EpubCheck (0, 2, 3) && EpubMetadata (0, 0, 6) && EpubXCustomMetadata (0, 0, 7) && JS_Editor_Tools (0, 3, 16) && JS_Editor_Utils (0, 0, 9) && JS_Modify_Epub (0, 0, 22) && KoboTouchExtended (3, 5, 4) && ScrambleEbook (0, 5, 0) && Smart_Device_App_CSSAdd (0, 0, 12) && TTS to MP3 (0, 5, 10) Traceback (most recent call last): File "calibre\gui2\tweak_book\editor\text.py", line 950, in keyPressEvent File "calibre\gui2\tweak_book\editor\smarts\html.py", line 738, in handle_key_press TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier' If the html is: Code:
<p class="noindent">First paragraph.</p> <p class="indent">Second paragraph.</p> Changing classname via copy/paste doesn't trigger the error. Neither does changing noindent to indent by manually deleting the first 2 chars with the [Delete] key or the [Backspace] key. |
01-02-2022, 05:32 PM | #30 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Thanks for the info and examples about needing fully qualifed names. |
|
|
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 |