Qt5.8 QML Why does a read-only Controls2.TextArea have the ibeam cursor?

1.3k Views Asked by At

Qt5.7 this example gives the "pointer" cursor, but Qt5.8, i get the "ibeam" cursor (like i am to insert).

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
        }
    }
}

Is this a deliberate change, if so, how can i show the pointer cursor for a read-only TextArea?

thanks.

update #1:

adding a dummy MouseArea appears to fix it. I don't know why/

like this:

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

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

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

There are 1 best solutions below

0
jkj yuio On

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
            }
        }