From 6f4e69c22e8979aeaa83552867c5cf8cecbe586f Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 24 May 2012 00:18:43 +0200 Subject: [PATCH] Add method to read the vote as double. --- votecommand.cpp | 5 +++++ votecommand.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/votecommand.cpp b/votecommand.cpp index 8e9cc50..f14b7db 100644 --- a/votecommand.cpp +++ b/votecommand.cpp @@ -188,6 +188,11 @@ int VoteReply::value() const return m_value; } +double VoteReply::vote() const +{ + return double(m_value) / 1000; +} + AniDBUdpClient::VoteCommand::VoteType VoteReply::voteType() const { return m_voteType; diff --git a/votecommand.h b/votecommand.h index cfed933..1ee1616 100644 --- a/votecommand.h +++ b/votecommand.h @@ -72,12 +72,14 @@ class ANIDBUDPCLIENTSHARED_EXPORT VoteReply : public AbstractReply Q_PROPERTY(QString entityName READ entityName); Q_PROPERTY(int value READ value); + Q_PROPERTY(double vote READ vote); // Q_PROPERTY(AniDBUdpClient::VoteCommand::VoteType voteType READ voteType); Q_PROPERTY(int entityId READ entityId); public: QString entityName() const; int value() const; + double vote() const; VoteCommand::VoteType voteType() const; int entityId() const; -- 2.52.0