summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-12-27 09:59:49 +0100
committerMontel Laurent <[email protected]>2014-12-27 09:59:49 +0100
commitdf7e0736df01db7b452210947a3212b567e1ec6c (patch)
tree44316abc1a8732881fd7088a9b875b133331dd46
parenta50fcbc0fa0b55de29649ab6aaf7691d8c82c1da (diff)
Port to new connect api
-rw-r--r--src/config/triggerconfigwidget.cpp4
-rw-r--r--src/config/triggerlistview.cpp2
-rw-r--r--src/creator/puzzlecreator.cpp10
-rw-r--r--src/creator/slicerselector.cpp2
-rw-r--r--src/engine/constraintvisualizer.cpp3
-rw-r--r--src/engine/mergegroup.cpp2
-rw-r--r--src/engine/piece.cpp2
-rw-r--r--src/engine/puzzlepreview.cpp2
-rw-r--r--src/engine/scene.cpp5
-rw-r--r--src/engine/view.cpp2
-rw-r--r--src/engine/zoomwidget.cpp8
-rw-r--r--src/file-io/collection-view.cpp4
-rw-r--r--src/importhelper.cpp2
-rw-r--r--src/window/puzzletablewidget.cpp11
14 files changed, 27 insertions, 32 deletions
diff --git a/src/config/triggerconfigwidget.cpp b/src/config/triggerconfigwidget.cpp
index eff1efb..9cd935a 100644
--- a/src/config/triggerconfigwidget.cpp
+++ b/src/config/triggerconfigwidget.cpp
@@ -31,8 +31,8 @@ Palapeli::TriggerConfigWidget::TriggerConfigWidget(QWidget* parent)
{
addTab(m_mouseView, i18n("Mouse buttons"));
addTab(m_wheelView, i18n("Mouse wheel"));
- connect(m_mouseView, SIGNAL(associationsChanged()), SIGNAL(associationsChanged()));
- connect(m_wheelView, SIGNAL(associationsChanged()), SIGNAL(associationsChanged()));
+ connect(m_mouseView, &Palapeli::TriggerListView::associationsChanged, this, &TriggerConfigWidget::associationsChanged);
+ connect(m_wheelView, &Palapeli::TriggerListView::associationsChanged, this, &TriggerConfigWidget::associationsChanged);
}
Palapeli::TriggerConfigWidget::~TriggerConfigWidget()
diff --git a/src/config/triggerlistview.cpp b/src/config/triggerlistview.cpp
index 09b0a1b..d97d756 100644
--- a/src/config/triggerlistview.cpp
+++ b/src/config/triggerlistview.cpp
@@ -64,7 +64,7 @@ Palapeli::TriggerListView::TriggerListView(const QMap<QByteArray, Palapeli::Inte
m_proxyModel->setSourceModel(m_baseModel);
setModel(m_proxyModel);
setItemDelegate(m_delegate);
- connect(m_delegate, SIGNAL(triggerChanged()), SIGNAL(associationsChanged()));
+ connect(m_delegate, &Palapeli::TriggerListDelegate::triggerChanged, this, &TriggerListView::associationsChanged);
// setCategoryDrawer(m_categoryDrawer); //FIXME: Why do I crash?
}
diff --git a/src/creator/puzzlecreator.cpp b/src/creator/puzzlecreator.cpp
index 382251e..3e833c3 100644
--- a/src/creator/puzzlecreator.cpp
+++ b/src/creator/puzzlecreator.cpp
@@ -72,12 +72,12 @@ Palapeli::PuzzleCreatorDialog::PuzzleCreatorDialog()
m_slicerConfigPage = addPage(m_slicerConfigMasterWidget, i18nc("@item:inlistbox (page name in an assistant dialog)", "Configure slicer"));
m_slicerConfigPage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Tweak the parameters of the chosen slicing method"));
//wire up stuff
- connect(this, SIGNAL(accepted()), this, SLOT(createPuzzle()));
- connect(m_imageSelector, SIGNAL(urlSelected(KUrl)), this, SLOT(checkData()));
- connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
- connect(m_authorEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
+ connect(this, &PuzzleCreatorDialog::accepted, this, &PuzzleCreatorDialog::createPuzzle);
+ connect(m_imageSelector, &KUrlRequester::urlSelected, this, &PuzzleCreatorDialog::checkData);
+ connect(m_nameEdit, &KLineEdit::textChanged, this, &PuzzleCreatorDialog::checkData);
+ connect(m_authorEdit, &KLineEdit::textChanged, this, &PuzzleCreatorDialog::checkData);
checkData(); //to invalidate first page
- connect(m_slicerSelector, SIGNAL(currentSelectionChanged(Palapeli::SlicerSelection)), this, SLOT(updateSlicerSelection(Palapeli::SlicerSelection)));
+ connect(m_slicerSelector, &Palapeli::SlicerSelector::currentSelectionChanged, this, &PuzzleCreatorDialog::updateSlicerSelection);
}
Palapeli::Puzzle* Palapeli::PuzzleCreatorDialog::result() const
diff --git a/src/creator/slicerselector.cpp b/src/creator/slicerselector.cpp
index c55db53..4e0b8a0 100644
--- a/src/creator/slicerselector.cpp
+++ b/src/creator/slicerselector.cpp
@@ -30,7 +30,7 @@ Palapeli::SlicerSelector::SlicerSelector(QWidget* parent)
setHeaderHidden(true);
setSelectionBehavior(QAbstractItemView::SelectItems);
setSelectionMode(QAbstractItemView::SingleSelection);
- connect(this, SIGNAL(itemSelectionChanged()), SLOT(slotSelectionChanged()));
+ connect(this, &SlicerSelector::itemSelectionChanged, this, &SlicerSelector::slotSelectionChanged);
//load slicer plugins
KService::List offers = KServiceTypeTrader::self()->query("Libpala/SlicerPlugin");
foreach (KService::Ptr offer, offers)
diff --git a/src/engine/constraintvisualizer.cpp b/src/engine/constraintvisualizer.cpp
index 61d5677..534a5da 100644
--- a/src/engine/constraintvisualizer.cpp
+++ b/src/engine/constraintvisualizer.cpp
@@ -79,8 +79,7 @@ void Palapeli::ConstraintVisualizer::start (const QRectF& sceneRect,
// thus enter an infinite loop when the constraint visualizer enlarges
// itself in reaction to the changed sceneRect, thereby changing the
// autogrowing sceneRect again.
- connect(m_scene, SIGNAL(sceneRectChanged(QRectF)),
- this, SLOT(update(QRectF)), Qt::QueuedConnection);
+ connect(m_scene, &Palapeli::Scene::sceneRectChanged, this, &ConstraintVisualizer::update, Qt::QueuedConnection);
m_isStopped = false;
}
diff --git a/src/engine/mergegroup.cpp b/src/engine/mergegroup.cpp
index 0070ae5..e183491 100644
--- a/src/engine/mergegroup.cpp
+++ b/src/engine/mergegroup.cpp
@@ -105,7 +105,7 @@ void Palapeli::MergeGroup::start()
masterAnimator->addAnimation(pieceAnimator);
}
masterAnimator->start(QAbstractAnimation::DeleteWhenStopped);
- connect(masterAnimator, SIGNAL(finished()), this, SLOT(createMergedPiece()));
+ connect(masterAnimator, &QParallelAnimationGroup::finished, this, &MergeGroup::createMergedPiece);
}
}
diff --git a/src/engine/piece.cpp b/src/engine/piece.cpp
index 8e16c9d..e0c2170 100644
--- a/src/engine/piece.cpp
+++ b/src/engine/piece.cpp
@@ -31,7 +31,7 @@
void Palapeli::Piece::commonInit(const Palapeli::PieceVisuals& pieceVisuals)
{
Palapeli::SelectionAwarePixmapItem* pieceItem = new Palapeli::SelectionAwarePixmapItem(pieceVisuals.pixmap(), this);
- connect(pieceItem, SIGNAL(selectedChanged(bool)), SLOT(pieceItemSelectedChanged(bool)));
+ connect(pieceItem, &Palapeli::SelectionAwarePixmapItem::selectedChanged, this, &Piece::pieceItemSelectedChanged);
m_pieceItem = pieceItem;
m_pieceItem->setOffset(pieceVisuals.offset());
//initialize behavior
diff --git a/src/engine/puzzlepreview.cpp b/src/engine/puzzlepreview.cpp
index 2030f36..6a47fb0 100644
--- a/src/engine/puzzlepreview.cpp
+++ b/src/engine/puzzlepreview.cpp
@@ -29,7 +29,7 @@
Palapeli::PuzzlePreview::PuzzlePreview(QWidget* parent)
{
m_settingsSaveTimer = new QTimer(this);
- connect(m_settingsSaveTimer, SIGNAL(timeout()), this, SLOT(writeConfigIfGeometryChanged()));
+ connect(m_settingsSaveTimer, &QTimer::timeout, this, &PuzzlePreview::writeConfigIfGeometryChanged);
m_geometryChanged = false;
m_hoverZoom = 1.0;
diff --git a/src/engine/scene.cpp b/src/engine/scene.cpp
index 1c82c2d..91a097c 100644
--- a/src/engine/scene.cpp
+++ b/src/engine/scene.cpp
@@ -181,10 +181,7 @@ void Palapeli::Scene::searchConnections(const QList<Palapeli::Piece*>& pieces,
Palapeli::MergeGroup* mergeGroup =
new Palapeli::MergeGroup(pieceGroup, this,
m_pieceAreaSize, animatedMerging);
- connect(mergeGroup, SIGNAL(pieceInstanceTransaction(
- QList<Palapeli::Piece*>,QList<Palapeli::Piece*>)),
- this, SLOT(pieceInstanceTransaction(
- QList<Palapeli::Piece*>,QList<Palapeli::Piece*>)));
+ connect(mergeGroup, &Palapeli::MergeGroup::pieceInstanceTransaction, this, &Scene::pieceInstanceTransaction);
mergeGroup->start();
}
}
diff --git a/src/engine/view.cpp b/src/engine/view.cpp
index fc4c006..015d861 100644
--- a/src/engine/view.cpp
+++ b/src/engine/view.cpp
@@ -55,7 +55,7 @@ Palapeli::View::View()
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setScene(new Palapeli::Scene(this));
- connect(m_scene, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(logSceneChange(QRectF))); // IDW test.
+ connect(m_scene, &Palapeli::Scene::sceneRectChanged, this, &View::logSceneChange);
qDebug() << "Initial size of Palapeli::View" << size();
}
diff --git a/src/engine/zoomwidget.cpp b/src/engine/zoomwidget.cpp
index 28c794f..31d019f 100644
--- a/src/engine/zoomwidget.cpp
+++ b/src/engine/zoomwidget.cpp
@@ -37,17 +37,17 @@ Palapeli::ZoomWidget::ZoomWidget(QWidget* parent)
m_constrainedButton->setIcon(QIcon::fromTheme( QLatin1String( "select-rectangular" )));
m_constrainedButton->setToolTip(i18n("Lock the puzzle table area"));
m_constrainedButton->setCheckable(true);
- connect(m_constrainedButton, SIGNAL(toggled(bool)), this, SIGNAL(constrainedChanged(bool)));
+ connect(m_constrainedButton, &QToolButton::toggled, this, &ZoomWidget::constrainedChanged);
m_zoomOutButton->setIcon(QIcon::fromTheme( QLatin1String( "zoom-out" )));
//QT5 m_zoomOutButton->setShortcut(KStandardShortcut::zoomOut().primary());
- connect(m_zoomOutButton, SIGNAL(pressed()), this, SIGNAL(zoomOutRequest()));
+ connect(m_zoomOutButton, &QToolButton::pressed, this, &ZoomWidget::zoomOutRequest);
m_zoomInButton->setIcon(QIcon::fromTheme( QLatin1String( "zoom-in" )));
//QT5 m_zoomInButton->setShortcut(KStandardShortcut::zoomIn().primary());
- connect(m_zoomInButton, SIGNAL(pressed()), this, SIGNAL(zoomInRequest()));
+ connect(m_zoomInButton, &QToolButton::pressed, this, &ZoomWidget::zoomInRequest);
//init slider
m_slider->setMinimum(Palapeli::View::MinimumZoomLevel);
m_slider->setMaximum(Palapeli::View::MaximumZoomLevel);
- connect(m_slider, SIGNAL(valueChanged(int)), this, SIGNAL(levelChanged(int)));
+ connect(m_slider, &QSlider::valueChanged, this, &ZoomWidget::levelChanged);
//init widget layout
QHBoxLayout* layout = new QHBoxLayout;
layout->addWidget(m_constrainedButton);
diff --git a/src/file-io/collection-view.cpp b/src/file-io/collection-view.cpp
index 7996e82..8e5d38a 100644
--- a/src/file-io/collection-view.cpp
+++ b/src/file-io/collection-view.cpp
@@ -37,7 +37,7 @@ Palapeli::CollectionView::CollectionView(QWidget* parent)
, m_proxyModel(new QSortFilterProxyModel(this))
{
//setup view
- connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(handleActivated(QModelIndex)));
+ connect(m_view, &QListView::activated, this, &CollectionView::handleActivated);
m_view->setAlternatingRowColors(true);
m_view->setMouseTracking(true);
m_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -60,7 +60,7 @@ Palapeli::CollectionView::CollectionView(QWidget* parent)
m_sortByPieceCount->setCheckable(true);
m_sortByTitle->setChecked(true);
m_sortByPieceCount->setChecked(false);
- connect(sortMenu, SIGNAL(triggered(QAction*)), SLOT(sortMenuTriggered(QAction*)));
+ connect(sortMenu, &QMenu::triggered, this, &CollectionView::sortMenuTriggered);
//construct layout
QGridLayout* layout = new QGridLayout(this);
layout->addWidget(sortButton, 0, 0);
diff --git a/src/importhelper.cpp b/src/importhelper.cpp
index 82345b4..ea26b29 100644
--- a/src/importhelper.cpp
+++ b/src/importhelper.cpp
@@ -55,7 +55,7 @@ void Palapeli::ImportHelper::doWork()
}
//keep program running until the puzzle has been written
Palapeli::FutureWatcher* watcher = new Palapeli::FutureWatcher;
- connect(watcher, SIGNAL(finished()), watcher, SLOT(deleteLater()));
+ connect(watcher, &Palapeli::FutureWatcher::finished, watcher, &Palapeli::FutureWatcher::deleteLater);
connect(watcher, SIGNAL(finished()), qApp, SLOT(quit()));
watcher->setFuture(puzzle->get(Palapeli::PuzzleComponent::ArchiveStorage));
}
diff --git a/src/window/puzzletablewidget.cpp b/src/window/puzzletablewidget.cpp
index 1a15a63..953cf49 100644
--- a/src/window/puzzletablewidget.cpp
+++ b/src/window/puzzletablewidget.cpp
@@ -59,12 +59,11 @@ Palapeli::PuzzleTableWidget::PuzzleTableWidget()
m_progressBar->setText(i18n("No puzzle loaded"));
//setup zoom widget
m_zoomWidget->setLevel((View::MaximumZoomLevel+View::MinimumZoomLevel)/2);
- connect(m_zoomWidget, SIGNAL(levelChanged(int)),
- m_view, SLOT(zoomSliderInput(int)));
- connect(m_zoomWidget, SIGNAL(zoomInRequest()), m_view, SLOT(zoomIn()));
- connect(m_zoomWidget, SIGNAL(zoomOutRequest()), m_view, SLOT(zoomOut()));
- connect(m_view, SIGNAL(zoomLevelChanged(int)), m_zoomWidget, SLOT(setLevel(int)));
- connect(m_view, SIGNAL(zoomAdjustable(bool)), this, SLOT(setZoomAdjustable(bool)));
+ connect(m_zoomWidget, &Palapeli::ZoomWidget::levelChanged, m_view, &Palapeli::View::zoomSliderInput);
+ connect(m_zoomWidget, &Palapeli::ZoomWidget::zoomInRequest, m_view, &Palapeli::View::zoomIn);
+ connect(m_zoomWidget, &Palapeli::ZoomWidget::zoomOutRequest, m_view, &Palapeli::View::zoomOut);
+ connect(m_view, &Palapeli::View::zoomLevelChanged, m_zoomWidget, &Palapeli::ZoomWidget::setLevel);
+ connect(m_view, &Palapeli::View::zoomAdjustable, this, &PuzzleTableWidget::setZoomAdjustable);
connect(m_zoomWidget, SIGNAL(constrainedChanged(bool)), m_view->scene(), SLOT(setConstrained(bool)));
connect(m_view->scene(), SIGNAL(constrainedChanged(bool)), m_zoomWidget, SLOT(setConstrained(bool)));
//setup widget stack