--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEKd6baxEMb21GugKE7cWb0F38aSBR4c1z82UEWm-7sxq8j4Lw%40mail.gmail.com.
Hey Folks,I'd love to get your approach to make state persist of your UI. Let's say I have a custom-built UI and for the majority of the time, the user input in the UI will be the same per scene. So next time they load up their scene and open my UI the settings they entered the first time around should persist. What is your approach? Do you create some arbitrary node in the scene which holds the information, or what would be considered a good approach? Looking forward to your approach, thanks!
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3JZ9FVYusT59RbN6T%2B1RB95Ta%3DN7NjaH_p0oSXdtmN0Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEKd6bbrAm%3D-DaQ_zsROOSULqR7FpgmE2o7OhgQOSybECmJzbg%40mail.gmail.com.
One gotcha with Qsettings is that it will cast everything to a str before storing it. So if you pass 3.14 for some setting, you’ll get “3.14” back.
For that reason, I generally subclass qsettings to pickle/unpickle the values before passing it to super() to store the value
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5e0e209c-d07a-4f86-9f97-cf3c0a83df65%40googlegroups.com.
On Sun, Aug 18, 2019 at 3:08 PM Russell Pearsall <robo...@gmail.com> wrote:One gotcha with Qsettings is that it will cast everything to a str before storing it. So if you pass 3.14 for some setting, you’ll get “3.14” back.
For that reason, I generally subclass qsettings to pickle/unpickle the values before passing it to super() to store the valueWhich version of the Qt bindings have you found this to be true? In PySide2 it seems to handle python object types just fine, and it retains a float type.I remember PyQt used to have issues when it encoded a bool, and it would store it as an int. So you would have to cast it back later.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.