Changeset View
Changeset View
Standalone View
Standalone View
tools/selection/kpAbstractSelectionTool.cpp
Show All 19 Lines | 2 | /* | |||
---|---|---|---|---|---|
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | 26 | */ | ||
27 | 27 | | |||
28 | | ||||
29 | #define DEBUG_KP_TOOL_SELECTION 0 | | |||
30 | | ||||
31 | | ||||
32 | #include "kpAbstractSelectionTool.h" | 28 | #include "kpAbstractSelectionTool.h" | ||
33 | #include "kpAbstractSelectionToolPrivate.h" | 29 | #include "kpAbstractSelectionToolPrivate.h" | ||
34 | 30 | | |||
35 | #include <QCursor> | 31 | #include <QCursor> | ||
36 | #include <QMenu> | 32 | #include <QMenu> | ||
37 | #include <QTimer> | 33 | #include <QTimer> | ||
38 | 34 | | |||
39 | #include "kpLogCategories.h" | 35 | #include "kpLogCategories.h" | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 148 | { | |||
153 | return (controlPressed () || shiftPressed ()); | 149 | return (controlPressed () || shiftPressed ()); | ||
154 | } | 150 | } | ||
155 | 151 | | |||
156 | //--------------------------------------------------------------------- | 152 | //--------------------------------------------------------------------- | ||
157 | 153 | | |||
158 | // protected | 154 | // protected | ||
159 | void kpAbstractSelectionTool::pushOntoDocument () | 155 | void kpAbstractSelectionTool::pushOntoDocument () | ||
160 | { | 156 | { | ||
161 | #if DEBUG_KP_TOOL_SELECTION && 1 | | |||
162 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::pushOntoDocument() selection=" | 157 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::pushOntoDocument() selection=" | ||
163 | << document ()->selection () << endl; | 158 | << document ()->selection (); | ||
164 | #endif | | |||
165 | Q_ASSERT (document ()->selection ()); | 159 | Q_ASSERT (document ()->selection ()); | ||
166 | environ ()->deselectSelection (); | 160 | environ ()->deselectSelection (); | ||
167 | } | 161 | } | ||
168 | 162 | | |||
169 | //--------------------------------------------------------------------- | 163 | //--------------------------------------------------------------------- | ||
170 | 164 | | |||
171 | // protected | 165 | // protected | ||
172 | void kpAbstractSelectionTool::giveContentIfNeeded () | 166 | void kpAbstractSelectionTool::giveContentIfNeeded () | ||
Show All 18 Lines | |||||
191 | void kpAbstractSelectionTool::addNeedingContentCommand (kpCommand *cmd) | 185 | void kpAbstractSelectionTool::addNeedingContentCommand (kpCommand *cmd) | ||
192 | { | 186 | { | ||
193 | Q_ASSERT (cmd); | 187 | Q_ASSERT (cmd); | ||
194 | 188 | | |||
195 | // Did we fill the selection with content? | 189 | // Did we fill the selection with content? | ||
196 | if (d->currentSelContentCommand) | 190 | if (d->currentSelContentCommand) | ||
197 | { | 191 | { | ||
198 | // Make the border creation a command. | 192 | // Make the border creation a command. | ||
199 | #if DEBUG_KP_TOOL_SELECTION | | |||
200 | qCDebug(kpLogTools) << "\thave currentSelContentCommand"; | 193 | qCDebug(kpLogTools) << "\thave currentSelContentCommand"; | ||
201 | #endif | | |||
202 | commandHistory ()->addCreateSelectionCommand ( | 194 | commandHistory ()->addCreateSelectionCommand ( | ||
203 | new kpToolSelectionCreateCommand ( | 195 | new kpToolSelectionCreateCommand ( | ||
204 | /*virtual*/nameOfCreateCommand (), | 196 | /*virtual*/nameOfCreateCommand (), | ||
205 | *d->currentSelContentCommand->originalSelection (), | 197 | *d->currentSelContentCommand->originalSelection (), | ||
206 | environ ()->commandEnvironment ()), | 198 | environ ()->commandEnvironment ()), | ||
207 | false/*no exec - user already dragged out sel*/); | 199 | false/*no exec - user already dragged out sel*/); | ||
208 | } | 200 | } | ||
209 | 201 | | |||
Show All 34 Lines | 230 | { | |||
244 | viewManager ()->restoreQueueUpdates (); | 236 | viewManager ()->restoreQueueUpdates (); | ||
245 | } | 237 | } | ||
246 | 238 | | |||
247 | //--------------------------------------------------------------------- | 239 | //--------------------------------------------------------------------- | ||
248 | 240 | | |||
249 | // private | 241 | // private | ||
250 | QString kpAbstractSelectionTool::haventBegunDrawUserMessage () | 242 | QString kpAbstractSelectionTool::haventBegunDrawUserMessage () | ||
251 | { | 243 | { | ||
252 | #if DEBUG_KP_TOOL_SELECTION && 0 | | |||
253 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::haventBegunDrawUserMessage()" | 244 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::haventBegunDrawUserMessage()" | ||
254 | " cancelledShapeButStillHoldingButtons=" | 245 | " cancelledShapeButStillHoldingButtons=" | ||
255 | << d->cancelledShapeButStillHoldingButtons | 246 | << d->cancelledShapeButStillHoldingButtons; | ||
256 | << endl; | | |||
257 | #endif | | |||
258 | 247 | | |||
259 | if (d->cancelledShapeButStillHoldingButtons) | 248 | if (d->cancelledShapeButStillHoldingButtons) | ||
260 | return i18n ("Let go of all the mouse buttons."); | 249 | return i18n ("Let go of all the mouse buttons."); | ||
261 | 250 | | |||
262 | return operation (calculateDrawType (), HaventBegunDrawUserMessage).toString (); | 251 | return operation (calculateDrawType (), HaventBegunDrawUserMessage).toString (); | ||
263 | } | 252 | } | ||
264 | 253 | | |||
265 | //--------------------------------------------------------------------- | 254 | //--------------------------------------------------------------------- | ||
266 | 255 | | |||
267 | // public virtual [base kpTool] | 256 | // public virtual [base kpTool] | ||
268 | void kpAbstractSelectionTool::begin () | 257 | void kpAbstractSelectionTool::begin () | ||
269 | { | 258 | { | ||
270 | #if DEBUG_KP_TOOL_SELECTION | | |||
271 | qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::begin()"; | 259 | qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::begin()"; | ||
272 | #endif | | |||
273 | 260 | | |||
274 | ::AssertAllTimersInactive (d); | 261 | ::AssertAllTimersInactive (d); | ||
275 | 262 | | |||
276 | // (state must be after construction, or after some time after end()) | 263 | // (state must be after construction, or after some time after end()) | ||
277 | Q_ASSERT (d->drawType == None); | 264 | Q_ASSERT (d->drawType == None); | ||
278 | Q_ASSERT (!d->currentSelContentCommand); | 265 | Q_ASSERT (!d->currentSelContentCommand); | ||
279 | 266 | | |||
280 | d->dragAccepted = false; | 267 | d->dragAccepted = false; | ||
Show All 23 Lines | |||||
304 | setUserMessage (haventBegunDrawUserMessage ()); | 291 | setUserMessage (haventBegunDrawUserMessage ()); | ||
305 | } | 292 | } | ||
306 | 293 | | |||
307 | //--------------------------------------------------------------------- | 294 | //--------------------------------------------------------------------- | ||
308 | 295 | | |||
309 | // public virtual [base kpTool] | 296 | // public virtual [base kpTool] | ||
310 | void kpAbstractSelectionTool::end () | 297 | void kpAbstractSelectionTool::end () | ||
311 | { | 298 | { | ||
312 | #if DEBUG_KP_TOOL_SELECTION | | |||
313 | qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::end()"; | 299 | qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::end()"; | ||
314 | #endif | | |||
315 | 300 | | |||
316 | if (document ()->selection ()) | 301 | if (document ()->selection ()) | ||
317 | pushOntoDocument (); | 302 | pushOntoDocument (); | ||
318 | 303 | | |||
319 | | ||||
320 | endCreate (); | 304 | endCreate (); | ||
321 | endMove (); | 305 | endMove (); | ||
322 | endResizeScale (); | 306 | endResizeScale (); | ||
323 | 307 | | |||
324 | 308 | | |||
325 | // (should have been killed by cancelShape() or endDraw()) | 309 | // (should have been killed by cancelShape() or endDraw()) | ||
326 | Q_ASSERT (d->drawType == None); | 310 | Q_ASSERT (d->drawType == None); | ||
327 | Q_ASSERT (!d->currentSelContentCommand); | 311 | Q_ASSERT (!d->currentSelContentCommand); | ||
Show All 16 Lines | |||||
344 | ::AssertAllTimersInactive (d); | 328 | ::AssertAllTimersInactive (d); | ||
345 | } | 329 | } | ||
346 | 330 | | |||
347 | //--------------------------------------------------------------------- | 331 | //--------------------------------------------------------------------- | ||
348 | 332 | | |||
349 | // public virtual [base kpTool] | 333 | // public virtual [base kpTool] | ||
350 | void kpAbstractSelectionTool::reselect () | 334 | void kpAbstractSelectionTool::reselect () | ||
351 | { | 335 | { | ||
352 | #if DEBUG_KP_TOOL_SELECTION | | |||
353 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::reselect()"; | 336 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::reselect()"; | ||
354 | #endif | | |||
355 | 337 | | |||
356 | if (document ()->selection ()) | 338 | if (document ()->selection ()) | ||
357 | pushOntoDocument (); | 339 | pushOntoDocument (); | ||
358 | } | 340 | } | ||
359 | 341 | | |||
360 | //--------------------------------------------------------------------- | 342 | //--------------------------------------------------------------------- | ||
361 | 343 | | |||
362 | // protected virtual | 344 | // protected virtual | ||
363 | kpAbstractSelectionTool::DrawType kpAbstractSelectionTool::calculateDrawTypeInsideSelection () const | 345 | kpAbstractSelectionTool::DrawType kpAbstractSelectionTool::calculateDrawTypeInsideSelection () const | ||
364 | { | 346 | { | ||
365 | #if DEBUG_KP_TOOL_SELECTION | | |||
366 | qCDebug(kpLogTools) << "\t\tis move"; | 347 | qCDebug(kpLogTools) << "\t\tis move"; | ||
367 | #endif | | |||
368 | return kpAbstractSelectionTool::Move; | 348 | return kpAbstractSelectionTool::Move; | ||
369 | } | 349 | } | ||
370 | 350 | | |||
371 | //--------------------------------------------------------------------- | 351 | //--------------------------------------------------------------------- | ||
372 | 352 | | |||
373 | // protected virtual | 353 | // protected virtual | ||
374 | kpAbstractSelectionTool::DrawType kpAbstractSelectionTool::calculateDrawType () const | 354 | kpAbstractSelectionTool::DrawType kpAbstractSelectionTool::calculateDrawType () const | ||
375 | { | 355 | { | ||
376 | kpAbstractSelection *sel = document ()->selection (); | 356 | kpAbstractSelection *sel = document ()->selection (); | ||
377 | if (!sel) | 357 | if (!sel) | ||
378 | return Create; | 358 | return Create; | ||
379 | #if DEBUG_KP_TOOL_SELECTION | | |||
380 | qCDebug(kpLogTools) << "\thas sel region rect=" << sel->boundingRect (); | 359 | qCDebug(kpLogTools) << "\thas sel region rect=" << sel->boundingRect (); | ||
381 | #endif | | |||
382 | 360 | | |||
383 | if (onSelectionResizeHandle () && !controlOrShiftPressed ()) | 361 | if (onSelectionResizeHandle () && !controlOrShiftPressed ()) | ||
384 | return ResizeScale; | 362 | return ResizeScale; | ||
385 | else if (sel->contains (currentPoint ())) | 363 | else if (sel->contains (currentPoint ())) | ||
386 | return /*virtual*/calculateDrawTypeInsideSelection (); | 364 | return /*virtual*/calculateDrawTypeInsideSelection (); | ||
387 | else | 365 | else | ||
388 | return Create; | 366 | return Create; | ||
389 | } | 367 | } | ||
390 | 368 | | |||
391 | //--------------------------------------------------------------------- | 369 | //--------------------------------------------------------------------- | ||
392 | 370 | | |||
393 | // public virtual [base kpTool] | 371 | // public virtual [base kpTool] | ||
394 | void kpAbstractSelectionTool::beginDraw () | 372 | void kpAbstractSelectionTool::beginDraw () | ||
395 | { | 373 | { | ||
396 | #if DEBUG_KP_TOOL_SELECTION | | |||
397 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::beginDraw() startPoint ()=" | 374 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::beginDraw() startPoint ()=" | ||
398 | << startPoint () | 375 | << startPoint () | ||
399 | << " QCursor::pos() view startPoint=" | 376 | << " QCursor::pos() view startPoint=" | ||
400 | << viewUnderStartPoint ()->mapFromGlobal (QCursor::pos ()) | 377 | << viewUnderStartPoint ()->mapFromGlobal (QCursor::pos ()); | ||
401 | << endl; | | |||
402 | #endif | | |||
403 | 378 | | |||
404 | // endDraw() and cancelShape() should have taken care of these. | 379 | // endDraw() and cancelShape() should have taken care of these. | ||
405 | ::AssertAllTimersInactive (d); | 380 | ::AssertAllTimersInactive (d); | ||
406 | 381 | | |||
407 | // In case the cursor was wrong to start with | 382 | // In case the cursor was wrong to start with | ||
408 | // (forgot to call kpTool::somethingBelowTheCursorChanged()), | 383 | // (forgot to call kpTool::somethingBelowTheCursorChanged()), | ||
409 | // make sure it is correct during this operation. | 384 | // make sure it is correct during this operation. | ||
410 | hover (currentPoint ()); | 385 | hover (currentPoint ()); | ||
Show All 15 Lines | |||||
426 | } | 401 | } | ||
427 | 402 | | |||
428 | //--------------------------------------------------------------------- | 403 | //--------------------------------------------------------------------- | ||
429 | 404 | | |||
430 | 405 | | |||
431 | // public virtual [base kpTool] | 406 | // public virtual [base kpTool] | ||
432 | void kpAbstractSelectionTool::hover (const QPoint &point) | 407 | void kpAbstractSelectionTool::hover (const QPoint &point) | ||
433 | { | 408 | { | ||
434 | #if DEBUG_KP_TOOL_SELECTION && 1 | | |||
435 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::hover" << point; | 409 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::hover" << point; | ||
436 | #endif | | |||
437 | 410 | | |||
438 | operation (calculateDrawType (), SetCursor); | 411 | operation (calculateDrawType (), SetCursor); | ||
439 | 412 | | |||
440 | setUserShapePoints (point, KP_INVALID_POINT, false/*don't set size*/); | 413 | setUserShapePoints (point, KP_INVALID_POINT, false/*don't set size*/); | ||
441 | if (document () && document ()->selection ()) | 414 | if (document () && document ()->selection ()) | ||
442 | { | 415 | { | ||
443 | setUserShapeSize (document ()->selection ()->width (), | 416 | setUserShapeSize (document ()->selection ()->width (), | ||
444 | document ()->selection ()->height ()); | 417 | document ()->selection ()->height ()); | ||
Show All 10 Lines | |||||
455 | 428 | | |||
456 | //--------------------------------------------------------------------- | 429 | //--------------------------------------------------------------------- | ||
457 | 430 | | |||
458 | 431 | | |||
459 | // public virtual [base kpTool] | 432 | // public virtual [base kpTool] | ||
460 | void kpAbstractSelectionTool::draw (const QPoint &thisPoint, const QPoint & /*lastPoint*/, | 433 | void kpAbstractSelectionTool::draw (const QPoint &thisPoint, const QPoint & /*lastPoint*/, | ||
461 | const QRect &normalizedRect) | 434 | const QRect &normalizedRect) | ||
462 | { | 435 | { | ||
463 | #if DEBUG_KP_TOOL_SELECTION && 1 | | |||
464 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::draw (" << thisPoint | 436 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::draw (" << thisPoint | ||
465 | << ",startPoint=" << startPoint () | 437 | << ",startPoint=" << startPoint () | ||
466 | << ",normalizedRect=" << normalizedRect << ")" << endl; | 438 | << ",normalizedRect=" << normalizedRect << ")"; | ||
467 | #else | | |||
468 | Q_UNUSED (thisPoint); | | |||
469 | Q_UNUSED (normalizedRect); | | |||
470 | #endif | | |||
471 | | ||||
472 | 439 | | |||
473 | // OPT: return when thisPoint == lastPoint () so that e.g. when creating | 440 | // OPT: return when thisPoint == lastPoint () so that e.g. when creating | ||
474 | // Points sel, press modifiers doesn't add multiple points in same | 441 | // Points sel, press modifiers doesn't add multiple points in same | ||
475 | // place | 442 | // place | ||
476 | 443 | | |||
477 | 444 | | |||
478 | operation (d->drawType, Draw); | 445 | operation (d->drawType, Draw); | ||
479 | } | 446 | } | ||
480 | 447 | | |||
481 | //--------------------------------------------------------------------- | 448 | //--------------------------------------------------------------------- | ||
482 | 449 | | |||
483 | 450 | | |||
484 | // public virtual [base kpTool] | 451 | // public virtual [base kpTool] | ||
485 | void kpAbstractSelectionTool::cancelShape () | 452 | void kpAbstractSelectionTool::cancelShape () | ||
486 | { | 453 | { | ||
487 | #if DEBUG_KP_TOOL_SELECTION | | |||
488 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::cancelShape() mouseButton=" | 454 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::cancelShape() mouseButton=" | ||
489 | << mouseButton () << endl; | 455 | << mouseButton (); | ||
490 | #endif | | |||
491 | 456 | | |||
492 | const DrawType oldDrawType = d->drawType; | 457 | const DrawType oldDrawType = d->drawType; | ||
493 | // kpTool::hasBegunDraw() returns false in this method so be consistent | 458 | // kpTool::hasBegunDraw() returns false in this method so be consistent | ||
494 | // and clear "drawType" before dispatching the operation() below. | 459 | // and clear "drawType" before dispatching the operation() below. | ||
495 | d->drawType = None; | 460 | d->drawType = None; | ||
496 | 461 | | |||
497 | 462 | | |||
498 | viewManager ()->setQueueUpdates (); | 463 | viewManager ()->setQueueUpdates (); | ||
499 | { | 464 | { | ||
500 | operation (oldDrawType, Cancel); | 465 | operation (oldDrawType, Cancel); | ||
501 | 466 | | |||
502 | 467 | | |||
503 | if (d->currentSelContentCommand) | 468 | if (d->currentSelContentCommand) | ||
504 | { | 469 | { | ||
505 | #if DEBUG_KP_TOOL_SELECTION | | |||
506 | qCDebug(kpLogTools) << "\t\tundo sel content"; | 470 | qCDebug(kpLogTools) << "\t\tundo sel content"; | ||
507 | #endif | | |||
508 | d->currentSelContentCommand->unexecute (); | 471 | d->currentSelContentCommand->unexecute (); | ||
509 | delete d->currentSelContentCommand; | 472 | delete d->currentSelContentCommand; | ||
510 | d->currentSelContentCommand = nullptr; | 473 | d->currentSelContentCommand = nullptr; | ||
511 | } | 474 | } | ||
512 | 475 | | |||
513 | 476 | | |||
514 | /*virtual*/setSelectionBorderForHaventBegunDraw (); | 477 | /*virtual*/setSelectionBorderForHaventBegunDraw (); | ||
515 | } | 478 | } | ||
Show All 16 Lines | 493 | { | |||
532 | setUserMessage (haventBegunDrawUserMessage ()); | 495 | setUserMessage (haventBegunDrawUserMessage ()); | ||
533 | } | 496 | } | ||
534 | 497 | | |||
535 | //--------------------------------------------------------------------- | 498 | //--------------------------------------------------------------------- | ||
536 | 499 | | |||
537 | // protected | 500 | // protected | ||
538 | void kpAbstractSelectionTool::popupRMBMenu () | 501 | void kpAbstractSelectionTool::popupRMBMenu () | ||
539 | { | 502 | { | ||
540 | #if DEBUG_KP_TOOL_SELECTION | | |||
541 | qCDebug(kpLogTools) << "CALL - exec'ing menu"; | 503 | qCDebug(kpLogTools) << "CALL - exec'ing menu"; | ||
542 | #endif | | |||
543 | 504 | | |||
544 | QMenu *pop = environ ()->selectionToolRMBMenu (); | 505 | QMenu *pop = environ ()->selectionToolRMBMenu (); | ||
545 | Q_ASSERT (pop); | 506 | Q_ASSERT (pop); | ||
546 | 507 | | |||
547 | // Blocks until the menu closes. | 508 | // Blocks until the menu closes. | ||
548 | // WARNING: Enters event loop - may re-enter view/tool event handlers. | 509 | // WARNING: Enters event loop - may re-enter view/tool event handlers. | ||
549 | pop->exec (QCursor::pos ()); | 510 | pop->exec (QCursor::pos ()); | ||
550 | #if DEBUG_KP_TOOL_SELECTION | | |||
551 | qCDebug(kpLogTools) << "calling somethingBelowTheCursorChanged()"; | 511 | qCDebug(kpLogTools) << "calling somethingBelowTheCursorChanged()"; | ||
552 | #endif | | |||
553 | 512 | | |||
554 | // Cursor may have moved while the menu was up, triggering QMouseMoveEvents | 513 | // Cursor may have moved while the menu was up, triggering QMouseMoveEvents | ||
555 | // for the menu -- but not the view -- so we may have missed cursor moves. | 514 | // for the menu -- but not the view -- so we may have missed cursor moves. | ||
556 | // Update cursor position now. | 515 | // Update cursor position now. | ||
557 | somethingBelowTheCursorChanged (); | 516 | somethingBelowTheCursorChanged (); | ||
558 | #if DEBUG_KP_TOOL_SELECTION | | |||
559 | qCDebug(kpLogTools) << "DONE"; | 517 | qCDebug(kpLogTools) << "DONE"; | ||
560 | #endif | | |||
561 | } | 518 | } | ||
562 | 519 | | |||
563 | //--------------------------------------------------------------------- | 520 | //--------------------------------------------------------------------- | ||
564 | 521 | | |||
565 | // public virtual [base kpTool] | 522 | // public virtual [base kpTool] | ||
566 | void kpAbstractSelectionTool::endDraw (const QPoint & /*thisPoint*/, | 523 | void kpAbstractSelectionTool::endDraw (const QPoint & /*thisPoint*/, | ||
567 | const QRect & /*normalizedRect*/) | 524 | const QRect & /*normalizedRect*/) | ||
568 | { | 525 | { | ||
569 | #if DEBUG_KP_TOOL_SELECTION | | |||
570 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::endDraw()"; | 526 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::endDraw()"; | ||
571 | #endif | | |||
572 | 527 | | |||
573 | const DrawType oldDrawType = d->drawType; | 528 | const DrawType oldDrawType = d->drawType; | ||
574 | // kpTool::hasBegunDraw() returns false in this method so be consistent | 529 | // kpTool::hasBegunDraw() returns false in this method so be consistent | ||
575 | // and clear "drawType" before dispatching the operation() below. | 530 | // and clear "drawType" before dispatching the operation() below. | ||
576 | d->drawType = None; | 531 | d->drawType = None; | ||
577 | 532 | | |||
578 | 533 | | |||
579 | viewManager ()->setQueueUpdates (); | 534 | viewManager ()->setQueueUpdates (); | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |