I need to simulate a button click from C++ code. I have written the following code so far
/*
* signalhandler.hpp
*
* Created on: Nov 14, 2013
* Author: fnazeem
*/
#ifndef SIGNALHANDLER_HPP_
#define SIGNALHANDLER_HPP_
#include <QObject>
namespace bb
{
namespace cascades
{
class Button;
}
}
class signalhandler : public QObject
{
Q_OBJECT
public:
signalhandler();
public slots:
void onClicked(bb::cascades::Button *button);
};
#endif /* SIGNALHANDLER_HPP_ */
in signalhandler.cpp so far this is what i have wriiten. Assume that I have the address of a specific button, and I want to emit a "clicked" signal for that button, without manually clicking it.
/*
* signalhandler.cpp
*
* Created on: Nov 14, 2013
* Author: fnazeem
*/
#include "signalhandler.hpp"
#include <bb/cascades/Button>
void signalhandler::onClicked(bb::cascades::Button *button){
emit button->clicked();
}
When I build the project I get an error in emit button->clicked();
this is the error
C:/bbndk/target_10_1_0_1020/qnx6/usr/include/bb/cascades/controls/abstractbutton.h:60:14: error: 'void bb::cascades::AbstractButton::clicked()' is protected
It says clicked is a protected method. IS there any work around to solve this issue and meet my goal?