[Solved] No such signal - My own class
Dear all,
I created my own PushButton to receive a signal when my button get focus. Please see code below:
- {
- Q_OBJECT
- public:
- signals:
- void getFocus();
- protected:
- };
- {
- }
- {
- emit getFocus();
- }
And in the main application I connect the signal to the slot.
- connect(ui->btn1, SIGNAL(gotFocus()), this, SLOT(gotFocus1()));
When I start the application, I receive the following message:
- Object::connect: No such signal MyPushButton::gotFocus() in ../page1.cpp:26
- Object::connect: (sender name: 'btn1')
- Object::connect: (receiver name 'Page1')
So, what is wrong in my code? Any ideas?
I promoted my QPushButton to MyPushButton.
Thanks a lot.
4 replies
You must log in to post a reply. Not a member yet? Register here!


