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

QSound support #287

Closed
mangopipeline opened this issue May 10, 2018 · 4 comments
Closed

QSound support #287

mangopipeline opened this issue May 10, 2018 · 4 comments
Labels

Comments

@mangopipeline
Copy link

Seems the class moved from QtGui.QSound to QtMultimedia.QSound.

usage
QSound.play("my_sound.mp3")

@mottosso
Copy link
Owner

Thanks

@tzaumiaan
Copy link
Contributor

The following patch should fix this issue, right? I only tested with python3.7 and PySide2 and PyQt5. I have so far no workable Qt4 or PySide environment and use cases so not sure if it fully works with also PyQt4 and PySide.

diff --git a/Qt.py b/Qt.py
index 3b8abd5..443547d 100644
--- a/Qt.py
+++ b/Qt.py
@@ -1030,6 +1030,7 @@ _misplaced_members = {
             "QtCompat.qInstallMessageHandler", _qInstallMessageHandler
         ],
         "QtWidgets.QStyleOptionViewItem": "QtCompat.QStyleOptionViewItemV4",
+        "QtMultimedia.QSound": "QtMultimedia.QSound",
     },
     "PyQt5": {
         "QtCore.pyqtProperty": "QtCore.Property",
@@ -1056,6 +1057,7 @@ _misplaced_members = {
             "QtCompat.qInstallMessageHandler", _qInstallMessageHandler
         ],
         "QtWidgets.QStyleOptionViewItem": "QtCompat.QStyleOptionViewItemV4",
+        "QtMultimedia.QSound": "QtMultimedia.QSound",
     },
     "PySide": {
         "QtGui.QAbstractProxyModel": "QtCore.QAbstractProxyModel",
@@ -1090,6 +1092,7 @@ _misplaced_members = {
             "QtCompat.qInstallMessageHandler", _qInstallMessageHandler
         ],
         "QtGui.QStyleOptionViewItemV4": "QtCompat.QStyleOptionViewItemV4",
+        "QtGui.QSound": "QtMultimedia.QSound",
     },
     "PyQt4": {
         "QtGui.QAbstractProxyModel": "QtCore.QAbstractProxyModel",
@@ -1126,6 +1129,7 @@ _misplaced_members = {
             "QtCompat.qInstallMessageHandler", _qInstallMessageHandler
         ],
         "QtGui.QStyleOptionViewItemV4": "QtCompat.QStyleOptionViewItemV4",
+        "QtGui.QSound": "QtMultimedia.QSound",
     }
 }

@mottosso
Copy link
Owner

Hard to say, if you submit a PR the automated tests will kick in and run this for each binding.

@tzaumiaan
Copy link
Contributor

Thanks for your hints on how to contribute. PR #361 passed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants