3

Qt5.7 这个例子给出了“指针”光标,但是 Qt5.8,我得到了“ibeam”光标(就像我要插入一样)。

import QtQuick 2.7
import QtQuick.Controls 2

ApplicationWindow
{
    width: 1024
    height: 800

    visible: true

    Flickable 
    {
        anchors.fill: parent
        flickableDirection: Flickable.VerticalFlick

        TextArea.flickable: TextArea
        {
            font.pixelSize: 25
            text: "hello world"
            readOnly: true
        }
    }
}

这是一个故意的改变,如果是这样,我如何显示只读TextArea的指针光标?

谢谢。

更新#1:

添加一个假人MouseArea似乎可以解决它。我不知道为什么/

像这样:

 Flickable 
    {
        anchors.fill: parent
        flickableDirection: Flickable.VerticalFlick

        TextArea.flickable: TextArea
        {
            font.pixelSize: 25
            text: "hello world"
            readOnly: true

            MouseArea 
            {
                anchors.fill: parent
                enabled: false
            }
        }
    }
4

1 回答 1

1

Following comments of Mitch and Jpnurmi, apparently this was a bug that is now fixed. Great!

In the meantime, my workaround is a dummy MouseArea

 TextArea.flickable: TextArea
        {
            font.pixelSize: 25
            text: "hello world"
            readOnly: true

            MouseArea 
            {
                anchors.fill: parent
                enabled: false
            }
        }
于 2017-02-11T18:02:35.563 回答