Remove all Qt4 imports.

This commit is contained in:
Jim Miller 2022-01-10 11:29:24 -06:00
parent b2b56e6366
commit c97407ae56
6 changed files with 20 additions and 52 deletions

View file

@ -9,10 +9,7 @@ __docformat__ = 'restructuredtext en'
import re
try:
from PyQt5.Qt import (Qt, QSyntaxHighlighter, QTextCharFormat, QBrush)
except ImportError as e:
from PyQt4.Qt import (Qt, QSyntaxHighlighter, QTextCharFormat, QBrush)
from PyQt5.Qt import (Qt, QSyntaxHighlighter, QTextCharFormat, QBrush)
from fanficfare.six import string_types

View file

@ -10,18 +10,11 @@ __docformat__ = 'restructuredtext en'
import os
from contextlib import contextmanager
try:
from PyQt5 import QtWidgets as QtGui
from PyQt5.Qt import (QApplication, Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QTextEdit, QListWidget, QAbstractItemView, QCursor)
except ImportError as e:
from PyQt4 import QtGui
from PyQt4.Qt import (QApplication, Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QTextEdit, QListWidget, QAbstractItemView, QCursor)
from PyQt5 import QtWidgets as QtGui
from PyQt5.Qt import (QApplication, Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout,
QTableWidgetItem, QFont, QLineEdit, QComboBox,
QVBoxLayout, QDialogButtonBox, QStyledItemDelegate, QDateTime,
QTextEdit, QListWidget, QAbstractItemView, QCursor)
from calibre.constants import iswindows, DEBUG
from calibre.gui2 import UNDEFINED_QDATETIME, gprefs, info_dialog

View file

@ -15,18 +15,11 @@ import re
import threading
from collections import OrderedDict
try:
from PyQt5 import QtWidgets as QtGui
from PyQt5.Qt import (QWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel,
QLineEdit, QComboBox, QCheckBox, QPushButton, QTabWidget,
QScrollArea, QGroupBox, QButtonGroup, QRadioButton,
Qt)
except ImportError as e:
from PyQt4 import QtGui
from PyQt4.Qt import (QWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel,
QLineEdit, QComboBox, QCheckBox, QPushButton, QTabWidget,
QScrollArea, QGroupBox, QButtonGroup, QRadioButton,
Qt)
from PyQt5 import QtWidgets as QtGui
from PyQt5.Qt import (QWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel,
QLineEdit, QComboBox, QCheckBox, QPushButton, QTabWidget,
QScrollArea, QGroupBox, QButtonGroup, QRadioButton,
Qt)
try:
from calibre.gui2 import QVariant
del QVariant

View file

@ -16,22 +16,13 @@ logger = logging.getLogger(__name__)
from datetime import datetime
try:
from PyQt5 import QtWidgets as QtGui
from PyQt5 import QtCore
from PyQt5.Qt import (QApplication, QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout,
QGridLayout, QPushButton, QFont, QLabel, QCheckBox, QIcon,
QLineEdit, QComboBox, QProgressDialog, QTimer, QDialogButtonBox,
QScrollArea, QPixmap, Qt, QAbstractItemView, QTextEdit,
pyqtSignal, QGroupBox, QFrame)
except ImportError as e:
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.Qt import (QApplication, QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout,
QGridLayout, QPushButton, QFont, QLabel, QCheckBox, QIcon,
QLineEdit, QComboBox, QProgressDialog, QTimer, QDialogButtonBox,
QScrollArea, QPixmap, Qt, QAbstractItemView, QTextEdit,
pyqtSignal, QGroupBox, QFrame)
from PyQt5 import QtWidgets as QtGui
from PyQt5 import QtCore
from PyQt5.Qt import (QApplication, QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout,
QGridLayout, QPushButton, QFont, QLabel, QCheckBox, QIcon,
QLineEdit, QComboBox, QProgressDialog, QTimer, QDialogButtonBox,
QScrollArea, QPixmap, Qt, QAbstractItemView, QTextEdit,
pyqtSignal, QGroupBox, QFrame)
try:
from calibre.gui2 import QVariant

View file

@ -40,10 +40,7 @@ from string import Template
import traceback
from collections import defaultdict
try:
from PyQt5.Qt import (QApplication, QMenu, QTimer, QToolButton)
except ImportError as e:
from PyQt4.Qt import (QApplication, QMenu, QTimer, QToolButton)
from PyQt5.Qt import (QApplication, QMenu, QTimer, QToolButton)
from calibre.constants import numeric_version as calibre_version

View file

@ -12,10 +12,7 @@ import re
import logging
logger = logging.getLogger(__name__)
try:
from PyQt5.Qt import (QApplication, Qt, QColor, QSyntaxHighlighter, QTextCharFormat, QBrush, QFont)
except ImportError as e:
from PyQt4.Qt import (QApplication, Qt, QColor, QSyntaxHighlighter, QTextCharFormat, QBrush, QFont)
from PyQt5.Qt import (QApplication, Qt, QColor, QSyntaxHighlighter, QTextCharFormat, QBrush, QFont)
from fanficfare.six import string_types