Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Display a custom ellipsis when text is elided

Display a custom ellipsis when text is elided

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstringelisionellipsis
3 Posts 2 Posters 646 Views
  • 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.
  • S Offline
    S Offline
    szumial
    wrote on 26 Apr 2023, 06:41 last edited by
    #1

    Hi! I know there is a way to set the elide mode for a QString to display an ellipsis ("...") when there is not enough space to contain the entire length of the text. Is there a way to change the default ellipsis symbols displayed though? Based on my research so far, there is nothing in the framework to change it, but I might be wrong - do you know if there is a way to achieve that? I took a look at the Elided Label Example which does not answer my question.

    C 1 Reply Last reply 26 Apr 2023, 06:52
    0
    • S szumial
      26 Apr 2023, 06:41

      Hi! I know there is a way to set the elide mode for a QString to display an ellipsis ("...") when there is not enough space to contain the entire length of the text. Is there a way to change the default ellipsis symbols displayed though? Based on my research so far, there is nothing in the framework to change it, but I might be wrong - do you know if there is a way to achieve that? I took a look at the Elided Label Example which does not answer my question.

      C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 26 Apr 2023, 06:52 last edited by
      #2

      @szumial The text engine uses the ellipsis character from the unicode set (U+2026). If the font used doesn't have it the "..." text is used and it's hardcoded. So the only exposed way to customize it is to use a font with a custom ellipsis character.

      S 1 Reply Last reply 26 Apr 2023, 07:14
      1
      • C Chris Kawa
        26 Apr 2023, 06:52

        @szumial The text engine uses the ellipsis character from the unicode set (U+2026). If the font used doesn't have it the "..." text is used and it's hardcoded. So the only exposed way to customize it is to use a font with a custom ellipsis character.

        S Offline
        S Offline
        szumial
        wrote on 26 Apr 2023, 07:14 last edited by
        #3

        @Chris-Kawa Thanks for the quick reply! It might be helpful, I will think whether I can use it to my advantage.

        1 Reply Last reply
        0

        1/3

        26 Apr 2023, 06:41

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved