Results 1 to 9 of 9

Thread: C++ code

  1. #1
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default C++ code

    hey there i have this implementation of Dijkstra's algorithm from a friend and i was wondering if it is possible to convert this or implement this using Qt so that i can use it as part of my current application?? i have attached the files...
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: C++ code

    You can use any C++ code with QT. You can use your data-structures and algorithm as they are. All you probably want is a way to input the adjacency list and a way to output the result. You can do that with QT. For the input you could use a QTable, for example. If you want to show the images, you can do that with QLabel. Large textual results could go in a QTextBrowser.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  3. #3
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: C++ code

    Quote Originally Posted by therealjag
    hey there i have this implementation of Dijkstra's algorithm from a friend and i was wondering if it is possible to convert this or implement this using Qt so that i can use it as part of my current application?? i have attached the files...
    What does that algorithm do? Never heard of it
    Current Qt projects : QCodeEdit, RotiDeCode

  4. #4
    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: C++ code

    Quote Originally Posted by fullmetalcoder
    What does that algorithm do? Never heard of it
    It's one of the most famous algorithms. Every programmer should know it.

    http://en.wikipedia.org/wiki/Dijkstra's_algorithm

  5. #5
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: C++ code

    is there a way to use this code with QtPainter??

  6. #6
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: C++ code

    I don't think that class is what you need.

    Anyway, could you explain your problem more clearly?
    Last edited by Michiel; 14th March 2006 at 16:51.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  7. #7
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: C++ code

    Quote Originally Posted by jacek
    It's one of the most famous algorithms. Every programmer should know it.

    http://en.wikipedia.org/wiki/Dijkstra's_algorithm
    I heard about it but didn't know what it was.

    To me, it looks like a Linear Algebra max-min problem that can be solved by using maxtrix transformations.

  8. #8
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: C++ code

    I don't think that class is what you need.

    Anyway, could you explain your problem more clearly?
    i am bascailly trying to implement Dijkstra's shortest path algorithm using Qt. I know i will need a graph which is why i was thinking of using QPainter to do it. but im not sure how to go about it doing it that way because i have been trying for the past month. is using matrix transformations the best way to do it? i dont even know what they are?!

  9. #9
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: C++ code

    Oooh. You want to show the shortest path dynamically on a graph! I can't help you with that. But now that your problem is clearly defined, maybe someone else can.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

Similar Threads

  1. copyright and gpl
    By janus in forum General Discussion
    Replies: 8
    Last Post: 21st October 2008, 01:13
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

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.