[Qt-interest] drag n drop problem QTreeWidget

Sujan Dasmahapatra sdh at lmwindpower.com
Mon Mar 21 09:01:42 CET 2011


Dear Friends 

I am implementing drag and drop for treeWidget. I am able to do it. But
as I implement mousePressEvent() I am not able to expand  or select
items from the treeview as I have childitems for every toplevelitem.

Whats going wrong in this. Please tell me someone.

 

 

QTreeWidgetItem  * draggingItem  = new  QTreeWidgetItem(this);

 

void Tree::mousePressEvent(QMouseEvent *event)

{

       if(event->button()==Qt::LeftButton)

       {

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

       QDrag *drag = new QDrag(this);

       drag->exec(Qt::MoveAction | Qt::CopyAction, Qt::CopyAction);

       event->accept();

       }

}

 

////////////////////////////////////////////////////////////////////////
////

Thanks sujan

 

Kind Regards,

 

 

Sujan Dasmahapatra
Project Leader, Aero Group
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/qt-interest-old/attachments/20110321/da20be97/attachment.html 


More information about the Qt-interest-old mailing list