[Interest] Can QML model specify a range including negative numbers? For example -180 to +180 ?

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Wed Nov 4 15:59:46 CET 2015


You'd better provide your implementation of TumblerColumn component.

Despite that fact, and assuming you somehow manage to know what value was
chosen, I'd suggest (as a quick attempt) to set model: 361, and the shift
values by -181.

On Wed, Nov 4, 2015 at 5:53 PM, Edward Sutton <edward.sutton at subsite.com>
wrote:

> Is there a way to declare a QML model range from -180 to +180?
>
> A method that does not require typing 361 numbers model: [-180, -179, … 0,
> … 179, 180 ] ?
>
>
>
> I added a Tumbler to Combining Qt Widgets and QML with
> QWidget::createWindowContainer()
> <http://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer>
> to experiment with making QML readable and writable from C++.
>
>
> Tumbler {
>
>     // latitude degrees -180 to +180
>
>     TumblerColumn {
>
>         model: 181  // <- Is there a way to declare model range -180 to +180 ?
>
>     }
>
>     // latitude minutes 0 - 59
>
>     TumblerColumn {
>
>         model: 60
>
>     }
>
>     // latitude seconds 0 - 59
>
>     TumblerColumn {
>
>         model: 60
>
>     }
>
> }
>
>
> Thanks in advance,
>
>
> -Ed
>
>
> This email and any files transmitted with it from The Charles Machine
> Works, Inc. are confidential and intended solely for the use of the
> individual or entity to which they are addressed. If you have received this
> email in error please notify the sender. Our company accepts no liability
> for the contents of this email, or for the consequences of any actions
> taken on the basis of the information provided, unless that information is
> subsequently confirmed in writing. Please note that any views or opinions
> presented in this email are solely those of the author and do not
> necessarily represent those of the company. Finally, the recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151104/7fed115e/attachment.html>


More information about the Interest mailing list