struct LineChartScene::LineChartSceneImpl
{
enum ContextMenuAction {ShowLabels, ShowPoints, SaveAsImage};
};
use it as
LineChartScene::LineChartSceneImpl::ShowLabels
For your info, C++11 also has strong typed enums with precisely the namespace semantics you expected:
enum class Enum2 : unsigned int {Val1, Val2};
The scoping of the enumeration is also defined as the enumeration name's scope. Using the enumerator names requires explicitly scoping. Val1
is undefined, but Enum2::Val1
is defined.
Additionally, C++11 will allow old-style enumerations to provide explicit scoping as well as the definition of the underlying type:
enum Enum3 : unsigned long {Val1 = 1, Val2};
The enumerator names are defined in the enumeration's scope (Enum3::Val1
), but for backwards compatibility, enumerator names are also placed in the enclosing scope.