May 4, 2012

felipe.c.sousa felipe.c.sou..
Lab Rat
48 posts

Delimitar por pixels[RESOLVIDO]

 

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?

 Signature 

From all, to all.

2 replies

May 9, 2012

felipe.c.sousa felipe.c.sou..
Lab Rat
48 posts

Fiz a pergunta em outro grupo, e me responderam isso

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

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

 Signature 

From all, to all.

May 18, 2012

gdouglas7 gdouglas7
Lab Rat
19 posts

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

 Signature 

Qt Developer
Student of Information System

 
  ‹‹ Como fazer que um evento onClick no javascript chame uma função do Qt?      Baixar Necessitas alpha 3 update 4 (18 Feb 2012) ››

You must log in to post a reply. Not a member yet? Register here!