ScrollView support?

248 views
Skip to first unread message

Cecil New

unread,
Nov 15, 2013, 5:54:22 PM11/15/13
to go-...@googlegroups.com
I'm going thru the examples and for the delegate.go example, I thought I'd put scroll bars on the 100 item list. Per http://qt-project.org/doc/qt-5.1/qtquickcontrols/qml-qtquick-controls1-scrollview.html, I thought I could just enclose the ListView with a ScrollView to make this work (see below). But I get an error. Am I doing something wrong? Are scroll bars supported yet?

thanks.

Here is the error:
$ go run delegate.go 
error: file:///home/cecil/Workspace/src/samples/qml/modelview/delegate.qml:5 ScrollView is not a type
exit status 1

Here is the QML:
import QtQuick 2.0

Item {
    width: 320; height: 200
    ScrollView {
        ListView {
            width: 120;
            model: colors.len
            delegate: Text {
                text: "I am color number: " + index
                color: colors.color(index)
            }
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            anchors.horizontalCenter: parent.horizontalCenter

        }
    }
}

Thomas Coopman

unread,
Nov 16, 2013, 4:21:38 AM11/16/13
to go-...@googlegroups.com
It looks like you also have to import QtQuick.Controls

Cecil New

unread,
Nov 16, 2013, 7:47:21 AM11/16/13
to go-...@googlegroups.com
Gave that a shot, but error claims it is not installed?? I tried various version numbers, but nothing worked. Why wouldn't this be installed? I used the PPA to install as documented.

Any ideas? here is the error:

error: file:///home/cecil/Workspace/src/samples/qml/modelview/delegate.qml:2 module "QtQuick.Controls" is not installed

Cecil New

unread,
Nov 17, 2013, 7:58:36 PM11/17/13
to go-...@googlegroups.com
Finally realized that the Ubuntu SDK was incomplete and I remembered thaDjahma had posted instructions on how to install a different version that included all the QML widgets.

Now working! As I mentioned in the other post, perhaps, these instructions should replace use of the Ubuntu PPA?? If you want to use any form elements (checkboxes, scroll bars, etc.) you need the full set of QML widgets.

Happily working now!

Gustavo Niemeyer

unread,
Nov 18, 2013, 6:01:11 AM11/18/13
to Cecil New, Go QML
On Sun, Nov 17, 2013 at 10:58 PM, Cecil New <ceci...@gmail.com> wrote:
> Finally realized that the Ubuntu SDK was incomplete and I remembered that
> Djahma had posted instructions on how to install a different version that
> included all the QML widgets.

The Ubuntu SDK isn't incomplete.. it's just using Qt 5.0.2 at the
moment. It'll be upgraded for the next release of Ubuntu.

> Now working! As I mentioned in the other post, perhaps, these instructions
> should replace use of the Ubuntu PPA?? If you want to use any form elements
> (checkboxes, scroll bars, etc.) you need the full set of QML widgets.

Yeah, maybe we should provide instructions to use Qt 5.1 or 5.2. I've
been waiting for the development story for Ubuntu 14.04 to clear up.

> Happily working now!

Nice!


gustavo @ http://niemeyer.net
Reply all
Reply to author
Forward
0 new messages