[Qt-qml] Can you shadow / override elements

henrik.hartz at nokia.com henrik.hartz at nokia.com
Fri Oct 29 15:11:42 CEST 2010


Hi,

in Qt Quick components we need to reuse a few elements from QML - but make them styled to fit the platform theme. E.g. the Label element is-a Text element, except we apply font, sizing, colors, margins etc from the theme. It would be silly from the end-user perspective to have to relate to multiple element names for the same functionality. is there a way to do e.g.

Text.qml;
import QtQuick 1.0

Text {
   font.family: style.get("fontfamily")
   ... etc
}

basically allowing eforcing some property default values, while still keeping the same API and element name?

See e.g. Label from http://bugreports.qt.nokia.com/browse/QTCOMPONENTS-200 for reference

Cheers,
Henrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101029/bbdcb3a3/attachment.html 


More information about the Qt-qml mailing list