Results 1 to 2 of 2

Thread: Problem with Treewidget

  1. #1
    Join Date
    May 2009
    Posts
    129

    Default Problem with Treewidget

    Hi All

    Already i have posted this query in forum ..

    My problem is TreeWidget Drag and drop..

    I have seen in forum ,some one faced same issue ,what i am facing

    How do i write the DropEvent function for accepting drops only TopLevelIems

    My code look like
    Qt Code:
    1. ui->treeWidget->setDragEnabled(true);
    2. ui->treeWidget->setAcceptDrops(true);
    3. ui->treeWidget->setDragDropMode(QAbstractItemView ::InternalMove);
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. void MainWindow::dragEnterEvent(QDragEnterEvent *eve)
    2. {
    3. qDebug() << "Drag enter event";
    4.  
    5. eve->accept();
    6.  
    7. }
    8. void MainWindow::dragMoveEvent(QDragMoveEvent *e)
    9. {
    10. qDebug() << "Drag move event";
    11. e->accept();
    12. }
    13. void MainWindow::dropEvent(QDropEvent *event)
    14. {
    15.  
    16. // QMessageBox::information(0,"",QString("Drop event"));
    17. qDebug() << "Drop function called";
    18.  
    19. }
    To copy to clipboard, switch view to plain text mode 

    Please help to sort out this problem


    Advance thanks for your helping


    Thanks

    Yuvaraj R

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with Treewidget

    Quote Originally Posted by addu View Post
    Already i have posted this query in forum ..
    Why are you opening a new thread about it then? Continue the old one instead.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Very strange socket programming problem
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2008, 12:05
  2. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  3. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.