drag-and-drop

How to tell where an item was dropped in qlistview?

那年仲夏 提交于 2019-12-24 09:11:09
问题 I have a custom QListView: from PyQt4.QtCore import * from PyQt4.QtGui import * from Diagnostics import Trace2 #writes to log file import traceback class ListOrderView(QListView): itemMoved = pyqtSignal(int, int, QStandardItem) # Old index, new index, item def __init__(self, parent=None): try: super(ListOrderView, self).__init__(parent) self.setAcceptDrops(True) self.setDragEnabled(True) self.setDragDropMode(QAbstractItemView.InternalMove) self.setDefaultDropAction(Qt.MoveAction) self

Prevent the default action. Working only in chrome

血红的双手。 提交于 2019-12-24 08:58:13
问题 Jquery: $(document).ready(function () { $('input[type=file]').uploadImage(); jQuery.event.props.push('dataTransfer'); $(".upload-cont").bind('dragenter', function (e) { $(".upload-cont").css("border", "1px dashed black;"); }); $(".upload-cont").bind('drop', function (e) { var files = e.dataTransfer.files; e.preventDefault(); }); $("body").bind('drop', function (e) { e.preventDefault(); }); }); In firefox 17,explorer 8 when dragging and dropping a file from desktop into browser the image will

Seeking jQuery demo of sort and reorder like iPhone icons

假装没事ソ 提交于 2019-12-24 08:15:44
问题 I'm trying to duplicate the drag and reorder action of the icons on the iPhone screen. I want to rearrange divs on a page basically. Like in flickr when you organize your images... you drag one and others make room for it. The gap where you removed it from closes up. I want to do the same thing with divs that contain data. I did find one page here that offers some insight... but their demo doesn't even work. So the search continues. I'm new at jQuery, but am getting there. If I could locate a

Drag and drop within PyQt5 TreeView?

拥有回忆 提交于 2019-12-24 07:57:55
问题 I'm trying to implement a file directory using PyQt5. I'd like to incorporate drag and drop functionality within this tree to support both internal and external files (i.e. if I had some files on my desktop I'd like to be able to drop them into a folder in my PyQt view). This is what I have currently: from PyQt5.QtWidgets import QTreeView,QFileSystemModel,QApplication, QMenu, QAbstractItemView from PyQt5.QtCore import * from PyQt5.QtGui import * from src import config class Tree(QTreeView):

Drag and drop within PyQt5 TreeView?

旧城冷巷雨未停 提交于 2019-12-24 07:57:18
问题 I'm trying to implement a file directory using PyQt5. I'd like to incorporate drag and drop functionality within this tree to support both internal and external files (i.e. if I had some files on my desktop I'd like to be able to drop them into a folder in my PyQt view). This is what I have currently: from PyQt5.QtWidgets import QTreeView,QFileSystemModel,QApplication, QMenu, QAbstractItemView from PyQt5.QtCore import * from PyQt5.QtGui import * from src import config class Tree(QTreeView):

Unusual dragging issue

£可爱£侵袭症+ 提交于 2019-12-24 07:36:10
问题 I've got a Picturebox, which the user can drag up or down. The program in question is a complex music staff editor for a piano, and thus the only way to achieve the moving of notes on a staff is with a number of if-statements and by modifying co-ordinates. The issue is that the user is unable to move the PictureBox component down, but when the object is dragged up, nothing happens. The class inherits from PictureBox. I would just like to emphasise that the PictureBox works when dragged

user control that other developers can add controls to it and “inherit” the behavior of all controls on my control

瘦欲@ 提交于 2019-12-24 07:34:48
问题 hi all and sorry for the confusing title... can't find the right words yet. just out of curiosity, I am playing with c# user control, I created a control that is built from a panel, a textbox that is being used as a filter, and some labels / buttons/ etc... that are being filtered. when ever you change the text of the textbox, all the controls on the panel are visible / invisible depending if their Text property contains the Text of the textbox. very simple. but I want this user control to be

Angular 7 - Add drag and drop behaviour to dynamically created components

≡放荡痞女 提交于 2019-12-24 07:28:28
问题 This is in continuation of the previous question I asked on SO: Add directives to component selector when it is declared - Angular 7 I am dynamically creating components on a button click. The components are displayed one below another in a list like manner. I want to introduce drag-drop behaviour so that the user can rearrange the components after creating them. In the previous question, I tried using Angular-Material, but realised it might not be possible to use it for components, due to

How to drag and drop an image from a Recycler view and place it outside of it into another layout

喜你入骨 提交于 2019-12-24 06:43:01
问题 I have a horizontal Recylcer view which holds a list of items. Each item has a text view and image view to represent the item (e.g an image of a square and the text "Square" above the image). The recylcer view is inside of it's own relative layout positioned at the top of the screen. What I need to do is drag an image from the recycler view and drop it outside of it into another layout that is below this one. However, the image that is dragged from the recycler view must not be removed, but

Drag and Drop to explorer causing invalid FORMATETC (DV_E_FORMATETC) error

我的梦境 提交于 2019-12-24 06:31:07
问题 I'm trying to use this excellent example to implement dropping virtual files into Windows Explorer. However, I'm stymied by this error. Towards the bottom, inside void System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium) on the first call to ((System.Runtime.InteropServices.ComTypes.IDataObject)this).GetDataHere(ref formatetc, ref medium); I'm getting back a DV