Results 1 to 3 of 3

Thread: Best way to display segregated map of a country

  1. #1
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Best way to display segregated map of a country

    Hi, I'm working on a project, where I need to have a scaleable map widget. Ultimately, I want to have a map of the United States, where individual preset regions or states can be highlighted. For example, I want my program to be able to highlight New England in the US with a red color.

    For the moment, I'm considering using several QLabels next to each other with their pixmap properties set, and then use painter composition to change the hue of the image (http://labs.trolltech.com/blogs/2008...r-composition/). Problems with this are:
    • When application is resized the map does not retain its aspect ratio. I've read that there are some properties like widthForHeight (or something like that) that can be implemented in QLabel's resizeEvent()
    • The borders of various regions would be rectangular. This could be solved by having transparent overlapping QLabels, but it might cause problems, especially when resizing the application.
    • It doesn't seem too adjustable or professional.


    I've looked around, but if anyone has any suggestions or perhaps there is some Model widget that's already made, please post here. Thanks in advance.

    ~codeslicer

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Best way to display segregated map of a country

    I would use a graphics view. Each item is a state. So you can simply use hover etc. to colour your states. Then put all items in a group and manage there "globally" the size and ratio of the whole shape. Seems to me the simplest solution.

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

    codeslicer (16th February 2010)

  4. #3
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Best way to display segregated map of a country

    Thanks, I'll try that once I get Qt for WinCE to compile...

Similar Threads

  1. Reg QWebview Display
    By Tavit in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2009, 15:19
  2. SVG Display
    By fca_neo in forum Newbie
    Replies: 0
    Last Post: 31st December 2008, 01:31
  3. How can I display XML in Qt??
    By highlightsong in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2008, 05:24
  4. How to display PDF in Qt?
    By stelio in forum Qt Programming
    Replies: 6
    Last Post: 19th May 2008, 09:44
  5. XML display in Qt
    By aamer4yu in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2007, 20:37

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.