Reputation: 1329
Why won't this work?
void RatingWidget::mouseDoubleClickEvent(QMouseEvent * e)
{
this->setEnabled(!this->Enabled);
}
// I also tried...
void RatingWidget::mouseDoubleClickEvent(QMouseEvent * e)
{
if(this->isEnabled())
this->setEnabled(false);
else
this->setEnabled true;
}
It works the first time, but after that it remains disabled.
Upvotes: 1
Views: 87
Reputation: 22272
To quote the documentation..
An enabled widget handles keyboard and mouse events; a disabled widget does not.
So once you disable it, you aren't going to get any more mouse events :)
Upvotes: 1