Thanks a lot, it is all good now.
Oh by the way, thank you also for the "Python for VFX" Vol  2 (Python for 
Maya Artist). Produced by CMI STUDIOS.
That helped me so much when I started learning python.

On Wednesday, June 5, 2024 at 1:05:45 AM UTC+2 Justin Israel wrote:

> On Tue, Jun 4, 2024 at 11:32 PM Pacifique Nzitonda <[email protected]> 
> wrote:
>
>> I'm sorry maybe I didn't explain well the issue.
>> What I'm looking for is a way to do something like this in *Maya 2024 
>> Script Editor*:
>>
>> https://codefile.io/f/gJMC306hSL
>>
>> I'm learning stuff about qt that's why It would be easier if I could 
>> convert the .ui to .py each time I run my script inside Maya 2024
>>
>
> If I test the following code in the Maya script editor, from the example 
> link I previously shared, it seems to work just fine in loading the ui file 
> and giving me a QDialog. Maya script editor can then autocomplete fields on 
> the QDialog object:
>
> from PySide2.QtUiTools import QUiLoaderfrom PySide2.QtCore import QFile, 
> QIODevice
> def load(ui_file_name):
>     ui_file = QFile(ui_file_name)
>     if not ui_file.open(QIODevice.ReadOnly):
>         print("Cannot open {}: {}".format(ui_file_name, 
> ui_file.errorString()))
>         return
>     loader = QUiLoader()
>     window = loader.load(ui_file)
>     ui_file.close()
>     return window
>
> win = load("test.ui")
>
>
> Each time I call load() it will return me a new instance of the dialog. 
>  
>
>>
>> On Tuesday, June 4, 2024 at 12:16:59 PM UTC+2 Justin Israel wrote:
>>
>>>
>>>
>>> On Tue, Jun 4, 2024, 8:16 PM Pacifique Nzitonda <[email protected]> 
>>> wrote:
>>>
>>>> Oh sorry! What I didn't mention is that I want to get autocompletion 
>>>> but the QUiLoader() doesn't provide it. 
>>>>
>>>
>>> This is a different problem. You said it didn't work because you thought 
>>> it was a console shell approach. But now that you see it is a code 
>>> approach, your actual problem is about autocomplete? 
>>>
>>>
>>>> On Tuesday, June 4, 2024 at 9:41:31 AM UTC+2 Justin Israel wrote:
>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 4, 2024, 7:29 PM Pacifique Nzitonda <[email protected]> 
>>>>> wrote:
>>>>>
>>>>>> Hi Justin, I had already read this but I want to do it directly in 
>>>>>> Maya not using external console. I want to do it that way because I'm 
>>>>>> still 
>>>>>> going back and forth between the code in Maya and Qt Designer. So I want 
>>>>>> to 
>>>>>> be able to reload the converted .py all the time.
>>>>>> Thanks
>>>>>>
>>>>>
>>>>> What am I missing? The code in the Option B is something you can run 
>>>>> in Maya. It isn't shell commands. 
>>>>>
>>>>>
>>>>>> On Tuesday, June 4, 2024 at 12:55:42 AM UTC+2 Justin Israel wrote:
>>>>>>
>>>>>>> On Tue, Jun 4, 2024 at 8:11 AM Pacifique Nzitonda <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi all, in Maya 2020 I used to import pyside2uic and convert .ui to 
>>>>>>>> .py
>>>>>>>> How do we do it in Maya 2024?
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>
>>>>>>> Does this link help?
>>>>>>>
>>>>>>> https://doc.qt.io/qtforpython-5/tutorials/basictutorial/uifiles.html#option-b-loading-it-directly
>>>>>>>  
>>>>>>>
>>>>>>>> -- 
>>>>>>>> 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/de8e4f24-270e-44ee-a369-4a383493b8a1n%40googlegroups.com
>>>>>>>>  
>>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/de8e4f24-270e-44ee-a369-4a383493b8a1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> -- 
>>>>>> 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/db77d1c5-af33-4e56-9d4a-d3c3aa90b686n%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/db77d1c5-af33-4e56-9d4a-d3c3aa90b686n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>> 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/aa85e260-65d7-4f94-93ce-14d5df380fedn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/aa85e260-65d7-4f94-93ce-14d5df380fedn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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/cbe153cd-899d-42a7-949c-4d08b8e1e044n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/cbe153cd-899d-42a7-949c-4d08b8e1e044n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/ef72a753-c215-4195-bfd5-8dd580db1916n%40googlegroups.com.

Reply via email to