兼容Qt4/Qt5版本Qml控件Triangle
小编:啊南 351阅读 2021.01.18
三角形控件(Triangle),等腰直角三角形。底是高的两倍。
文件导入示例
Triangle { anchors.centerIn: parent }属性
- width:设置三角形的等宽。
- color:设置三角形的颜色。
//#if Qt4 //import QtQuick 1.0 //#else import QtQuick 2.0 //#endif Item { id: root property alias color: triangle.color implicitWidth: 100 implicitHeight: implicitWidth width: implicitWidth height: width clip: true rotation: -45 Rectangle { id: triangle anchors.verticalCenter: parent.verticalCenter anchors.verticalCenterOffset: parent.height/2 anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenterOffset: -parent.width/2 width: Math.sqrt(root.width * root.width * 2) height: width color: "#4cbeff" rotation: 45 } }
相关推荐
- Qt加载XPM图像 XPM是一种基于ASCII编码的图像格式,一般用于创建图标。由于它是ASCII编码,很方便地在代码中使用。 Qt的QPixmap类支持XPM格式,原型如下:QPixmap::QPixmap(const char *const [] xpm)摘取Qt源码中的"严重警告"XPM图标:static const char* const c…
- 3DMAX提示和技巧 本主题标识使用 Civil View 的一些重要提示和技巧。常规使用屏幕分辨率至少为 1280x1024 的 Civil View。低于此分辨率时,一些面板将占用过多屏幕空间。 将视口设置为线框显示以达到最佳性能。 要尽可能简化用户界面,请在单个视口中工作并关闭 3ds Max 命令面…