hi All!
There is Qml model and TableView in my application.
TextEdit is used in delegate for text displaying (I use this element because I will use QSyntaxHighlighter with it)
Also I use wrapMode: Text.NoWrap
After column width changing I want get elide string (like ThisIsATex... for example)
I use TextMetrics for text eliding (http://doc.qt.io/qt-5/qml-qtquick-te...tml#width-prop)
Qt Code:
onWidthChanged: { textMetrics.text = delegateTextEdit.text textMetrics.elideWidth = delegateTextEdit.width - 10 var str = textMetrics.elidedText console.debug(str) //delegateTextEdit.text = str }To copy to clipboard, switch view to plain text mode
Problem:
- on width changing I can see correct elide text in console (in TableView it doesn't appear)
qml_log.png
- after last line uncommented I see text only at first column in my table. Yes, text is elided but only in one way
qml_log1.jpg
Bookmarks