Results 1 to 2 of 2

Thread: QCurrencyWidget -- Help!

  1. #1
    Join Date
    Jun 2007
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QCurrencyWidget -- Help!

    Hey, i am trying to make a simple Currency control derived from QLineEdit. The Control should have a $ in start and . at some place in that line edit. The . should remain there only and not move. Say for example a line edit will contain something like "$ . " i.e $ some space then dot and then two spaces. When a user enters a text he can enter 11 press . and then say 11 so we have in a line edit "$11 .11" . Now as soon as user should enter the last digit or say leave the control (in case he only enters first 1st two digits and leaves) the text would change to $-----11.11. Can someone give me idea how to achieve it?

    Also i used input mask as $000009.00 but when you enter something . keeps moving... to right.

    Kindly help me with some sample code...!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCurrencyWidget -- Help!

    Quote Originally Posted by Preeteesh View Post
    when you enter something . keeps moving... to right.
    That's because you use proportional font, switch to fixed width one, like Courier New, and the dot won't move.

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.