Important: Please read the 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


    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