本文整理汇总了Python中playlist.Playlist.setParent方法的典型用法代码示例。如果您正苦于以下问题:Python Playlist.setParent方法的具体用法?Python Playlist.setParent怎么用?Python Playlist.setParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.setParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QMPCApp
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import setParent [as 别名]
#.........这里部分代码省略.........
if not have_maemo:
self.mw = QMainWindow()
menu = self.mw.menuBar()
menufile = menu.addMenu("&File")
menuwindows = menu.addMenu("&Windows")
self.mw.statusBar()
menuwindows.addAction(self.actionPlayer)
menuwindows.addAction(self.actionPlaylist)
menuwindows.addAction(self.actionBrowser)
menuwindows.addAction(self.actionOutputs)
menuwindows.addAction(self.actionStats)
menufile.addAction(self.actionConnect)
menufile.addAction(self.actionPrefs)
menufile.addSeparator()
menufile.addAction("&Quit", QApplication.quit)
self.setConnectionState(False)
def initStartScreen(self):
self.startscreen = StartScreen(self)
self.startscreen.clicked.connect(self.connectActivated)
if have_maemo:
menu = QMenuBar(self.startscreen)
menu.addAction(self.actionConnect)
menu.addAction(self.actionPrefs)
def initWidgets(self):
# create subwidgets
self.player = Player(self)
self.playlist = Playlist(self)
self.browser = Browser(self)
if have_maemo:
# build Maemo stack hierarchy
self.playlist.setParent(self.player)
self.browser.setParent(self.player)
for w in [ self.player, self.playlist, self.browser ]:
w.setAttribute( Qt.WA_Maemo5StackedWindow)
w.setWindowFlags( w.windowFlags() | Qt.Window)
# add menu bar
menu = QMenuBar(self.player)
menu.addAction(self.actionPlaylist)
menu.addAction(self.actionBrowser)
menu.addAction(self.actionStats)
menu.addAction(self.actionOutputs)
menu.addAction(self.actionPrefs)
menu.addAction(self.actionConnect)
else:
self.stack = QStackedWidget()
for w in [ self.player, self.playlist, self.browser ]:
w.setParent(self.stack)
self.stack.addWidget(w)
def switchView(self, connected):
if have_maemo:
if connected:
self.player.show()
self.startscreen.hide()
else:
self.startscreen.show()
else:
cw = self.mw.centralWidget()
if cw:
cw.setParent(None)
cw.hide()
if connected: