File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -185,19 +185,18 @@ void PinItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* _event)
185
185
if (m_dragging)
186
186
{
187
187
qDebug () << " Pin Release!" ;
188
-
189
188
QList<QGraphicsItem*> items = scene ()->items (_event->scenePos ());
190
189
191
- PinItem* pin = nullptr ;
192
- for (int i = 0 ; i < items.size () && pin == nullptr ; i++)
193
- {
194
- pin = dynamic_cast <PinItem*>(items[i]);
195
- }
196
-
197
- if (link (pin))
190
+ bool found = false ;
191
+ for (int i = 0 ; !found && i < items.size (); ++i)
198
192
{
199
- qDebug () << " Pin connected!" ;
200
- pin->update ();
193
+ PinItem* pin = dynamic_cast <PinItem*>(items[i]);
194
+ if (link (pin))
195
+ {
196
+ qDebug () << " Pin connected!" ;
197
+ pin->update ();
198
+ found = true ;
199
+ }
201
200
}
202
201
203
202
m_dragging = false ;
You can’t perform that action at this time.
0 commit comments