How to disable widget for 1second
Solved
General and Desktop
-
How can I disable the listWidget for 1second and enable it again?
-
widget->setEnabled(false); QTimer::singleShot(1000,widget,std::bind(&QWidget::setEnabled,widget,true));
-
Fixed my code above, I was missing an argument
- did you
#include <functional>
? - are you using Qt >= 5.4?
- did you
-
@Kinesis
I'm to lazy to google my way to the correct include for std::bind, so my suggestion lambda your way through itwidget->setEnabled(false); QTimer::singleShot(1000,widget,[widget]{widget->setEnabled(true);});
7/7