Added antennaConnected property to QRadioTuner and radio qml element

Change-Id: I5af8487277e0444629c710c6a0a4e890a8d35c6f
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Jonas Rabbe
2012-01-30 13:53:30 +10:00
committed by Qt by Nokia
parent 5e801e2793
commit 9d3102efe2
6 changed files with 52 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ QDeclarativeRadio::QDeclarativeRadio(QObject *parent) :
connect(m_radioTuner, SIGNAL(volumeChanged(int)), this, SIGNAL(volumeChanged(int)));
connect(m_radioTuner, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool)));
connect(m_radioTuner, SIGNAL(stationFound(int, QString)), this, SIGNAL(stationFound(int, QString)));
connect(m_radioTuner, SIGNAL(antennaConnectedChanged(bool)), this, SIGNAL(antennaConnectedChanged(bool)));
connect(m_radioTuner, SIGNAL(error(QRadioTuner::Error)), this, SLOT(_q_error(QRadioTuner::Error)));
}
@@ -293,6 +294,16 @@ int QDeclarativeRadio::maximumFrequency() const
return m_radioTuner->frequencyRange(m_radioTuner->band()).second;
}
/*!
\qmlproperty int Radio::antennaConnected
This property is true if there is an antenna connected. Otherwise it will be false.
*/
bool QDeclarativeRadio::isAntennaConnected() const
{
return m_radioTuner->isAntennaConnected();
}
/*!
\qmlmethod bool Radio::isAvailable()

View File

@@ -75,6 +75,7 @@ class QDeclarativeRadio : public QObject
Q_PROPERTY(int frequencyStep READ frequencyStep NOTIFY bandChanged)
Q_PROPERTY(int minimumFrequency READ minimumFrequency NOTIFY bandChanged)
Q_PROPERTY(int maximumFrequency READ maximumFrequency NOTIFY bandChanged)
Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
Q_ENUMS(State)
Q_ENUMS(Band)
Q_ENUMS(Error)
@@ -131,6 +132,8 @@ public:
int minimumFrequency() const;
int maximumFrequency() const;
bool isAntennaConnected() const;
Q_INVOKABLE bool isAvailable() const;
public Q_SLOTS:
@@ -160,6 +163,7 @@ Q_SIGNALS:
void volumeChanged(int volume);
void mutedChanged(bool muted);
void stationFound(int frequency, QString stationId);
void antennaConnectedChanged(bool connectionStatus);
void errorChanged();
void error(QDeclarativeRadio::Error errorCode);