Example: Notify user of errors

Before, the widget simply failed silently, which gave the impression
that the widget is broken.

Change-Id: I8ab7ed0e0a62f9643791b6f4732f7f3b2cd7521a
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Sze Howe Koh
2012-12-19 00:11:29 +08:00
committed by The Qt Project
parent d13a7a1f89
commit 404b7dbe3f
2 changed files with 17 additions and 1 deletions

View File

@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
class QAbstractButton;
class QSlider;
class QLabel;
QT_END_NAMESPACE
class VideoPlayer : public QWidget
@@ -67,11 +68,13 @@ private slots:
void positionChanged(qint64 position);
void durationChanged(qint64 duration);
void setPosition(int position);
void handleError();
private:
QMediaPlayer mediaPlayer;
QAbstractButton *playButton;
QSlider *positionSlider;
QLabel *errorLabel;
};
#endif