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. Dropped contents is not getting placed into cells in qtablewidget
Forum Updated to NodeBB v4.3 + New Features

Dropped contents is not getting placed into cells in qtablewidget

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 614 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.
  • E Offline
    E Offline
    ecmanja
    wrote on last edited by
    #1

    hello ,
    i'm not getting how to place dropped contents in cells of tablewidget , here is my code . i'm getting dragged contents but the problem is in placing into cells :( please do help me to solve this problem.

    @void ProjectListWidget::dropEvent(QDropEvent *event)
    {
    qDebug()<<"drop event";
    ProjectListWidget *source =
    qobject_cast<ProjectListWidget *>(event->source());
    if (source && source != this) {
    QString str=event->mimeData()->text();
    qDebug()<<"str=="<<str;
    event->setDropAction(Qt::CopyAction);
    event->accept();
    }
    }@

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Basically you are not doing anything with the mime data so it won't appear in your list widget.

      Have a look at "this":http://qt-project.org/doc/qt-5.0/qtwidgets/model-view-programming.html#using-drag-and-drop-with-item-views for an explanation about the drag and drop and item views.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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