Using setEnabled() or setDisabled()

c++, qt, user-interface, widget

Solution

They both modify the same property. `setDisabled` is just for convenience, for example if you use it as a slot for a toggled signal.

Using `setEnabled` and `setDisabled` you can either enable or disable a widget by toggling a button/action/checkbox without needing an intermediate slot to invert the value.

Problem

If I want to disable a button from being clicked while a GUI function is calculating, is there any difference between using `setEnabled(false)` or `setDisabled(true)`? I am just curious why there are two functions that seem to have the same purpose.

Original source