I've been working with C++ on a Time class in Qt and I need to write an enum class
that contains the formats that I use in showTime()
. Because of the nature of the QString
formats I've been getting the following error, the value is not convertible to 'int'
. I would gladly appreciate any help or suggestions.
P.S: Here's the code:
enum class TimeFormat {
a = "hh:mm:ss",
b = "hh:mm",
c = "H:m:s a"
};
class Time {
public:
Time();
~Time();
void setTime(QTime t);
QString showTime(){
return time->toString(format);
}
private:
QTime* time;
TimeFormat format;
};