Results 1 to 5 of 5

Thread: QListWidget Dragging Problem after scrolling down the list

  1. #1
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy QListWidget Dragging Problem after scrolling down the list

    I am creating A Sortable List in Qt. The Code works perfectly well for Downward Scroll but when i having some issues getting the draggable item after i scroll the list down. I have added some test case screenshot for better understanding







    Well this is the test case code

    Qt Code:
    1. ui->listWidget->addItem("SongOne");
    2. ui->listWidget->addItem("SongTwo");
    3. ui->listWidget->addItem("SongThree");
    4. ui->listWidget->addItem("SongFour");
    5. ui->listWidget->addItem("SongFive");
    6. ui->listWidget->setDragDropMode(QAbstractItemView::InternalMove);
    7. ui->listWidget->setDragEnabled(true);
    8. ui->listWidget->setAcceptDrops(true);
    9. ui->listWidget->setDropIndicatorShown(true);
    10. ui->listWidget->viewport()->setAcceptDrops(true);
    11. ui->listWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    To copy to clipboard, switch view to plain text mode 


    Thankz for taking the time in reading my post. Do help me if you have any hint on what i am missing out.I think i am missing setting some property. In the main Program(not the test code), i tried rewriting the `dragMoveEvent` and few more method, but no use.
    Attached Images Attached Images

  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: QListWidget Dragging Problem after scrolling down the list

    Can you reproduce the problem with the following example?

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv) {
    4. QApplication app(argc, argv);
    5. QListWidget *listWidget = new QListWidget;
    6. for(int i=0;i<100;++i){
    7. listWidget->addItem("SongOne");
    8. listWidget->addItem("SongTwo");
    9. listWidget->addItem("SongThree");
    10. listWidget->addItem("SongFour");
    11. listWidget->addItem("SongFive");
    12. }
    13. listWidget->setDragDropMode(QAbstractItemView::InternalMove);
    14. listWidget->setDragEnabled(true);
    15. listWidget->setAcceptDrops(true);
    16. listWidget->setDropIndicatorShown(true);
    17. listWidget->viewport()->setAcceptDrops(true);
    18. listWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    19. listWidget->show();
    20. app.exec();
    21. delete listWidget;
    22. return 0;
    23. }
    To copy to clipboard, switch view to plain text mode 
    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.


  3. #3
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget Dragging Problem after scrolling down the list

    Thankz.Yes its the same and also i will update the question with your code..

  4. #4
    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: QListWidget Dragging Problem after scrolling down the list

    I cannot reproduce the bug with the above code. I'm using Qt 4.8 on x64 Linux.
    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.


  5. #5
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: QListWidget Dragging Problem after scrolling down the list

    HI wysota,

    I am using the same conf.(Qt 4.8 on x64 Linux - Ubuntu). i have no clue why this is having.i mean the top ones works perfectly well but when you scroll down to the bottom and try to drag them to the top the bug comes into picture.

    I also checked it on my colleague's PC. I am getting the same Bug.

    Do i have to do some settings for this?
    Last edited by learningqt; 8th October 2012 at 09:39.

Similar Threads

  1. Round Scrolling of List Items in QListWidget
    By vivek.panchal in forum Qt Programming
    Replies: 2
    Last Post: 29th August 2016, 10:52
  2. Dragging text/uri-list: Qt inserts garbage
    By drhex in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2011, 21:45
  3. Replies: 4
    Last Post: 10th May 2010, 23:12
  4. Kinetic scrolling in QListWidget
    By jimiq in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2009, 10:43
  5. Replies: 11
    Last Post: 4th July 2006, 16:09

Tags for this Thread

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.