[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 // Update internal ListModel when ChartView's series change
Connections { Connections {
target: chartView target: chartView
onSeriesAdded: seriesModel.append({"series": series}) function onSeriesAdded(series) {
onSeriesRemoved: { seriesModel.append({"series": series})
for(var i = 0; i < seriesModel.count; ++i) }
{ function onSeriesRemoved(series) {
if(seriesModel.get(i)["series"] === series) for(var i = 0; i < seriesModel.count; ++i) {
{ if(seriesModel.get(i)["series"] === series) {
seriesModel.remove(i); seriesModel.remove(i);
return; return;
} }

View file

@ -316,7 +316,9 @@ RowLayout {
onActivated: _reconstruction.setAttribute(attribute, currentText) onActivated: _reconstruction.setAttribute(attribute, currentText)
Connections { Connections {
target: attribute 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 { Connections {
target: root.node target: root.node
// update x,y when node position changes // update x,y when node position changes
onPositionChanged: { function onPositionChanged() {
root.x = root.node.x root.x = root.node.x
root.y = root.node.y root.y = root.node.y
} }

View file

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

View file

@ -141,7 +141,7 @@ RowLayout {
Connections { Connections {
target: attribute 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 { Connections {
target: root target: root
onDownscaleReady: { function onDownscaleReady() {
root.imagesLoaded = 0; root.imagesLoaded = 0;
// Retrieve downscale value from C++ // Retrieve downscale value from C++

View file

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

View file

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

View file

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