Results 1 to 8 of 8

Thread: LookUp table Implementation in Qt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    17
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: LookUp table Implementation in Qt

    It's not that hard really. First you populate the lookup table with all keys and values. Then if you want to use it you just ask for the key of a specific value.
    Qt Code:
    1. QMap<QString, QString> lookupTable;
    2.  
    3. // Populate lookup table
    4. lookupTable.insert("-40", "289");
    5. lookupTable.insert("-39", "292");
    6. lookupTable.insert("-38", "294");
    7. lookupTable.insert("-37", "296");
    8. lookupTable.insert("-36", "299");
    9. lookupTable.insert("-35", "301");
    10. // ... And so on
    11.  
    12. // Use it
    13. temperaturedata.append(lookupTable.value(str));
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Stef for this useful post:

    rex (9th February 2011)

Similar Threads

  1. Image resource lookup in OS X
    By stipa in forum Qt Quick
    Replies: 1
    Last Post: 1st December 2010, 08:11
  2. symbol lookup error
    By knishaq in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 15:22
  3. QT-Embedded Symbol Lookup Error
    By augusbas in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 23rd June 2009, 05:01
  4. Dynamic lookup problem
    By jwintz in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2006, 14:19
  5. lookup table
    By georgie in forum General Programming
    Replies: 6
    Last Post: 12th May 2006, 09:57

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
  •  
Qt is a trademark of The Qt Company.