QTreeView custom dropEvent

  • Hello,

    I have a custom QTreeView with this dropEvent:

    if (event->mimeData()->hasFormat(KeyFolder::mimeType()))
        if (event->keyboardModifiers() & Qt::ControlModifier)

    I am able to move entries into each other but I can not reorder them as i want when they have same parent. How can I reorder items that has same parent? If dropping an item to its parent moves it to the end, it will work for me.

    Thank you

  • Lifetime Qt Champion


    Aren't you looking for the InternalMove drop action ?

  • Sir, since I'm not professional, can you please share me code to use?
    Thank you

  • Lifetime Qt Champion

Log in to reply