Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using setEnabled() or setDisabled()

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.

like image 595
Quaxton Hale Avatar asked Jun 01 '14 03:06

Quaxton Hale


1 Answers

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.

like image 173
Nejat Avatar answered Oct 15 '22 10:10

Nejat