Results 1 to 2 of 2

Thread: Icon Change in Drag & Drop

  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Unhappy Icon Change in Drag & Drop

    Dear all,

    Qt version : Qt 3.3.4
    Problem : Drag & Drop Event handling

    I have a class " MyToolButton " inherited from QToolButton.
    I have created 4 puttons like this and placed this 4 buttons in a QMainWindow's ToolBar ( MyToolBar ---> QToolBar ).

    I need to drag the 1 button to a canvas, via the surface of other 3 tool buttons.
    While draging a button like this ( via on surface of other 3 Tool Buttons ) i need to change the icon (which is attached to POINTER/ARROW_CURSOR ) to a Circle_And_Slash_Icon ( overridden cursor ).


    I have used the " setAcceptDrops( true ) " in " MyToolButton " - Class , then tried to handle the dragEventHandles likes : mousePressEvent(), dragEnterEvent(), dragMoveEvent(), dragDropEvent()...But its not is not serving my purpose. as all the 4 buttons belogs to same class.



    My problem is only in these 4 buttons. Please help me if you have any idea or correct me if have coded in a wrong way.

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Icon Change in Drag & Drop

    How did you implement dragEnterEvent and dragMoveEvent?

Similar Threads

  1. Drag & drop with model/view (Qt4)
    By yogeshm02 in forum Qt Programming
    Replies: 16
    Last Post: 19th September 2011, 20:36
  2. Replies: 7
    Last Post: 8th September 2006, 16:19
  3. Drag and drop outside the application
    By jpn in forum Newbie
    Replies: 7
    Last Post: 27th August 2006, 15:37
  4. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41
  5. Replies: 5
    Last Post: 23rd May 2006, 11:40

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.