Results 1 to 3 of 3

Thread: Display time in 12hr format using QLcdNumber

  1. #1
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Display time in 12hr format using QLcdNumber

    Hi Everyone,

    Currently I am using QLcdNumber class to display time in 24hrs format. It works really great. But when I want to display time in 12hrs format I am facing issue because QLcdNumber is not able to display 'M' letter. For ex-
    Time in 24 hrs format- 15:05
    Time in 12 hrs format- 03:05 PM
    For 12 hrs format the letters AM and PM should also be displayed but QLcdNumber is not able to display the letter 'M'. I would be really glad if someone would help me out with it.

    -sattu

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display time in 12hr format using QLcdNumber

    From QLCDNumber doc : These digits and other symbols can be shown: 0/O, 1, 2, 3, 4, 5/S, 6, 7, 8, 9/g, minus, decimal point, A, B, C, D, E, F, h, H, L, o, P, r, u, U, Y, colon, degree sign (which is specified as single quote in the string) and space. QLCDNumber substitutes spaces for illegal characters.. Did You see M letter in legal characters ?

  3. #3
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Display time in 12hr format using QLcdNumber

    Quote Originally Posted by Lesiok View Post
    From QLCDNumber doc : These digits and other symbols can be shown: 0/O, 1, 2, 3, 4, 5/S, 6, 7, 8, 9/g, minus, decimal point, A, B, C, D, E, F, h, H, L, o, P, r, u, U, Y, colon, degree sign (which is specified as single quote in the string) and space. QLCDNumber substitutes spaces for illegal characters.. Did You see M letter in legal characters ?
    That means it's not possible to display time in 12hrs format using QLcdNumber, right? Then I guess instead of a Digital Clock i will have to try using some normal Label for displaying the time in digital format.

Similar Threads

  1. How to use QLCDnumber to display negative numbers?
    By grissiom in forum Qt Programming
    Replies: 1
    Last Post: 19th March 2010, 07:23
  2. Replies: 1
    Last Post: 15th April 2009, 10:00
  3. QLCDNumber display
    By jhearon in forum Qt Programming
    Replies: 0
    Last Post: 27th October 2008, 00:53
  4. Date and Time format.
    By kaushal_gaurav in forum Qt Programming
    Replies: 3
    Last Post: 12th August 2008, 12:36
  5. Need to make QLCDNumber display count up/down
    By JimDaniel in forum Newbie
    Replies: 2
    Last Post: 29th September 2007, 02:59

Tags for this Thread

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.