I discovered a very curious thing. I have a big MainWindow class that does a lot of computations with a GUI. In order to keep the GUI responsive, I created a thread for a QTimer that updates the GUI every n milliseconds and another thread for the computations, and now all is very smooth and fast.
A simple problem I noticed is that when calling this
connect (_worker, &RRTWorker::finished, [=]()
{
ui->stopButton->setEnabled(false);
});
, that is, when the worker
emits the signal finished
(when it has ended computations), both with [=]
and [&]
the stopButton
gets disabled BUT the label inside is still black (not with that greyish filter as normal disabled buttons).
If you need some feedback, here is a picture:
As you can clearly see, the Start button gets grayed out completely, and that is done in the on_startButtonclicked()
via the statement
ui->startButton->setEnabled(false)
.
So, is this a bug, or am I doing something wrong?