Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6832199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:49:47+00:00 2026-05-26T22:49:47+00:00

If I have the following: struct LineChartScene::LineChartSceneImpl { enum ContextMenuAction {ShowLabels, ShowPoints, SaveAsImage}; };

  • 0

If I have the following:

struct LineChartScene::LineChartSceneImpl
{
    enum ContextMenuAction {ShowLabels, ShowPoints, SaveAsImage};
};

How can I access ShowLabels, ShowPoints etc outside LineChartScene::LineChartSceneImpl struct? I thought LineChartScene::LineChartSceneImpl::ContextMenuAction::ShowLabels would work but it doesn’t. I’m using C++, Qt Creator 2.2.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:49:47+00:00Added an answer on May 26, 2026 at 10:49 pm
    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following struct: typedef enum { kPacketTypeJoin = 1, kPacketTypeServerAcceptedJoin, kPacketTypeSelectedNumber, }
I have a following templated struct : template<int Degree> struct CPowerOfTen { enum {
I have the following struct: struct Datastore_T { Partition_Datastores_T cmtDatastores; // bytes 0 to
Suppose I have the following: struct Person { std::string mName; Birthday mBirthday; }; using
Let's say we have following code: struct A{ virtual ~A(){} void f(){ p =
Say, I have the following struct in C# : public struct MyStructCSharp { private
I have declared the following struct: typedef struct _RECOGNITIONRESULT { int begin_time_ms, end_time_ms; char*
Say I have the following code: struct date { int day; int month; int
Let's say I have the following code: struct mytype { ~mytype() { /* do
I'm using C++, and I have the following structures: struct ArrayOfThese { int a;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.