Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Retrieve elided text?



  • Suppose you're writing a long dialogue--say you're displaying the Gettysburg Address in a Text field a few lines at a time--is there a function to retrieve the text that wasn't shown? Or possibly the character position where the eliding took place?


  • Lifetime Qt Champion

    Hi,

    AFAIK, no.

    You’d likely have to go through calculating the size of the needed rectangle using QFontMetrics.

    If your text is so long and you need to know what wasn’t shown, why not use a QTextEdit ? It could be read-only.


Log in to reply