Results 1 to 3 of 3

Thread: Changing QDrag's pixmap

  1. #1
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Changing QDrag's pixmap

    Hi,
    though drag and drop from treeview to QGraphicsScene is working appropriately in my app, I thought of implementing a feature as described below.
    What I want to do is change the pixmap of drag object to that of item (Eg. Resistor's pixmap) when the drag enters QGraphicsScene\QGraphicsView.
    Is this possible ? If so, can somebody guide me on how can I achieve this ?

    Also I would like the item to be added to scene when it is selected in treeview (just by clicking) and then just moving mouse without any button pressed and finally place it at right spot when clicked once more in view. Can this be done using drag and drop mechanism ?
    Or is there any better way to do this ?

  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Changing QDrag's pixmap

    Don't think you can. I may be wrong, but AFAIK, you can only assign a pixmap when starting the drag.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  3. #3
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Changing QDrag's pixmap

    Thanks for the reply Bitto. Now I set the required drag pixmap while initiating drag in treeview itself.
    I have one doubt now.
    The QDrag's icon or pixmap changes when some widget is able to accept it, like + sign if it accepts. Where is this controlled ? (Just curious ..)

Similar Threads

  1. load pixmap from another host
    By raphaelf in forum Newbie
    Replies: 16
    Last Post: 31st August 2006, 22:58
  2. multi pixmap transparency
    By bluesguy82 in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2006, 22:13
  3. Invalid pixmap
    By munna in forum Newbie
    Replies: 2
    Last Post: 8th June 2006, 08:00
  4. Paint XP radio button to pixmap
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2006, 21:15
  5. Changing pixmap in PixmapLabel
    By bullerwj in forum Qt Tools
    Replies: 1
    Last Post: 11th April 2006, 22:28

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.