Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:21:39+00:00 2026-06-13T04:21:39+00:00

Please help me out to solve this…. I have a QListView on the Left

  • 0

Please help me out to solve this…. I have a QListView on the Left side and a QWidget on the other side. In QListView i had added few items using QStandardItem. Now i want to Drag and Drop the QListView Items to the other side QWidget and i have to do the same with the QWidget also. I can drag and drop my QListView Items inside the QListView itself by using

listView.setAcceptDrops(true);
listView.setDragEnabled(true);
listView.setDragDropMode(QAbstractItemView::InternalMove); 

this is working fine inside the QListView alone. I want to Drag and Drop the QListView Items to the other Widget. How can i do this? I know that i have to handle the Events like

void dropEvent(QDropEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dragEnterEvent(QDragEnterEvent *);
void mousePressEvent(QMouseEvent *);

i just tried it like this

void Example::dragMoveEvent(QDragMoveEvent *e)
{
    // The event needs to be accepted here
    e->accept();
}

void Example::dragEnterEvent(QDragEnterEvent *e)
{
    // Set the drop action to be the proposed action.
    e->acceptProposedAction();
}

void Example::dropEvent(QDropEvent *e)
{
    qDebug("Items Dropped");
}

As i just tried with some qDebug() , this is Working when i drag an Item from my QListView and Drop it in the QWidget and am getting the output as “Items Dropped”. But i dont know how to bring my exact QListView‘s Items here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:21:40+00:00Added an answer on June 13, 2026 at 4:21 am

    You don’t have to subclass the view. All the drag and drop stuff is handled by the model, hence you have to subclass your standard model. You may want to take a look on the model subclassing reference. Of course you also have to change the drag-and-drop mode of your view to QAbstractItemView::DragDrop to get external drag and drop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help me out on this explode() function issue. I am getting unexpected results
Please help me out here because im getting kind of confused.. I have a
Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
This is a simple one! yet, I am missing something. Please help me out.
I have an issue of Facebook offline access-token please help me out how to
I have a sub-string: substring = please help me out I have another string:
Again I am in a serious problem .. please help me out. I have
please Help to solve this problem RewriteEngine On ErrorDocument 400 /tmp/error/404.html ErrorDocument 401 /404.html
Please help me out with an algorithm for the following problem - Given a
Could you please help me out to find the correct deceleration rate for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.