Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Drop event on tab widget
Forum Updated to NodeBB v4.3 + New Features

Drop event on tab widget

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 785 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aswal
    wrote on last edited by
    #1

    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)
    {
    QWidget
    widget=new QWidget;
    widget->setAcceptDrops(true);

    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?

    Thanks.
    aswal

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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved