[Interest] Tree widget: rearrange elements
dom at dotzteam.com
Mon Aug 27 12:37:59 CEST 2012
Set the flag since that you have to do that only when creating the item
and I guess Qt internally it will check the flag anyway.
On 2012-08-27 12:33, Sensei wrote:
> On 8/27/12 10:59am, Tibold Kandrai wrote:
>> As I understood the task is this:
>> You want Qt to handle the drag and drop, but you want to control whether
>> you can or cannot drop the item.
>> For this you need to override one of the drag events not the drop event.
>> I think you need to use this:
>> http://doc.qt.nokia.com/4.7-snapshot/qtreeview.html#dragMoveEvent and
>> you have to accept or ignore the events here.
> While I was awaiting, I found a workaround, setting a flag:
> i->setFlags(i->flags() & (~Qt::ItemIsDropEnabled));
> Which one would you suggest? Creating an event filter, or setting item
> I'm at a crossroad...
> Interest mailing list
> Interest at qt-project.org
CEO @ Dotz Team
More information about the Interest