[Development] Qt Quick Controls Dialogs -- enabled state of the standard buttons (API choices)

Filippo Cucchetto filippocucchetto at gmail.com
Sat Aug 22 14:41:47 CEST 2015


I totally agree with the solution proposed by mitch c. With the only
exception that i would add a DialogButtonGroup qml element into which put
the buttons. This allows us to add functions and logic without clutturing
the Dialog component. Furthermore it matches the widget implementation.

F.
Il 22/ago/2015 13:57, "Curtis Mitch" <mitch.curtis at theqtcompany.com> ha
scritto:

>
>
> ------------------------------
> *From:* development-bounces+mitch.curtis=theqtcompany.com at qt-project.org
> <development-bounces+mitch.curtis=theqtcompany.com at qt-project.org> on
> behalf of Vladimir Moolle <vmoolle at ics.com>
> *Sent:* Saturday, 22 August 2015 01:22
> *To:* development at qt-project.org
> *Subject:* [Development] Qt Quick Controls Dialogs -- enabled state of
> the standard buttons (API choices)
>
> [snip]
>
> 6. Finally, Dialog could accept (optional) delegates for the buttons
> created, allowing for arbitrary customizations, i.e.:
> Dialog {
>     <...>
>     StandardButtonDelegate {       //name arguably could be better
>         role: StandardButton.Apply // could be “roles” here even
>         StandardButton {           // a Button, but with default bindings
> for “text”, etc.
>             enabled: <some binding expression>
>         }
>     }
>     StandardButtonDelegate {       //name arguably could be better
>         role: StandardButton.Apply // could be “roles” here even
>         Rectangle {                // a very custom “button”
>        <...>
>             signal clicked         // or a warning emitted by Dialog if
> absent
>             enabled: <some binding expression>
>         }
>     }
> }
>
> [snip]
>
> At this stage, wouldn't it just be easier to declare regular buttons as
> children of the dialog and then introduce some Dialog.buttonRole attached
> property? For example:
>
> Dialog {
>     Button {
>         Dialog.buttonRole: StandardButton.Ok
>     }
>     Button {
>         Dialog.buttonRole: StandardButton.Cancel
>     }
> }
>
> The dialog can still take care of the layouting of the buttons, and the
> text would even be set for you (unless you want to set your own). We could
> document this as overriding the standardButtons property if both are
> specified for whatever reason.
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150822/9f4f86e7/attachment.html>


More information about the Development mailing list