[Qt-interest] QTReeWidget Drag and Drop
Sujan Dasmahapatra
sdh at lmwindpower.com
Fri Mar 18 13:13:51 CET 2011
Hi Sarvesh Thanks for the helping documents. I am looking into it .
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.
From: qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com
[mailto:qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com] On Behalf
Of sarvesh saran
Sent: Friday, March 18, 2011 3:57 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QTReeWidget Drag and Drop
Hi Sujan,
you can get some pointers on how to begin here:
http://doc.qt.nokia.com/latest/model-view-programming.html#using-drag-an
d-drop-with-item-views
and an example can be seen here:
http://sector.ynet.sk/qt4-tutorial/dnd.html
hope this helps!
-Sarvesh
On Fri, Mar 18, 2011 at 3:08 PM, Sujan Dasmahapatra
<sdh at lmwindpower.com> wrote:
Dear Friends
I am trying to implement drag and drop for QTreeWidgetItem.I have some
toplevelitems and some of them have children items. I want to implement
hte drag and drop functionality for the toplevel items, when an item if
dragged and dropped the toplevele items and its children items all
should occupy the new place. Somekind of reordering I want to achieve.
Please give me some guidelines.
I am curreny trying to implement startDrag() but its crashing.
void Tree::startDrag(Qt::DropActions supportedActions)
{
QDrag *drag = new QDrag(this);
QMimeData *data = new QMimeData;
data->setText(currentItem()->text(0));
drag->setMimeData(data);
drag->exec(supportedActions, Qt::MoveAction);
}
Thanks in advance
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.
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110318/4d14d175/attachment.html
More information about the Qt-interest-old
mailing list