Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QML ScrollBar

$
0
0
Hi guys, I have a two problems. I have a Scroll Bar like this. ScrollBar [i.imgur.com] I want to do, what i showed in this picture. My first problem is when i scroll down my text goes out of my rectangle, another problem, I want ScrollBar shift to the right, out of my rectangle, any idea how can i do that ? :) My main.qml import QtQuick 2.0   Rectangle {     width: 1280     height: 864;     color: "transparent";     y:160;       FontLoader { id: font; source: "/home/g/Documents/UI/canvas_img/fonts/OpenSans-Light.ttf" }       Text {         id: text;         anchors.horizontalCenter: parent.horizontalCenter;         anchors.top: parent.top;         anchors.topMargin: 30;         text: "Rules";         font.pixelSize: 30;         font.family: font.name;     }       Rectangle {     id: _scrollbar;     width: 1000;     height: 300;     anchors.centerIn: parent;     color: "#c2c2c2"     radius: 8;         ListView {             id: list;             width: 1000;             height: 590;             anchors.fill: parent;             model: 1;             delegate: Rectangle {                 height: 800;                 width: parent.width;                 color: "transparent" //(model.index %2 === 0 ? "darkgray" : "lightgray");                 Text {                     id: rules;                     anchors.left: parent.left;                     anchors.leftMargin: 15;                     anchors.topMargin: 15;                     text: "Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules  \nRules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules Rules \nRules Rules Rules Rules Rules Rules Rules Rules \nRules Rules Rules Rules ";                     font.pixelSize: 20;                     font.family: font.name;                 }             }         }         ScrollBar {             target: list;         }     } }

Viewing all articles
Browse latest Browse all 4972

Trending Articles