鱼C论坛

 找回密码
 立即注册
查看: 3162|回复: 1

[技术原创] QT动画制作(六)

[复制链接]
发表于 2017-2-25 07:39:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

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

x
效果 b1.png
知识点1:学会positioner(定位器)的使用
知识点2:repeater重复器的使用

今天做的东西虽然无聊但是学会了相当有用,也很简单,先创建QML项目,直接在MainForm.ui.qml文件下修改就行

  1. import QtQuick 2.5

  2. Rectangle {
  3.     property alias mouseArea: mouseArea

  4.     width: 660
  5.     height: 660

  6.     MouseArea {
  7.         id: mouseArea
  8.         anchors.fill: parent
  9.     }

  10.    Item{


  11.        Row{//行布局
  12.            x:65
  13.            y:65
  14.            spacing:5//相隔的距离
  15.        Repeater{//重复器

  16.            model:5//定义重复个数
  17.        Rectangle{

  18.            width:40
  19.            height:40
  20.            color:"green"
  21.        }
  22.     }
  23.     }
  24.        Column{//列布局
  25.            x:85
  26.            y:115
  27.            spacing:5
  28.        Repeater{

  29.            model:5
  30.        Rectangle{

  31.            width:40
  32.            height:40
  33.            color:"green"
  34.        }
  35.     }

  36.     }
  37.        Flow{//流布局
  38.            x:125
  39.            y:125
  40.            spacing:5
  41.             Repeater{
  42.             model:5
  43.             Rectangle{
  44.             width:40
  45.             height:40
  46.             color:"red"
  47.             }
  48.             }
  49.        }
  50.        Grid{//网格布局
  51.            x:225
  52.            y:225
  53.            spacing:5
  54.        Repeater{

  55.            model:5
  56.        Rectangle{

  57.            width:40
  58.            height:40
  59.            color:"green"
  60.        }
  61.     }
  62.     }

  63.    }
  64.    }

复制代码

评分

参与人数 2荣誉 +10 鱼币 +10 贡献 +8 收起 理由
零度非安全 + 5 + 5 + 3 热爱鱼C^_^
不二如是 + 5 + 5 + 5 支持楼主!

查看全部评分

本帖被以下淘专辑推荐:

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2017-2-25 08:48:38 | 显示全部楼层
前排占楼~
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-4 03:42

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表