当前位置: 首页 > news >正文

QML控件--Drawer

文章目录

  • 一、控件基本信息
  • 二、控件使用
  • 三、属性成员

一、控件基本信息

Import Statement:import QtQuick.Controls 2.14
Since:Qt 5.7
Inherits:Popup


二、控件使用

Drawer:提供一个可以使用滑动手势打开和关闭的侧面板;Drawer 可以从上下左右四个方向打开;

在这里插入图片描述

import QtQuick 2.10
import QtQuick.Window 2.10
import QtQuick.Controls 2.3ApplicationWindow{visible: true;width: 1280;height: 720;Drawer {id: drawerwidth: 0.3 * parent.widthheight: parent.heightdragMargin: parent.width * 0.1; //拉动开始生效的区域,最低为0,也就是0的位置拖动才有效Label {id: content_Drawertext: "content_Drawer"font.pixelSize: 40anchors.fill: parentverticalAlignment: Label.AlignVCenterhorizontalAlignment: Label.AlignHCenter}}Label {id: content_maintext: "content_main"font.pixelSize: 50anchors.fill: parentverticalAlignment: Label.AlignVCenterhorizontalAlignment: Label.AlignHCentertransform: Translate {x: drawer.position * content_main.width * 0.33}}}

三、属性成员

1、dragMargin : real

与屏幕边缘的距离,在该距离内拖动操作将打开 Drawer,默认值为 Qt.styleHints.startDragDistance
注意:设置为 小于等于 0 可禁用通过拖动打开Drawer;

2、edge : enumeration

打开 Drawer 的窗口边缘:

  • Qt.TopEdge:上边缘;
  • Qt.LeftEdge:左边缘(默认);
  • Qt.RightEdge:右边缘;
  • Qt.BottomEdge:底部边缘;

3、interactive : bool

Drawer 是否是交互式的。 非交互式不会对滑动做出反应。默认为 true

4、position : real

Drawer 相对于其最终目的地的位置。完全关闭时位置为 0.0,完全打开时位置为 1.0

http://www.lryc.cn/news/59177.html

相关文章:

  • PHY- PHY芯片概述
  • 【C++】如何获取当前正在运行的函数的名称?
  • 42.原型对象 prototype
  • python 读写txt方法
  • 香橙派pi5下,debian,docker19.03.9版本runc容器逃逸
  • Thinkphp6.0中间件.上
  • 十进制到八进制的转换
  • 【从零开始学Skynet】基础篇(四):网络模块常用API
  • 怎么免费制作logo?logo免费设计在线生成,从此设计不求人
  • 【目标检测】目标检测遇上知识图谱:Object detection meets knowledge graphs论文解读与复现
  • IDEA重复下载SNAPSHOT包问题
  • 【Unity入门】12.MonoBehaviour事件函数
  • 1.3 Docker Compose-详细介绍
  • 数据分析:麦当劳食品营养数据探索并可视化
  • ES6标准
  • ASP一个物流商品运输系统的设计与实现
  • 肖 sir_就业课__009ui自动化讲解
  • 「线性DP」花店橱窗
  • 数组的去重方法
  • ESP32-LORA通信
  • 博客首页效果
  • 【LeetCode】剑指 Offer(29)
  • 自然语言处理(八):Lexical Semantics
  • 推荐一款 AI 脑图软件,助你神速提高知识体系搭建
  • 掌握这些“学习方法和工具”,让你事半功倍!
  • MyBatis 源码解析 面试题总结
  • 「业务架构」需求工程—需求规范(第3部分)
  • chapter-1数据管理技术的发展
  • 23.Spring练习(spring、springMVC)
  • 【数据库原理 • 七】数据库并发控制