Results 1 to 1 of 1

Thread: conversion to 'const QObject *' exists, but is inaccessible

  1. #1
    Join Date
    Mar 2013
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: conversion to 'const QObject *' exists, but is inaccessible

    In my project i have class Scheduller(.h is below)
    Qt Code:
    1. class Scheduller : QObject
    2. {
    3. Q_OBJECT
    4. protected:
    5. Scheduller();
    6. ~Scheduller();
    7. static Scheduller* _instance;
    8. static int _instanceCount;
    9. void timerEvent(QTimerEvent *event);
    10. public:
    11. static Scheduller* getInstance();
    12. static void freeInstance();
    13. private:
    14. int cuurentTimerID;
    15. QList<SchedulerTask> tasks;
    16. QApplicationSettings* settings;
    17. void checkTasks();
    18. public slots:
    19. void UpdateTasks();
    20. };
    To copy to clipboard, switch view to plain text mode 
    To copy to clipboard, switch view to plain text mode
    In some other part of code i have
    Qt Code:
    1. QObject::connect(this,SIGNAL(tasksChanged()),scheduller,SLOT(UpadteTasks()));
    To copy to clipboard, switch view to plain text mode 
    To copy to clipboard, switch view to plain text mode
    I dont understand why compiler says me
    error C2243: 'type cast' : conversion from 'Scheduller *' to 'const QObject *' exists, but is inaccessible
    Could any one explain why this happend and how to fix this ?
    The answer
    hooly s**t....
    The answer is because the default inheirt type it private....
    class Scheduller : public QObject
    sory for making a thread. It may be deleted....

  2. The following user says thank you to big_buka for this useful post:

    Meep (30th January 2017)

Similar Threads

  1. Replies: 2
    Last Post: 24th December 2015, 13:33
  2. how to conver from 'QObject* const' to 'QLabel'?
    By kenchan in forum Qt Programming
    Replies: 6
    Last Post: 27th November 2012, 01:26
  3. Replies: 5
    Last Post: 8th September 2011, 10:38
  4. Replies: 2
    Last Post: 21st February 2011, 14:52
  5. conversion from QString to const uint8 *
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2007, 13:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.