Commit f561f6d5 authored by André Agenor's avatar André Agenor Committed by Tomaz Canabrava
Browse files

Convert old style to Qt5 style connection

Summary:
Almost all old-style code was converted. There are some residual code that needs more attention because he has interdependencies that need to be
solved before conversions

Reviewers: tcanabrava

Reviewed By: tcanabrava

Differential Revision: https://phabricator.kde.org/D18741
parent d675556a
......@@ -79,22 +79,23 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig,
m_actionUndo = new KToolBarPopupAction(KDE::icon("edit-undo"), undoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Undo), m_actionUndo);
ac->setDefaultShortcuts (m_actionUndo, KStandardShortcut::shortcut (KStandardShortcut::Undo));
connect (m_actionUndo, SIGNAL(triggered(bool)), this, SLOT (undo()));
connect (m_actionUndo, &KToolBarPopupAction::triggered, this, &kpCommandHistoryBase::undo);
m_actionRedo = new KToolBarPopupAction(KDE::icon("edit-redo"), redoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Redo), m_actionRedo);
ac->setDefaultShortcuts (m_actionRedo, KStandardShortcut::shortcut (KStandardShortcut::Redo));
connect (m_actionRedo, SIGNAL(triggered(bool)), this, SLOT (redo()));
connect (m_actionRedo, &KToolBarPopupAction::triggered, this, &kpCommandHistoryBase::redo );
m_actionUndo->setEnabled (false);
m_actionRedo->setEnabled (false);
connect (m_actionUndo->menu (), SIGNAL (triggered(QAction*)),
this, SLOT (undoUpToNumber(QAction*)));
connect (m_actionRedo->menu (), SIGNAL (triggered(QAction*)),
this, SLOT (redoUpToNumber(QAction*)));
connect (m_actionUndo->menu(), &QMenu::triggered,
this, &kpCommandHistoryBase::undoUpToNumber);
connect (m_actionRedo->menu(), &QMenu::triggered,
this, &kpCommandHistoryBase::redoUpToNumber);
m_undoMinLimit = 10;
......
......@@ -63,8 +63,7 @@ kpToolSelectionResizeScaleCommand::kpToolSelectionResizeScaleCommand (
m_newHeight = selection ()->height ();
m_smoothScaleTimer->setSingleShot (true);
connect (m_smoothScaleTimer, SIGNAL (timeout()),
this, SLOT (resizeScaleAndMove()));
connect (m_smoothScaleTimer, &QTimer::timeout, this, [this]{resizeScaleAndMove(false);});
}
kpToolSelectionResizeScaleCommand::~kpToolSelectionResizeScaleCommand ()
......@@ -207,15 +206,6 @@ void kpToolSelectionResizeScaleCommand::resizeScaleAndMove (bool delayed)
delete newSelPtr;
}
// protected slots
void kpToolSelectionResizeScaleCommand::resizeScaleAndMove ()
{
#if DEBUG_KP_TOOL_SELECTION
qCDebug(kpLogCommands) << "kpToolSelectionResizeScaleCommand::resizeScaleAndMove()";
#endif
resizeScaleAndMove (false/*no delay*/);
}
// public
void kpToolSelectionResizeScaleCommand::finalize ()
......
......@@ -82,10 +82,7 @@ protected:
// If <delayed>, does a fast, low-quality scale and then calls itself
// with <delayed> unset for a smooth scale, a short time later.
// If acting on a text box, <delayed> is ignored.
void resizeScaleAndMove (bool delayed);
protected slots:
void resizeScaleAndMove (/*delayed = false*/);
void resizeScaleAndMove (bool delayed = false);
public:
void finalize ();
......
......@@ -92,8 +92,8 @@ kpEffectsDialog::kpEffectsDialog (bool actOnSelection,
m_delayedUpdateTimer->setSingleShot (true);
connect (m_delayedUpdateTimer, SIGNAL (timeout()),
this, SLOT (slotUpdateWithWaitCursor()));
connect (m_delayedUpdateTimer, &QTimer::timeout,
this, &kpEffectsDialog::slotUpdateWithWaitCursor);
QWidget *effectContainer = new QWidget (mainWidget ());
......@@ -128,8 +128,10 @@ kpEffectsDialog::kpEffectsDialog (bool actOnSelection,
addCustomWidgetToBack (m_settingsGroupBox);
connect (m_effectsComboBox, SIGNAL (activated(int)),
this, SLOT (selectEffect(int)));
connect (m_effectsComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &kpEffectsDialog::selectEffect);
selectEffect (defaultSelectedEffect);
......@@ -293,12 +295,12 @@ void kpEffectsDialog::selectEffect (int which)
#endif
m_effectWidget->show ();
connect (m_effectWidget, SIGNAL (settingsChangedNoWaitCursor()),
this, SLOT (slotUpdate()));
connect (m_effectWidget, SIGNAL (settingsChanged()),
this, SLOT (slotUpdateWithWaitCursor()));
connect (m_effectWidget, SIGNAL (settingsChangedDelayed()),
this, SLOT (slotDelayedUpdate()));
connect (m_effectWidget, &kpEffectWidgetBase::settingsChangedNoWaitCursor,
this, &kpEffectsDialog::slotUpdate);
connect (m_effectWidget, &kpEffectWidgetBase::settingsChanged,
this, &kpEffectsDialog::slotUpdateWithWaitCursor);
connect (m_effectWidget, &kpEffectWidgetBase::settingsChangedDelayed,
this, &kpEffectsDialog::slotDelayedUpdate);
#if DEBUG_KP_EFFECTS_DIALOG
qCDebug(kpLogDialogs) << "about to setUpdatesEnabled()";
......
......@@ -121,8 +121,9 @@ kpDocumentMetaInfoDialog::kpDocumentMetaInfoDialog (
setWindowTitle (i18nc ("@title:window", "Document Properties"));
QDialogButtonBox * buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
connect (buttons, &QDialogButtonBox::accepted, this, &kpDocumentMetaInfoDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &kpDocumentMetaInfoDialog::reject);
QWidget *baseWidget = new QWidget (this);
......@@ -243,26 +244,26 @@ kpDocumentMetaInfoDialog::kpDocumentMetaInfoDialog (
d->fieldsTableWidget = new QTableWidget (fieldsGroupBox);
d->fieldsTableWidget->setEditTriggers(QAbstractItemView::AllEditTriggers);
connect (d->fieldsTableWidget, SIGNAL (currentCellChanged(int,int,int,int)),
SLOT (slotFieldsCurrentCellChanged(int,int,int,int)));
connect (d->fieldsTableWidget, &QTableWidget::currentCellChanged,
this, &kpDocumentMetaInfoDialog::slotFieldsCurrentCellChanged);
connect (d->fieldsTableWidget, SIGNAL (itemChanged(QTableWidgetItem*)),
SLOT (slotFieldsItemChanged(QTableWidgetItem*)));
connect (d->fieldsTableWidget, &QTableWidget::itemChanged,
this, &kpDocumentMetaInfoDialog::slotFieldsItemChanged);
d->fieldsAddRowButton = new QPushButton (i18n ("&Add Row"),
fieldsGroupBox);
connect (d->fieldsAddRowButton, SIGNAL (clicked()),
SLOT (slotFieldsAddRowButtonClicked()));
connect (d->fieldsAddRowButton, &QPushButton::clicked,
this, &kpDocumentMetaInfoDialog::slotFieldsAddRowButtonClicked);
d->fieldsDeleteRowButton = new QPushButton (i18n ("&Delete Row"),
fieldsGroupBox);
connect (d->fieldsDeleteRowButton, SIGNAL (clicked()),
SLOT (slotFieldsDeleteRowButtonClicked()));
connect (d->fieldsDeleteRowButton, &QPushButton::clicked,
this, &kpDocumentMetaInfoDialog::slotFieldsDeleteRowButtonClicked);
d->fieldsResetButton = new QPushButton (i18n ("&Reset"),
fieldsGroupBox);
connect (d->fieldsResetButton, SIGNAL (clicked()),
SLOT (setUIToOriginalMetaInfo()));
connect (d->fieldsResetButton, &QPushButton::clicked,
this, &kpDocumentMetaInfoDialog::setUIToOriginalMetaInfo);
QHBoxLayout *fieldsButtonsLayout = new QHBoxLayout ();
fieldsButtonsLayout->addWidget (d->fieldsAddRowButton);
......
......@@ -72,8 +72,8 @@ kpTransformPreviewDialog::kpTransformPreviewDialog (Features features,
setWindowTitle (caption);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
connect (buttons, &QDialogButtonBox::accepted, this, &kpTransformPreviewDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &kpTransformPreviewDialog::reject);
QWidget *baseWidget = new QWidget (this);
m_mainWidget = baseWidget;
......@@ -173,13 +173,13 @@ void kpTransformPreviewDialog::createPreviewGroupBox ()
m_previewPixmapLabel = new kpResizeSignallingLabel (m_previewGroupBox);
m_previewPixmapLabel->setMinimumSize (150, 110);
connect (m_previewPixmapLabel, SIGNAL (resized()),
this, SLOT (updatePreview()));
connect (m_previewPixmapLabel, &kpResizeSignallingLabel::resized,
this, &kpTransformPreviewDialog::updatePreview);
QPushButton *updatePushButton = new QPushButton (i18n ("&Update"),
m_previewGroupBox);
connect (updatePushButton, SIGNAL (clicked()),
this, SLOT (slotUpdateWithWaitCursor()));
connect (updatePushButton, &QPushButton::clicked,
this, &kpTransformPreviewDialog::slotUpdateWithWaitCursor);
QVBoxLayout *previewLayout = new QVBoxLayout (m_previewGroupBox);
......
......@@ -95,8 +95,8 @@ kpTransformResizeScaleDialog::kpTransformResizeScaleDialog (
setWindowTitle (i18nc ("@title:window", "Resize / Scale"));
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
connect (buttons, &QDialogButtonBox::accepted, this, &kpTransformResizeScaleDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &kpTransformResizeScaleDialog::reject);
QWidget *baseWidget = new QWidget (this);
......@@ -191,8 +191,8 @@ QWidget *kpTransformResizeScaleDialog::createActOnBox(QWidget *baseWidget)
lay->addWidget (m_actOnCombo, 1);
connect (m_actOnCombo, SIGNAL (activated(int)),
this, SLOT (slotActOnChanged()));
connect (m_actOnCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &kpTransformResizeScaleDialog::slotActOnChanged);
return actOnBox;
}
......@@ -264,12 +264,12 @@ QGroupBox *kpTransformResizeScaleDialog::createOperationGroupBox (QWidget *baseW
operationLayout->addWidget (m_scaleButton, 0, 1, Qt::AlignCenter);
operationLayout->addWidget (m_smoothScaleButton, 0, 2, Qt::AlignCenter);
connect (m_resizeButton, SIGNAL (toggled(bool)),
this, SLOT (slotTypeChanged()));
connect (m_scaleButton, SIGNAL (toggled(bool)),
this, SLOT (slotTypeChanged()));
connect (m_smoothScaleButton, SIGNAL (toggled(bool)),
this, SLOT (slotTypeChanged()));
connect (m_resizeButton, &QToolButton::toggled,
this, &kpTransformResizeScaleDialog::slotTypeChanged);
connect (m_scaleButton, &QToolButton::toggled,
this, &kpTransformResizeScaleDialog::slotTypeChanged);
connect (m_smoothScaleButton, &QToolButton::toggled,
this, &kpTransformResizeScaleDialog::slotTypeChanged);
return operationGroupBox;
}
......@@ -360,10 +360,12 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
dimensionsLayout->setRowMinimumHeight (4/*row*/, dimensionsLayout->rowMinimumHeight (4) * 2);
connect (m_newWidthInput, SIGNAL (valueChanged(int)),
this, SLOT (slotWidthChanged(int)));
connect (m_newHeightInput, SIGNAL (valueChanged(int)),
this, SLOT (slotHeightChanged(int)));
connect (m_newWidthInput, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &kpTransformResizeScaleDialog::slotWidthChanged);
connect (m_newHeightInput, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &kpTransformResizeScaleDialog::slotHeightChanged);
// COMPAT: KDoubleNumInput only fires valueChanged(double) once per
// edit. It should either fire:
......@@ -376,13 +378,16 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
// 2. Once per keystroke.
//
// Bug in KDoubleNumInput.
connect (m_percentWidthInput, SIGNAL (valueChanged(double)),
this, SLOT (slotPercentWidthChanged(double)));
connect (m_percentHeightInput, SIGNAL (valueChanged(double)),
this, SLOT (slotPercentHeightChanged(double)));
connect (m_percentWidthInput,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &kpTransformResizeScaleDialog::slotPercentWidthChanged);
connect (m_percentHeightInput,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &kpTransformResizeScaleDialog::slotPercentHeightChanged);
connect (m_keepAspectRatioCheckBox, SIGNAL (toggled(bool)),
this, SLOT (setKeepAspectRatio(bool)));
connect (m_keepAspectRatioCheckBox, &QCheckBox::toggled,
this, &kpTransformResizeScaleDialog::setKeepAspectRatio);
return dimensionsGroupBox;
}
......
......@@ -121,10 +121,11 @@ void kpTransformRotateDialog::createDirectionGroupBox ()
directionLayout->addWidget (m_clockwiseRadioButton, 1, 1, Qt::AlignCenter);
connect (m_antiClockwiseRadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_clockwiseRadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_antiClockwiseRadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
connect (m_clockwiseRadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
}
// private
......@@ -162,20 +163,22 @@ void kpTransformRotateDialog::createAngleGroupBox ()
angleLayout->setColumnStretch (1, 2); // Stretch Custom Angle Input
connect (m_angle90RadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_angle180RadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_angle270RadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_angleCustomRadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotAngleCustomRadioButtonToggled(bool)));
connect (m_angleCustomRadioButton, SIGNAL (toggled(bool)),
this, SLOT (slotUpdate()));
connect (m_angle90RadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
connect (m_angle180RadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
connect (m_angle270RadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
connect (m_angleCustomRadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotAngleCustomRadioButtonToggled);
connect (m_angleCustomRadioButton, &QRadioButton::toggled,
this, &kpTransformRotateDialog::slotUpdate);
connect (m_angleCustomInput, SIGNAL (valueChanged(int)),
this, SLOT (slotUpdate()));
connect (m_angleCustomInput,
static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &kpTransformRotateDialog::slotUpdate);
}
......
......@@ -142,10 +142,13 @@ void kpTransformSkewDialog::createAngleGroupBox ()
angleLayout->addWidget (verticalSkewDegreesLabel, 1, 3);
connect (m_horizontalSkewInput, SIGNAL (valueChanged(int)),
this, SLOT (slotUpdate()));
connect (m_verticalSkewInput, SIGNAL (valueChanged(int)),
this, SLOT (slotUpdate()));
connect (m_horizontalSkewInput,
static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &kpTransformSkewDialog::slotUpdate);
connect (m_verticalSkewInput,
static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &kpTransformSkewDialog::slotUpdate);
}
......
......@@ -47,8 +47,8 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
setWindowTitle (i18nc ("@title:window", "Color Similarity"));
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
connect (buttons, &QDialogButtonBox::accepted, this, &kpColorSimilarityDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &kpColorSimilarityDialog::reject);
QWidget *baseWidget = new QWidget (this);
......@@ -69,8 +69,8 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
cubeLayout->addWidget (updatePushButton, 0/*stretch*/, Qt::AlignHCenter);
connect (updatePushButton, SIGNAL (clicked()),
this, SLOT (slotColorSimilarityValueChanged()));
connect (updatePushButton, &QPushButton::clicked,
this, &kpColorSimilarityDialog::slotColorSimilarityValueChanged);
QGroupBox *inputGroupBox = new QGroupBox (i18n ("&RGB Color Cube Distance"),
......@@ -89,8 +89,8 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
"What is Color Similarity?</a>"),
inputGroupBox);
m_whatIsLabel->setAlignment (Qt::AlignHCenter);
connect (m_whatIsLabel, SIGNAL (linkActivated(QString)),
SLOT (slotWhatIsLabelClicked()));
connect (m_whatIsLabel, &QLabel::linkActivated,
this, &kpColorSimilarityDialog::slotWhatIsLabelClicked);
QVBoxLayout *inputLayout = new QVBoxLayout (inputGroupBox);
......@@ -101,8 +101,8 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
// COMPAT: This is not firing properly when the user is typing in a
// new value.
connect (m_colorSimilarityInput, SIGNAL (valueChanged(int)),
this, SLOT (slotColorSimilarityValueChanged()));
connect (m_colorSimilarityInput, &kpIntNumInput::valueChanged,
this, &kpColorSimilarityDialog::slotColorSimilarityValueChanged);
QVBoxLayout *baseLayout = new QVBoxLayout (baseWidget);
......
......@@ -80,8 +80,8 @@ kpDocumentSaveOptionsPreviewDialog::kpDocumentSaveOptionsPreviewDialog (
lay->setRowStretch (0, 1);
connect (m_filePixmapLabel, SIGNAL (resized()),
this, SLOT (updatePixmapPreview()));
connect (m_filePixmapLabel, &kpResizeSignallingLabel::resized,
this, &kpDocumentSaveOptionsPreviewDialog::updatePixmapPreview);
}
kpDocumentSaveOptionsPreviewDialog::~kpDocumentSaveOptionsPreviewDialog ()
......
......@@ -378,7 +378,7 @@ void kpDocument::setImage (const kpImage &image)
if (m_oldWidth == width () && m_oldHeight == height ())
slotContentsChanged (image.rect ());
else
slotSizeChanged (width (), height ());
slotSizeChanged (QSize (width (), height ()));
}
//---------------------------------------------------------------------
......@@ -433,7 +433,7 @@ void kpDocument::resize (int w, int h, const kpColor &backgroundColor)
kpPixmapFX::resize (m_image, w, h, backgroundColor);
slotSizeChanged (width (), height ());
slotSizeChanged (QSize (width (), height ()));
}
//---------------------------------------------------------------------
......@@ -446,18 +446,11 @@ void kpDocument::slotContentsChanged (const QRect &rect)
//---------------------------------------------------------------------
void kpDocument::slotSizeChanged (int newWidth, int newHeight)
{
setModified ();
emit sizeChanged (newWidth, newHeight);
emit sizeChanged (QSize (newWidth, newHeight));
}
//---------------------------------------------------------------------
void kpDocument::slotSizeChanged (const QSize &newSize)
{
slotSizeChanged (newSize.width (), newSize.height ());
setModified ();
emit sizeChanged (newSize.width(), newSize.height());
emit sizeChanged (newSize);
}
//---------------------------------------------------------------------
......
......@@ -311,7 +311,6 @@ public:
public slots:
// these will emit signals!
void slotContentsChanged (const QRect &rect);
void slotSizeChanged (int newWidth, int newHeight);
void slotSizeChanged (const QSize &newSize);
signals:
......
......@@ -100,8 +100,8 @@ void kpDocument::setSelection (const kpAbstractSelection &selection)
// There's no need to uninitialize the old selection
// (e.g. call disconnect()) since we delete it later.
connect (m_selection, SIGNAL (changed(QRect)),
this, SLOT (slotContentsChanged(QRect)));
connect (m_selection, &kpAbstractSelection::changed,
this, &kpDocument::slotContentsChanged);
//
......
......@@ -93,10 +93,11 @@ void kpThumbnail::setView (kpThumbnailView *view)
if (d->view)
{
disconnect (d->view, SIGNAL (destroyed()),
this, SLOT (slotViewDestroyed()));
disconnect (d->view, SIGNAL (zoomLevelChanged(int,int)),
this, SLOT (updateCaption()));
disconnect (d->view, &kpThumbnailView::destroyed,
this, &kpThumbnail::slotViewDestroyed);
disconnect (d->view, &kpThumbnailView::zoomLevelChanged,
this, &kpThumbnail::updateCaption);
d->lay->removeWidget (d->view);
}
......@@ -105,10 +106,11 @@ void kpThumbnail::setView (kpThumbnailView *view)
if (d->view)
{
connect (d->view, SIGNAL (destroyed()),
this, SLOT (slotViewDestroyed()));
connect (d->view, SIGNAL (zoomLevelChanged(int,int)),
this, SLOT (updateCaption()));
connect (d->view, &kpThumbnailView::destroyed,
this, &kpThumbnail::slotViewDestroyed);
connect (d->view, &kpThumbnailView::zoomLevelChanged,
this, &kpThumbnail::updateCaption);
Q_ASSERT (d->view->parent () == this);
d->lay->addWidget (d->view, Qt::AlignCenter);
......
......@@ -401,14 +401,13 @@ kpViewScrollableContainer::kpViewScrollableContainer(QWidget *parent)
connectGripSignals (m_bottomRightGrip);
connect (horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(slotContentsMoved()));
connect (horizontalScrollBar(), &QScrollBar::valueChanged,
this, &kpViewScrollableContainer::slotContentsMoved);
connect (verticalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(slotContentsMoved()));
connect (verticalScrollBar(), &QScrollBar::valueChanged,
this, &kpViewScrollableContainer::slotContentsMoved);
connect (m_dragScrollTimer, SIGNAL (timeout()),
this, SLOT (slotDragScroll()));
connect (m_dragScrollTimer, &QTimer::timeout, this, [this]{slotDragScroll();});
m_overlay->hide();
}
......@@ -418,20 +417,23 @@ kpViewScrollableContainer::kpViewScrollableContainer(QWidget *parent)
// protected
void kpViewScrollableContainer::connectGripSignals (kpGrip *grip)
{
connect (grip, SIGNAL (beganDraw()),
this, SLOT (slotGripBeganDraw()));
connect (grip, SIGNAL (continuedDraw(int,int,bool)),
this, SLOT (slotGripContinuedDraw(int,int,bool)));
connect (grip, SIGNAL (cancelledDraw()),
this, SLOT (slotGripCancelledDraw()));
connect (grip, SIGNAL (endedDraw(int,int)),
this, SLOT (slotGripEndedDraw(int,int)));
connect (grip, SIGNAL (statusMessageChanged(QString)),
this, SLOT (slotGripStatusMessageChanged(QString)));
connect (grip, SIGNAL (releasedAllButtons()),
this, SLOT (recalculateStatusMessage()));
connect (grip, &kpGrip::beganDraw,
this, &kpViewScrollableContainer::slotGripBeganDraw);
connect (grip, &kpGrip::continuedDraw,
this, &kpViewScrollableContainer::slotGripContinuedDraw);
connect (grip, &kpGrip::cancelledDraw,
this, &kpViewScrollableContainer::slotGripCancelledDraw);
connect (grip, &kpGrip::endedDraw,
this, &kpViewScrollableContainer::slotGripEndedDraw);
connect (grip, &kpGrip::statusMessageChanged,
this, &kpViewScrollableContainer::slotGripStatusMessageChanged);
connect (grip, &kpGrip::releasedAllButtons,
this, &kpViewScrollableContainer::recalculateStatusMessage);
}
//---------------------------------------------------------------------
......@@ -889,10 +891,12 @@ void kpViewScrollableContainer::slotContentsMoved ()
// protected
void kpViewScrollableContainer::disconnectViewSignals ()
{
disconnect (m_view, SIGNAL (sizeChanged(QSize)),
this, SLOT (updateGrips()));
disconnect (m_view, SIGNAL (destroyed()),
this, SLOT (slotViewDestroyed()));
disconnect (m_view,
static_cast<void (kpView::*)(int, int)>(&kpView::sizeChanged),
this, &kpViewScrollableContainer::updateGrips);
disconnect (m_view, &kpView::destroyed,
this, &kpViewScrollableContainer::slotViewDestroyed);
}
//---------------------------------------------------------------------
......@@ -900,10 +904,12 @@ void kpViewScrollableContainer::disconnectViewSignals ()
// protected
void kpViewScrollableContainer::connectViewSignals ()
{
connect (m_view, SIGNAL (sizeChanged(QSize)),
this, SLOT (updateGrips()));
connect (m_view, SIGNAL (destroyed()),
this, SLOT (slotViewDestroyed()));
connect (m_view,
static_cast<void (kpView::*)(int, int)>(&kpView::sizeChanged),
this, &kpViewScrollableContainer::updateGrips);
connect (m_view, &kpView::destroye