Skip to content

Commit

Permalink
Player example: Simplify slot connections
Browse files Browse the repository at this point in the history
Change-Id: I181164d72ae19eae04570df4fdd6dec76f4af6cb
Reviewed-by: Christian Tismer <tismer@stackless.com>
  • Loading branch information
FriedemannKleint authored and ctismer committed Sep 28, 2017
1 parent b13c6d9 commit b43152d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/multimedia/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):
playMenu = self.menuBar().addMenu("&Play")
playIcon = self.style().standardIcon(QStyle.SP_MediaPlay)
self.playAction = toolBar.addAction(playIcon, "Play")
self.playAction.triggered.connect(self.player, SLOT("play()"))
self.playAction.triggered.connect(self.player.play)
playMenu.addAction(self.playAction)

previousIcon = self.style().standardIcon(QStyle.SP_MediaSkipBackward)
Expand All @@ -83,17 +83,17 @@ def __init__(self):

pauseIcon = self.style().standardIcon(QStyle.SP_MediaPause)
self.pauseAction = toolBar.addAction(pauseIcon, "Pause")
self.pauseAction.triggered.connect(self.player, SLOT("pause()"))
self.pauseAction.triggered.connect(self.player.pause)
playMenu.addAction(self.pauseAction)

nextIcon = self.style().standardIcon(QStyle.SP_MediaSkipForward)
self.nextAction = toolBar.addAction(nextIcon, "Next")
self.nextAction.triggered.connect(self.playlist, SLOT("next()"))
self.nextAction.triggered.connect(self.playlist.next)
playMenu.addAction(self.nextAction)

stopIcon = self.style().standardIcon(QStyle.SP_MediaStop)
self.stopAction = toolBar.addAction(stopIcon, "Stop")
self.stopAction.triggered.connect(self.player, SLOT("stop()"))
self.stopAction.triggered.connect(self.player.stop)
playMenu.addAction(self.stopAction)

self.volumeSlider = QSlider()
Expand All @@ -105,7 +105,7 @@ def __init__(self):
self.volumeSlider.setTickInterval(10)
self.volumeSlider.setTickPosition(QSlider.TicksBelow)
self.volumeSlider.setToolTip("Volume")
self.volumeSlider.valueChanged.connect(self.player, SLOT("setVolume(int)"))
self.volumeSlider.valueChanged.connect(self.player.setVolume)
toolBar.addWidget(self.volumeSlider)

aboutMenu = self.menuBar().addMenu("&About")
Expand Down

0 comments on commit b43152d

Please sign in to comment.