[Interest] drag and drop disappear the item for windows, in Linux it fine

Sujan Dasmahapatra sdh at lmwindpower.com
Thu Jan 19 07:42:47 CET 2012


Dear Friends

In my application I have implemented drag and drop on the treewidget
items. In linux its working fine but in windows I see when dragging and
dropping an item in the treewidget list, then from where the item is
dragged there's items name is disappearing but its child items are
present. And the item become inactive. Its working fine in Linux but in
windows I am facing this problem. Please give me some suggestions. Check
my drag and drop event.

 

[code]

void TreeWidget::dragMoveEvent(QDragMoveEvent * event)

{

        event->acceptProposedAction();

}

void TreeWidget::dragEnterEvent(QDragEnterEvent * event )

{

        Preprocessor = true;

        draggingItem = currentItem();

        event->acceptProposedAction();

        oldindex = indexOfTopLevelItem(currentItem());

}

void TreeWidget::dropEvent(QDropEvent * event )

{

        dropingOn = this->itemAt(event->pos());

        if(!dropingOn)

        return;

        if(dropingOn->parent())

        return;

        int dropingIndex = this->indexOfTopLevelItem(dropingOn);

        this->takeTopLevelItem(this->indexOfTopLevelItem(draggingItem));

        index = this->indexOfTopLevelItem(dropingOn);

        if(index < dropingIndex) index++;

        this->insertTopLevelItem(index, draggingItem);

}

[/code]

 

 

Kind regards,

 

 

Sujan Dasmahapatra
Project Leader, Aero Group
CE - Aero Group

Tel    +91 80 66470248
Mob  

sdh at lmwindpower.com <mailto:%25EMAIL%25> 

 

LM Wind Power Blades

lmwindpower.com

 

Together we capture the wind to power a cleaner world

________________________________

 

This e-mail and any attachments are confidential. If you are not the
named or intended recipient, please notify the sender immediately and do
not disclose the contents to any other person, use it for any purpose,
or store or copy the information in any medium. Any unauthorized
disclosure, use or storage is prohibited and might be unlawful.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120119/c34fce9b/attachment.html>


More information about the Interest mailing list