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

  • Home
  • SEARCH
  • 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 807921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:28:47+00:00 2026-05-15T00:28:47+00:00

i created a singleton class and trying to access that class in other class

  • 0

i created a singleton class and trying to access that class in other class but getting error
“cannot access private member”

Setupconfig is my singleton class and i am trying to access this class in other class which have QMainWindow

And here is the error message:

Error ‘Setupconfig::Setupconfig’ : cannot access private member
declared in class ‘Setupconfig’

Setupconfig.h
static Setupconfig *buiderObj()
{
    static Setupconfig *_setupObj= new Setupconfig();
    return _setupObj;
}

private:
Setupconfig();

//////////////////////////////////////
EasyBudget.h
class EasyBudget : public QMainWindow, public Ui::EasyBudgetClass, public Setupconfig
{
Q_OBJECT
public:
Setupconfig *setupObj;
}

//////////////////////////////////////
EasyBudget.cpp
EasyBudget::EasyBudget(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent,Qt::FramelessWindowHint)
 {
 setupObj=Setupconfig::buiderObj();
 }
  • 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-15T00:28:48+00:00Added an answer on May 15, 2026 at 12:28 am

    Why are you deriving “EasyBudget” from the singleton class “SetupConfig”?

    Remove that part to resolve your problem.

    EasyBudget.h
    class EasyBudget : public QMainWindow, public Ui::EasyBudgetClass
    {......
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK so im trying to create a settings class to store certain strings that
I'm trying to build something (ultimately a gem but for now an application) that
I'm having a very hard time trying to access a custom configuration section in
I am using .Net Remoting and trying to access a remote object modified in
I have had several occasions recently to access a specific class several times over
I'm currently struggling to understand how I should organize/structure a class which I have
I'm trying to use linq to sql for my project (very short deadline), and
I am experimenting with PHP OOP what i'm trying to find out is, Is
I'm just starting my journey into OOP - and I'm currently trying to roll

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.