Skip to content
Closed

Dev/qt6 #1709

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2c353f7
[requirements] Use PySide for Qt 5.15
gregoire-dl May 1, 2021
4d4ed38
[ui] Update QtQuick and QtQuick.Controls import versions to 2.15
gregoire-dl May 1, 2021
efd4914
[ui] Update Qt3D import versions to 2.15
gregoire-dl May 1, 2021
70e4e55
[ui] Update QML Connections functions syntax
gregoire-dl May 1, 2021
feeebd4
[requirements] Use PySide for Qt 6.0.3
gregoire-dl May 4, 2021
308e3e3
[ui] Use PySide 6
gregoire-dl May 4, 2021
5de240d
[tests] Use PySide 6
gregoire-dl May 4, 2021
18f1913
[common] Use PySide 6
gregoire-dl May 4, 2021
1d8bd13
[setup] Update install_requires for PySide 6
gregoire-dl May 4, 2021
432a8b2
[ui] Node: Remove QtGraphicalEffects dependency
gregoire-dl May 4, 2021
97195fd
[ui] Update QML Connections functions syntax
gregoire-dl May 4, 2021
17b5542
[ui] Remove QtQuick.Dialogs dependency
gregoire-dl May 4, 2021
d009dc0
[ui] Remove QtQuick.Controls 1.x dependencies
gregoire-dl May 4, 2021
100bf1b
[ui] Use js function Request.get for all calls to XMLHttpRequest
gregoire-dl May 4, 2021
da5fa59
[qt6] fix slots with parameters
monsieurgustav May 31, 2022
e76c12b
[qt6] fix misc. changes and incompatibilities
monsieurgustav May 31, 2022
06fb8ac
[qt6] move ShaderEffect code to QtAliceVision plugin
monsieurgustav May 31, 2022
c5f205d
[qt6] fix image metadata view (also, for now, removed map if GPS coords)
monsieurgustav Jun 2, 2022
42c7f08
[qt6] fix compute
monsieurgustav Jun 2, 2022
f3dad02
[qt6] fix node logs/status/etc.
monsieurgustav Jun 2, 2022
20b467d
[qt6] fix disabled buttons + small UI issues
monsieurgustav Jun 8, 2022
d618495
Merge branch 'develop' into dev/qt6
monsieurgustav Jun 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions meshroom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions meshroom/common/qt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide2 import QtCore, QtQml
import shiboken2
from PySide6 import QtCore, QtQml
import shiboken6

class QObjectListModel(QtCore.QAbstractListModel):
"""
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
10 changes: 5 additions & 5 deletions meshroom/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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 = []
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/components/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/clipboard.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/csvData.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/components/edge.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/filepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 13 additions & 12 deletions meshroom/ui/components/scene3D.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 22 additions & 3 deletions meshroom/ui/palette.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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)
6 changes: 3 additions & 3 deletions meshroom/ui/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -197,7 +197,7 @@ Dialog {
selectByKeyboard: true
wrapMode: TextArea.WrapAnywhere
textFormat: TextEdit.RichText
onLinkActivated: Qt.openUrlExternally(link)
onLinkActivated: function (link) { Qt.openUrlExternally(link) }
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Charts/ChartViewCheckBox.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick 2.15
import QtQuick.Controls 2.15


/**
Expand Down
10 changes: 5 additions & 5 deletions meshroom/ui/qml/Charts/ChartViewLegend.qml
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -84,7 +84,7 @@ Flow {

MouseArea {
anchors.fill: parent
onClicked: {
onClicked: function (mouse) {
if(mouse.modifiers & Qt.ControlModifier)
root.soloSeries(index);
else
Expand Down
5 changes: 2 additions & 3 deletions meshroom/ui/qml/Charts/InteractiveChartView.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/ColorChart.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/FloatingPane.qml
Original file line number Diff line number Diff line change
@@ -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

/**
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/Group.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/KeyValue.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions meshroom/ui/qml/Controls/MessageDialog.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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) }
}
}

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/Panel.qml
Original file line number Diff line number Diff line change
@@ -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


Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/SearchBar.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Controls/TabPanel.qml
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Loading