[Interest] Tired of QML

Vlad Stelmahovsky vladstelmahovsky at gmail.com
Sat Apr 15 14:26:07 CEST 2017


if you tired of QML, go take some html+css+js as a antipattern and come
back relaxed to QML

On Sat, Apr 15, 2017 at 1:40 PM, Alexander Dyagilev <alervdvcw at gmail.com>
wrote:

> Hello,
>
> It seems to be a very non intuitive for me... :(
>
> I'm trying to create my own header for ListView as TableView does not
> exist in Quick Controls 2.
>
> ListView
> {
>         header: DownloadListHeader{}
>
>         delegate: DownloadListItem
>         {
>             preInfoColumnWidth: header.preInfoColumnWidth
>         }
>
> }
>
> gives the following result:
>
>
> This:
>
> DownloadListHeader
>     {
>         id: downloadsViewHeader
>     }
>
>     ListView
>     {
>         header: downloadsViewHeader
>         delegate: DownloadListItem
>         {
>             preInfoColumnWidth: header.preInfoColumnWidth
>         }
>     }
>
> gives:
>
>
> This:
>
> DownloadListHeader
>     {
>         id: downloadsViewHeader
>     }
>
>     ListView
>     {
>         header: downloadsViewHeader
>         delegate: DownloadListItem
>         {
>             preInfoColumnWidth: downloadsViewHeader.preInfoColumnWidth
>         }
>     }
>
> Gives:
>
>
> Ooops, this:
>
> DownloadListHeader
>     {
>         id: downloadsViewHeader
>     }
>
>     ListView
>     {
>         header: DownloadListHeader {}
>         delegate: DownloadListItem
>         {
>             preInfoColumnWidth: downloadsViewHeader.preInfoColumnWidth
>         }
>     }
>
> Gives the expected behaviour:
>
>
> Could somebody please explain me differences between all these variants?
> Right now, all this look crazy for me.
>
>
> Just in case. The remaining code:
>
> import QtQuick 2.7
>
> import QtQuick.Controls 2.0
>
> import QtQuick.Layouts 1.0
>
> ToolButton
>
> {
>
>     property int preInfoColumnWidth: 50
>
>     text: "Column #1"
>
>     height: 20
>
> }
>
>
> -------
> import QtQuick 2.7import QtQuick.Controls 2.0import QtQuick.Layouts 1.0
>
> ItemDelegate
> {    property int preInfoColumnWidth: 0
>
>     height: 40
>
>     Row    {        spacing: 10
>
>         Row        {            width: preInfoColumnWidth
>
>             CheckBox            {            }        }
>
>         Text        {            text: name            width: 150            elide: Text.ElideRight            anchors.verticalCenter: parent.verticalCenter        }
>
>         Column        {            anchors.verticalCenter: parent.verticalCenter            width: 80            spacing: 2
>
>             Row            {                width: parent.width                height: 10                Text { text: progress + "%"; anchors.left: parent.left}                Text { text: timeLeft == "" ? "Paused" : timeLeft; anchors.right: parent.right}            }
>
>             ProgressBar            {                from: 0; to: 100; value: progress                height: 10; width: parent.width            }        }
>
>         Text        {            text: size + "MB"            width: 50            elide: Text.ElideRight            anchors.verticalCenter: parent.verticalCenter        }    }
> }
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>


-- 
Best regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/a9a3d70d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpjinnnkcalikehe.png
Type: image/png
Size: 9689 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/a9a3d70d/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dflljchikakebhph.png
Type: image/png
Size: 9799 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/a9a3d70d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: laacjakopgdppfep.png
Type: image/png
Size: 9261 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/a9a3d70d/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ljoeehhjhepopheh.png
Type: image/png
Size: 9215 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/a9a3d70d/attachment-0003.png>


More information about the Interest mailing list