Results 1 to 5 of 5

Thread: Drag&Drop problem

  1. #1
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1

    Default Drag&Drop problem

    Hi,

    i want make a simple "simulator logic circuits" with only AND, OR, NOT gate (C++/QT).

    For make the circuit i use Drag&Drop, i begin the project editing this example ( http://doc.trolltech.com/4.4/dragand...ableicons.html ).

    Now my problems are:

    - how can i delete the images?

    - And i need to link the image with a line. I thought to drag the gate and drop over another gate and make the line with the images coordinates ...but i dont know how i can do that.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Drag&Drop problem

    Quote Originally Posted by m1k3l3 View Post
    i want make a simple "simulator logic circuits" with only AND, OR, NOT gate (C++/QT).
    Sounds like a perfect candidate for yet another graphics view based application.

    For make the circuit i use Drag&Drop, i begin the project editing this example ( http://doc.trolltech.com/4.4/dragand...ableicons.html ).
    That application was written to demonstrate DnD functionality in a simple way. I'm not convinced it is flexible enough for your purposes.

    - how can i delete the images?
    From user's point of view, how do you want to delete them?

    - And i need to link the image with a line. I thought to drag the gate and drop over another gate and make the line with the images coordinates ...but i dont know how i can do that.
    If you really insist doing it the hard way, store a list of labels in the parent (or find them dynamically at run-time) and paint lines between labels' positions.
    J-P Nurmi

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

    m1k3l3 (24th September 2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1

    Default Re: Drag&Drop problem

    Quote Originally Posted by jpn View Post
    Sounds like a perfect candidate for yet another graphics view based application.
    I look graphics view and it is cool...but i like the simple way...if that way is possible

    Quote Originally Posted by jpn View Post
    That application was written to demonstrate DnD functionality in a simple way. I'm not convinced it is flexible enough for your purposes.
    That it's very bad for me...
    i editing this code:
    Now I have two Horizontal Layer:
    on the left Menu (AND, OR, NOT gate)
    and on the right Drawing Area where is possible to create a copy of the Menu gates with Drag&Drop.
    When i create a copy, insert a pointer of gate in a list, and that allow me to store the gates in memory. In future i will store the links between the gates.
    It's wrong idea?

    Quote Originally Posted by jpn View Post
    From user's point of view, how do you want to delete them?
    I don't know now, but in the simple way not for user but for me! What do you suggest for this problem?

    Quote Originally Posted by jpn View Post
    If you really insist doing it the hard way, store a list of labels in the parent (or find them dynamically at run-time) and paint lines between labels' positions.
    I dont insist, but don't know another method to link the layer. What do you suggest for this problem?

  5. #4
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1

    Default Re: Drag&Drop problem

    Nobody can help me?

  6. #5
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Drag&Drop problem

    imo QGraphicsView is the simple way.
    The time you need to get up to speed with it is well invested. Do yourself a favour and give it a try. (There are also lots of examples for QGraphicsView in the Qt docs.)

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  4. Problem with drag&drop in qlistview
    By mambo in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2006, 16:14
  5. Replies: 16
    Last Post: 7th March 2006, 15: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.