I have created a ToolButton with my qt designer and Im trying to connect it to a slot.
I wrote this
connect(ui->toolButton_addfiles, SIGNAL(triggered()), this, SLOT(changeDirectory()));
Im able to run the program but when I press the button I see the following log into my qt Application Output :
Object::connect: No such signal QToolButton::triggered() in ../RightDoneIt/rightdoneit.cpp:10
Object::connect: (sender name: 'toolButton_addfiles')
Object::connect: (receiver name: 'RightDoneIt')
- If I change the toolButton_addfile to some action like (actionChange_addfile) it will work fine.
How can I make this connection work ?
As the error says, there’s no signal
triggered()buttriggered(QAction*)in theQToolButton.Edit
In the connect function you must have the signal signature like
triggered(QAction*)sinceQToolButtonclass has no signaltriggered()(with no parameter) declared