Thanks, I will keep those things in mind.
As the QUiLoader in PySide is somewhat buggy, especially with custom/promoted widgets, I would recommend using the QtBindingHelper.py from rosgui, or at least the loadUi function implemented therein.
Using the binding helper makes your software agnostic of the actual binding used, so you can easily switch between PySide and PyQt, which sometimes helps in finding bugs that are actually in PySide and not in your own code...
All you have to do is import QtBindingHelper before importing any Qt stuff:
from QtBindingHelper import loadUi
from QtGui import QWidget
It will try to use PyQt and fall back to PySide automatically if necessary.
But you can also force it to use only one of them by editing the binding list, or setting a property on the sys module before importing the binding helper:
setattr(sys, 'SELECT_QT_BINDING', 'pyside')
On 11/03/2011 01:22 AM, William Woodall wrote:Ah, I don't know why I didn't think about something like QUiLoader... †Man I feel silly, I guess I have been just using the script to generate the py files because that is how they do it in many of the tutorials. †
I have worked with the cmake macros for generating headers from ui files in c++, but I guess I was expecting something similar for python. †This makes way more sense.
Graduate Software Engineering
On Wed, Nov 2, 2011 at 7:15 PM, Dirk Thomas <firstname.lastname@example.org> wrote:
I am not sure why you would generate any code for UI files in Python.Have you found a good way to automatically generate py files from ui files using pyqt and/or pyside inside a ros build system?
It looks like ros_gui isn't currently, but I was wondering if you had any leads. †I am working on a project that uses pyside and I wanted to generate them at build time rather than committing the
In Python plugins you can just load the UI file at runtime (no need for any generated files)??
For C++ plugins you will include your UI files in the cmake files and the generated code will be included in the library.
Ros-sig-gui mailing list
_______________________________________________ Ros-sig-gui mailing list Rosemail@example.com https://code.ros.org/mailman/listinfo/ros-sig-gui
-- Dipl.-Inform. Dorian Scholz E-Mail:scholz(at)sim.tu-darmstadt.de Simulation, Systems Optimization Phone: +49 (0) 6151 16-4811 and Robotics Group Fax: +49 (0) 6151 16-6648 Technische Universitšt Darmstadt http://www.sim.tu-darmstadt.de Hochschulstr. 10 D-64289 Darmstadt, Germany
Ros-sig-gui mailing list