[Interest] QML TableView style & Windows Phone

Alexander Ivash elderorb at gmail.com
Sat Jan 3 13:25:11 CET 2015


While I would still like to find a proper solution, here is ugly workaround
which allows to get rid of scrollbars and return scrolling-by-dragging
behaviour to TableView on Windows Phone:

TableViewStyle {
Component.onCompleted: {

            if(Qt.platform.os == 'winphone')
            {
                var traverse = function(item, level, filter) {
                    for(var i = 0; i < item.children.length; ++i) {
                        if(filter && filter(level, item.children[i])) {
                            return item.children[i];
                        }

                        traverse(item.children[i], level + 1, filter)
                    }
                }

                traverse(control, 0, function(level, item) {
                    console.log(new Array(level * 4).join(' ') + item);

                    if(item.toString().indexOf('QQuickMouseArea') != -1)
                    {
                        if(item.parent.toString().indexOf('QQuickListView')
!= -1)
                        {
                            console.log('item.preventStealing: ',
item.preventStealing)
                            item.preventStealing = false
                            console.log('item.parent.interactive: ',
item.parent.interactive)
                            item.parent.interactive = true
                        }

                        return true;
                    }

                    return false;
                })

                control.horizontalScrollBarPolicy = Qt.ScrollBarAlwaysOff;
                control.verticalScrollBarPolicy =  Qt.ScrollBarAlwaysOff;
            }
        }
}

2015-01-03 13:25 GMT+03:00 Alexander Ivash <elderorb at gmail.com>:

> Is it possible to apply different style (for example android's) to
> TableView ? Not sure why, but on Windows Phone it looks like on desktop
> platforms: has desktop-like scrollbars and scrolling is possible only via
> scrollbars. What I need - is behaviour like on android platform: no
> scrollbars visible and scrolling is possible just by dragging.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150103/629f0a1a/attachment.html>


More information about the Interest mailing list