Important: Please read the Qt Code of Conduct -

Drop event on tab widget

  • Hi Team

    I am working on a -QT- Qt component for tab widget and could add new tabs using it. What I want:

    I create 1 tab widget via dragging my tab plugin on main-window in Qt creator.

    I drag one more instance of tab plugin over on tab created in above step. I can do it.

    I have overridden eventfilter in my tab plugin as shown below and tried overriding Drop event with no success.

    bool QTab::eventFilter(QObject *obj, QEvent ev)
    widget=new QWidget;

    if(((ev->type() == QEvent::DragEnter) || (ev->type() == QEvent::Drop) || (ev->type() == QEvent::DragMove) )
    //some action on drop event

    return false;


    Please let me know how to check if drop event occur on tab widget?


    Edit: fixed message layout. Please at least use @ tags around code sections; Andre

  • Why are you creating a new QWidget in your eventFilter? Note that this gets called a lot. So, you are just creating loads of widget objects, and then leaking them.

Log in to reply