On Fri, Aug 24, 2018 at 9:06 AM kiteh <[email protected]> wrote:

> I have created my tool using PyQt. Things are working correctly and I am
> encountering 2 issues.
>
> 1. This is more of an implementation - I am trying to capture the input
> state of the widgets that User has made within the tool. Eg. User has
> written something in one of the many QLineEdits, checked some options in
> the checkboxes etc. How can I 'save' and load these inputs?
>

Use QSettings <http://doc.qt.io/archives/qt-4.8/qsettings.html> to save and
load the state of your application.
This means you have some point in your app, either as things change or once
on a close or hide event, where you save the state to your QSettings (can
be created on the fly). And then you have a point when you first initialize
your app that you load them back from the QSettings.


>
> 2. Since converting my tool to use PyQt, I came to notice that 'undo-ing'
> functionality does not works, only the actions that my tool has executed
> on. Is this a known issue if one changes from using maya.cmds gui to pyqt?
>

Maya has no way to know what you are doing within your Qt widgets. It only
knows what you do when you call into its cmds API. So you would need to
make use of cmds.undoInfo or the api MDGModifier if you are talking about
controlling Maya operations. But if you are talking about undoing
operations to your custom UI, then you would have to look at having your
own undo:
http://doc.qt.io/archives/qt-4.8/qundo.html


>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/9b86a5e5-2b34-4a98-be14-9cb18929615a%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/9b86a5e5-2b34-4a98-be14-9cb18929615a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1pOyCxteee8HTfuO0p1y5s-eQiy_R56ZiUm7yzAEoH5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to