|
|
#16 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,294
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
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 10:36 AM. |
|
|
|
|
|
#17 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,382
Karma: 79699999
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 | |
|
|
|
|
#18 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,650
Karma: 28549046
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. |
|
|
|
|
|
#19 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,294
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Also, what about the missing separators? |
|
|
|
|
|
|
#20 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,272
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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 | |
|
|
|
|
#21 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 900
Karma: 3501166
Join Date: Jan 2017
Location: Poland
Device: Various
|
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. |
|
|
|
|
|
#22 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,272
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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 02:51 PM. |
|
|
|
|
|
#23 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,294
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Quote:
Code:
QApplication.setHighDpiScaleFactorRoundingPolicy(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.Round) |
||
|
|
|
|
|
#24 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,294
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
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) |
|
|
|
|
|
|
#25 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,650
Karma: 28549046
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.
|
|
|
|
|
|
#26 | |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,650
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
|
|
|
|
|
#27 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,650
Karma: 28549046
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*[\.]$)'))
|
|
|
|
|
|
#28 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,294
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
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 11:44 PM. Reason: Add comments |
|
|
|
|
|
|
#29 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,272
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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. |
|
|
|
|
|
#30 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,272
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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 07:18 PM |
| Attn plugin devs: porting to python 3 | kovidgoyal | Plugins | 129 | 06-16-2020 02:31 AM |
| Attention All Plugin Devs: Remove vestiges from python 2? | KevinH | Plugins | 11 | 05-29-2020 04:16 PM |
| Plugin Devs: Should we include a License or COPYING file? | KevinH | Plugins | 3 | 08-15-2017 02:09 PM |
| New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 03:48 PM |