[Development] Qt Quick Controls 2.0

manish sharma 83.manish at gmail.com
Mon May 25 13:04:58 CEST 2015


Thanks J-P for your reply.

I was under assumption that my entire code will just work out of the box, I
need to just replace import statement from 1.* to 2.0. But looks like i
need to move my code from style code to individual control properties.

Thanks,
Manish


On Mon, May 25, 2015 at 2:33 PM, Nurmi J-P <jpnurmi at theqtcompany.com> wrote:

> > On 25 May 2015, at 08:56, manish sharma <83.manish at gmail.com> wrote:
> >
> > Hi,
> >
> > I was reading
> https://blog.qt.io/blog/2015/03/31/qt-quick-controls-for-embedded/ and it
> looks very promising.
> >
> > Currently I am using QtQuickControls 1.3 and I am customizing look and
> feel by extending QtQuick.Controls.Styles.
> >
> > I just browsed through qtquickcontrols2 code and i could not find Style
> hooks. Is it by design Or something which is coming up?
>
> Hi Manish,
>
> This is what the “styles” section in the blog post talks about:
>
> > The concept of styling is changing in a way that styles no longer
> provide components
> > that are dynamically instantiated by controls, but controls themselves
> consist of delegates
> > that can be replaced without dynamic instantiation.
>
> In fact, any visual part of any control can be replaced by your own.
> Here’s an example of a Button with a custom background. The background is a
> simplified version Qt Quick Controls 1 Base style’s Button background.
>
>          Button {
>             id: control
>             text: "Button"
>             Theme.selectedTextColor: "black" // WIP! This will change...
>             background: Rectangle {
>                 radius: 3
>                 border.color: control.activeFocus ? "#47b" : "#999"
>                 gradient: Gradient {
>                     GradientStop { color: control.pressed ? "#aaa" :
> "#fefefe"; position: 0 }
>                     GradientStop { color: control.pressed ? "#ccc" :
> "#e3e3e3"; position: control.pressed ? 0.1 : 1 }
>                 }
>                 Rectangle {
>                     radius: 3
>                     anchors.fill: parent
>                     color: control.activeFocus ? "#194477bb" :
> "transparent"
>                     Behavior on color { ColorAnimation { duration: 100 } }
>                 }
>             }
>         }
>
> Disclaimer: these things are still heavily work in progress.
>
> --
> J-P Nurmi
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150525/9f3212d8/attachment.html>


More information about the Development mailing list