[Development] Desktop components: project directory structure

jens.bache-wiig at nokia.com jens.bache-wiig at nokia.com
Wed May 9 11:12:06 CEST 2012


Mostly due to historical reasons. The desktop components were originally based on a concept of styled "custom" components developed in a separate branch on Gitorious:
https://qt.gitorious.org/qt-components/qt-components/commits/custom

The idea was that you can create a custom component with it's own look and feel like this:

Button {  
	background: Rectangle{ color: styledItem.pressed ? "red" : "blue" }  
	label: Text{ text:styledItem.text ; color:"red }
}

These "custom" components have no native look and feel by themselves and a very limited API. The components that you find in the "custom" folder are all derived from this idea and can still be used by themselves.
It separates the platform independent logic, while still adding platform dependent specific things like ToolTips, MouseWheel support etc separately.  In practice we don't expose the custom components so to the end user it means nothing,
but you can still override the styling of desktop buttons by setting a custom background delegate.

As the branches have since diverged and I have been less strict about keeping the separation for components which clearly do not make sense outside of the desktop, I don't see it as all that useful to enforce this as a pattern so it is little more than an implementation detail at this point. I still keep some of it around to more easily backport patches. I can move them to the "private" directory if it makes it less confusing though.

Regards,
Jens



On May 8, 2012, at 6:45 PM, ext Alberto Mardegan wrote:

> Hi all,
>   I've got a question about the QML Desktop components at:
> https://qt.gitorious.org/qtplayground/qtdesktopcomponents
> 
> Some components, such as TextField, are implemented as a derivative of 
> another (homonymous) component defined in the "custom/" subdirectory. 
> Why is this separation needed? Are there guidelines which tell whether 
> some piece of code should belong to the toplevel component or in the 
> "custom/" implementation?
> 
> Ciao,
>   Alberto
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development




More information about the Development mailing list