Results 1 to 2 of 2

Thread: Display special symbols

  1. #1
    Join Date
    Apr 2007
    Posts
    62
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Display special symbols

    Can someone show me how to display special symbols characters using QLabel? Especially the degree symbol?

    For example, I want to display latitude in terms of degree, minute, second like

    Latitude: 70* 34' 30"

    and replace the * with the actual degree symbol:

    70, 34, 30 are 3 different double values

    so in C++, it's kinda like:

    double degree, minute, second
    string = "Latitude: " + degree + "*" + minute + "'" + second """;
    cout << string;

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display special symbols

    You can do this via QLabel::setText( QString ).
    QString can be built from an Unicode array with QString::fromUtf16. All you need to do is pass the 2-byte Unicode character code of the character you want displayed. For °, you have 0x00b0.

    Regards

  3. The following user says thank you to marcel for this useful post:

    ShaChris23 (1st May 2007)

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Replies: 8
    Last Post: 18th March 2011, 11:27
  3. Display and divide the image
    By kiransu123 in forum Qt Programming
    Replies: 19
    Last Post: 5th March 2007, 20:40
  4. Simple display of an image
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 15th January 2007, 23:49
  5. Modifying the Display on Device
    By mahe2310 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 13th April 2006, 04:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.