Results 1 to 12 of 12

Thread: Very disappointed with drag-and-drop :(

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy Very disappointed with drag-and-drop :(

    I am searching around 3 days now on how to do a drag-and-drop action in a listwidget, which should just take the name (full path), and, depending on the extension, do some action (e.g. if it is .png add to listwidget, if it is .txt, read the content etc)
    I found some full examples but very misleading... I don't know... If anybody could send me back the attachment but working, please, i am so tired of this...?
    Attached Files Attached Files
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  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: Very disappointed with drag-and-drop :(

    How did you subclass QListWidget?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: Very disappointed with drag-and-drop :(

    How do I do this?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Very disappointed with drag-and-drop :(

    I see no functionality for drag and drop in your code, so basically what you are asking for is a full implementation, which is not going to happen.

  5. The following user says thank you to squidge for this useful post:

    hakermania (29th January 2011)

  6. #5
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Very disappointed with drag-and-drop :(

    Thanks for the replies.... If you knew what searching i've done till now you won't tell this... Anyway, I expected it.
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  7. #6
    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: Very disappointed with drag-and-drop :(

    Quote Originally Posted by hakermania View Post
    How do I do this?
    So... you don't know what subclassing is? So what exactly have you tried so far?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    hakermania (29th January 2011)

  9. #7
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Very disappointed with drag-and-drop :(

    That's is as far as I managed to go,... The lineedit does work, but (in my OS) with file:/// in frond of the name, but listwudget doesn't work at all....
    Attached Files Attached Files
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  10. #8
    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: Very disappointed with drag-and-drop :(

    Where did you copy this from?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. The following user says thank you to wysota for this useful post:

    hakermania (29th January 2011)

  12. #9
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Very disappointed with drag-and-drop :(

    I didn't copy anything actually. I had a very strange (at least, in my opinion) example, an tried to make a program that works similar to he example but with code understandable to me..... And that's the result...
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  13. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Very disappointed with drag-and-drop :(

    file:/// is a (almost-valid) uri, which is what you state you accept, so I would expect that. If you wrote the code and understood how it worked, you would expect that also.

  14. #11
    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: Very disappointed with drag-and-drop :(

    So what was the example? You didn't even enable drops for your listwidget...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #12
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Very disappointed with drag-and-drop :(

    tried to make a program that works similar to he example but with code understandable to me....
    You need to do few things:
    1) know how to subclass a widget
    2) read the "Drag and Drop" documentation section
    3) reimplement some protected methods of QWidget and enable drops in order to handle expected drop events
    Don't copy-paste the code. Maybe the program will work, but you'll dont know why. And that's even worse than having the code that does not work.

  16. The following user says thank you to stampede for this useful post:

    hakermania (30th January 2011)

Similar Threads

  1. Replies: 2
    Last Post: 13th October 2010, 21:51
  2. Replies: 3
    Last Post: 10th June 2010, 15:13
  3. Replies: 0
    Last Post: 4th May 2010, 10:24
  4. Drag and Drop
    By chris_helloworld in forum Qt Programming
    Replies: 2
    Last Post: 31st March 2010, 09:03
  5. drag and drop
    By mickey in forum Qt Programming
    Replies: 5
    Last Post: 27th May 2006, 03:05

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.