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]
Forum Updated to NodeBB v4.3 + New Features

Delimitar por pixels[RESOLVIDO]

Scheduled Pinned Locked Moved Portuguese
3 Posts 2 Posters 2.1k 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.
  • F Offline
    F Offline
    felipe.c.sousa
    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?

    From all, to all.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      felipe.c.sousa
      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.

      From all, to all.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gdouglas7
        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

        Qt Developer
        Student of Information System

        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