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

PyQt vs. PySide QFontDialog.getFont difference #36

Open
wants to merge 1 commit into
base: python3
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions usdmanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3862,9 +3862,9 @@ def mouseMoveEvent(self, e):
drag = QtGui.QDrag(self)
drag.setPixmap(self.style().standardIcon(QtWidgets.QStyle.SP_ArrowUp).pixmap(12, 12))
mimeData = QtCore.QMimeData()
mimeData.setData("action", "moveTab")
mimeData.setData("action", QtCore.QByteArray(b"moveTab"))
# Set the source window index so we know which window the drag/drop came from.
mimeData.setData("window", str(self.currentWindowIndex()))
mimeData.setData("window", QtCore.QByteArray(str(self.currentWindowIndex()).encode('utf-8')))
drag.setMimeData(mimeData)
drag.exec_()

Expand All @@ -3877,7 +3877,7 @@ def dragEnterEvent(self, e):
"""
mime = e.mimeData()
formats = mime.formats()
if "action" in formats and "window" in formats and mime.data("action") == "moveTab":
if "action" in formats and "window" in formats and mime.data("action") == b"moveTab":
e.acceptProposedAction()

def currentWindowIndex(self):
Expand Down
7 changes: 6 additions & 1 deletion usdmanager/preferences_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
""" Create a Preferences dialog.
"""

import Qt
from Qt.QtCore import Slot, QRegExp
from Qt.QtGui import QRegExpValidator
from Qt.QtWidgets import QAbstractButton, QDialog, QDialogButtonBox, QFontDialog, QLineEdit, QMessageBox, QVBoxLayout
Expand Down Expand Up @@ -376,7 +377,11 @@ def restoreDefaults(self, btn):
def selectFont(self, *args):
""" Update the user's font preference.
"""
font, ok = QFontDialog.getFont(self.docFont, self, "Select Font")
result = QFontDialog.getFont(self.docFont, self, "Select Font")
if Qt.IsPyQt4 or Qt.IsPyQt5:
font, ok = result
else:
ok, font = result
if ok:
self.docFont = font
self.updateFontLabel()
Expand Down