[Gammaray-interest] Widget generation for rapid prototyping
Kevin Funk
kevin.funk at kdab.com
Thu Dec 20 22:23:21 CET 2012
On Thursday 20 December 2012, 11:50, Oggo Loggo wrote:
> Hi,
>
> during my thesis I am developing a piece of software using c++ and qt. I
> often do quick prototypes to try out methods. The way I have my project
> setup currently, it takes me quite some time to forward a set of parameters
> from the gui to the code:
>
> 1. Edit myPluginWidget.ui file (add spin box,combo box, checkbox)
> 2. Edit myPluginWidget.h which inherits from Ui_myPluginWidget.h to call the
> right function in myPlugin.h
>
> Now, what I'd like to have an automatic way of generating a widget for a
> class/struct that stores a set of necessary parameters. I feel that it
> should be possible using qt's metaobject and property mechanism, but I was
> wondering if there is a reasonably size piece of code out there which would
> do that for me and I am open to any efficient alternative?
Hey there,
If I've understood you correctly, that's basically what you can do with the
'Objects' browser in GammaRay:
The object browser tab allows you to edit static/dynamic properties of a
QObject-based class and trigger slots from within them.
The property editor in GammaRay is also able to manipulate object properties
that were registered within the Qt meta object system by using Q_PROPERTY()
[1]. This in combination with being able to call slots on the object is
basically what you want.
Have a look at 'core/propertyeditor' if you'd like to see the code that deals
with this logic. That's what we use in the 'Objects' browser tool.
Greets
[1] http://doc.qt.digia.com/qt/properties.html
--
Kevin Funk | kevin.funk at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
More information about the Gammaray-interest
mailing list