Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Qt imports #1019

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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