4

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
            }
        }
    }
jkj yuio
  • 2,543
  • 5
  • 32
  • 49
  • 1
    Sounds like an oversight that should be easy to fix. Please report at bugreports.qt.io. – jpnurmi Feb 02 '17 at 15:50
  • @jpnurmi thanks. i found a workaround, but i don't understand why it works. anyway... – jkj yuio Feb 07 '17 at 16:12
  • Probably because the default `cursorShape` for `MouseArea` is `Qt.ArrowCursor`: http://doc.qt.io/qt-5/qml-qtquick-mousearea.html#cursorShape-prop. By the way, can you answer your question and accept it so we know it's solved? :) – Mitch Feb 08 '17 at 08:54
  • The bug has been fixed in Qt 5.8.1 and/or 5.9.0: https://codereview.qt-project.org/#/c/185002/ – jpnurmi Feb 08 '17 at 15:23
  • Thanks for the bugfix! i posted an answer to this effect and my workaround in the meantime. – jkj yuio Feb 11 '17 at 18:03

1 Answers1

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
            }
        }
jkj yuio
  • 2,543
  • 5
  • 32
  • 49