Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Bug created] Elide plain text in a QTextDocument?

    General and Desktop
    2
    3
    1057
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Asperamanca last edited by

      How do I configure a QTextDocument to elide plain text?

      I.e. If the text is too long, I'd like to see something like

      "This is a ridi...line of text".

      1 Reply Last reply Reply Quote 0
      • S
        ScottR last edited by

        QFontMetrics::elidedText() should do what you want.

        1 Reply Last reply Reply Quote 0
        • A
          Asperamanca last edited by

          I have discussed this issue with Qt support. The result is this QTBUG (well, it's a suggestion, but they are all called "QTBUG"):

          "QTBUG":https://bugreports.qt-project.org/browse/QTBUG-34857

          The code is there in QFontMetrics, there's just no way to make use of it in a QTextDocument in any sensible way.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post