[Qt-interest] plugins and domXml function
Frank Hemer
frank at hemer.org
Tue Mar 9 14:17:01 CET 2010
On Tuesday 09 March 2010 12:55:46 Neville Dastur wrote:
> > Hi
> >
> > I'm working in many plugins (runtime load) and i try to understand the
> > differences using or not a complete list of properties in the domXml
> > pluging function, using ...
> >
> > return "<widget class=\"QiTagsList\" name=\"QiTagsList\">\n"
> > " <property name=\"geometry\">\n"
> > " <rect>\n"
> > " <x>0</x>\n"
> > " <y>0</y>\n"
> > " <width>100</width>\n"
> > " <height>100</height>\n"
> > " </rect>\n"
> > " </property>\n"
> > "</widget>\n";
> >
> > or
> >
> > return "<widget class=\"QiTagsList\" name=\"QiTagsList\">\n"
> > " <property name=\"geometry\">\n"
> > " <rect>\n"
> > " <x>0</x>\n"
> > " <y>0</y>\n"
> > " <width>100</width>\n"
> > " <height>100</height>\n"
> > " </rect>\n"
> > " </property>\n"
> > " <property name=\"useColors\">\n"
> > " <bool>false</bool>\n"
> > " </property>\n"
> > "</widget>\n";
> >
> > I found no differences using designer, also in my exe, then i don't
> > know what version i must use.
> >
> I too have been struggling with custom widgets. As far as I can tell
> properties like geometry give designer a hint to size in the absence of
> a a widget that specifies a sizeHint. For custom properties use the
> Q_PROPERTY mechanism and they appear auto-magically in designer.
My research revealed, that Q_PROPERTYs with a reset method are automatically
added to the xml code and need not to be mentioned in the domXML.
However, properties that are required for initial display (like a default
size) can be added to be used as defaults as long as there is no explicite
size set.
Frank
More information about the Qt-interest-old
mailing list