hi all,
i have a global enum defined as:
enum EditType {Currency, Percent, LabeledNumber, Text};
enum EditType {Currency, Percent, LabeledNumber, Text};
To copy to clipboard, switch view to plain text mode
then i have a class with an enum defined identically:
{
public:
A();
~A();
enum EditTypeBase {Currency, Percent, LabeledNumber, Text};
EditTypeBase LineType;
...
}
class A : public QWidget
{
public:
A();
~A();
enum EditTypeBase {Currency, Percent, LabeledNumber, Text};
EditTypeBase LineType;
...
}
To copy to clipboard, switch view to plain text mode
in the function definitions i need to map from EditTypeBase to EditType. i HAVE to do it this way because of the meta-object compiler.
how do i compare the two enums?
EditType A::GetType()
{
if (LineType == Currency)
return EditType::Currency;
...
}
EditType A::GetType()
{
if (LineType == Currency)
return EditType::Currency;
...
}
To copy to clipboard, switch view to plain text mode
this gives a syntax error. the first 'Currency' is from EditTypeBase defined inside the class, but the 2nd 'Currency' is of type EditType defined outside. how do i properly refer to EditType enumerators within class A since they have the same names as the ones defined inside the class?
thanks
lou
Bookmarks