I'm working in a Qt project where the user can enable or disable a QPushButton by selecting or deselecting a QCheckBox.
I have already developed a function where the mouse event enable the QPushButton, but the problem is that when i deselect the QCheckBox the QPushButton remain enabled.
Is there a Qt function to disable a button when QCheckBox are unchecked?
This is the code i wrote:
//Class.h
//Function to enable the button
private slots:
void on_QCheckBox_clicked();
//Class.cpp
void class::on_QCheckBox_clicked() {
ui->QPushButton->setEnabled(true);
//Here i enabled the button with setEnabled function
}