找回密码
 立即注册
收起左侧

使用PathView时,如何使其中的Button具有不同的功能?

0
回复
4343
查看
[复制链接]

尚未签到

来源: 2015-7-28 20:26:34 显示全部楼层 |阅读模式

马上注册,查看详细内容!注册请先查看:注册须知

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
import QtQuick 2.4import QtQuick.Controls 1.2Rectangle {    width: 400    height: 400        PathView {        id: view        anchors.fill: parent        delegate: d        model: 12;  pathItemCount: 6        preferredHighlightBegin: 0.5;       preferredHighlightEnd: 0.5        highlight:  Rectangle{            width:45;  height:45            color: "blue"        }                path: Path {            startX: 200            startY: 200            PathArc {                x: 200;        y: 40                radiusX: 80; radiusY: 80                useLargeArc: true            }            PathArc {                x: 200;        y: 200                radiusX: 80; radiusY: 80                useLargeArc: true            }        }
        Component{            id:d            Button {                width: 40                height: 40                text: index            }        }    }}
我写的这个程序运行后是6个Button绕成一圈的PathView,怎样才能点击每个Button实现不同的功能,我看各个教程都是讲模式——视图和路径的问题,没有讲怎么用啊,总不能只做个好看的样子吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了