Changeset View
Changeset View
Standalone View
Standalone View
kpViewScrollableContainer.cpp
Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Line(s) | 385 | { | |||
---|---|---|---|---|---|
399 | 399 | | |||
400 | m_rightGrip->hide (); | 400 | m_rightGrip->hide (); | ||
401 | connectGripSignals (m_rightGrip); | 401 | connectGripSignals (m_rightGrip); | ||
402 | 402 | | |||
403 | m_bottomRightGrip->hide (); | 403 | m_bottomRightGrip->hide (); | ||
404 | connectGripSignals (m_bottomRightGrip); | 404 | connectGripSignals (m_bottomRightGrip); | ||
405 | 405 | | |||
406 | 406 | | |||
407 | connect (horizontalScrollBar(), SIGNAL(valueChanged(int)), | 407 | connect (horizontalScrollBar(), &QScrollBar::valueChanged, | ||
408 | this, SLOT(slotContentsMoved())); | 408 | this, &kpViewScrollableContainer::slotContentsMoved); | ||
409 | 409 | | |||
410 | connect (verticalScrollBar(), SIGNAL(valueChanged(int)), | 410 | connect (verticalScrollBar(), &QScrollBar::valueChanged, | ||
411 | this, SLOT(slotContentsMoved())); | 411 | this, &kpViewScrollableContainer::slotContentsMoved); | ||
412 | 412 | | |||
413 | connect (m_dragScrollTimer, SIGNAL (timeout()), | 413 | connect (m_dragScrollTimer, &QTimer::timeout, this, [this]{slotDragScroll();}); | ||
414 | this, SLOT (slotDragScroll())); | | |||
415 | 414 | | |||
416 | m_overlay->hide(); | 415 | m_overlay->hide(); | ||
417 | } | 416 | } | ||
418 | 417 | | |||
419 | //--------------------------------------------------------------------- | 418 | //--------------------------------------------------------------------- | ||
420 | 419 | | |||
421 | // protected | 420 | // protected | ||
422 | void kpViewScrollableContainer::connectGripSignals (kpGrip *grip) | 421 | void kpViewScrollableContainer::connectGripSignals (kpGrip *grip) | ||
423 | { | 422 | { | ||
424 | connect (grip, SIGNAL (beganDraw()), | 423 | connect (grip, &kpGrip::beganDraw, | ||
425 | this, SLOT (slotGripBeganDraw())); | 424 | this, &kpViewScrollableContainer::slotGripBeganDraw); | ||
426 | connect (grip, SIGNAL (continuedDraw(int,int,bool)), | | |||
427 | this, SLOT (slotGripContinuedDraw(int,int,bool))); | | |||
428 | connect (grip, SIGNAL (cancelledDraw()), | | |||
429 | this, SLOT (slotGripCancelledDraw())); | | |||
430 | connect (grip, SIGNAL (endedDraw(int,int)), | | |||
431 | this, SLOT (slotGripEndedDraw(int,int))); | | |||
432 | 425 | | |||
433 | connect (grip, SIGNAL (statusMessageChanged(QString)), | 426 | connect (grip, &kpGrip::continuedDraw, | ||
434 | this, SLOT (slotGripStatusMessageChanged(QString))); | 427 | this, &kpViewScrollableContainer::slotGripContinuedDraw); | ||
435 | 428 | | |||
436 | connect (grip, SIGNAL (releasedAllButtons()), | 429 | connect (grip, &kpGrip::cancelledDraw, | ||
437 | this, SLOT (recalculateStatusMessage())); | 430 | this, &kpViewScrollableContainer::slotGripCancelledDraw); | ||
431 | | ||||
432 | connect (grip, &kpGrip::endedDraw, | ||||
433 | this, &kpViewScrollableContainer::slotGripEndedDraw); | ||||
434 | | ||||
435 | connect (grip, &kpGrip::statusMessageChanged, | ||||
436 | this, &kpViewScrollableContainer::slotGripStatusMessageChanged); | ||||
437 | | ||||
438 | connect (grip, &kpGrip::releasedAllButtons, | ||||
439 | this, &kpViewScrollableContainer::recalculateStatusMessage); | ||||
438 | } | 440 | } | ||
439 | 441 | | |||
440 | //--------------------------------------------------------------------- | 442 | //--------------------------------------------------------------------- | ||
441 | 443 | | |||
442 | // public | 444 | // public | ||
443 | QSize kpViewScrollableContainer::newDocSize () const | 445 | QSize kpViewScrollableContainer::newDocSize () const | ||
444 | { | 446 | { | ||
445 | return newDocSize (m_resizeRoundedLastViewDX, | 447 | return newDocSize (m_resizeRoundedLastViewDX, | ||
▲ Show 20 Lines • Show All 441 Lines • ▼ Show 20 Line(s) | 878 | { | |||
887 | emit contentsMoved(); | 889 | emit contentsMoved(); | ||
888 | } | 890 | } | ||
889 | 891 | | |||
890 | //--------------------------------------------------------------------- | 892 | //--------------------------------------------------------------------- | ||
891 | 893 | | |||
892 | // protected | 894 | // protected | ||
893 | void kpViewScrollableContainer::disconnectViewSignals () | 895 | void kpViewScrollableContainer::disconnectViewSignals () | ||
894 | { | 896 | { | ||
895 | disconnect (m_view, SIGNAL (sizeChanged(QSize)), | 897 | disconnect (m_view, | ||
896 | this, SLOT (updateGrips())); | 898 | static_cast<void (kpView::*)(int, int)>(&kpView::sizeChanged), | ||
897 | disconnect (m_view, SIGNAL (destroyed()), | 899 | this, &kpViewScrollableContainer::updateGrips); | ||
898 | this, SLOT (slotViewDestroyed())); | 900 | | ||
901 | disconnect (m_view, &kpView::destroyed, | ||||
902 | this, &kpViewScrollableContainer::slotViewDestroyed); | ||||
899 | } | 903 | } | ||
900 | 904 | | |||
901 | //--------------------------------------------------------------------- | 905 | //--------------------------------------------------------------------- | ||
902 | 906 | | |||
903 | // protected | 907 | // protected | ||
904 | void kpViewScrollableContainer::connectViewSignals () | 908 | void kpViewScrollableContainer::connectViewSignals () | ||
905 | { | 909 | { | ||
906 | connect (m_view, SIGNAL (sizeChanged(QSize)), | 910 | connect (m_view, | ||
907 | this, SLOT (updateGrips())); | 911 | static_cast<void (kpView::*)(int, int)>(&kpView::sizeChanged), | ||
908 | connect (m_view, SIGNAL (destroyed()), | 912 | this, &kpViewScrollableContainer::updateGrips); | ||
909 | this, SLOT (slotViewDestroyed())); | 913 | | ||
914 | connect (m_view, &kpView::destroyed, | ||||
915 | this, &kpViewScrollableContainer::slotViewDestroyed); | ||||
910 | } | 916 | } | ||
911 | 917 | | |||
912 | //--------------------------------------------------------------------- | 918 | //--------------------------------------------------------------------- | ||
913 | 919 | | |||
914 | // public | 920 | // public | ||
915 | kpView *kpViewScrollableContainer::view () const | 921 | kpView *kpViewScrollableContainer::view () const | ||
916 | { | 922 | { | ||
917 | return m_view; | 923 | return m_view; | ||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | 1076 | { | |||
1133 | m_scrollTimerRunOnce = true; | 1139 | m_scrollTimerRunOnce = true; | ||
1134 | 1140 | | |||
1135 | if (didSomething) | 1141 | if (didSomething) | ||
1136 | *didSomething = scrolled; | 1142 | *didSomething = scrolled; | ||
1137 | 1143 | | |||
1138 | return scrolled; | 1144 | return scrolled; | ||
1139 | } | 1145 | } | ||
1140 | 1146 | | |||
1141 | //--------------------------------------------------------------------- | | |||
1142 | | ||||
1143 | // protected slot | | |||
1144 | bool kpViewScrollableContainer::slotDragScroll () | | |||
1145 | { | | |||
1146 | return slotDragScroll (nullptr/*don't want scrolled notification*/); | | |||
1147 | } | | |||
1148 | 1147 | | |||
1149 | //--------------------------------------------------------------------- | 1148 | //--------------------------------------------------------------------- | ||
1150 | 1149 | | |||
1151 | // protected virtual | 1150 | // protected virtual | ||
1152 | void kpViewScrollableContainer::wheelEvent (QWheelEvent *e) | 1151 | void kpViewScrollableContainer::wheelEvent (QWheelEvent *e) | ||
1153 | { | 1152 | { | ||
1154 | e->ignore (); | 1153 | e->ignore (); | ||
1155 | 1154 | | |||
Show All 28 Lines |