Skip to content

Commit

Permalink
Merge pull request #412 from dalthviz/fixes_issue_411
Browse files Browse the repository at this point in the history
PR: Fix use of QtGui instead of QtWidgets to create QMenu instances
  • Loading branch information
ccordoba12 committed Mar 2, 2020
2 parents 7512ab7 + bc33b95 commit a28c131
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qtconsole/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def _fill_temporary_buffer(self, cursor, text, html=False):
def _context_menu_make(self, pos):
""" Creates a context menu for the given QPoint (in widget coordinates).
"""
menu = QtGui.QMenu(self)
menu = QtWidgets.QMenu(self)

self.cut_action = menu.addAction('Cut', self.cut)
self.cut_action.setEnabled(self.can_cut())
Expand Down
4 changes: 2 additions & 2 deletions qtconsole/rich_jupyter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
from warnings import warn

from qtpy import QtCore, QtGui
from qtpy import QtCore, QtGui, QtWidgets

from ipython_genutils.path import ensure_dir_exists
from traitlets import Bool
Expand Down Expand Up @@ -88,7 +88,7 @@ def _context_menu_make(self, pos):
format = self._control.cursorForPosition(pos).charFormat()
name = format.stringProperty(QtGui.QTextFormat.ImageName)
if name:
menu = QtGui.QMenu(self)
menu = QtWidgets.QMenu(self)

menu.addAction('Copy Image', lambda: self._copy_image(name))
menu.addAction('Save Image As...', lambda: self._save_image(name))
Expand Down

0 comments on commit a28c131

Please sign in to comment.