Skip to content

Commit

Permalink
Remove Qt imports (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marilyth authored Jun 8, 2021
1 parent a7d79a1 commit 5ff94e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mslib/msui/_tests/test_mscolab_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from mslib.msui.mscolab import MSSMscolabWindow
from mslib.mscolab.conf import mscolab_settings
from mslib.mscolab.models import Message
from PyQt5 import QtCore, QtTest, QtWidgets, Qt
from PyQt5 import QtCore, QtTest, QtWidgets
from mslib._tests.utils import mscolab_start_server


Expand Down Expand Up @@ -103,7 +103,7 @@ def test_copy_message(self):
self._send_message("**test message**")
self._send_message("**test message**")
self._activate_context_menu_action(Actions.COPY)
assert Qt.QApplication.clipboard().text() == "**test message**"
assert QtWidgets.QApplication.clipboard().text() == "**test message**"

def test_reply_message(self):
self._send_message("**test message**")
Expand Down
8 changes: 4 additions & 4 deletions mslib/msui/mscolab_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from werkzeug.urls import url_join

from mslib.mscolab.models import MessageType
from PyQt5 import Qt, QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets
from mslib.msui.mss_qt import get_open_filename, get_save_filename
from mslib.msui.qt5 import ui_mscolab_project_window as ui
from mslib.utils import config_loader, show_popup
Expand Down Expand Up @@ -293,7 +293,7 @@ def start_message_edit(self, message_text, message_id):
self.active_edit_id = message_id
self.messageText.setText(message_text)
self.messageText.setFocus()
self.messageText.moveCursor(Qt.QTextCursor.End)
self.messageText.moveCursor(QtGui.QTextCursor.End)
self.editMessageBtn.setVisible(True)
self.cancelBtn.setVisible(True)
self.sendMessageBtn.setVisible(False)
Expand Down Expand Up @@ -621,7 +621,7 @@ def open_context_menu(self, pos):
self.context_menu.exec_(self.messageBox.mapToGlobal(pos))

def handle_copy_action(self):
Qt.QApplication.clipboard().setText(self.message_text)
QtWidgets.QApplication.clipboard().setText(self.message_text)

def handle_download_action(self):
file_name = fs.path.basename(self.attachment_path)
Expand Down Expand Up @@ -668,7 +668,7 @@ def set_selected(self, selected):
def on_link_click(self, url):
if url.scheme() == "":
url.setScheme("http")
Qt.QDesktopServices.openUrl(url)
QtGui.QDesktopServices.openUrl(url)


# Deregister all the syntax that we don't want to allow
Expand Down

0 comments on commit 5ff94e9

Please sign in to comment.