Qt/QML学习-TextEdit

QML学习

main.qml

复制代码
import QtQuick 2.15
import QtQuick.Window 2.15

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Rectangle {
        anchors.centerIn: parent
        width: textEdit.width
        height: textEdit.height
        color: "yellow"
        TextEdit {
            id: textEdit
            anchors.centerIn: parent
            text: "TextEdit"
            color: "red"
            font{
                pointSize: 30
                bold: true
            }
            selectByMouse: true
            selectionColor: "blue"
            cursorDelegate: Canvas {
                width: 4
                onPaint: {
                    var ctx = getContext('2d')
                    ctx.setLineDash([2, 2, 2])
                    ctx.lineWidth = 4
                    ctx.strokeStyle = "#444fff"
                    ctx.lineCap = "round"
                    ctx.beginPath()
                    ctx.moveTo(0, 0)
                    ctx.lineTo(0, height)
                    ctx.stroke();
                }
            }
        }
    }
}

演示

相关推荐
好奇龙猫1 天前
【AI学习-comfyUI学习-第二十三-法线贴图工作流-depth 结构+MiDaS 法线-各个部分学习】
人工智能·学习·贴图
Nan_Shu_6141 天前
学习:Java (1)
java·开发语言·学习
t198751281 天前
经典的KSVD图像字典学习
人工智能·学习·计算机视觉
Boxsc_midnight1 天前
【数字人学习之语音合成】Fun-CosyVoice3-0.5B-2512的windows系统中本地部署的方法
windows·学习·cosyvoice3
Larry_Yanan1 天前
Qt多进程(四)QTcpSocket
开发语言·c++·qt·ui
CC.GG1 天前
【Qt】常用控件----QWidget属性
java·数据库·qt
hqwest1 天前
码上通QT实战02--登录设计
开发语言·qt·登录·ui设计·qt控件·qt布局·qt登录
世转神风-1 天前
qt-文件自动按编号命名
开发语言·qt
龘龍龙1 天前
Python基础学习(七)
开发语言·python·学习
李小星同志1 天前
Flowing from Reasoning to Motion: Learning 3D Hand Trajectory Prediction论文学习
学习