[Qt-interest] Same widget in two Designer plugins - problem

Andreas Pakulat apaku at gmx.de
Fri Sep 30 15:53:53 CEST 2011


On 30.09.11 15:29:26, Frank Hemer wrote:
> On Friday 30 September 2011 15:14:35 André Somers wrote:
> > Thanks a lot for your suggestion.
> >
> > One question remains: if I return a different class name in the XML, what
> > will actually be generated by uic?
> > It sounds like you are suggesting that, just for the sake of Designer
> > integration, I actually subclass my Slider class and create VSlider and a
> > HSlider, that do nothing else than set the right orientation by default?
> > That seems taking it a bit far, for me. I guess it would work, but it is
> > not the way it seems to be done with QSlider. That one actually generates a
> > QSlider as the class name (not matching the name I see in designer!) I
> > would like to avoid having to subclass the actual widget (even if that is
> > very simple) just for the sake of Designer integration, especially since
> > these subclasses will end up in the generated code.
> >
> > I really don't get why the name() from the plugin needs to match the class
> > from the domXml(). If the information is supposed to be the same, then I
> > only want to supply it once. If it is supposed to be different, then I
> > should be allowed to have them different...
> 
> I had exactly the same thoughts - however I didn't find a way to get around 
> these limitations.

Thats because Designer simply does not provide the same amount of
customization for plugin-based widgets as it does for the integrated
ones in Qt. If you look at its sources for QSlider there's a xml-config
file which creates 2 entries, one for horizontal and another for
vertical sliders setting the Qt property
(components/widgetbox/widgetbox.xml).

Andreas




More information about the Qt-interest-old mailing list