Results 1 to 3 of 3

Thread: how to drag a file to github ?

  1. #1
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default how to drag a file to github ?

    I was created a app ui, a file or program, represented by an icon,

    I want draging a icon to github, and then the file upload to github
    my drag code like this

    Qt Code:
    1. QMimeData* mimeData = new QMimeData;
    2. QList<QUrl> urls;
    3. foreach (DesktopItemPointer pCheckedItem, m_checkedDesktopItems) {
    4. urls.append(pCheckedItem->getRawUrl());
    5. }
    6.  
    7. mimeData->setUrls(urls);
    8.  
    9. if (m_checkedDesktopItems.length() > 0){
    10. QPixmap dragPixmap = getCheckedPixmap();
    11. QDrag* pDrag = new QDrag(this);
    12. pDrag->setMimeData(mimeData);
    13. pDrag->setPixmap(dragPixmap);
    14. QRect borderRect = getCheckedBorderRect();
    15. pDrag->setHotSpot(QPoint(-borderRect.x() + QCursor::pos().x(), -borderRect.y() + QCursor::pos().y() ));
    16. Qt::DropAction action = pDrag->exec(Qt::MoveAction | Qt::CopyAction, Qt::CopyAction);
    To copy to clipboard, switch view to plain text mode 
    code on github: https://github.com/linuxdeepin/dde-d...frame.cpp#L514

    but the file can't upload, I suspect that the problem is with mimedata ...

    github support drag file to upload

    "File uploading is now available
    You can now drag and drop files into your repositories. "
    learn more https://help.github.com/articles/add...-a-repository/

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to drag a file to github ?

    What does "drag to github" mean?

    Dragging into a special Github client app?
    Dragging into a browser?
    Dragging into a Git UI that works on a clone of a github repository?

    Cheers,
    _

  3. #3
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default Re: how to drag a file to github ?

    can't Draging into a google chrome browser

    firefox is ok
    Last edited by tsuibin; 24th February 2016 at 02:41.

Similar Threads

  1. Replies: 3
    Last Post: 25th May 2013, 23:27
  2. Replies: 3
    Last Post: 2nd December 2012, 15:10
  3. Drag and Drop file into Qt Quick window
    By marwooj in forum Qt Quick
    Replies: 0
    Last Post: 23rd June 2011, 05:04
  4. Drag and Drop QTableWidget in UI file.
    By tpf80 in forum Qt Programming
    Replies: 3
    Last Post: 21st January 2009, 00:02
  5. Drag & Drop: delayed file delivery (Win & Mac)
    By Conel in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2007, 17:01

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.