pyside2uic, qtdesigner output, and FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
pyside2uic, qtdesigner output, and FreeCAD
I would like to create some dialogs for use with my FC python code.
There is plenty of "stuff" around about doing so...but. The last time I followed one of the FreeCAD tutorials about doing so, it recommended using pip to install pyside2-tools to get pyside2uic to convert the QTDesigner out put to pyside python. Which proceeded to wreak havoc on my PC and I could no longer build or run FreeCAD.
So, what is the correct way to get pyside2uic?
It doesn't appear to be included in the FC dependencies.
There is plenty of "stuff" around about doing so...but. The last time I followed one of the FreeCAD tutorials about doing so, it recommended using pip to install pyside2-tools to get pyside2uic to convert the QTDesigner out put to pyside python. Which proceeded to wreak havoc on my PC and I could no longer build or run FreeCAD.
So, what is the correct way to get pyside2uic?
It doesn't appear to be included in the FC dependencies.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: pyside2uic, qtdesigner output, and FreeCAD
No need to use Qtcreator for simple dialogs
see the bottom of this page
https://wiki.freecadweb.org/Dialog_creation
I have done some test this morning for a project and it work fine, at least in Linux with Appimages.
Regards
Carlo D.
see the bottom of this page
https://wiki.freecadweb.org/Dialog_creation
I have done some test this morning for a project and it work fine, at least in Linux with Appimages.
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: pyside2uic, qtdesigner output, and FreeCAD
As noted QTDesigner, not QTCreator.
And, I didn't say I didn't know how to make simple dialogs.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: pyside2uic, qtdesigner output, and FreeCAD
Sorry, it wasn't my intention to offend you.
Now I don't know what OS you are using, but generally, pip and Linux distribution don't cope very well, at least on debian based distributions.
On Windows I don't know, in the past when I've used windows generally I've installed python using the official packages, so maybe on windows pip is almost safe.
But I don't know if in the FreeCAD bundle there is already pip installed, as many people advice to install on Windows the "portable build" to keep FreeCAD "environment" separate from the OS installed programs.
Better to ask on the Installation section, for one reason many people that know this "delicate interactions" between OS and FreeCAD are frequenting that section of this forum.
But as usual, when asking something that could be OS related put the "FreeCAD info" on the post (in the installation forum almost everytime you are asked to do so).
Hope it helps
Carlo D.
Now I don't know what OS you are using, but generally, pip and Linux distribution don't cope very well, at least on debian based distributions.
On Windows I don't know, in the past when I've used windows generally I've installed python using the official packages, so maybe on windows pip is almost safe.
But I don't know if in the FreeCAD bundle there is already pip installed, as many people advice to install on Windows the "portable build" to keep FreeCAD "environment" separate from the OS installed programs.
Better to ask on the Installation section, for one reason many people that know this "delicate interactions" between OS and FreeCAD are frequenting that section of this forum.
But as usual, when asking something that could be OS related put the "FreeCAD info" on the post (in the installation forum almost everytime you are asked to do so).
Hope it helps
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: pyside2uic, qtdesigner output, and FreeCAD
No offense taken... I have pretty thick skin.
I ran into @kkremitski on gitter last night.
Apparently pyside2uic has been replaced and the replacement (uic) should be available with the dependencies for building FreeCAD. I'm going to try it later.
I ran into @kkremitski on gitter last night.
Apparently pyside2uic has been replaced and the replacement (uic) should be available with the dependencies for building FreeCAD. I'm going to try it later.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: pyside2uic, qtdesigner output, and FreeCAD
If so then it's a bad advice because it may pull in another Qt version than the default version for your system (in case it's a Linux) and may cause quite some instabilities. The recommended way is to install official packages of your repository.
It's currently not possible to generate Python code out of a ui file that has some FreeCAD specific widgets. To make this working we had to write some wrapper classes using the PySide2 type system.It doesn't appear to be included in the FC dependencies
For more details see: https://forum.freecadweb.org/viewtopic.php?f=10&t=5374
Re: pyside2uic, qtdesigner output, and FreeCAD
@wmayer it is not clear to me a couple of things:
1) is it possible to use qtcreator/qtdesigner (or whatever is named now) to create UI for FreeCAD
2) what are the "FreeCAD specific widgets"
3) I'm interest in knowing more on Gui programming to make some Macro, there is some documentation on "how to " manage the TreeView interaction, or to better explain, how much the wiki pages are updated to be "in sync" with the actual FreeCAD version.
To be more clear, sometimes we users and "newbie developers" (pass me the term) are struggling with incomplete or outdated informations, there will be a manner to mark the wiki pages as "not in sync" and maybe talk with some people that could change something.
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: pyside2uic, qtdesigner output, and FreeCAD
Sure.
E.g. the class QuantitySpinBox is derived from QAbstractSpinBox and is part of the FreeCAD code. We also provide a plugin that can be used with the Qt Designer in order to simplify its usage.2) what are the "FreeCAD specific widgets"
However, when you use pyside's uic tool to create Python code from the UI format it won't support QuantitySpinBox.
Re: pyside2uic, qtdesigner output, and FreeCAD
In fact I was referring to a FreeCAD wiki: https://wiki.freecadweb.org/Dialog_creation
Unfortunately, it's only mention of what to do on Linux is labeled To Do, I was left to guessing...and guessed wrong.
This may be helpful when I get to using FreeCAD widgets...though, I don't know what's available. I have just been attempting to use non-FreeCAD widgets like textedit and checkbox.It's currently not possible to generate Python code out of a ui file that has some FreeCAD specific widgets. To make this working we had to write some wrapper classes using the PySide2 type system.
For more details see: https://forum.freecadweb.org/viewtopic.php?f=10&t=5374
The thread starts in 2014 and rests in 2017, then rekindled in March of this year...so this has been bouncing around for some time.
The wiki page I referenced above is a sort of jumping off point to several dialog example pages. I found no mention of FreeCADGui.PySideUic in any of the 6 pages linked for more examples.
I also noted that many of the examples are using PyQT4 and python 2.7.
It appears the FreeCAD scripting/dialog wiki pages could use some love...
It also appears that Ubuntu 20.04 and the FreeCAD dependencies are in some sort of transition, with the package by @kkremitski rejected, etc.
It seems I have a knack for getting into "perfect storm" situations with software...
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."