[qml] Qt5.15: Update syntax for slots

Slots now need to be written as function; the previous syntax is
deprecated.
This commit is contained in:
Candice Bentéjac 2023-01-13 17:07:59 +01:00
parent 62ba08447d
commit 8c494198e0
9 changed files with 21 additions and 19 deletions

View file

@ -29,12 +29,12 @@ Flow {
// Update internal ListModel when ChartView's series change
Connections {
target: chartView
onSeriesAdded: seriesModel.append({"series": series})
onSeriesRemoved: {
for(var i = 0; i < seriesModel.count; ++i)
{
if(seriesModel.get(i)["series"] === series)
{
function onSeriesAdded(series) {
seriesModel.append({"series": series})
}
function onSeriesRemoved(series) {
for(var i = 0; i < seriesModel.count; ++i) {
if(seriesModel.get(i)["series"] === series) {
seriesModel.remove(i);
return;
}

View file

@ -316,7 +316,9 @@ RowLayout {
onActivated: _reconstruction.setAttribute(attribute, currentText)
Connections {
target: attribute
onValueChanged: combo.currentIndex = combo.find(attribute.value)
function onValueChanged() {
combo.currentIndex = combo.find(attribute.value)
}
}
}
}

View file

@ -67,7 +67,7 @@ Item {
Connections {
target: root.node
// update x,y when node position changes
onPositionChanged: {
function onPositionChanged() {
root.x = root.node.x
root.y = root.node.y
}

View file

@ -179,7 +179,7 @@ Panel {
// Update grid current item when selected view changes
Connections {
target: _reconstruction
onSelectedViewIdChanged: {
function onSelectedViewIdChanged() {
if (_reconstruction.selectedViewId > -1) {
grid.updateCurrentIndexFromSelectionViewId()
}

View file

@ -141,7 +141,7 @@ RowLayout {
Connections {
target: attribute
onValueChanged: combo.currentIndex = combo.find(attribute.value)
function onValueChanged() { combo.currentIndex = combo.find(attribute.value) }
}
}
}

View file

@ -317,7 +317,7 @@ AliceVision.PanoramaViewer {
}
Connections {
target: root
onDownscaleReady: {
function onDownscaleReady() {
root.imagesLoaded = 0;
// Retrieve downscale value from C++

View file

@ -285,7 +285,7 @@ FocusScope {
Connections {
target: _reconstruction
onSelectedViewIdChanged: {
function onSelectedViewIdChanged() {
root.source = getImageFile();
if (useExternal)
useExternal = false;

View file

@ -39,13 +39,13 @@ Item {
Connections {
target: reconstruction
onGraphChanged: {
function onGraphChanged() {
if(panel3dViewerLoader.active) {
panel3dViewerLoader.item.viewer3D.clear()
}
}
onSfmChanged: viewSfM()
onSfmReportChanged: viewSfM()
function onSfmChanged() { viewSfM() }
function onSfmReportChanged() { viewSfM() }
}
Component.onCompleted: viewSfM()

View file

@ -866,7 +866,7 @@ ApplicationWindow {
dialog.detailedText = message.detailedText
}
onGraphChanged: {
function onGraphChanged() {
// open CompatibilityManager after file loading if any issue is detected
if(compatibilityManager.issueCount)
compatibilityManager.open()
@ -874,9 +874,9 @@ ApplicationWindow {
graphEditor.fit()
}
onInfo: createDialog(dialogsFactory.info, arguments[0])
onWarning: createDialog(dialogsFactory.warning, arguments[0])
onError: createDialog(dialogsFactory.error, arguments[0])
function onInfo() { createDialog(dialogsFactory.info, arguments[0]) }
function onWarning() { createDialog(dialogsFactory.warning, arguments[0]) }
function onError() { createDialog(dialogsFactory.error, arguments[0]) }
}