Results 1 to 20 of 21

Thread: use custom mimedata between two windows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default use custom mimedata between two windows

    HI,
    I wanted to drag & drop custom mime data between two windows (basically 2 QTreeview's in the same application), But when I use this custom mimedata I am not able to drop any data (I could see + sign while dragging in 1st window & the moment I leave the 1st winnow the + sign is changing to ForbiddenCursor & I am not able to drop data in 2nd window)

    My classs:

    Qt Code:
    1. class MyMimedata : public QMimeData
    2. {
    3. Q_OBJECT
    4. public:
    5. MyMimedata () : QMimeData() { }
    6.  
    7. bool hasFormat(const QString &mimetype) const { return QMimeData::hasFormat(mimetype); }
    8. QStringList formats() const{ return QMimeData::formats(); }
    9. QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const { QMimeData::retrieveData(mimetype, preferredType); }
    10. };
    To copy to clipboard, switch view to plain text mode 

    I am not able to drag & drop above custome data type.
    When I use
    Qt Code:
    1. Q_DECLARE_METATYPE(MyMimedata );
    To copy to clipboard, switch view to plain text mode 
    I am getting compile time error: 'QMimeData::QMimeData(const QMimeData&)' is private

    What am I doing wrong here.... any hint ??
    Last edited by prasad_N; 4th March 2016 at 14:34. Reason: missing [code] tags
    Thanks :-)

Similar Threads

  1. Replies: 15
    Last Post: 18th February 2016, 09:19
  2. When does Mimedata() get called?
    By TEAmerc in forum Newbie
    Replies: 4
    Last Post: 13th October 2015, 15:58
  3. Replies: 3
    Last Post: 6th March 2014, 18:54
  4. Itemview D&D mimeData
    By chocolate in forum Qt Programming
    Replies: 6
    Last Post: 19th March 2009, 15:44
  5. Drag and Drop MimeData
    By Zephro in forum Qt Programming
    Replies: 10
    Last Post: 16th May 2006, 19:20

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.