c++ - Qt conversion error when connecting slots and signals -


i have class inherits qlistwidget called menu , trying connect class' signals widget's slots.

class menu : qlistwidget { q_object  public:     menu(config &config, qwidget *parent = 0);     ~menu();  public slots:     void itemchanged(qlistwidgetitem *item);  signals:     void clickeditemchanged(std::string item);  private:     std::vector<qlistwidgetitem*> items;  };  // in widget connect signals , slots  connect(menu, signal(clickeditemchanged(std::string)),         this, slot(menuitemchanged(std::string))); 

but compilation failed, saying cannot cast 'menu' private base class 'const qobject'. signature of slot matches of signal, , widget class slot belongs holds reference menu. caused problem , how should solve it?


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -