It's a bug.  https://bugreports.qt.nokia.com/browse/QTBUG-23670

Specifically items are being clipped to their boundingRect's, for which some 
item's  quite logically return their painted size and so are never clipped.  
Text and Image are I think the only ones that do this.

Andrew

From: [email protected] 
[mailto:[email protected]] On 
Behalf Of Rose Todd (Nokia-M/Alpharetta)
Sent: Tuesday, January 17, 2012 3:42 PM
To: [email protected]
Subject: Re: [Development] Text clipping in QtQuick 2.0

Doh!  That should read "Text elements...are *not* being clipped..."

From: 
[email protected]<mailto:[email protected]>
 
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
 On Behalf Of ext [email protected]<mailto:[email protected]>
Sent: Tuesday, January 17, 2012 12:34 AM
To: [email protected]<mailto:[email protected]>
Subject: [Development] Text clipping in QtQuick 2.0

Text elements with wrapMode: Text.NoWrap are being clipped when the text 
painted width exceeds the element width.   Seems like a big regression from 
QtQuick1.x...is this a known issue?  Bug? Feature?

Simple example:

TextBug.qml


import QtQuick 2.0

Rectangle {

    width: 360

    height: 360

    Rectangle {

        id: leftRect

        anchors.left: parent.left

        anchors.top: parent.top

        anchors.bottom: parent.bottom

        width: 60

        color: "red"

    }

    Rectangle {

        id: rightRect

        anchors.right: parent.right

        anchors.top: parent.top

        anchors.bottom: parent.bottom

        width: 60

        color: "red"

    }

    Text {

        id: bugText

        anchors.left: leftRect.right

        anchors.right: rightRect.left

        anchors.verticalCenter: parent.verticalCenter

        wrapMode: Text.NoWrap

        font.pointSize: 16

        clip: true

        text: "Hello World! Hello World! Hello World! Hello World! Hello World! 
Hello World! Hello World! Hello World! Hello World! Hello World!"

    }

    MouseArea {

        anchors.fill: parent

        onClicked: {

            if (bugText.wrapMode == Text.NoWrap)

                bugText.wrapMode = Text.WordWrap

            else

                bugText.wrapMode = Text.NoWrap

        }

    }

}

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to