wmayer wrote: ↑Tue Dec 03, 2019 12:06 pm
Our solution is considered to be a simple wrapper for PySide2 and its purpose is exactly to avoid to explicitly handle the differences between PySide and PySide2 in client code.
IMO, it reduces readability of code when you everywhere have to add try-except-else constructs.
I don't think it's too bad, because such try-except blocks would be used sparingly. PySide and PySide2 aren't very different.
Now that Qt5 and Py3 are the default versions for FreeCAD the wrapper should be the other way around, i.e. make the wrapper for PySide to behave it like PySide2. The advantage of this wrapper will be that when we completely drop Qt4 support we only have to remove the wrapper but don't have to touch a single line in client code.
Well, let us know if you plan to make this official soon so we can start preparing on the Python workbenches. Qt4 has been obsolete for many years but many programs seemingly still support it.
Well, let us know if you plan to make this official soon so we can start preparing on the Python workbenches.
I was just thinking about it but I don't have concrete plans at the moment. The question then is if this should happen before or after the release and if it's worth all the work.
Qt4 has been obsolete for many years but many programs seemingly still support it.
In the recent days when I was forced to use my very old computer with Qt4 and Py2 I could still compile and run FreeCAD.
wmayer wrote: ↑Wed Dec 04, 2019 8:37 am
I was just thinking about it but I don't have concrete plans at the moment. The question then is if this should happen before or after the release and if it's worth all the work.
Probably after the release so that we can dedicate the proper attention, and we don't try to tackle too many things at the same time. Also, since Python 2 is now officially unsupported, we should try to push Python 3 and Qt5 more than ever.
In the recent days when I was forced to use my very old computer with Qt4 and Py2 I could still compile and run FreeCAD.
No ofense to you, but you should really have a spare computer that is up to date. People are willing to gift you a computer for free, just ask!
from PySide import QtGui, QtCore
import FreeCAD
import FreeCADGui
class GDMLColourMapList(QtGui.QScrollArea) :
def __init__(self,matList) :
super().__init__()
# Scroll Area which contains the widgets, set as the centralWidget
# Widget that contains the collection of Vertical Box
self.widget = QtGui.QWidget()
self.matList = matList
# The Vertical Box that contains the Horizontal Boxes of labels and buttons
self.vbox = QtGui.QVBoxLayout()
self.widget.setLayout(self.vbox)
#Scroll Area Properties
self.setVerticalScrollBarPolicy(QtGui.Qt.ScrollBarAlwaysOn)
self.setHorizontalScrollBarPolicy(QtGui.Qt.ScrollBarAlwaysOff)
self.setWidgetResizable(True)
self.setWidget(self.widget)
def addEntry(self, colour) :
print('Add Entry')
mat = GDMLMaterial(self.matList)
self.vbox.addWidget(GDMLColourMapEntry(colour,mat))
[/File "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/GDML/freecad/gdml/GDMLColourMap.py", line 111, in __init__
self.setVerticalScrollBarPolicy(QtGui.Qt.ScrollBarAlwaysOn)
module 'PySide.QtGui' has no attribute 'Qt'