Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ecaf89f4 authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent 78106aa8
......@@ -263,7 +263,7 @@ HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent)
hlayout->addWidget(new QLabel(i18n("Course name: "), this));
KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this);
hlayout->addWidget(nameEdit);
connect(nameEdit, SIGNAL(textChanged(QString)), this, SLOT(nameChanged(QString)));
connect(nameEdit, &KLineEdit::textChanged, this, &HoleConfig::nameChanged);
hlayout = new QHBoxLayout;
hlayout->setSpacing( spacingHint() );
......@@ -271,7 +271,7 @@ HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent)
hlayout->addWidget(new QLabel(i18n("Course author: "), this));
KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this);
hlayout->addWidget(authorEdit);
connect(authorEdit, SIGNAL(textChanged(QString)), this, SLOT(authorChanged(QString)));
connect(authorEdit, &KLineEdit::textChanged, this, &HoleConfig::authorChanged);
layout->addStretch();
......@@ -284,7 +284,7 @@ HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent)
par->setSingleStep( 1 );
par->setValue(holeInfo->par());
hlayout->addWidget(par);
connect(par, SIGNAL(valueChanged(int)), this, SLOT(parChanged(int)));
connect(par, static_cast<void (KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &HoleConfig::parChanged);
hlayout->addStretch();
hlayout->addWidget(new QLabel(i18n("Maximum:"), this));
......@@ -296,12 +296,12 @@ HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent)
maxstrokes->setSpecialValueText(i18n("Unlimited"));
maxstrokes->setValue(holeInfo->maxStrokes());
hlayout->addWidget(maxstrokes);
connect(maxstrokes, SIGNAL(valueChanged(int)), this, SLOT(maxStrokesChanged(int)));
connect(maxstrokes, static_cast<void (KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &HoleConfig::maxStrokesChanged);
QCheckBox *check = new QCheckBox(i18n("Show border walls"), this);
check->setChecked(holeInfo->borderWalls());
layout->addWidget(check);
connect(check, SIGNAL(toggled(bool)), this, SLOT(borderWallsChanged(bool)));
connect(check, &QCheckBox::toggled, this, &HoleConfig::borderWallsChanged);
}
void HoleConfig::authorChanged(const QString &newauthor)
......@@ -582,15 +582,15 @@ KolfGame::KolfGame(const Kolf::ItemFactory& factory, PlayerList *players, const
addBorderWall(QPoint(width - margin - 1, margin), QPoint(width - margin - 1, height - margin));
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(timeout()));
connect(timer, &QTimer::timeout, this, &KolfGame::timeout);
timerMsec = 300;
fastTimer = new QTimer(this);
connect(fastTimer, SIGNAL(timeout()), this, SLOT(fastTimeout()));
connect(fastTimer, &QTimer::timeout, this, &KolfGame::fastTimeout);
fastTimerMsec = 11;
autoSaveTimer = new QTimer(this);
connect(autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSaveTimeout()));
connect(autoSaveTimer, &QTimer::timeout, this, &KolfGame::autoSaveTimeout);
autoSaveMsec = 5 * 1000 * 60; // 5 min autosave
// setUseAdvancedPutting() sets maxStrength!
......@@ -598,7 +598,7 @@ KolfGame::KolfGame(const Kolf::ItemFactory& factory, PlayerList *players, const
putting = false;
putterTimer = new QTimer(this);
connect(putterTimer, SIGNAL(timeout()), this, SLOT(putterTimeout()));
connect(putterTimer, &QTimer::timeout, this, &KolfGame::putterTimeout);
putterTimerMsec = 20;
}
......
......@@ -193,15 +193,15 @@ Kolf::Overlay::Overlay(CanvasItem* citem, QGraphicsItem* qitem, bool hack_addQit
setFlag(QGraphicsItem::ItemHasNoContents);
//initialize activator area item
m_activatorItem->setZValue(1);
connect(m_activatorItem, SIGNAL(hoverEntered()), this, SLOT(activatorEntered()));
connect(m_activatorItem, SIGNAL(hoverLeft()), this, SLOT(activatorLeft()));
connect(m_activatorItem, SIGNAL(clicked(int)), this, SLOT(activatorClicked(int)));
connect(m_activatorItem, &Kolf::OverlayAreaItem::hoverEntered, this, &Overlay::activatorEntered);
connect(m_activatorItem, &Kolf::OverlayAreaItem::hoverLeft, this, &Overlay::activatorLeft);
connect(m_activatorItem, &Kolf::OverlayAreaItem::clicked, this, &Overlay::activatorClicked);
//initialize interactor area item
m_interactorAnimator->setZValue(2);
m_interactorAnimator->setOpacity(0); //not visible at first
m_interactorItem->setBrush(Qt::green);
connect(m_interactorItem, SIGNAL(clicked(int)), this, SLOT(activatorClicked(int))); //note that interactor item is over activator in hovered mode
connect(m_interactorItem, SIGNAL(dragged(QPointF)), this, SLOT(interactorDragged(QPointF)));
connect(m_interactorItem, &Kolf::OverlayAreaItem::clicked, this, &Overlay::activatorClicked);
connect(m_interactorItem, &Kolf::OverlayAreaItem::dragged, this, &Overlay::interactorDragged);
//initialize handle manager
m_handleAnimator->setZValue(3);
m_handleAnimator->setHideWhenInvisible(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment