Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. Delimitar por pixels[RESOLVIDO]
Qt 6.11 is out! See what's new in the release blog

Delimitar por pixels[RESOLVIDO]

Scheduled Pinned Locked Moved Portuguese
3 Posts 2 Posters 2.6k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Estou usando o html no Qt e gostaria de delimitar algumas coisas q estou jogando na tela. botando um tamanho maximo para elas. Utilizando a função "mid" até consigo o q quero, mas por causa do tamanho dos caracteres serem diferentes, não fica bonita visualização. alguem poderia ajudar?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Fiz a pergunta em outro grupo, e me responderam isso

      @QFontMetrics fm(theFontYoureUsing);
      QString originalText("very long phrase that might not fit inside the parent window, how sad.");
      QString outText = fm.elidedText(originalText, Qt::ElideRight, 200);@

      funcionou muito bem. se for útil para alguém, já ta ai.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        não funcionou muito bem não, talvez haja um metodo que corte o caractere ou seja o que seja ao meio caso chegue em determinado pixel

        1 Reply Last reply
        0

        • Login

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