×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2010
    Location
    Bangalore,Karnataka,India
    Posts
    8

    Any possible way for Implementation of Ellipsis to the Label...

    Hi,
    I am facing the problem of clipping for the text inside the label when i am trying to fix the width of label (but the text is too long).
    Is there any way to implement Ellipsis (other than font metrics) to the label as by default we have to list items.

    Thanks,
    Suhail Moh'd.

  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Any possible way for Implementation of Ellipsis to the Label...

    Just out of curiosity why not use QFontMetrics? If you don't use the actual fonts, it is very difficult to estimate the actual size of label content.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Location
    Bangalore,Karnataka,India
    Posts
    8

    Re: Any possible way for Implementation of Ellipsis to the Label...

    Fuzz,
    Its due to the time consumption that QFontMetrics takes, (not for creating the code but when it works out) . So i was searching for the alternative.

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Any possible way for Implementation of Ellipsis to the Label...

    Either QFontMetrics.elidedText or count characters and pray.

    You could do a "smart" character count by making your own 256-entry table of relative character widths and adding them up, left to right, until you get to your cutoff point. Juggle the cutoff point, not the widths, for different font sizes, to simplify the code.

Similar Threads

  1. [beginner]-Label
    By jurekr in forum Symbian
    Replies: 4
    Last Post: 2007-11-15, 07:29
  2. Label is not found ?
    By pravesh99_sw in forum Symbian
    Replies: 1
    Last Post: 2006-01-23, 06:14
  3. dynamic label
    By white_dragon in forum Symbian
    Replies: 2
    Last Post: 2005-04-04, 13:36
  4. label
    By naibmys in forum Symbian
    Replies: 2
    Last Post: 2003-06-17, 01:57
  5. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×