diff --git a/meshroom/__init__.py b/meshroom/__init__.py index 9b091cfe49..ff2adefb8a 100644 --- a/meshroom/__init__.py +++ b/meshroom/__init__.py @@ -121,3 +121,6 @@ def addToEnvPath(var, val, index=-1): os.environ[key] = value else: addToEnvPath("PATH", os.environ.get("ALICEVISION_BIN_PATH", "")) + + os.environ["QSG_RHI_BACKEND"] = "opengl" + os.environ["QML_XHR_ALLOW_FILE_READ"] = "1" # there is no obvious replacement yet diff --git a/meshroom/common/qt.py b/meshroom/common/qt.py index 8b6e324a6d..af172a2830 100644 --- a/meshroom/common/qt.py +++ b/meshroom/common/qt.py @@ -1,5 +1,5 @@ -from PySide2 import QtCore, QtQml -import shiboken2 +from PySide6 import QtCore, QtQml +import shiboken6 class QObjectListModel(QtCore.QAbstractListModel): """ @@ -274,7 +274,7 @@ def _referenceItem(self, item): def _dereferenceItem(self, item): # Ask for object deletion if parented to the model - if shiboken2.isValid(item) and item.parent() == self: + if shiboken6.isValid(item) and item.parent() == self: # delay deletion until the next event loop # This avoids warnings when the QML engine tries to evaluate (but should not) # an object that has already been deleted diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 2149c8cd61..b29a66d21c 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -115,6 +115,7 @@ def elapsedTimeStr(self): def toDict(self): d = self.__dict__.copy() d.pop('destroyed', None) # skip non data attributes from BaseObject + d.pop('objectNameChanged', None) # skip non data attributes from BaseObject d["elapsedTimeStr"] = self.elapsedTimeStr return d diff --git a/meshroom/ui/__main__.py b/meshroom/ui/__main__.py index 5914f1ad2d..bc3e45e176 100644 --- a/meshroom/ui/__main__.py +++ b/meshroom/ui/__main__.py @@ -9,4 +9,4 @@ signal.signal(signal.SIGINT, signal.SIG_DFL) from meshroom.ui.app import MeshroomApp app = MeshroomApp(sys.argv) - app.exec_() + app.exec() diff --git a/meshroom/ui/app.py b/meshroom/ui/app.py index 110daec47b..501adbd64d 100644 --- a/meshroom/ui/app.py +++ b/meshroom/ui/app.py @@ -2,9 +2,9 @@ import os import argparse -from PySide2.QtCore import Qt, QUrl, Slot, QJsonValue, Property, Signal, qInstallMessageHandler, QtMsgType, QSettings -from PySide2.QtGui import QIcon -from PySide2.QtWidgets import QApplication +from PySide6.QtCore import Qt, QUrl, Slot, QJsonValue, Property, Signal, qInstallMessageHandler, QtMsgType, QSettings +from PySide6.QtGui import QIcon +from PySide6.QtWidgets import QApplication import meshroom from meshroom.core import nodesDesc @@ -59,7 +59,7 @@ def handler(cls, messageType, context, message): class MeshroomApp(QApplication): """ Meshroom UI Application. """ def __init__(self, args): - QtArgs = [args[0], '-style', 'fusion'] + args[1:] # force Fusion style by default + QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default parser = argparse.ArgumentParser(prog=args[0], description='Launch Meshroom UI.', add_help=True) @@ -174,7 +174,7 @@ def __init__(self, args): r.saveAs(args.save) self.addRecentProjectFile(args.save) - self.engine.load(os.path.normpath(url)) + self.engine.load('file:///' + os.path.normpath(url).replace('\\', '/')) def _recentProjectFiles(self): projects = [] diff --git a/meshroom/ui/commands.py b/meshroom/ui/commands.py index 4ae6a4f376..83e4aa597d 100755 --- a/meshroom/ui/commands.py +++ b/meshroom/ui/commands.py @@ -2,8 +2,8 @@ import traceback from contextlib import contextmanager -from PySide2.QtWidgets import QUndoCommand, QUndoStack -from PySide2.QtCore import Property, Signal +from PySide6.QtGui import QUndoCommand, QUndoStack +from PySide6.QtCore import Property, Signal from meshroom.core.attribute import ListAttribute, Attribute from meshroom.core.graph import GraphModification diff --git a/meshroom/ui/components/__init__.py b/meshroom/ui/components/__init__.py index 260acb0408..59c77618f8 100755 --- a/meshroom/ui/components/__init__.py +++ b/meshroom/ui/components/__init__.py @@ -1,6 +1,6 @@ def registerTypes(): - from PySide2.QtQml import qmlRegisterType + from PySide6.QtQml import qmlRegisterType from meshroom.ui.components.clipboard import ClipboardHelper from meshroom.ui.components.edge import EdgeMouseArea from meshroom.ui.components.filepath import FilepathHelper diff --git a/meshroom/ui/components/clipboard.py b/meshroom/ui/components/clipboard.py index 2cca6e1a5a..964e08dad6 100644 --- a/meshroom/ui/components/clipboard.py +++ b/meshroom/ui/components/clipboard.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import Slot, QObject -from PySide2.QtGui import QClipboard +from PySide6.QtCore import Slot, QObject +from PySide6.QtGui import QClipboard class ClipboardHelper(QObject): diff --git a/meshroom/ui/components/csvData.py b/meshroom/ui/components/csvData.py index c9ecef2f25..f52cabe991 100644 --- a/meshroom/ui/components/csvData.py +++ b/meshroom/ui/components/csvData.py @@ -1,7 +1,7 @@ from meshroom.common.qt import QObjectListModel -from PySide2.QtCore import QObject, Slot, Signal, Property -from PySide2.QtCharts import QtCharts +from PySide6.QtCore import QObject, Slot, Signal, Property +from PySide6 import QtCharts import csv import os diff --git a/meshroom/ui/components/edge.py b/meshroom/ui/components/edge.py index 64a9f0e3c8..d802d5b6cf 100755 --- a/meshroom/ui/components/edge.py +++ b/meshroom/ui/components/edge.py @@ -1,6 +1,6 @@ -from PySide2.QtCore import Signal, Property, QPointF, Qt, QObject -from PySide2.QtGui import QPainterPath, QVector2D -from PySide2.QtQuick import QQuickItem +from PySide6.QtCore import Signal, Property, QPointF, Qt, QObject +from PySide6.QtGui import QPainterPath, QVector2D +from PySide6.QtQuick import QQuickItem class MouseEvent(QObject): diff --git a/meshroom/ui/components/filepath.py b/meshroom/ui/components/filepath.py index 6c19e87f8b..7e33891378 100644 --- a/meshroom/ui/components/filepath.py +++ b/meshroom/ui/components/filepath.py @@ -2,8 +2,8 @@ # coding:utf-8 from meshroom.core import pyCompatibility -from PySide2.QtCore import QUrl, QFileInfo -from PySide2.QtCore import QObject, Slot +from PySide6.QtCore import QUrl, QFileInfo +from PySide6.QtCore import QObject, Slot import os diff --git a/meshroom/ui/components/scene3D.py b/meshroom/ui/components/scene3D.py index b4569c19f0..b7c04d85fa 100644 --- a/meshroom/ui/components/scene3D.py +++ b/meshroom/ui/components/scene3D.py @@ -1,9 +1,9 @@ from math import acos, pi, sqrt -from PySide2.QtCore import QObject, Slot, QSize, Signal, QPointF -from PySide2.Qt3DCore import Qt3DCore -from PySide2.Qt3DRender import Qt3DRender -from PySide2.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4 +from PySide6.QtCore import QObject, Slot, QSize, Signal, QPointF +from PySide6.Qt3DCore import Qt3DCore +from PySide6.Qt3DRender import Qt3DRender +from PySide6.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4 from meshroom.ui.utils import makeProperty @@ -41,14 +41,14 @@ def vertexCount(self, entity): def faceCount(self, entity): """ Returns face count based on children QGeometry buffers size.""" count = 0 - for geo in entity.findChildren(Qt3DRender.QGeometry): + for geo in entity.findChildren(Qt3DCore.QGeometry): count += sum([attr.count() for attr in geo.attributes() if attr.name() == "vertexPosition"]) return count / 3 @Slot(Qt3DCore.QEntity, result=int) def vertexColorCount(self, entity): count = 0 - for geo in entity.findChildren(Qt3DRender.QGeometry): + for geo in entity.findChildren(Qt3DCore.QGeometry): count += sum([attr.count() for attr in geo.attributes() if attr.name() == "vertexColor"]) return count @@ -58,11 +58,12 @@ class TrackballController(QObject): Trackball-like camera controller. Based on the C++ version from https://github.com/cjmdaixi/Qt3DTrackball """ - - _windowSize = QSize() - _camera = None - _trackballSize = 1.0 - _rotationSpeed = 5.0 + def __init__(self, parent=None): + super().__init__(parent) + self._windowSize = QSize() + self._camera = None + self._trackballSize = 1.0 + self._rotationSpeed = 5.0 def projectToTrackball(self, screenCoords): sx = screenCoords.x() @@ -98,7 +99,7 @@ def rotate(self, lastPosition, currentPosition, dt): windowSizeChanged = Signal() windowSize = makeProperty(QSize, '_windowSize', windowSizeChanged) cameraChanged = Signal() - camera = makeProperty(Qt3DRender.QCamera, '_camera', cameraChanged) + camera = makeProperty(QObject, '_camera', cameraChanged) trackballSizeChanged = Signal() trackballSize = makeProperty(float, '_trackballSize', trackballSizeChanged) rotationSpeedChanged = Signal() diff --git a/meshroom/ui/graph.py b/meshroom/ui/graph.py index 250abcd2dc..25119b371d 100644 --- a/meshroom/ui/graph.py +++ b/meshroom/ui/graph.py @@ -7,7 +7,7 @@ from threading import Thread, Event, Lock from multiprocessing.pool import ThreadPool -from PySide2.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint +from PySide6.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint from meshroom import multiview from meshroom.common.qt import QObjectListModel diff --git a/meshroom/ui/palette.py b/meshroom/ui/palette.py index 00e4ec0fab..4d96870915 100644 --- a/meshroom/ui/palette.py +++ b/meshroom/ui/palette.py @@ -1,6 +1,6 @@ -from PySide2.QtCore import QObject, Qt, Slot, Property, Signal -from PySide2.QtGui import QPalette, QColor -from PySide2.QtWidgets import QApplication +from PySide6.QtCore import QObject, Qt, Slot, Property, Signal +from PySide6.QtGui import QPalette, QColor +from PySide6.QtWidgets import QApplication class PaletteManager(QObject): @@ -57,3 +57,22 @@ def togglePalette(self): paletteChanged = Signal() palette = Property(QPalette, lambda self: QApplication.instance().palette(), notify=paletteChanged) + alternateBase = Property(QColor, lambda self: self.palette.color(QPalette.AlternateBase), notify=paletteChanged) + base = Property(QColor, lambda self: self.palette.color(QPalette.Base), notify=paletteChanged) + button = Property(QColor, lambda self: self.palette.color(QPalette.Button), notify=paletteChanged) + buttonText = Property(QColor, lambda self: self.palette.color(QPalette.ButtonText), notify=paletteChanged) + disabledButtonText = Property(QColor, lambda self: self.palette.color(QPalette.Disabled, QPalette.ButtonText), notify=paletteChanged) + highlight = Property(QColor, lambda self: self.palette.color(QPalette.Highlight), notify=paletteChanged) + disabledHighlight = Property(QColor, lambda self: self.palette.color(QPalette.Disabled, QPalette.Highlight), notify=paletteChanged) + highlightedText = Property(QColor, lambda self: self.palette.color(QPalette.HighlightedText), notify=paletteChanged) + disabledHighlightedText = Property(QColor, lambda self: self.palette.color(QPalette.Disabled, QPalette.HighlightedText), notify=paletteChanged) + link = Property(QColor, lambda self: self.palette.color(QPalette.Link), notify=paletteChanged) + mid = Property(QColor, lambda self: self.palette.color(QPalette.Mid), notify=paletteChanged) + shadow = Property(QColor, lambda self: self.palette.color(QPalette.Shadow), notify=paletteChanged) + text = Property(QColor, lambda self: self.palette.color(QPalette.Text), notify=paletteChanged) + disabledText = Property(QColor, lambda self: self.palette.color(QPalette.Disabled, QPalette.Text), notify=paletteChanged) + toolTipBase = Property(QColor, lambda self: self.palette.color(QPalette.ToolTipBase), notify=paletteChanged) + toolTipText = Property(QColor, lambda self: self.palette.color(QPalette.ToolTipText), notify=paletteChanged) + window = Property(QColor, lambda self: self.palette.color(QPalette.Window), notify=paletteChanged) + windowText = Property(QColor, lambda self: self.palette.color(QPalette.WindowText), notify=paletteChanged) + disabledWindowText = Property(QColor, lambda self: self.palette.color(QPalette.Disabled, QPalette.WindowText), notify=paletteChanged) diff --git a/meshroom/ui/qml/AboutDialog.qml b/meshroom/ui/qml/AboutDialog.qml index 483a4dce7f..f43fe1fc73 100644 --- a/meshroom/ui/qml/AboutDialog.qml +++ b/meshroom/ui/qml/AboutDialog.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Utils 1.0 import MaterialIcons 2.2 @@ -197,7 +197,7 @@ Dialog { selectByKeyboard: true wrapMode: TextArea.WrapAnywhere textFormat: TextEdit.RichText - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: function (link) { Qt.openUrlExternally(link) } } } } diff --git a/meshroom/ui/qml/Charts/ChartViewCheckBox.qml b/meshroom/ui/qml/Charts/ChartViewCheckBox.qml index 0b395b72e7..c678e0f264 100644 --- a/meshroom/ui/qml/Charts/ChartViewCheckBox.qml +++ b/meshroom/ui/qml/Charts/ChartViewCheckBox.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 /** diff --git a/meshroom/ui/qml/Charts/ChartViewLegend.qml b/meshroom/ui/qml/Charts/ChartViewLegend.qml index 1244871559..ded83c74b2 100644 --- a/meshroom/ui/qml/Charts/ChartViewLegend.qml +++ b/meshroom/ui/qml/Charts/ChartViewLegend.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.9 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtCharts 2.3 @@ -29,8 +29,8 @@ Flow { // Update internal ListModel when ChartView's series change Connections { target: chartView - onSeriesAdded: seriesModel.append({"series": series}) - onSeriesRemoved: { + function onSeriesAdded(series) { seriesModel.append({"series": series}) } + function onSeriesRemoved(series) { for(var i = 0; i < seriesModel.count; ++i) { if(seriesModel.get(i)["series"] === series) @@ -84,7 +84,7 @@ Flow { MouseArea { anchors.fill: parent - onClicked: { + onClicked: function (mouse) { if(mouse.modifiers & Qt.ControlModifier) root.soloSeries(index); else diff --git a/meshroom/ui/qml/Charts/InteractiveChartView.qml b/meshroom/ui/qml/Charts/InteractiveChartView.qml index eef47765f9..41060b57c7 100644 --- a/meshroom/ui/qml/Charts/InteractiveChartView.qml +++ b/meshroom/ui/qml/Charts/InteractiveChartView.qml @@ -1,9 +1,8 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtPositioning 5.8 -import QtLocation 5.9 import QtCharts 2.13 diff --git a/meshroom/ui/qml/Controls/ColorChart.qml b/meshroom/ui/qml/Controls/ColorChart.qml index 82667f22d0..072fd22c8e 100644 --- a/meshroom/ui/qml/Controls/ColorChart.qml +++ b/meshroom/ui/qml/Controls/ColorChart.qml @@ -1,5 +1,5 @@ -import QtQuick 2.10 -import QtQuick.Controls 2.10 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import Utils 1.0 diff --git a/meshroom/ui/qml/Controls/FloatingPane.qml b/meshroom/ui/qml/Controls/FloatingPane.qml index 36dd7f1d9a..a845707f3d 100644 --- a/meshroom/ui/qml/Controls/FloatingPane.qml +++ b/meshroom/ui/qml/Controls/FloatingPane.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 /** diff --git a/meshroom/ui/qml/Controls/Group.qml b/meshroom/ui/qml/Controls/Group.qml index 452c9cddf2..98918ccf84 100644 --- a/meshroom/ui/qml/Controls/Group.qml +++ b/meshroom/ui/qml/Controls/Group.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 diff --git a/meshroom/ui/qml/Controls/KeyValue.qml b/meshroom/ui/qml/Controls/KeyValue.qml index 0f0f10592e..a095e2c3d4 100644 --- a/meshroom/ui/qml/Controls/KeyValue.qml +++ b/meshroom/ui/qml/Controls/KeyValue.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 diff --git a/meshroom/ui/qml/Controls/MessageDialog.qml b/meshroom/ui/qml/Controls/MessageDialog.qml index 079bc2025f..e633ccf757 100644 --- a/meshroom/ui/qml/Controls/MessageDialog.qml +++ b/meshroom/ui/qml/Controls/MessageDialog.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 @@ -83,20 +83,20 @@ Dialog { id: textLabel font.bold: true visible: text != "" - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: function (link) { Qt.openUrlExternally(link) } } // Detailed text Label { id: detailedLabel text: text visible: text != "" - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: function (link) { Qt.openUrlExternally(link) } } // Additional helper text Label { id: helperLabel visible: text != "" - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: function (link) { Qt.openUrlExternally(link) } } } diff --git a/meshroom/ui/qml/Controls/Panel.qml b/meshroom/ui/qml/Controls/Panel.qml index 6cadad9338..ecca91719b 100644 --- a/meshroom/ui/qml/Controls/Panel.qml +++ b/meshroom/ui/qml/Controls/Panel.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 diff --git a/meshroom/ui/qml/Controls/SearchBar.qml b/meshroom/ui/qml/Controls/SearchBar.qml index 9d759b44db..25ac2bc246 100644 --- a/meshroom/ui/qml/Controls/SearchBar.qml +++ b/meshroom/ui/qml/Controls/SearchBar.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 diff --git a/meshroom/ui/qml/Controls/TabPanel.qml b/meshroom/ui/qml/Controls/TabPanel.qml index fac384c10d..267c500996 100644 --- a/meshroom/ui/qml/Controls/TabPanel.qml +++ b/meshroom/ui/qml/Controls/TabPanel.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 Page { diff --git a/meshroom/ui/qml/Controls/TextFileViewer.qml b/meshroom/ui/qml/Controls/TextFileViewer.qml index a8d5cfd2a4..f94d13f546 100644 --- a/meshroom/ui/qml/Controls/TextFileViewer.qml +++ b/meshroom/ui/qml/Controls/TextFileViewer.qml @@ -1,5 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.11 import MaterialIcons 2.2 @@ -112,7 +112,7 @@ Item { keyNavigationEnabled: false highlightFollowsCurrentItem: true highlightMoveDuration: 0 - Keys.onPressed: { + Keys.onPressed: function (event) { switch(event.key) { case Qt.Key_Home: @@ -314,10 +314,8 @@ Item { return; loading = true; - var xhr = new XMLHttpRequest; - xhr.open("GET", root.source); - xhr.onreadystatechange = function() { + Request.get(root.source, function(xhr){ // - can't rely on 'Last-Modified' header response to verify // that file has changed on disk (not always up-to-date) // - instead, let QML engine evaluate whether 'text' property value has changed @@ -328,7 +326,6 @@ Item { if(autoReload) reloadTimer.restart(); } - }; - xhr.send(); + }) } } diff --git a/meshroom/ui/qml/DialogsFactory.qml b/meshroom/ui/qml/DialogsFactory.qml index f0ccaab86b..c7256afac3 100644 --- a/meshroom/ui/qml/DialogsFactory.qml +++ b/meshroom/ui/qml/DialogsFactory.qml @@ -1,4 +1,4 @@ -import QtQuick 2.9 +import QtQuick 2.15 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/GraphEditor/AttributeEditor.qml b/meshroom/ui/qml/GraphEditor/AttributeEditor.qml index 6baeca39e1..62dfd2e8a1 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeEditor.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeEditor.qml @@ -1,6 +1,6 @@ -import QtQuick 2.9 +import QtQuick 2.15 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.15 import MaterialIcons 2.2 import Utils 1.0 @@ -32,7 +32,7 @@ ListView { readOnly: root.readOnly labelWidth: root.labelWidth attribute: object - onDoubleClicked: root.attributeDoubleClicked(mouse, attr) + onDoubleClicked: function (mouse) { root.attributeDoubleClicked(mouse, attr) } } } diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 83ab8ca33f..2279113c3e 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -1,6 +1,6 @@ -import QtQuick 2.9 +import QtQuick 2.15 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.15 import MaterialIcons 2.2 import Utils 1.0 @@ -62,7 +62,7 @@ RowLayout { anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.AllButtons - onDoubleClicked: root.doubleClicked(mouse, root.attribute) + onDoubleClicked: function (mouse) { root.doubleClicked(mouse, root.attribute) } property Component menuComp: Menu { id: paramMenu @@ -97,7 +97,7 @@ RowLayout { } } - onClicked: { + onClicked: function (mouse) { forceActiveFocus() if(mouse.button == Qt.RightButton) { @@ -174,7 +174,7 @@ RowLayout { DropArea { enabled: root.editable anchors.fill: parent - onDropped: { + onDropped: function (drop) { if(drop.hasUrls) setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) else if(drop.hasText && drop.text != '') @@ -194,7 +194,7 @@ RowLayout { onActivated: _reconstruction.setAttribute(attribute, currentText) Connections { target: attribute - onValueChanged: combo.currentIndex = combo.find(attribute.value) + function onValueChanged() {combo.currentIndex = combo.find(attribute.value)} } } } @@ -429,16 +429,7 @@ RowLayout { width: control.availableWidth height: control.availableHeight blending: false - fragmentShader: " - varying mediump vec2 qt_TexCoord0; - vec3 hsv2rgb(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); - } - void main() { - gl_FragColor = vec4(hsv2rgb(vec3(qt_TexCoord0.x, 1.0, 1.0)), 1.0); - }" + fragmentShader: 'qrc:/shaders/AttributeItemDelegate.frag.qsb' } } } diff --git a/meshroom/ui/qml/GraphEditor/AttributePin.qml b/meshroom/ui/qml/GraphEditor/AttributePin.qml index 9b38b3d155..836ad5a0de 100755 --- a/meshroom/ui/qml/GraphEditor/AttributePin.qml +++ b/meshroom/ui/qml/GraphEditor/AttributePin.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Utils 1.0 @@ -39,8 +39,8 @@ RowLayout { Repeater { id: childrenRepeater model: isList && !attribute.isLink ? attribute.value : 0 - onItemAdded: {childPinCreated(item.childAttribute, item)} - onItemRemoved: {childPinDeleted(item.childAttribute, item)} + onItemAdded: function(item) {childPinCreated(item.childAttribute, item)} + onItemRemoved: function(item) {childPinDeleted(item.childAttribute, item)} delegate: Item { property var childAttribute: object } @@ -82,7 +82,7 @@ RowLayout { anchors.rightMargin: -root.width * 0.3 keys: [inputDragTarget.objectName] - onEntered: { + onEntered: function (drag) { // Check if attributes are compatible to create a valid connection if( root.readOnly // cannot connect on a read-only attribute || drag.source.objectName != inputDragTarget.objectName // not an edge connector @@ -109,7 +109,7 @@ RowLayout { drag.source.dropAccepted = false } - onDropped: { + onDropped: function (drop) { root.edgeAboutToBeRemoved(undefined) _reconstruction.addEdge(drag.source.attribute, inputDragTarget.attribute) } @@ -145,7 +145,7 @@ RowLayout { anchors.margins: inputDropArea.anchors.margins anchors.leftMargin: inputDropArea.anchors.leftMargin anchors.rightMargin: inputDropArea.anchors.rightMargin - onPressed: { + onPressed: function (mouse) { root.pressed(mouse) } onReleased: { @@ -228,7 +228,7 @@ RowLayout { anchors.leftMargin: -root.width * 0.2 keys: [outputDragTarget.objectName] - onEntered: { + onEntered: function (drag) { // Check if attributes are compatible to create a valid connection if( drag.source.objectName != outputDragTarget.objectName // not an edge connector || drag.source.baseType != outputDragTarget.baseType // not the same base type @@ -251,7 +251,7 @@ RowLayout { acceptableDrop = false } - onDropped: { + onDropped: function (drop) { root.edgeAboutToBeRemoved(undefined) _reconstruction.addEdge(outputDragTarget.attribute, drag.source.attribute) } @@ -287,7 +287,7 @@ RowLayout { anchors.leftMargin: outputDropArea.anchors.leftMargin anchors.rightMargin: outputDropArea.anchors.rightMargin - onPressed: root.pressed(mouse) + onPressed: function (mouse) { root.pressed(mouse)} onReleased: outputDragTarget.Drag.drop() hoverEnabled: true diff --git a/meshroom/ui/qml/GraphEditor/ChunksListView.qml b/meshroom/ui/qml/GraphEditor/ChunksListView.qml index f2ec5544e1..fddc3c30a6 100644 --- a/meshroom/ui/qml/GraphEditor/ChunksListView.qml +++ b/meshroom/ui/qml/GraphEditor/ChunksListView.qml @@ -1,6 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as Controls1 // SplitView +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 @@ -80,7 +79,7 @@ ColumnLayout { id: chunkDelegate property var chunk: object text: index - width: parent.width + width: ListView.view.width leftPadding: 8 onClicked: { chunksLV.forceActiveFocus() diff --git a/meshroom/ui/qml/GraphEditor/CompatibilityBadge.qml b/meshroom/ui/qml/GraphEditor/CompatibilityBadge.qml index f4e1c81307..f75a599912 100644 --- a/meshroom/ui/qml/GraphEditor/CompatibilityBadge.qml +++ b/meshroom/ui/qml/GraphEditor/CompatibilityBadge.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 @@ -32,7 +32,7 @@ Loader { MouseArea { anchors.fill: parent hoverEnabled: true - onPressed: mouse.accepted = false + onPressed: function (mouse) { mouse.accepted = false } ToolTip.text: issueDetails ToolTip.visible: containsMouse } diff --git a/meshroom/ui/qml/GraphEditor/CompatibilityManager.qml b/meshroom/ui/qml/GraphEditor/CompatibilityManager.qml index d9cad1eed9..7387686268 100644 --- a/meshroom/ui/qml/GraphEditor/CompatibilityManager.qml +++ b/meshroom/ui/qml/GraphEditor/CompatibilityManager.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 @@ -70,7 +70,7 @@ MessageDialog { headerPositioning: ListView.OverlayHeader header: Pane { z: 2 - width: ListView.view.width + width: parent.width padding: 6 background: Rectangle { color: Qt.darker(parent.palette.window, 1.15) } RowLayout { diff --git a/meshroom/ui/qml/GraphEditor/Edge.qml b/meshroom/ui/qml/GraphEditor/Edge.qml index e28a3f1818..49632fae7b 100644 --- a/meshroom/ui/qml/GraphEditor/Edge.qml +++ b/meshroom/ui/qml/GraphEditor/Edge.qml @@ -1,4 +1,4 @@ -import QtQuick 2.9 +import QtQuick 2.15 import GraphEditor 1.0 import QtQuick.Shapes 1.0 diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 2d3591ab6b..5dad0f11b6 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Controls 1.0 import Utils 1.0 @@ -76,7 +76,7 @@ Item { } - Keys.onPressed: { + Keys.onPressed: function (event) { if(event.key === Qt.Key_F) fit() if(event.key === Qt.Key_Delete) @@ -103,7 +103,7 @@ Item { drag.threshold: 0 cursorShape: drag.target == draggable ? Qt.ClosedHandCursor : Qt.ArrowCursor - onWheel: { + onWheel: function (wheel) { var zoomFactor = wheel.angleDelta.y > 0 ? factor : 1/factor var scale = draggable.scale * zoomFactor scale = Math.min(Math.max(minZoom, scale), maxZoom) @@ -116,7 +116,7 @@ Item { workspaceMoved() } - onPressed: { + onPressed: function (mouse) { if (mouse.button != Qt.MiddleButton && mouse.modifiers == Qt.NoModifier) { uigraph.clearNodeSelection() } @@ -141,7 +141,7 @@ Item { workspaceMoved() } - onClicked: { + onClicked: function (mouse) { if(mouse.button == Qt.RightButton) { // store mouse click position in 'draggable' coordinates as new node spawn position @@ -209,7 +209,7 @@ Item { // Forward key events to the search bar to continue typing seamlessly // even if this delegate took the activeFocus due to mouse hovering Keys.forwardTo: [searchBar.textField] - Keys.onPressed: { + Keys.onPressed: function (event) { event.accepted = false; switch(event.key) { case Qt.Key_Return: @@ -256,8 +256,8 @@ Item { // Dynamically add the menu categories Instantiator { model: !(searchBar.text != "") ? Object.keys(newNodeMenu.parseCategories()).sort() : undefined - onObjectAdded: newNodeMenu.insertMenu(index+1, object ) // add sub-menu under the search bar - onObjectRemoved: newNodeMenu.removeMenu(object) + onObjectAdded: function (index, object) { newNodeMenu.insertMenu(index+1, object ); } // add sub-menu under the search bar + onObjectRemoved: function (index, object) { newNodeMenu.removeMenu(object); } delegate: Menu { title: modelData @@ -265,8 +265,8 @@ Item { Instantiator { model: newNodeMenu.visible && newNodeSubMenu.activeFocus ? newNodeMenu.parseCategories()[modelData] : undefined - onObjectAdded: newNodeSubMenu.insertItem(index, object) - onObjectRemoved: newNodeSubMenu.removeItem(object) + onObjectAdded: function (index, object) { newNodeSubMenu.insertItem(index, object); } + onObjectRemoved: function (index, object) { newNodeSubMenu.removeItem(object); } delegate: menuItemDelegateComponent } } @@ -323,7 +323,7 @@ Item { point1y: isValidEdge ? src.globalY + src.outputAnchorPos.y : 0 point2x: isValidEdge ? dst.globalX + dst.inputAnchorPos.x : 0 point2y: isValidEdge ? dst.globalY + dst.inputAnchorPos.y : 0 - onPressed: { + onPressed: function (mouse) { const canEdit = !edge.dst.node.locked if(event.button == Qt.RightButton) @@ -496,10 +496,10 @@ Item { selected: uigraph.selectedNodes.contains(node) hovered: uigraph.hoveredNode === node - onAttributePinCreated: registerAttributePin(attribute, pin) - onAttributePinDeleted: unregisterAttributePin(attribute, pin) + onAttributePinCreated: function(attribute, pin) { registerAttributePin(attribute, pin); } + onAttributePinDeleted: function(attribute, pin) { unregisterAttributePin(attribute, pin); } - onPressed: { + onPressed: function (mouse) { if (mouse.button == Qt.LeftButton) { if (mouse.modifiers & Qt.ControlModifier && !(mouse.modifiers & Qt.AltModifier)) { if (mainSelected && selected) { @@ -527,14 +527,14 @@ Item { selectNode(node) } - onDoubleClicked: root.nodeDoubleClicked(mouse, node) + onDoubleClicked: function (mouse) { root.nodeDoubleClicked(mouse, node) } onMoved: uigraph.moveNode(node, position, uigraph.selectedNodes) onEntered: uigraph.hoveredNode = node onExited: uigraph.hoveredNode = null - onEdgeAboutToBeRemoved: { + onEdgeAboutToBeRemoved: function (input) { /* Sometimes the signals are not in the right order because of weird Qt/QML update order (next DropArea diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 0cf8289288..db8992eac9 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -1,7 +1,7 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 -import QtGraphicalEffects 1.0 +// import QtGraphicalEffects 1.0 // TODO: Porting to Qt6, QtGraphicalEffects is unavailable import Utils 1.0 import MaterialIcons 2.2 @@ -65,7 +65,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 } @@ -108,8 +108,8 @@ Item { drag.threshold: 2 hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton - onPressed: root.pressed(mouse) - onDoubleClicked: root.doubleClicked(mouse) + onPressed: function (mouse) { root.pressed(mouse) } + onDoubleClicked: function (mouse) { root.doubleClicked(mouse) } onEntered: root.entered() onExited: root.exited() drag.onActiveChanged: { @@ -138,7 +138,7 @@ Item { anchors.fill: nodeContent color: Qt.lighter(activePalette.base, 1.4) layer.enabled: true - layer.effect: DropShadow { radius: 3; color: shadowColor } + // layer.effect: DropShadow { radius: 3; color: shadowColor } // TODO: Porting to Qt6, QtGraphicalEffects is unavailable radius: 3 opacity: 0.7 } @@ -305,8 +305,8 @@ Item { property real globalX: root.x + nodeAttributes.x + outputs.x + outputLoader.x + outPin.x property real globalY: root.y + nodeAttributes.y + outputs.y + outputLoader.y + outPin.y - onPressed: root.pressed(mouse) - onEdgeAboutToBeRemoved: root.edgeAboutToBeRemoved(input) + onPressed: function (mouse) { root.pressed(mouse) } + onEdgeAboutToBeRemoved: function (input) { root.edgeAboutToBeRemoved(input) } Component.onCompleted: attributePinCreated(object, outPin) Component.onDestruction: attributePinDeleted(attribute, outPin) @@ -338,10 +338,10 @@ Item { readOnly: root.readOnly || object.isReadOnly Component.onCompleted: attributePinCreated(attribute, inPin) Component.onDestruction: attributePinDeleted(attribute, inPin) - onPressed: root.pressed(mouse) - onEdgeAboutToBeRemoved: root.edgeAboutToBeRemoved(input) - onChildPinCreated: attributePinCreated(childAttribute, inPin) - onChildPinDeleted: attributePinDeleted(childAttribute, inPin) + onPressed: function (mouse) { root.pressed(mouse) } + onEdgeAboutToBeRemoved: function (input) { root.edgeAboutToBeRemoved(input) } + onChildPinCreated: function(childAttribute, inPin) { attributePinCreated(childAttribute, inPin); } + onChildPinDeleted: function(childAttribute, inPin) { attributePinDeleted(childAttribute, inPin); } } } } @@ -398,12 +398,12 @@ Item { visible: (height == childrenRect.height) attribute: object readOnly: root.readOnly || object.isReadOnly - Component.onCompleted: attributePinCreated(attribute, inPin) - Component.onDestruction: attributePinDeleted(attribute, inPin) - onPressed: root.pressed(mouse) - onEdgeAboutToBeRemoved: root.edgeAboutToBeRemoved(input) - onChildPinCreated: attributePinCreated(childAttribute, inPin) - onChildPinDeleted: attributePinDeleted(childAttribute, inPin) + Component.onCompleted: function(attribute, inPin) { attributePinCreated(attribute, inPin); } + Component.onDestruction: function(attribute, inPin) { attributePinDeleted(attribute, inPin); } + onPressed: function (mouse) { root.pressed(mouse) } + onEdgeAboutToBeRemoved: function (input) { root.edgeAboutToBeRemoved(input) } + onChildPinCreated: function(childAttribute, inPin) { attributePinCreated(childAttribute, inPin); } + onChildPinDeleted: function(childAttribute, inPin) { attributePinDeleted(childAttribute, inPin); } } } } diff --git a/meshroom/ui/qml/GraphEditor/NodeChunks.qml b/meshroom/ui/qml/GraphEditor/NodeChunks.qml index ac426db43f..35561d5268 100644 --- a/meshroom/ui/qml/GraphEditor/NodeChunks.qml +++ b/meshroom/ui/qml/GraphEditor/NodeChunks.qml @@ -1,4 +1,4 @@ -import QtQuick 2.7 +import QtQuick 2.15 import Utils 1.0 //import "common.js" as Common diff --git a/meshroom/ui/qml/GraphEditor/NodeDocumentation.qml b/meshroom/ui/qml/GraphEditor/NodeDocumentation.qml index 337f3e3711..6ba9d63e27 100644 --- a/meshroom/ui/qml/GraphEditor/NodeDocumentation.qml +++ b/meshroom/ui/qml/GraphEditor/NodeDocumentation.qml @@ -1,5 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Controls 1.0 diff --git a/meshroom/ui/qml/GraphEditor/NodeEditor.qml b/meshroom/ui/qml/GraphEditor/NodeEditor.qml index f4cc2de1d4..3fbf491734 100644 --- a/meshroom/ui/qml/GraphEditor/NodeEditor.qml +++ b/meshroom/ui/qml/GraphEditor/NodeEditor.qml @@ -1,6 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.4 -import QtQuick.Controls 1.4 as Controls1 // SplitView +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 @@ -106,7 +105,7 @@ Panel { Component { id: editor_component - Controls1.SplitView { + SplitView { anchors.fill: parent // The list of chunks @@ -114,11 +113,12 @@ Panel { id: chunksLV visible: (tabBar.currentIndex >= 1 && tabBar.currentIndex <= 3) chunks: root.node.chunks + SplitView.preferredWidth: 60 } StackLayout { - Layout.fillHeight: true - Layout.fillWidth: true + SplitView.fillHeight: true + SplitView.fillWidth: true currentIndex: tabBar.currentIndex @@ -127,7 +127,7 @@ Panel { Layout.fillWidth: true model: root.node.attributes readOnly: root.readOnly || root.isCompatibilityNode - onAttributeDoubleClicked: root.attributeDoubleClicked(mouse, attribute) + onAttributeDoubleClicked: function (mouse, attribute) { root.attributeDoubleClicked(mouse, attribute) } onUpgradeRequest: root.upgradeRequest() } diff --git a/meshroom/ui/qml/GraphEditor/NodeLog.qml b/meshroom/ui/qml/GraphEditor/NodeLog.qml index 941d5099f9..f2a94e4652 100644 --- a/meshroom/ui/qml/GraphEditor/NodeLog.qml +++ b/meshroom/ui/qml/GraphEditor/NodeLog.qml @@ -1,5 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/GraphEditor/NodeStatistics.qml b/meshroom/ui/qml/GraphEditor/NodeStatistics.qml index ee943693a3..4dbee254cf 100644 --- a/meshroom/ui/qml/GraphEditor/NodeStatistics.qml +++ b/meshroom/ui/qml/GraphEditor/NodeStatistics.qml @@ -1,6 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as Controls1 // SplitView +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/GraphEditor/NodeStatus.qml b/meshroom/ui/qml/GraphEditor/NodeStatus.qml index 8de87fbc3e..aa10415b63 100644 --- a/meshroom/ui/qml/GraphEditor/NodeStatus.qml +++ b/meshroom/ui/qml/GraphEditor/NodeStatus.qml @@ -1,9 +1,11 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 +import Utils 1.0 + import "common.js" as Common /** @@ -50,10 +52,7 @@ FocusScope { if(!Filepath.urlToString(source).endsWith("status")) return; - var xhr = new XMLHttpRequest; - xhr.open("GET", source); - - xhr.onreadystatechange = function() { + Request.get(source, function(xhr) { if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { // console.warn("StatusListModel: read valid file") if(lastModified === undefined || lastModified !== xhr.getResponseHeader('Last-Modified')) { @@ -88,8 +87,7 @@ FocusScope { lastModified = undefined; statusListModel.clear(); } - }; - xhr.send(); + }) } } @@ -101,7 +99,7 @@ FocusScope { delegate: Rectangle { color: activePalette.window - width: parent.width + width: ListView.view.width height: childrenRect.height RowLayout { width: parent.width diff --git a/meshroom/ui/qml/GraphEditor/StatViewer.qml b/meshroom/ui/qml/GraphEditor/StatViewer.qml index c6a2adcffe..3749b2c8be 100644 --- a/meshroom/ui/qml/GraphEditor/StatViewer.qml +++ b/meshroom/ui/qml/GraphEditor/StatViewer.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtCharts 2.2 import QtQuick.Layouts 1.11 import Utils 1.0 @@ -97,12 +97,8 @@ Item { if(!Filepath.urlToString(source).endsWith("statistics")) return; - var xhr = new XMLHttpRequest; - xhr.open("GET", source); - - xhr.onreadystatechange = function() { + Request.get(source, function(xhr){ if (xhr.readyState === XMLHttpRequest.DONE && xhr.status == 200) { - if(sourceModified === undefined || sourceModified < xhr.getResponseHeader('Last-Modified')) { try { root.jsonObject = JSON.parse(xhr.responseText); @@ -119,8 +115,7 @@ Item { reloadTimer.restart(); } } - }; - xhr.send(); + }) } function resetCharts() { diff --git a/meshroom/ui/qml/GraphEditor/TaskManager.qml b/meshroom/ui/qml/GraphEditor/TaskManager.qml index 52fa209d59..d3d8aad8c4 100644 --- a/meshroom/ui/qml/GraphEditor/TaskManager.qml +++ b/meshroom/ui/qml/GraphEditor/TaskManager.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Controls 1.0 import Utils 1.0 @@ -144,7 +144,7 @@ Item { } delegate: RowLayout { - width: parent.width + width: ListView.view.width height: 18 spacing: 3 diff --git a/meshroom/ui/qml/ImageGallery/ImageBadge.qml b/meshroom/ui/qml/ImageGallery/ImageBadge.qml index 7609be8cd6..3a655f280f 100644 --- a/meshroom/ui/qml/ImageGallery/ImageBadge.qml +++ b/meshroom/ui/qml/ImageGallery/ImageBadge.qml @@ -1,4 +1,4 @@ -import QtQuick 2.9 +import QtQuick 2.15 import MaterialIcons 2.2 import Utils 1.0 diff --git a/meshroom/ui/qml/ImageGallery/ImageDelegate.qml b/meshroom/ui/qml/ImageGallery/ImageDelegate.qml index bc5beb116b..3ba4f7564a 100644 --- a/meshroom/ui/qml/ImageGallery/ImageDelegate.qml +++ b/meshroom/ui/qml/ImageGallery/ImageDelegate.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Utils 1.0 @@ -37,7 +37,7 @@ Item { anchors.margins: 6 hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton - onPressed: { + onPressed: function (mouse) { if (mouse.button == Qt.RightButton) imageMenu.popup() root.pressed(mouse) diff --git a/meshroom/ui/qml/ImageGallery/ImageGallery.qml b/meshroom/ui/qml/ImageGallery/ImageGallery.qml index 6e0256e22c..4f5f53f63f 100644 --- a/meshroom/ui/qml/ImageGallery/ImageGallery.qml +++ b/meshroom/ui/qml/ImageGallery/ImageGallery.qml @@ -1,5 +1,5 @@ -import QtQuick 2.14 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtQml.Models 2.2 @@ -168,7 +168,7 @@ Panel { // Update grid current item when selected view changes Connections { target: _reconstruction - onSelectedViewIdChanged: { + function onSelectedViewIdChanged() { grid.updateCurrentIndexFromSelectionViewId() } } @@ -238,7 +238,7 @@ Panel { isCurrentItem: GridView.isCurrentItem - onPressed: { + onPressed: function (mouse) { grid.currentIndex = DelegateModel.filteredIndex if(mouse.button == Qt.LeftButton) grid.forceActiveFocus() @@ -312,7 +312,7 @@ Panel { // Keyboard shortcut to change current image group Keys.priority: Keys.BeforeItem - Keys.onPressed: { + Keys.onPressed: function (event) { if(event.modifiers & Qt.AltModifier) { if(event.key == Qt.Key_Right) @@ -394,7 +394,7 @@ Panel { enabled: !m.readOnly && !intrinsicsFilterButton.checked keys: ["text/uri-list"] // TODO: onEntered: call specific method to filter files based on extension - onDropped: { + onDropped: function (drop) { var augmentSfm = augmentArea.hovered root.filesDropped(drop, augmentSfm) } diff --git a/meshroom/ui/qml/ImageGallery/IntrinsicsIndicator.qml b/meshroom/ui/qml/ImageGallery/IntrinsicsIndicator.qml index cd7f472a49..e5c2a00584 100644 --- a/meshroom/ui/qml/ImageGallery/IntrinsicsIndicator.qml +++ b/meshroom/ui/qml/ImageGallery/IntrinsicsIndicator.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.4 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import MaterialIcons 2.2 import Utils 1.0 diff --git a/meshroom/ui/qml/ImageGallery/SensorDBDialog.qml b/meshroom/ui/qml/ImageGallery/SensorDBDialog.qml index 3fe17e7543..36e339908a 100644 --- a/meshroom/ui/qml/ImageGallery/SensorDBDialog.qml +++ b/meshroom/ui/qml/ImageGallery/SensorDBDialog.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 diff --git a/meshroom/ui/qml/LiveSfmView.qml b/meshroom/ui/qml/LiveSfmView.qml index b8190de99a..bde6ad3a7c 100644 --- a/meshroom/ui/qml/LiveSfmView.qml +++ b/meshroom/ui/qml/LiveSfmView.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Qt.labs.platform 1.0 as Platform // for FileDialog diff --git a/meshroom/ui/qml/MaterialIcons/MLabel.qml b/meshroom/ui/qml/MaterialIcons/MLabel.qml index 2251a6b6ed..e7c0e66b8d 100644 --- a/meshroom/ui/qml/MaterialIcons/MLabel.qml +++ b/meshroom/ui/qml/MaterialIcons/MLabel.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.4 +import QtQuick 2.15 +import QtQuick.Controls 2.15 /** diff --git a/meshroom/ui/qml/MaterialIcons/MaterialIcons.qml b/meshroom/ui/qml/MaterialIcons/MaterialIcons.qml index 457845d211..aa28b4a435 100644 --- a/meshroom/ui/qml/MaterialIcons/MaterialIcons.qml +++ b/meshroom/ui/qml/MaterialIcons/MaterialIcons.qml @@ -1,5 +1,5 @@ pragma Singleton -import QtQuick 2.0 +import QtQuick 2.15 QtObject { property FontLoader fl: FontLoader { diff --git a/meshroom/ui/qml/MaterialIcons/MaterialLabel.qml b/meshroom/ui/qml/MaterialIcons/MaterialLabel.qml index 2b1140d6cc..8fcce1159e 100644 --- a/meshroom/ui/qml/MaterialIcons/MaterialLabel.qml +++ b/meshroom/ui/qml/MaterialIcons/MaterialLabel.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.4 +import QtQuick 2.15 +import QtQuick.Controls 2.15 /** diff --git a/meshroom/ui/qml/MaterialIcons/MaterialToolButton.qml b/meshroom/ui/qml/MaterialIcons/MaterialToolButton.qml index b24e2ad457..84df11559d 100644 --- a/meshroom/ui/qml/MaterialIcons/MaterialToolButton.qml +++ b/meshroom/ui/qml/MaterialIcons/MaterialToolButton.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 @@ -19,7 +19,7 @@ ToolButton { } background: Rectangle { color: { - if(pressed || checked || hovered) + if(enabled && (pressed || checked || hovered)) { if(pressed || checked) return Qt.darker(parent.palette.base, 1.3) diff --git a/meshroom/ui/qml/MaterialIcons/MaterialToolLabel.qml b/meshroom/ui/qml/MaterialIcons/MaterialToolLabel.qml index b1fde8a03c..c43c40d815 100644 --- a/meshroom/ui/qml/MaterialIcons/MaterialToolLabel.qml +++ b/meshroom/ui/qml/MaterialIcons/MaterialToolLabel.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 diff --git a/meshroom/ui/qml/MaterialIcons/MaterialToolLabelButton.qml b/meshroom/ui/qml/MaterialIcons/MaterialToolLabelButton.qml index 6613dd5133..1aa2768ecc 100644 --- a/meshroom/ui/qml/MaterialIcons/MaterialToolLabelButton.qml +++ b/meshroom/ui/qml/MaterialIcons/MaterialToolLabelButton.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 @@ -36,7 +36,7 @@ ToolButton { } background: Rectangle { color: { - if(pressed || checked || hovered) + if(enabled && (pressed || checked || hovered)) { if(pressed || checked) return Qt.darker(parent.palette.base, 1.3) diff --git a/meshroom/ui/qml/Utils/Colors.qml b/meshroom/ui/qml/Utils/Colors.qml index 25e7c21ced..9d15ea047c 100644 --- a/meshroom/ui/qml/Utils/Colors.qml +++ b/meshroom/ui/qml/Utils/Colors.qml @@ -1,6 +1,6 @@ pragma Singleton -import QtQuick 2.9 -import QtQuick.Controls 2.4 +import QtQuick 2.15 +import QtQuick.Controls 2.15 /** * Singleton that gathers useful colors, shades and system palettes. diff --git a/meshroom/ui/qml/Utils/SortFilterDelegateModel.qml b/meshroom/ui/qml/Utils/SortFilterDelegateModel.qml index 29135b0722..dbf92b3f7e 100644 --- a/meshroom/ui/qml/Utils/SortFilterDelegateModel.qml +++ b/meshroom/ui/qml/Utils/SortFilterDelegateModel.qml @@ -1,6 +1,6 @@ -import QtQuick 2.9 +import QtQuick 2.15 import QtQml.Models 2.2 -import QtQuick.Controls 2.3 +import QtQuick.Controls 2.15 /** * SortFilderDelegateModel adds sorting and filtering capabilities on a source model. diff --git a/meshroom/ui/qml/Utils/request.js b/meshroom/ui/qml/Utils/request.js index ffb5f2d663..adfa7d2289 100644 --- a/meshroom/ui/qml/Utils/request.js +++ b/meshroom/ui/qml/Utils/request.js @@ -1,7 +1,12 @@ .pragma library /** - * Perform 'GET' request on url, and bind 'callback' to onreadystatechange (with XHR object as parameter). + * Perform 'GET' request on url, and bind 'callback' to onreadystatechange (with XHR objet as parameter). + * + * TODO: Porting to Qt6 + * TODO: This function needs to be rewritten in Python. + * Using GET on a local file with XMLHttpRequest is disabled by default in Qt6. + * For now, environmental variable QML_XHR_ALLOW_FILE_READ must be set to 1 to enable this feature. */ function get(url, callback) { var xhr = new XMLHttpRequest(); diff --git a/meshroom/ui/qml/Viewer/CameraResponseGraph.qml b/meshroom/ui/qml/Viewer/CameraResponseGraph.qml index 54ace0257b..1aab984950 100644 --- a/meshroom/ui/qml/Viewer/CameraResponseGraph.qml +++ b/meshroom/ui/qml/Viewer/CameraResponseGraph.qml @@ -1,9 +1,8 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtPositioning 5.8 -import QtLocation 5.9 import QtCharts 2.13 import Charts 1.0 diff --git a/meshroom/ui/qml/Viewer/CircleGizmo.qml b/meshroom/ui/qml/Viewer/CircleGizmo.qml index 0b7d9e9814..e8007a955a 100644 --- a/meshroom/ui/qml/Viewer/CircleGizmo.qml +++ b/meshroom/ui/qml/Viewer/CircleGizmo.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 Rectangle { id: root @@ -70,7 +70,7 @@ Rectangle { propagateComposedEvents: true property bool controlModifierEnabled: false - onPositionChanged: { + onPositionChanged: function (mouse) { mArea.controlModifierEnabled = (mouse.modifiers & Qt.ControlModifier) mouse.accepted = false; } @@ -86,7 +86,7 @@ Rectangle { onPressed: { forceActiveFocus(); } - onWheel: { + onWheel: function (wheel) { mArea.controlModifierEnabled = (wheel.modifiers & Qt.ControlModifier) if (wheel.modifiers & Qt.ControlModifier) { incrementRadius(wheel.angleDelta.y / 120.0); diff --git a/meshroom/ui/qml/Viewer/ColorCheckerEntity.qml b/meshroom/ui/qml/Viewer/ColorCheckerEntity.qml index 385bb25c7e..fb57de0e8d 100644 --- a/meshroom/ui/qml/Viewer/ColorCheckerEntity.qml +++ b/meshroom/ui/qml/Viewer/ColorCheckerEntity.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 Item { id: root diff --git a/meshroom/ui/qml/Viewer/ColorCheckerPane.qml b/meshroom/ui/qml/Viewer/ColorCheckerPane.qml index 3833a891e6..b9852145fb 100644 --- a/meshroom/ui/qml/Viewer/ColorCheckerPane.qml +++ b/meshroom/ui/qml/Viewer/ColorCheckerPane.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 import QtQuick.Layouts 1.3 import Controls 1.0 diff --git a/meshroom/ui/qml/Viewer/ColorCheckerViewer.qml b/meshroom/ui/qml/Viewer/ColorCheckerViewer.qml index 00684d7779..01285664a4 100644 --- a/meshroom/ui/qml/Viewer/ColorCheckerViewer.qml +++ b/meshroom/ui/qml/Viewer/ColorCheckerViewer.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 Item { id: root @@ -39,11 +39,7 @@ Item { } function readSourceFile() { - var xhr = new XMLHttpRequest; - // console.warn("readSourceFile: " + root.source) - xhr.open("GET", root.source); - - xhr.onreadystatechange = function() { + Request.get(root.source, function(xhr){ if (xhr.readyState === XMLHttpRequest.DONE && xhr.status == 200) { try { root.json = null; @@ -58,8 +54,7 @@ Item { } } loadCCheckers(); - }; - xhr.send(); + }) } function loadCCheckers() { diff --git a/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml b/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml index d971c57343..5f009eb1ab 100644 --- a/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml +++ b/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 diff --git a/meshroom/ui/qml/Viewer/FeaturesViewer.qml b/meshroom/ui/qml/Viewer/FeaturesViewer.qml index 454f24c25e..ac559315d0 100644 --- a/meshroom/ui/qml/Viewer/FeaturesViewer.qml +++ b/meshroom/ui/qml/Viewer/FeaturesViewer.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 import AliceVision 1.0 as AliceVision import Utils 1.0 diff --git a/meshroom/ui/qml/Viewer/FloatImage.qml b/meshroom/ui/qml/Viewer/FloatImage.qml index 885833041c..a6c91cfc81 100644 --- a/meshroom/ui/qml/Viewer/FloatImage.qml +++ b/meshroom/ui/qml/Viewer/FloatImage.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 import Utils 1.0 import AliceVision 1.0 as AliceVision diff --git a/meshroom/ui/qml/Viewer/HdrImageToolbar.qml b/meshroom/ui/qml/Viewer/HdrImageToolbar.qml index 37c67e0507..a05dc9338b 100644 --- a/meshroom/ui/qml/Viewer/HdrImageToolbar.qml +++ b/meshroom/ui/qml/Viewer/HdrImageToolbar.qml @@ -1,5 +1,5 @@ -import QtQuick 2.11 -import QtQuick.Controls 2.0 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/Viewer/ImageMetadataView.qml b/meshroom/ui/qml/Viewer/ImageMetadataView.qml index 7c86767f6a..278e756003 100644 --- a/meshroom/ui/qml/Viewer/ImageMetadataView.qml +++ b/meshroom/ui/qml/Viewer/ImageMetadataView.qml @@ -1,9 +1,8 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtPositioning 5.8 -import QtLocation 5.9 import Controls 1.0 import Utils 1.0 @@ -117,7 +116,7 @@ FloatingPane { MouseArea { anchors.fill: parent acceptedButtons: Qt.MiddleButton - onWheel: wheel.accepted = true + onWheel: function (wheel) { wheel.accepted = true } } @@ -191,7 +190,7 @@ FloatingPane { filterRole: "raw" filterValue: searchBar.text delegate: RowLayout { - width: parent.width + width: ListView.view.width Label { text: key leftPadding: 6 @@ -251,7 +250,13 @@ FloatingPane { Layout.preferredHeight: coordinates.isValid ? 160 : 0 active: coordinates.isValid + sourceComponent: Label { + anchors.centerIn: parent + text: "Map is not currently supported in Qt6" + } + /* + https://bugreports.qt.io/browse/QTBUG-96795 Plugin { id: osmPlugin name: "osm" @@ -268,7 +273,7 @@ FloatingPane { Connections { target: root - onCoordinatesChanged: recenter() + function onCoordinatesChanged() { recenter() } } zoomLevel: 16 @@ -302,6 +307,7 @@ FloatingPane { } } } + */ } } } diff --git a/meshroom/ui/qml/Viewer/MSfMData.qml b/meshroom/ui/qml/Viewer/MSfMData.qml index eb880a31fc..2f6c348392 100644 --- a/meshroom/ui/qml/Viewer/MSfMData.qml +++ b/meshroom/ui/qml/Viewer/MSfMData.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 import AliceVision 1.0 as AliceVision // Data from the SfM diff --git a/meshroom/ui/qml/Viewer/MTracks.qml b/meshroom/ui/qml/Viewer/MTracks.qml index 9b5afd081d..eb594aedee 100644 --- a/meshroom/ui/qml/Viewer/MTracks.qml +++ b/meshroom/ui/qml/Viewer/MTracks.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.15 import AliceVision 1.0 as AliceVision AliceVision.MTracks { diff --git a/meshroom/ui/qml/Viewer/PanoramaViewer.qml b/meshroom/ui/qml/Viewer/PanoramaViewer.qml index 70f641f8c2..16e9dec922 100644 --- a/meshroom/ui/qml/Viewer/PanoramaViewer.qml +++ b/meshroom/ui/qml/Viewer/PanoramaViewer.qml @@ -119,7 +119,7 @@ AliceVision.PanoramaViewer { if (isEditable) isRotating ? Qt.ClosedHandCursor : Qt.OpenHandCursor } - onPositionChanged: { + onPositionChanged: function (mouse) { // Send Mouse Coordinates to Float Images Viewers idSelected = -1; for (var i = 0; i < repeater.model && isHighlightable; ++i) { @@ -152,7 +152,7 @@ AliceVision.PanoramaViewer { } } - onPressed:{ + onPressed: function (mouse) { _reconstruction.beginModification("Panorama Manual Rotation"); isRotating = true; lastX = mouse.x; @@ -162,7 +162,7 @@ AliceVision.PanoramaViewer { yStart = mouse.y; } - onReleased: { + onReleased: function (mouse) { _reconstruction.endModification(); isRotating = false; lastX = 0 diff --git a/meshroom/ui/qml/Viewer/SfmGlobalStats.qml b/meshroom/ui/qml/Viewer/SfmGlobalStats.qml index e97d8c96e2..f3dde0bb7d 100644 --- a/meshroom/ui/qml/Viewer/SfmGlobalStats.qml +++ b/meshroom/ui/qml/Viewer/SfmGlobalStats.qml @@ -1,9 +1,8 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtPositioning 5.8 -import QtLocation 5.9 import QtCharts 2.13 import Charts 1.0 diff --git a/meshroom/ui/qml/Viewer/SfmStatsView.qml b/meshroom/ui/qml/Viewer/SfmStatsView.qml index d4ba8b2f3c..593c69aa1e 100644 --- a/meshroom/ui/qml/Viewer/SfmStatsView.qml +++ b/meshroom/ui/qml/Viewer/SfmStatsView.qml @@ -1,9 +1,8 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import QtPositioning 5.8 -import QtLocation 5.9 import QtCharts 2.13 import Charts 1.0 diff --git a/meshroom/ui/qml/Viewer/TestAliceVisionPlugin.qml b/meshroom/ui/qml/Viewer/TestAliceVisionPlugin.qml index 4b40ee5ecd..17045c0478 100644 --- a/meshroom/ui/qml/Viewer/TestAliceVisionPlugin.qml +++ b/meshroom/ui/qml/Viewer/TestAliceVisionPlugin.qml @@ -1,5 +1,5 @@ import AliceVision 1.0 -import QtQuick 2.7 +import QtQuick 2.15 /** * To evaluate if the QtAliceVision plugin is available. diff --git a/meshroom/ui/qml/Viewer/TestOIIOPlugin.qml b/meshroom/ui/qml/Viewer/TestOIIOPlugin.qml index 7fde5b4591..c1dfd840ab 100644 --- a/meshroom/ui/qml/Viewer/TestOIIOPlugin.qml +++ b/meshroom/ui/qml/Viewer/TestOIIOPlugin.qml @@ -1,5 +1,5 @@ import DepthMapEntity 2.1 -import QtQuick 2.7 +import QtQuick 2.15 /** * To evaluate if the QtOIIO plugin is available. diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 8bd2ceb1bb..d6371c8a58 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -1,5 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.0 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 import Controls 1.0 @@ -89,7 +89,7 @@ FocusScope { if(mtracksLoader.item.status === MTracks.Loading) res += " Tracks"; } - if(msfmDataLoader.status === Loader.Ready) + if(msfmDataLoader.status === Loader.Ready && msfmDataLoader.item) { if(msfmDataLoader.item.status === MSfMData.Loading) { @@ -106,7 +106,7 @@ FocusScope { } // slots - Keys.onPressed: { + Keys.onPressed: function (event) { if(event.key == Qt.Key_F) { root.fit(); event.accepted = true; @@ -118,12 +118,12 @@ FocusScope { anchors.fill: parent property double factor: 1.2 acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - onPressed: { + onPressed: function (mouse) { imgContainer.forceActiveFocus() if(mouse.button & Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier)) drag.target = imgContainer // start drag } - onReleased: { + onReleased: function (mouse) { drag.target = undefined // stop drag if(mouse.button & Qt.RightButton) { var menu = contextMenu.createObject(root); @@ -132,7 +132,7 @@ FocusScope { menu.open() } } - onWheel: { + onWheel: function (wheel) { var zoomFactor = wheel.angleDelta.y > 0 ? factor : 1/factor if(Math.min(imgContainer.width, imgContainer.image.height) * imgContainer.scale * zoomFactor < 10) @@ -282,8 +282,7 @@ FocusScope { 'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}), 'surface.subdivisions' : Qt.binding(function(){ return root.useFloatImageViewer ? 1 : lensDistortionImageToolbar.subdivisionsValue;}), 'viewerTypeString': Qt.binding(function(){ return displayLensDistortionViewer.checked ? "distortion" : "hdr";}), - 'sfmRequired': Qt.binding(function(){ return displayLensDistortionViewer.checked ? true : false;}), - 'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), + 'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), 'canBeHovered': false, 'idView': Qt.binding(function() { return _reconstruction.selectedViewId; }), 'cropFisheye': false @@ -795,7 +794,7 @@ FocusScope { MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { + onClicked: function (mouse) { if(mouse.button & Qt.LeftButton) { fit() } diff --git a/meshroom/ui/qml/Viewer3D/AlembicLoader.qml b/meshroom/ui/qml/Viewer3D/AlembicLoader.qml index 9b8bbf5f33..2bdb660d17 100644 --- a/meshroom/ui/qml/Viewer3D/AlembicLoader.qml +++ b/meshroom/ui/qml/Viewer3D/AlembicLoader.qml @@ -1,8 +1,8 @@ import AlembicEntity 2.0 -import QtQuick 2.9 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Extras 2.1 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 /** * Support for Alembic files in Qt3d. @@ -62,7 +62,7 @@ AlembicEntity { }, CuboidMesh { id: cameraStick; xExtent: parent.extent * 0.2; yExtent: xExtent; zExtent: xExtent * 50.0 }, */ - PhongMaterial{ + PhongMaterial { id: mat ambient: viewId === _reconstruction.selectedViewId ? activePalette.highlight : customColor // "#CCC" diffuse: cameraPicker.containsMouse ? Qt.lighter(activePalette.highlight, 1.2) : ambient @@ -70,11 +70,11 @@ AlembicEntity { ObjectPicker { id: cameraPicker property point pos - onPressed: { + onPressed: function (pick) { pos = pick.position; pick.accepted = (pick.buttons & Qt.LeftButton) && cameraPickingEnabled } - onReleased: { + onReleased: function (pick) { const delta = Qt.point(Math.abs(pos.x - pick.position.x), Math.abs(pos.y - pick.position.y)); // only trigger picking when mouse has not moved between press and release if(delta.x + delta.y < 4) diff --git a/meshroom/ui/qml/Viewer3D/BoundingBox.qml b/meshroom/ui/qml/Viewer3D/BoundingBox.qml index a33cb2ba7b..ceef931fcc 100644 --- a/meshroom/ui/qml/Viewer3D/BoundingBox.qml +++ b/meshroom/ui/qml/Viewer3D/BoundingBox.qml @@ -1,8 +1,8 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 Entity { id: root @@ -56,7 +56,6 @@ Entity { count: 24 name: defaultPositionAttributeName buffer: Buffer { - type: Buffer.VertexBuffer data: new Float32Array([ 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, diff --git a/meshroom/ui/qml/Viewer3D/DefaultCameraController.qml b/meshroom/ui/qml/Viewer3D/DefaultCameraController.qml index b922a1cd9c..ad33b38705 100644 --- a/meshroom/ui/qml/Viewer3D/DefaultCameraController.qml +++ b/meshroom/ui/qml/Viewer3D/DefaultCameraController.qml @@ -1,8 +1,8 @@ -import QtQuick 2.7 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Input 2.1 -import Qt3D.Logic 2.0 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Logic 2.15 import QtQml 2.2 import Meshroom.Helpers 1.0 @@ -47,19 +47,19 @@ Entity { property point currentPosition property bool hasMoved sourceDevice: loseMouseFocus ? null : mouseSourceDevice - onPressed: { + onPressed: function(mouse) { _pressed = true; currentPosition.x = lastPosition.x = mouse.x; currentPosition.y = lastPosition.y = mouse.y; hasMoved = false; mousePressed(mouse); } - onReleased: { + onReleased: function(mouse) { _pressed = false; mouseReleased(mouse, hasMoved); } - onClicked: mouseClicked(mouse) - onPositionChanged: { + onClicked: function(mouse) { mouseClicked(mouse); } + onPositionChanged: function(mouse) { currentPosition.x = mouse.x; currentPosition.y = mouse.y; @@ -87,8 +87,8 @@ Entity { return; } } - onDoubleClicked: mouseDoubleClicked(mouse) - onWheel: { + onDoubleClicked: function(mouse) { mouseDoubleClicked(mouse); } + onWheel: function(wheel) { var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.2; var tz = (wheel.angleDelta.y / 120) * d; root.camera.translate(Qt.vector3d(0, 0, tz), Camera.DontTranslateViewCenter) @@ -104,7 +104,7 @@ Entity { // stays active, even when it's released. // Handle this issue manually by keeping an additional _pressed state // which is cleared when focus changes (used for 'pickingActive' property). - onFocusChanged: if(!focus) _pressed = false + onFocusChanged: function (focus) { if(!focus) _pressed = false; } onPressed: _pressed = true onReleased: _pressed = false } diff --git a/meshroom/ui/qml/Viewer3D/EntityWithGizmo.qml b/meshroom/ui/qml/Viewer3D/EntityWithGizmo.qml index b2cf95e58f..bdb5f0682d 100644 --- a/meshroom/ui/qml/Viewer3D/EntityWithGizmo.qml +++ b/meshroom/ui/qml/Viewer3D/EntityWithGizmo.qml @@ -1,9 +1,9 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 -import Qt3D.Logic 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 +import Qt3D.Logic 2.15 /** * Wrapper for TransformGizmo. @@ -25,7 +25,7 @@ Entity { frontLayerComponent: root.frontLayerComponent window: root.window - onPickedChanged: { + onPickedChanged: function (pressed) { sceneCameraController.loseMouseFocus = pressed // Notify the camera if the transform takes/releases the focus } } diff --git a/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml b/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml index 5d3402a36a..fa0394e17e 100644 --- a/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml +++ b/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml @@ -1,7 +1,7 @@ -import QtQuick 2.9 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Extras 2.10 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 /** diff --git a/meshroom/ui/qml/Viewer3D/Grid3D.qml b/meshroom/ui/qml/Viewer3D/Grid3D.qml index bd852a8e0d..5e67dc8c6c 100644 --- a/meshroom/ui/qml/Viewer3D/Grid3D.qml +++ b/meshroom/ui/qml/Viewer3D/Grid3D.qml @@ -1,7 +1,7 @@ -import QtQuick 2.7 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Extras 2.0 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 // Grid Entity { @@ -18,7 +18,6 @@ Entity { count: 0 name: defaultPositionAttributeName buffer: Buffer { - type: Buffer.VertexBuffer data: { function buildGrid(first, last, offset, attribute) { var vertexCount = (((last-first)/offset)+1)*4; diff --git a/meshroom/ui/qml/Viewer3D/ImageOverlay.qml b/meshroom/ui/qml/Viewer3D/ImageOverlay.qml index 5f79d4df3c..d6a49ab26a 100644 --- a/meshroom/ui/qml/Viewer3D/ImageOverlay.qml +++ b/meshroom/ui/qml/Viewer3D/ImageOverlay.qml @@ -1,4 +1,4 @@ -import QtQuick 2.12 +import QtQuick 2.15 import QtQuick.Layouts 1.12 /** @@ -69,31 +69,6 @@ Item { height: image.paintedHeight property variant src: image property variant uvCenterOffset - - vertexShader: " - #version 330 core - uniform highp mat4 qt_Matrix; - attribute highp vec4 qt_Vertex; - attribute highp vec2 qt_MultiTexCoord0; - out highp vec2 coord; - void main() { - coord = qt_MultiTexCoord0; - gl_Position = qt_Matrix * qt_Vertex; - }" - fragmentShader: " - #version 330 core - in highp vec2 coord; - uniform sampler2D src; - uniform lowp vec2 uvCenterOffset; - uniform lowp float qt_Opacity; - out vec4 fragColor; - void main() { - vec2 xy = coord + uvCenterOffset; - fragColor = texture2D(src, xy); - fragColor.rgb *= qt_Opacity; - fragColor.a = qt_Opacity; - // remove undistortion black pixels - fragColor.a *= step(0.001, fragColor.r + fragColor.g + fragColor.b); - }" + fragmentShader: 'qrc:/shaders/ImageOverlay.frag.qsb' } } diff --git a/meshroom/ui/qml/Viewer3D/Inspector3D.qml b/meshroom/ui/qml/Viewer3D/Inspector3D.qml index 7e4ac47231..816ea5c8a5 100644 --- a/meshroom/ui/qml/Viewer3D/Inspector3D.qml +++ b/meshroom/ui/qml/Viewer3D/Inspector3D.qml @@ -1,10 +1,9 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import MaterialIcons 2.2 -import Qt3D.Core 2.0 -import Qt3D.Render 2.1 -import QtQuick.Controls.Material 2.4 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 import Controls 1.0 import Utils 1.0 @@ -25,7 +24,10 @@ FloatingPane { padding: 0 - MouseArea { anchors.fill: parent; onWheel: wheel.accepted = true } + MouseArea { + anchors.fill: parent; + onWheel: function (wheel) { wheel.accepted = true } + } ColumnLayout { anchors.fill: parent @@ -185,12 +187,14 @@ FloatingPane { Connections { target: uigraph - onSelectedNodeChanged: mediaListView.currentIndex = -1 + function onSelectedNodeChanged() { + mediaListView.currentIndex = -1 + } } Connections { target: mediaLibrary - onLoadRequest: { + function onLoadRequest(idx) { mediaListView.positionViewAtIndex(idx, ListView.Visible); } } @@ -210,12 +214,12 @@ FloatingPane { } height: childrenRect.height - width: parent.width - scrollBar.width + width: ListView.view.width - scrollBar.width hoverEnabled: true onEntered: { if(model.attribute) uigraph.hoveredNode = model.attribute.node } onExited: { if(model.attribute) uigraph.hoveredNode = null } - onClicked: { + onClicked: function (mouse) { if(model.attribute) uigraph.selectedNode = model.attribute.node; else @@ -238,7 +242,7 @@ FloatingPane { Connections { target: mediaListView - onCountChanged: mediaDelegate.updateCurrentIndex() + function onCountChanged() { mediaDelegate.updateCurrentIndex() } } // Current/selected element indicator @@ -275,9 +279,9 @@ FloatingPane { property int modifiers anchors.fill: parent hoverEnabled: true - onPositionChanged: modifiers = mouse.modifiers + onPositionChanged: function (mouse) { modifiers = mouse.modifiers; } onExited: modifiers = Qt.NoModifier - onPressed: { + onPressed: function (mouse) { modifiers = mouse.modifiers; mouse.accepted = false; } @@ -340,7 +344,7 @@ FloatingPane { background: Rectangle { Connections { target: mediaLibrary - onLoadRequest: if(idx == index) focusAnim.restart() + function onLoadRequest(idx) { if(idx == index) focusAnim.restart() } } ColorAnimation on color { id: focusAnim diff --git a/meshroom/ui/qml/Viewer3D/Locator3D.qml b/meshroom/ui/qml/Viewer3D/Locator3D.qml index 3ff40133b7..c7dfb2176d 100644 --- a/meshroom/ui/qml/Viewer3D/Locator3D.qml +++ b/meshroom/ui/qml/Viewer3D/Locator3D.qml @@ -1,7 +1,7 @@ -import QtQuick 2.7 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Extras 2.0 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 import Utils 1.0 // Locator @@ -19,7 +19,6 @@ Entity { count: 6 name: defaultPositionAttributeName buffer: Buffer { - type: Buffer.VertexBuffer data: new Float32Array([ 0.0, 0.001, 0.0, 1.0, 0.001, 0.0, @@ -37,7 +36,6 @@ Entity { count: 6 name: defaultColorAttributeName buffer: Buffer { - type: Buffer.VertexBuffer data: new Float32Array([ Colors.red.r, Colors.red.g, Colors.red.b, Colors.red.r, Colors.red.g, Colors.red.b, diff --git a/meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml b/meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml index 06b09a3fbf..7413666500 100644 --- a/meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml +++ b/meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml @@ -1,8 +1,8 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 import Utils 1.0 import "Materials" diff --git a/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsEffect.qml b/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsEffect.qml index 065992c9ba..265d9c8ef9 100644 --- a/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsEffect.qml +++ b/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsEffect.qml @@ -1,5 +1,5 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 Effect { id: root diff --git a/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsMaterial.qml b/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsMaterial.qml index 8ecc07bb16..bb7c350567 100644 --- a/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsMaterial.qml +++ b/meshroom/ui/qml/Viewer3D/Materials/SphericalHarmonicsMaterial.qml @@ -1,5 +1,5 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 import Utils 1.0 Material { diff --git a/meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml b/meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml index abe3f32f85..61d1e8ba4f 100644 --- a/meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml +++ b/meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml @@ -1,5 +1,5 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 Effect { id: root diff --git a/meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml b/meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml index 5d3ef7e1c7..cdebc3dcc0 100644 --- a/meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml +++ b/meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml @@ -1,5 +1,5 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 Material { id: root diff --git a/meshroom/ui/qml/Viewer3D/MediaCache.qml b/meshroom/ui/qml/Viewer3D/MediaCache.qml index 863e03148a..d5dee74283 100644 --- a/meshroom/ui/qml/Viewer3D/MediaCache.qml +++ b/meshroom/ui/qml/Viewer3D/MediaCache.qml @@ -1,6 +1,6 @@ -import QtQuick 2.9 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 import Utils 1.0 diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index f3fa124f23..f8b20a9094 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml @@ -1,6 +1,6 @@ -import QtQuick 2.9 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 import Utils 1.0 @@ -339,7 +339,7 @@ Entity { ObjectPicker { enabled: mediaLoader.enabled && pickingEnabled hoverEnabled: false - onPressed: root.pressed(pick) + onPressed: function (pick) { root.pressed(pick) } } ] } @@ -383,12 +383,12 @@ Entity { } } - onObjectAdded: { + onObjectAdded: function(object) { // notify object that it is now fully instantiated object.fullyInstantiated = true; } - onObjectRemoved: { + onObjectRemoved: function(object) { if(m.sourceToEntity[object.modelSource]) delete m.sourceToEntity[object.modelSource] } diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index 1ca0133191..681f8c6400 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoader.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoader.qml @@ -1,7 +1,7 @@ -import QtQuick 2.9 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Extras 2.10 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 import QtQuick.Scene3D 2.0 import "Materials" import Utils 1.0 @@ -68,7 +68,7 @@ import Utils 1.0 components: [ SceneLoader { source: parent.source - onStatusChanged: { + onStatusChanged: function (status) { if(status == SceneLoader.Ready) { textureCount = sceneLoaderPostProcess(sceneLoaderEntity); faceCount = Scene3DHelper.faceCount(sceneLoaderEntity) diff --git a/meshroom/ui/qml/Viewer3D/MediaLoaderEntity.qml b/meshroom/ui/qml/Viewer3D/MediaLoaderEntity.qml index 657404d6f9..cbe56e5b03 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoaderEntity.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoaderEntity.qml @@ -1,5 +1,5 @@ -import QtQuick 2.9 -import Qt3D.Core 2.1 +import QtQuick 2.15 +import Qt3D.Core 2.15 /** diff --git a/meshroom/ui/qml/Viewer3D/MeshingBoundingBox.qml b/meshroom/ui/qml/Viewer3D/MeshingBoundingBox.qml index 4baf412154..7654a23af0 100644 --- a/meshroom/ui/qml/Viewer3D/MeshingBoundingBox.qml +++ b/meshroom/ui/qml/Viewer3D/MeshingBoundingBox.qml @@ -1,8 +1,8 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 /** * BoundingBox entity for Meshing node. Used to define the area to reconstruct. diff --git a/meshroom/ui/qml/Viewer3D/SfMTransformGizmo.qml b/meshroom/ui/qml/Viewer3D/SfMTransformGizmo.qml index e9998264ad..ae467d2916 100644 --- a/meshroom/ui/qml/Viewer3D/SfMTransformGizmo.qml +++ b/meshroom/ui/qml/Viewer3D/SfMTransformGizmo.qml @@ -1,8 +1,8 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 /** * Gizmo for SfMTransform node. diff --git a/meshroom/ui/qml/Viewer3D/TrackballGizmo.qml b/meshroom/ui/qml/Viewer3D/TrackballGizmo.qml index 38efa9617b..6b4d2ec17d 100644 --- a/meshroom/ui/qml/Viewer3D/TrackballGizmo.qml +++ b/meshroom/ui/qml/Viewer3D/TrackballGizmo.qml @@ -1,8 +1,8 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 Entity { id: root diff --git a/meshroom/ui/qml/Viewer3D/TransformGizmo.qml b/meshroom/ui/qml/Viewer3D/TransformGizmo.qml index 05ada07948..a615e01d7a 100644 --- a/meshroom/ui/qml/Viewer3D/TransformGizmo.qml +++ b/meshroom/ui/qml/Viewer3D/TransformGizmo.qml @@ -1,10 +1,10 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 -import Qt3D.Logic 2.0 -import QtQuick.Controls 2.3 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 +import Qt3D.Logic 2.15 +import QtQuick.Controls 2.15 import Utils 1.0 @@ -208,7 +208,7 @@ Entity { property var objectPicker: null property bool enabled: false - onPositionChanged: { + onPositionChanged: function (mouse) { if (objectPicker && objectPicker.button === Qt.LeftButton) { root.focusGizmoPriority = true @@ -276,7 +276,7 @@ Entity { resetMenu.popup(window) } } - onReleased: { + onReleased: function (mouse) { if(objectPicker && mouse.button === Qt.LeftButton) { const type = objectPicker.gizmoType objectPicker = null // To prevent going again in the onPositionChanged diff --git a/meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml b/meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml index 7eb649be36..6e1bcec6aa 100644 --- a/meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml +++ b/meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml @@ -1,9 +1,9 @@ -import Qt3D.Core 2.0 -import Qt3D.Render 2.9 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.10 -import QtQuick 2.9 -import Qt3D.Logic 2.0 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Input 2.15 +import Qt3D.Extras 2.15 +import QtQuick 2.15 +import Qt3D.Logic 2.15 ObjectPicker { id: root @@ -22,7 +22,7 @@ ObjectPicker { hoverEnabled: true - onPressed: { + onPressed: function (pick) { mouseController.enabled = true mouseController.objectPicker = this root.isPressed = true diff --git a/meshroom/ui/qml/Viewer3D/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml index 5e0e390fb4..aa875668a4 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3D.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3D.qml @@ -1,13 +1,12 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as Controls1 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import QtQml.Models 2.2 import QtQuick.Scene3D 2.0 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Extras 2.10 -import Qt3D.Input 2.1 as Qt3DInput // to avoid clash with Controls2 Action +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 +import Qt3D.Input 2.15 as Qt3DInput // to avoid clash with Controls2 Action import MaterialIcons 2.2 @@ -73,7 +72,7 @@ FocusScope { focus: true - Keys.onPressed: { + Keys.onPressed: function (event) { if (event.key == Qt.Key_F) { resetCameraPosition(); } @@ -127,7 +126,7 @@ FocusScope { TrackballGizmo { beamRadius: 4.0/root.height - alpha: cameraController.moving ? 1.0 : 0.7 + alpha: 0.7 // cameraController.moving ? 1.0 : 0.7 enabled: Viewer3DSettings.displayGizmo && cameraSelector.camera == mainCamera xColor: Colors.red yColor: Colors.green @@ -152,7 +151,7 @@ FocusScope { camera: mainCamera focus: scene3D.activeFocus - onMousePressed: { + onMousePressed: function (mouse) { scene3D.forceActiveFocus() if(mouse.button == Qt.LeftButton) { @@ -162,7 +161,7 @@ FocusScope { else doubleClickTimer.stop() } - onMouseReleased: { + onMouseReleased: function (mouse, moved) { if(moving) return if(!moved && mouse.button == Qt.RightButton) @@ -245,7 +244,7 @@ FocusScope { } ] - onPressed: { + onPressed: function (pick) { if(pick.button == Qt.LeftButton) { mainCamera.viewCenter = pick.worldIntersection; @@ -269,6 +268,7 @@ FocusScope { sourceComponent: ImageOverlay { id: imageOverlay + anchors.fill: parent source: root.viewpoint.undistortedImageSource imageRatio: root.viewpoint.orientedImageSize.width / root.viewpoint.orientedImageSize.height uvCenterOffset: root.viewpoint.uvCenterOffset diff --git a/meshroom/ui/qml/Viewer3D/Viewer3DSettings.qml b/meshroom/ui/qml/Viewer3D/Viewer3DSettings.qml index f2f272ec12..c0702f0c4b 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3DSettings.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3DSettings.qml @@ -1,5 +1,5 @@ pragma Singleton -import QtQuick 2.9 +import QtQuick 2.15 import MaterialIcons 2.2 /** diff --git a/meshroom/ui/qml/Viewer3D/ViewpointCamera.qml b/meshroom/ui/qml/Viewer3D/ViewpointCamera.qml index dfdb64fd7f..313c24e900 100644 --- a/meshroom/ui/qml/Viewer3D/ViewpointCamera.qml +++ b/meshroom/ui/qml/Viewer3D/ViewpointCamera.qml @@ -1,6 +1,6 @@ -import QtQuick 2.12 -import Qt3D.Core 2.12 -import Qt3D.Render 2.12 +import QtQuick 2.15 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 /** diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index ced16fe22a..d8c0449ac6 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -1,6 +1,5 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as Controls1 // For SplitView +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import Qt.labs.platform 1.0 as Platform import ImageGallery 1.0 @@ -38,13 +37,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() @@ -60,32 +59,32 @@ Item { SystemPalette { id: activePalette } - Controls1.SplitView { + SplitView { anchors.fill: parent - Controls1.SplitView { + SplitView { orientation: Qt.Vertical - Layout.fillWidth: true - Layout.fillHeight: true - implicitWidth: Math.round(parent.width * 0.2) - Layout.minimumWidth: imageGallery.defaultCellSize + SplitView.fillWidth: true + SplitView.fillHeight: true + SplitView.preferredWidth : Math.round(parent.width * 0.2) + SplitView.minimumWidth: imageGallery.defaultCellSize ImageGallery { id: imageGallery - Layout.fillHeight: true + SplitView.fillHeight: true readOnly: root.readOnly cameraInits: root.cameraInits cameraInit: reconstruction.cameraInit tempCameraInit: reconstruction.tempCameraInit cameraInitIndex: reconstruction.cameraInitIndex - onRemoveImageRequest: reconstruction.removeAttribute(attribute) - onFilesDropped: reconstruction.handleFilesDrop(drop, augmentSfm ? null : cameraInit) + onRemoveImageRequest: function (attribute) { reconstruction.removeAttribute(attribute) } + onFilesDropped: function (drop, augmentSfm) { reconstruction.handleFilesDrop(drop, augmentSfm ? null : cameraInit) } } LiveSfmView { visible: settings_UILayout.showLiveReconstruction reconstruction: root.reconstruction - Layout.fillWidth: true - Layout.preferredHeight: childrenRect.height + SplitView.fillWidth: true + SplitView.preferredHeight: childrenRect.height } } @@ -93,9 +92,9 @@ Item { title: "Image Viewer" visible: settings_UILayout.showImageViewer implicitWidth: Math.round(parent.width * 0.35) - Layout.fillHeight: true - Layout.fillWidth: true - Layout.minimumWidth: 50 + SplitView.fillHeight: true + SplitView.fillWidth: true + SplitView.minimumWidth: 50 loading: viewer2D.loadingModules.length > 0 loadingText: loading ? "Loading " + viewer2D.loadingModules : "" @@ -150,7 +149,7 @@ Item { Connections { target: imageGallery - onCurrentItemChanged: { + function onCurrentItemChanged() { viewer2D.source = imageGallery.currentItemSource viewer2D.metadata = imageGallery.currentItemMetadata } @@ -159,7 +158,7 @@ Item { DropArea { anchors.fill: parent keys: ["text/uri-list"] - onDropped: { + onDropped: function (drop) { viewer2D.source = drop.urls[0] viewer2D.metadata = {} } @@ -197,20 +196,20 @@ Item { property alias viewer3D: c_viewer3D - Controls1.SplitView { + SplitView { id: c_viewer3DSplitView anchors.fill: parent Viewer3D { id: c_viewer3D - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: 20 + SplitView.fillWidth: true + SplitView.fillHeight: true + SplitView.minimumWidth: 20 DropArea { anchors.fill: parent keys: ["text/uri-list"] - onDropped: { + onDropped: function (drop) { drop.urls.forEach(function(url){ load3DMedia(url); }); } } @@ -233,13 +232,13 @@ Item { // Inspector Panel Inspector3D { id: inspector3d - width: 200 - Layout.minimumWidth: 5 + SplitView.preferredWidth: 200 + SplitView.minimumWidth: 5 mediaLibrary: c_viewer3D.library camera: c_viewer3D.mainCamera uigraph: reconstruction - onNodeActivated: _reconstruction.setActiveNode(node) + onNodeActivated: function (node) { _reconstruction.setActiveNode(node) } } } } diff --git a/meshroom/ui/qml/main.qml b/meshroom/ui/qml/main.qml index 2b06ea18b6..5282887e3b 100755 --- a/meshroom/ui/qml/main.qml +++ b/meshroom/ui/qml/main.qml @@ -1,12 +1,10 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as Controls1 // For SplitView +import QtQuick 2.15 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import QtQuick.Window 2.3 import QtQml.Models 2.2 import Qt.labs.platform 1.0 as Platform -import QtQuick.Dialogs 1.3 import Qt.labs.settings 1.0 import GraphEditor 1.0 @@ -31,7 +29,7 @@ ApplicationWindow { return t } - onClosing: { + onClosing: function(close) { // make sure document is saved before exiting application close.accepted = false if(!ensureNotComputing()) @@ -39,10 +37,28 @@ ApplicationWindow { ensureSaved(function(){ Qt.quit() }) } - // force Application palette assignation - // note: should be implicit (PySide bug) - palette: _PaletteManager.palette - + // QPalette is not convertible to QML palette (anymore) + Component.onCompleted: { + palette.alternateBase = _PaletteManager.alternateBase + palette.base = _PaletteManager.base + palette.button = _PaletteManager.button + palette.buttonText = _PaletteManager.buttonText + palette.disabled.buttonText = _PaletteManager.disabledButtonText + palette.highlight = _PaletteManager.highlight + palette.disabled.highlight = _PaletteManager.disabledHighlight + palette.highlightedText = _PaletteManager.highlightedText + palette.disabled.highlightedText = _PaletteManager.disabledHighlightedText + palette.link = _PaletteManager.link + palette.mid = _PaletteManager.mid + palette.shadow = _PaletteManager.shadow + palette.text = _PaletteManager.text + palette.disabled.text = _PaletteManager.disabledText + palette.toolTipBase = _PaletteManager.toolTipBase + palette.toolTipText = _PaletteManager.toolTipText + palette.window = _PaletteManager.window + palette.windowText = _PaletteManager.windowText + palette.disabled.windowText = _PaletteManager.disabledWindowText + } SystemPalette { id: activePalette } SystemPalette { id: disabledPalette; colorGroup: SystemPalette.Disabled } @@ -295,8 +311,7 @@ ApplicationWindow { FileDialog { id: importFilesDialog title: "Import Images" - selectExisting: true - selectMultiple: true + fileMode: FileDialog.OpenFiles nameFilters: [] onAccepted: { console.warn("importFilesDialog fileUrls: " + importFilesDialog.fileUrls) @@ -660,7 +675,7 @@ ApplicationWindow { dialog.detailedText = message.detailedText } - onGraphChanged: { + function onGraphChanged() { // open CompatibilityManager after file loading if any issue is detected if(compatibilityManager.issueCount) compatibilityManager.open() @@ -668,13 +683,13 @@ 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]) } } - Controls1.SplitView { + SplitView { anchors.fill: parent orientation: Qt.Vertical @@ -682,8 +697,8 @@ ApplicationWindow { ToolTip.toolTip.background: Rectangle { color: activePalette.base; border.color: activePalette.mid } ColumnLayout { - Layout.fillWidth: true - Layout.fillHeight: true + SplitView.fillWidth: true + SplitView.fillHeight: true Layout.topMargin: 2 implicitHeight: Math.round(parent.height * 0.7) spacing: 4 @@ -790,15 +805,16 @@ ApplicationWindow { } } - Controls1.SplitView { + SplitView { orientation: Qt.Horizontal - width: parent.width - height: Math.round(parent.height * 0.3) + SplitView.preferredWidth: parent.width + SplitView.preferredHeight: Math.round(parent.height * 0.3) visible: settings_UILayout.showGraphEditor TabPanel { id: graphEditorPanel - Layout.fillWidth: true + SplitView.fillWidth: true + width: Math.round(parent.width * 0.7) padding: 4 tabs: ["Graph Editor", "Task Manager"] @@ -850,7 +866,7 @@ ApplicationWindow { uigraph: _reconstruction nodeTypesModel: _nodeTypes - onNodeDoubleClicked: { + onNodeDoubleClicked: function (mouse, node) { _reconstruction.setActiveNode(node); let viewable = false; @@ -861,8 +877,8 @@ ApplicationWindow { break; } } - onComputeRequest: computeManager.compute(node) - onSubmitRequest: computeManager.submit(node) + onComputeRequest: function (node) { computeManager.compute(node) } + onSubmitRequest: function (node) { computeManager.submit(node) } } TaskManager { @@ -880,13 +896,13 @@ ApplicationWindow { NodeEditor { id: nodeEditor - width: Math.round(parent.width * 0.3) + SplitView.preferredWidth: Math.round(parent.width * 0.3) node: _reconstruction.selectedNode property bool computing: _reconstruction.computing // Make NodeEditor readOnly when computing readOnly: node ? node.locked : false - onAttributeDoubleClicked: workspaceView.viewAttribute(attribute, mouse) + onAttributeDoubleClicked: function (mouse, attribute) { workspaceView.viewAttribute(attribute, mouse) } onUpgradeRequest: { var n = _reconstruction.upgradeNode(node); _reconstruction.selectedNode = n; diff --git a/meshroom/ui/reconstruction.py b/meshroom/ui/reconstruction.py index 3915c42ada..c7b99d3e86 100755 --- a/meshroom/ui/reconstruction.py +++ b/meshroom/ui/reconstruction.py @@ -5,8 +5,8 @@ from threading import Thread from collections import Iterable -from PySide2.QtCore import QObject, Slot, Property, Signal, QUrl, QSizeF -from PySide2.QtGui import QMatrix4x4, QMatrix3x3, QQuaternion, QVector3D, QVector2D +from PySide6.QtCore import QObject, Slot, Property, Signal, QUrl, QSizeF +from PySide6.QtGui import QMatrix4x4, QMatrix3x3, QQuaternion, QVector3D, QVector2D import meshroom.core import meshroom.common diff --git a/meshroom/ui/utils.py b/meshroom/ui/utils.py index 700bb1b420..db03ccd02d 100755 --- a/meshroom/ui/utils.py +++ b/meshroom/ui/utils.py @@ -1,12 +1,12 @@ import os import time -from PySide2.QtCore import QFileSystemWatcher, QUrl, Slot, QTimer, Property, QObject -from PySide2.QtQml import QQmlApplicationEngine +from PySide6.QtCore import QFileSystemWatcher, QUrl, Slot, QTimer, Property, QObject +from PySide6.QtQml import QQmlApplicationEngine try: - from PySide2 import shiboken2 + from PySide6 import shiboken6 except: - import shiboken2 + import shiboken6 class QmlInstantEngine(QQmlApplicationEngine): @@ -237,7 +237,7 @@ def setter(instance, value): setattr(instance, resetCallbackName, lambda self=instance, *args: setter(self, None)) resetCallback = getattr(instance, resetCallbackName, None) - if resetCallback and currentValue and shiboken2.isValid(currentValue): + if resetCallback and currentValue and shiboken6.isValid(currentValue): currentValue.destroyed.disconnect(resetCallback) setattr(instance, attributeName, value) if resetCallback and value: diff --git a/requirements.txt b/requirements.txt index d43e19234d..8983d593c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # runtime psutil>=5.6.3 enum34;python_version<"3.4" -PySide2==5.14.1 +pyside6==6.3 markdown==2.6.11 requests==2.22.0 diff --git a/setup.py b/setup.py index 6d37da5c67..f93d7ce386 100644 --- a/setup.py +++ b/setup.py @@ -130,7 +130,7 @@ def __init__(self, script, initScript=None, base=None, targetName=None, icons=No setup( name="Meshroom", description="Meshroom", - install_requires=['psutil', 'pytest', 'PySide2', 'markdown'], + install_requires=['psutil', 'pytest', 'PySide6', 'markdown'], extras_require={ ':python_version < "3.4"': [ 'enum34', diff --git a/tests/test_model.py b/tests/test_model.py index 6c6c784ac0..5f967949dc 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -1,6 +1,6 @@ import pytest -from PySide2.QtCore import QObject, Property +from PySide6.QtCore import QObject, Property from meshroom.common.core import CoreDictModel from meshroom.common.qt import QObjectListModel, QTypedObjectListModel