don't change our state unless the mouse was release inside of the widget
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=735135
This commit is contained in:
parent
2089854d5e
commit
a61562ad95
@ -192,8 +192,12 @@ void CheckBox::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||
d->state = Qt::Checked;
|
||||
}
|
||||
}
|
||||
|
||||
update();
|
||||
emit clicked();
|
||||
|
||||
if (sceneBoundingRect().contains(event->scenePos())) {
|
||||
emit clicked();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -255,11 +255,14 @@ void PushButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
event->accept();
|
||||
if (d->state == Private::Pressed) {
|
||||
d->state = Private::Released;
|
||||
emit clicked();
|
||||
|
||||
if (d->checkable) {
|
||||
d->checked = ! d->checked;
|
||||
emit toggled(d->checked);
|
||||
if (sceneBoundingRect().contains(event->scenePos())) {
|
||||
emit clicked();
|
||||
|
||||
if (d->checkable) {
|
||||
d->checked = ! d->checked;
|
||||
emit toggled(d->checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
|
@ -123,9 +123,9 @@ void RadioButton::setChecked(bool checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
// If not, we should be on a scene, not flying anywhere
|
||||
else if (checked && !parentItem() && scene())
|
||||
{
|
||||
// we should be on a scene, not flying anywhere
|
||||
foreach(QGraphicsItem *sibling, scene()->items())
|
||||
{
|
||||
siblingRadioButton = dynamic_cast<RadioButton*>(sibling);
|
||||
@ -173,10 +173,13 @@ void RadioButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
d->mouseDown = false;
|
||||
setChecked(true);
|
||||
update();
|
||||
|
||||
emit clicked();
|
||||
if (sceneBoundingRect().contains(event->scenePos())) {
|
||||
setChecked(true);
|
||||
emit clicked();
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void RadioButton::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
Loading…
Reference in New Issue
Block a user