QML MaximumBlockCount on TextArea



  • Hi,

    I've linked below a discussion about maximum line count for textarea. Unfortunately I'm not able to define it for the TextArea. I'm not sure has something changed in the previous 2 years which makes it impossible to use maximumblockcount for TextArea nowadays or is it just that I don't understand something fundamental here? Could someone provide a simple example how it is meant to be defined?

    Thanks in advance,
    Tuukka

    Re: QML TextArea maximum line count



  • @tuukkap
    I presume this means you are using QtQuick.Controls 1.5 and not QtQuickControls 2.0 ?



  • @JonB
    I'm using QtQuick.Controls 2.3 but it might be that my issue might be that I don't understand what this sentence means:
    "TextEdit should simply expose the maximum line count"



  • @tuukkap
    I'm just quoting from your linked post:

    When I switched from QtQuick.Controls 1.5 to QtQuickControls 2.0 the above issue was resolved and setting the maximumBlockCount of the underlying QTextDocument behaves as expected.



  • @JonB
    I have tried with different QtQuick.Controls versions and I can't get this to work with any of those which probably means that I'm doing something incorrect.



  • @tuukkap
    Given that thread says code should now work at QC 2.x, I think you'd best produce a small example of your code problem and post here, for others to comment on.



  • @JonB
    I somehow imagined it should be usable "simply" like below but MaximumBlockCount can't be used from textDocument at least like this:

            TextArea {
                id: ticketTextArea
                textDocument.MaximumBlockCount: 3
                Layout.preferredHeight: 150
                Layout.fillWidth: true
                Layout.maximumHeight: 200
                Layout.rowSpan: 3
            }
    

    Thanks for your patience :)



  • @tuukkap
    I've never done QML, so I'll have to leave an expert to help you further...

    BTW, textDocument.MaximumBlockCount --- is QML case-sensitive? Property name is maximumBlockCount.



  • @JonB
    Thanks for your help! Yeah, that starting capital "M" was mistake as I recreated the example but it doesn't work with "m" either.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.