Solved: Something happened
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Solved: Something happened
Hi guys, I have something weird going on. I don't know what it is.
In https://github.com/grd/FreePDM I start the program with "python3 main.py" and it works. Directories work, but when I double click on a FCStd file I see that it runs "EditItem.ui" and it finds the right FCStd file but I don't see the form. I also don't get any error. Can you guys tell me what is wrong?
I can also run "EditItem.ui" file with "python3 src/gui/EditItem.py", but unfortulately the path to one item is hard coded.
Gerard
Edit:
I solved it with translating the ui file to a python file and everything worked.
In https://github.com/grd/FreePDM I start the program with "python3 main.py" and it works. Directories work, but when I double click on a FCStd file I see that it runs "EditItem.ui" and it finds the right FCStd file but I don't see the form. I also don't get any error. Can you guys tell me what is wrong?
I can also run "EditItem.ui" file with "python3 src/gui/EditItem.py", but unfortulately the path to one item is hard coded.
Gerard
Edit:
I solved it with translating the ui file to a python file and everything worked.
Last edited by grd on Wed Sep 07, 2022 5:46 pm, edited 1 time in total.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Re: A stupid thing is happening
That is solved. But PySide2 is a b*tch that keeps on biting me. I am still not comfortable with it.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Re: A stupid thing is happening
I did have problems with the ".ui" files. For some reason I could only use a ".ui" file (dialog and messagebox too) and then the program just ended. So I created the python code from the ".ui" file and after that everything just worked fine. I don't know what the problem created.brownharris561 wrote: ↑Wed Sep 07, 2022 12:31 pmCan you share the fix ?
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Re: A stupid thing is happening
I have used ui files one time, and then I've stopped to use them, as it is more easy to made manually the interface, it is not so hard, to code manually the page, and somewhat it is more a work of copy, paste and modify some little thing between each or maybe as I've done for some of my interfaces it could be done creating some automatic form creation code that use info stored in a list to fill the appropriate fields.grd wrote: ↑Wed Sep 07, 2022 12:51 pm I did have problems with the ".ui" files. For some reason I could only use a ".ui" file (dialog and messagebox too) and then the program just ended. So I created the python code from the ".ui" file and after that everything just worked fine. I don't know what the problem created.
Obviously the interface should not be too complicated, but usually if dialogs are or frames are made to input data, the interface should not to be too complicated.
Like this:
that is driven by a creation list (it is a tuple to save some memory space) something like:
Code: Select all
fields = (
("ifi_sides", ("mn", "Box Sides", "mm", 3, 10, 1, 4),
"Number of sides"),
("cbo_type", ("mn", "Box Type", ("Closed", "Open", "Frame", "With Cover")),
"Box Type"),
("ifd_hei", ("mn", "Box Height", "mm", 20, 800, 0.5, 200),
"Box Height (along Y axis), for polygonal boxes this value is the " +
"internal diameter, (apothem * 2)"),
("ifd_wid", ("mn", "Box Width", "mm", 20, 800, 0.5, 100),
"Box Width (along X axis)"),
("ifd_dep", ("mn", "Box Depth", "mm", 20, 800, 0.5, 50),
"Box Depth"),
("chb_ind", ("mn", "Inner Dims", True),
"Given dimensions are inner dimensions"),
...
Just to add something to the discussion.
Sorry for bothering, if applicable.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: A stupid thing is happening
You can do that, but you shouldn't .
There is a reason for .ui files: skilled UI designers are (usually) bad coders and skilled coders are (usually) bad UI designers.
If you are a skilled coder, you can give your .ui file to a skilled UI designer and he doesn't need to know anything about coding but could still optimize your bad UI design into a fantastic one (and vice versa).
There is a reason for .ui files: skilled UI designers are (usually) bad coders and skilled coders are (usually) bad UI designers.
If you are a skilled coder, you can give your .ui file to a skilled UI designer and he doesn't need to know anything about coding but could still optimize your bad UI design into a fantastic one (and vice versa).
Cheers,
Markus
Markus
Re: A stupid thing is happening
I agree, but it didn't work and now it does. So... But don't ask me why it didn't work because I don't know the answer.mfro wrote: ↑Wed Sep 07, 2022 3:57 pm You can do that, but you shouldn't .
There is a reason for .ui files: skilled UI designers are (usually) bad coders and skilled coders are (usually) bad UI designers.
If you are a skilled coder, you can give your .ui file to a skilled UI designer and he doesn't need to know anything about coding but could still optimize your bad UI design into a fantastic one (and vice versa).
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Re: A stupid thing is happening
I see your point.mfro wrote: ↑Wed Sep 07, 2022 3:57 pm You can do that, but you shouldn't .
There is a reason for .ui files: skilled UI designers are (usually) bad coders and skilled coders are (usually) bad UI designers.
If you are a skilled coder, you can give your .ui file to a skilled UI designer and he doesn't need to know anything about coding but could still optimize your bad UI design into a fantastic one (and vice versa).
I've tried to use ui files, but I gave up because it was not so trivial to use them, as in Linux there were no real QtDesigner at least form my distribution due to the strange License that Qt uses these times.
And for some other reasons, like size of the automatic generated UI files even for simple interfaces and difficult to assign a proper ObjectName as the program insist to use strange and complicated names and I'm using the ObjectName to retrieve the instance of the QtObject, using findChild so I prefer some mnemonic ones.
Plus it is not so trivial to find "skilled UI designer" for little money, so I prefer the DIY work.
But i don't advise to use my "very personal" way of working, it was a simple experience, that maybe will add some hints to others.
Regards
Carlo D.
Last edited by onekk on Wed Sep 07, 2022 5:18 pm, edited 1 time in total.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: A stupid thing is happening
@grd please change the subject of the first post - it's the topic title - to something more descriptive.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.