diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-03 10:16:45 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-07 10:27:09 (GMT) |
commit | ea6b181df68a18044a06063ab33dc6eb35b2aba1 (patch) | |
tree | 3963fa624840d90a90645ab58faea98184ee8a24 | |
parent | 7823dc43b85c3d1dd2f3ba10d0e7efbd83888059 (diff) | |
download | Qt-ea6b181df68a18044a06063ab33dc6eb35b2aba1.zip Qt-ea6b181df68a18044a06063ab33dc6eb35b2aba1.tar.gz Qt-ea6b181df68a18044a06063ab33dc6eb35b2aba1.tar.bz2 |
Modified MediaPlayer to set names on its child QObject instances
This is useful for debugging, as it helps to associate nodes in the object tree with the corresponding source code.
-rw-r--r-- | demos/mediaplayer/mediaplayer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/demos/mediaplayer/mediaplayer.cpp b/demos/mediaplayer/mediaplayer.cpp index 5a69e4f..4bbe413 100644 --- a/demos/mediaplayer/mediaplayer.cpp +++ b/demos/mediaplayer/mediaplayer.cpp @@ -152,6 +152,9 @@ MediaPlayer::MediaPlayer(const QString &filePath) : m_AudioOutput(Phonon::VideoCategory), m_videoWidget(new MediaVideoWidget(this)) { + m_videoWindow.setObjectName("videoWindow"); + m_videoWidget->setObjectName("videoWidget"); + setWindowTitle(tr("Media Player")); setContextMenuPolicy(Qt::CustomContextMenu); m_videoWidget->setContextMenuPolicy(Qt::CustomContextMenu); @@ -159,6 +162,7 @@ MediaPlayer::MediaPlayer(const QString &filePath) : QSize buttonSize(34, 28); QPushButton *openButton = new QPushButton(this); + openButton->setObjectName("openButton"); openButton->setIcon(style()->standardIcon(QStyle::SP_DialogOpenButton)); QPalette bpal; @@ -169,20 +173,25 @@ MediaPlayer::MediaPlayer(const QString &filePath) : openButton->setPalette(bpal); rewindButton = new QPushButton(this); + rewindButton->setObjectName("rewindButton"); rewindButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipBackward)); forwardButton = new QPushButton(this); + forwardButton->setObjectName("forwardButton"); forwardButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipForward)); forwardButton->setEnabled(false); playButton = new QPushButton(this); + playButton->setObjectName("playButton"); playIcon = style()->standardIcon(QStyle::SP_MediaPlay); pauseIcon = style()->standardIcon(QStyle::SP_MediaPause); playButton->setIcon(playIcon); slider = new Phonon::SeekSlider(this); + slider->setObjectName("slider"); slider->setMediaObject(&m_MediaObject); volume = new Phonon::VolumeSlider(&m_AudioOutput); + volume->setObjectName("volume"); QVBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setContentsMargins(8, 8, 8, 8); @@ -190,6 +199,7 @@ MediaPlayer::MediaPlayer(const QString &filePath) : QHBoxLayout *layout = new QHBoxLayout(); info = new QLabel(this); + info->setObjectName("info"); info->setMinimumHeight(70); info->setAcceptDrops(false); info->setMargin(2); @@ -227,8 +237,11 @@ MediaPlayer::MediaPlayer(const QString &filePath) : buttonPanelLayout->addLayout(layout); timeLabel = new QLabel(this); + timeLabel->setObjectName("timeLabel"); progressLabel = new QLabel(this); + progressLabel->setObjectName("progressLabel"); QWidget *sliderPanel = new QWidget(this); + sliderPanel->setObjectName("sliderPanel"); QHBoxLayout *sliderLayout = new QHBoxLayout(); sliderLayout->addWidget(slider); sliderLayout->addWidget(timeLabel); @@ -251,6 +264,7 @@ MediaPlayer::MediaPlayer(const QString &filePath) : // forwardButton->setStyle(flatButtonStyle); #endif QWidget *buttonPanelWidget = new QWidget(this); + buttonPanelWidget->setObjectName("buttonPanelWidget"); buttonPanelWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); buttonPanelWidget->setLayout(buttonPanelLayout); vLayout->addWidget(buttonPanelWidget); |