QPushButton* button = new QPushButton("Click me"); button->setEnabled(true); // widget is enabled bool isButtonEnabled = button->isEnabled(); // true
QLineEdit* input = new QLineEdit(); input->setEnabled(false); // widget is disabled bool isInputEnabled = input->isEnabled(); // falseThis example creates a QLineEdit and sets it to be disabled. The isEnabled() method is then called and returns false. Package/library: Qt.