Quote:
Originally Posted by CaraRae
Looking for some simple language help fixing my Kobo Utilities plugin.
When trying to set it up and backup my database (which I'm in the process of rebuilding as the previous one was corrupted) I came across the following errors which prevent me from continuing.
When I try to 'View library preferences...' an error pops up...
ERROR: Unhandled exception (AttributeError: 'QTextEdit' object has no attribute 'setTabStopWidth').
Also, when I try to 'Backup device database' I get the following error...
ERROR: Unhandled exception (AttributeError:type object 'QFileDialogue' has no attribute 'AnyFile').
I have tried removing the Kobo Utilities plugin, restarting Calibre, reinstalling plugin. I have tried uninstalling and reinstalling Calibre.
I'm at a loss as to how to fix these errors so I can use the plugin properly and googling didn't give me any suggestions at all. Any help would be greatly appreciated.
CaraRae

|
These are almost certainly more problems caused by the Qt6 nightmare.
In Qt6 the first one should be:
Code:
mode=QFileDialog.FileMode.AnyFile
In Qt5 and below it could be:
Code:
mode=QFileDialog.AnyFile
I suspect that the Qt6 version is backwards compatible to Qt5, but I don't know that.
The second is yet another Qt6 problem. They changed the name of a method. In plugins I converted I had to do:
Code:
if using_Qt6:
self.value_text.setTabStopDistance(24)
else:
self.value_text.setTabStopWidth(24)
where "using_Qt6_ is set in the imports:
Code:
try:
import qt.core as QtGui
from qt.core import (Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QTextEdit, QListWidget, QAbstractItemView)
from qt.core import QRegularExpressionValidator as QRegExpValidator
from qt.core import QRegularExpression as QRegExp
using_Qt6 = True
except ImportError:
using_Qt6 = False
try:
from PyQt5 import Qt as QtGui
from PyQt5.Qt import (Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QRegExpValidator, QRegExp, QTextEdit,
QListWidget, QAbstractItemView)
except ImportError:
from PyQt4 import QtGui
from PyQt4.Qt import (Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QRegExpValidator, QRegExp, QTextEdit,
QListWidget, QAbstractItemView)
You must wait for a fix to the plugin.