Skip to content

Commit

Permalink
Split QtGui imports into QtGui and QtWidgets
Browse files Browse the repository at this point in the history
  • Loading branch information
marciomazza committed Nov 29, 2016
1 parent ee7b318 commit 303e1a5
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 36 deletions.
5 changes: 3 additions & 2 deletions add_kanji_embeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
import re
import sys

from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction
from PyQt5.QtCore import SIGNAL
from PyQt5.QtWidgets import QAction


# The rest of the anki componets.
from aqt.utils import askUser, tooltip
Expand Down
5 changes: 3 additions & 2 deletions add_note_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
Add the note id to a field named Note ID in
"""

from PyQt4.QtCore import QCoreApplication, SIGNAL
from PyQt4.QtGui import QAction, QProgressDialog
from PyQt5.QtCore import QCoreApplication, SIGNAL
from PyQt5.QtWidgets import QAction, QProgressDialog


from anki.hooks import addHook
from anki.lang import _
Expand Down
5 changes: 3 additions & 2 deletions colorful_toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
be added by the user.
"""

from PyQt4.QtCore import QSize, Qt, SIGNAL
from PyQt4.QtGui import QAction, QIcon, QMenu, QPalette, QToolBar
from PyQt5.QtCore import QSize, Qt, SIGNAL
from PyQt5.QtGui import QIcon, QPalette
from PyQt5.QtWidgets import QAction, QMenu, QToolBar
import os

from anki.hooks import wrap, addHook
Expand Down
6 changes: 4 additions & 2 deletions downloadaudio/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
"""

import os
from PyQt4.QtGui import QAction, QIcon, QMenu
from PyQt4.QtCore import SIGNAL
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction, QMenu
from PyQt5.QtCore import SIGNAL


from aqt import mw
from aqt.utils import tooltip
Expand Down
4 changes: 2 additions & 2 deletions downloadaudio/downloaders/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# Make this work without PyQt
with_pyqt = True
try:
from PyQt4.QtGui import QImage
from PyQt4.QtCore import QSize, Qt
from PyQt5.QtGui import QImage
from PyQt5.QtCore import QSize, Qt
except ImportError:
with_pyqt = False

Expand Down
2 changes: 1 addition & 1 deletion downloadaudio/downloaders/leo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Make this work without PyQt
with_pyqt = True
try:
from PyQt4.QtGui import QImage
from PyQt5.QtGui import QImage
except ImportError:
with_pyqt = False

Expand Down
4 changes: 2 additions & 2 deletions downloadaudio/downloaders/wiktionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# Make this work without PyQt
with_pyqt = True
try:
from PyQt4.QtGui import QImage
from PyQt4.QtCore import QSize, Qt
from PyQt5.QtGui import QImage
from PyQt5.QtCore import QSize, Qt
except ImportError:
with_pyqt = False

Expand Down
8 changes: 4 additions & 4 deletions downloadaudio/review_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import os

from PyQt4.QtGui import QButtonGroup, QDialog, QDialogButtonBox, QFrame, \
QGridLayout, QIcon, QLabel, QPixmap, QPushButton, QScrollArea, \
QSizePolicy, QVBoxLayout
from PyQt4.QtCore import SIGNAL, SLOT
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtWidgets import QButtonGroup, QDialog, QDialogButtonBox, QFrame, \
QGridLayout, QLabel, QPushButton, QScrollArea, QSizePolicy, QVBoxLayout
from PyQt5.QtCore import SIGNAL, SLOT

from aqt import mw
from anki.lang import _
Expand Down
7 changes: 4 additions & 3 deletions downloadaudio/update_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
Change the download audio parameters on user input.
"""

from PyQt4.QtCore import SIGNAL, SLOT
from PyQt4.QtGui import QDialog, QDialogButtonBox, QFrame, QGridLayout, \
QHBoxLayout, QIcon, QLabel, QLineEdit, QVBoxLayout
from PyQt5.QtCore import SIGNAL, SLOT
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QFrame, QGridLayout, \
QHBoxLayout, QLabel, QLineEdit, QVBoxLayout

from anki.lang import _

Expand Down
4 changes: 2 additions & 2 deletions fix_negative_review_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
http://code.google.com/p/ankidroid/issues/detail?id=1449#c23
"""

from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction
from PyQt5.QtCore import SIGNAL
from PyQt5.QtWidgets import QAction

from anki.lang import _
from aqt import mw
Expand Down
4 changes: 2 additions & 2 deletions local_css_and_diy_night_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
the style from the template.
"""

from PyQt4.QtGui import QAction, QActionGroup, QMenu
from PyQt4.QtCore import SIGNAL
from PyQt5.QtWidgets import QAction, QActionGroup, QMenu
from PyQt5.QtCore import SIGNAL

import os
import re
Expand Down
5 changes: 3 additions & 2 deletions mhwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# http://www.gnu.org/copyleft/gpl.html
u"""Anki 2 add-on that opens an audio editor."""

from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction, QIcon, QMenu
from PyQt5.QtCore import SIGNAL
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction, QMenu
import copy
import os
import re
Expand Down
4 changes: 2 additions & 2 deletions more_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
right hand on the numeric key-pad.
"""

from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QKeySequence, QShortcut
from PyQt5.QtCore import SIGNAL
from PyQt5.QtGui import QKeySequence, QShortcut

from anki.hooks import wrap
from aqt import mw
Expand Down
6 changes: 5 additions & 1 deletion nachschlagen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@


import urllib
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QAction, QMenu

from aqt import mw
from aqt.qt import QDesktopServices, QUrl, QMenu, QAction, SIGNAL
from aqt.qt import SIGNAL
from aqt.utils import tooltip
from aqt.webview import QWebPage

Expand Down
4 changes: 2 additions & 2 deletions quick_note_and_deck_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
## IAR, (or "practicality beats purity"). Put the stuff to change on
## top, even before the imports.

from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QHBoxLayout, QKeySequence, QPushButton, QShortcut
from PyQt5.QtCore import SIGNAL
from PyQt5.QtGui import QHBoxLayout, QKeySequence, QPushButton, QShortcut

from aqt.modelchooser import ModelChooser
from aqt.deckchooser import DeckChooser
Expand Down
4 changes: 2 additions & 2 deletions svg_play_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import shutil

from BeautifulSoup import BeautifulSoup
from PyQt4.QtCore import QUrl
from PyQt4.QtGui import QDesktopServices
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices

from anki.cards import Card
from anki.hooks import addHook, wrap
Expand Down
2 changes: 1 addition & 1 deletion unnormalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import unicodedata

from PyQt4.QtCore import QCoreApplication, SIGNAL
from PyQt4.QtGui import QAction, QProgressDialog
from PyQt5.QtWidgets import QAction, QProgressDialog

from anki.utils import isMac
from anki.lang import _
Expand Down
5 changes: 3 additions & 2 deletions zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

"""Add-on for Anki 2 to zoom in or out."""

from PyQt4.QtCore import Qt, SIGNAL
from PyQt4.QtGui import QAction, QKeySequence, QMenu
from PyQt5.QtCore import Qt, SIGNAL
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QAction, QMenu

from aqt import mw
from anki.hooks import addHook, runHook, wrap
Expand Down

0 comments on commit 303e1a5

Please sign in to comment.