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. when i am trying to move table widget item its shaking all item??
Forum Update on Monday, May 27th 2025

when i am trying to move table widget item its shaking all item??

Scheduled Pinned Locked Moved Unsolved General and Desktop
drag and dropqtablewidget
2 Posts 2 Posters 329 Views
  • 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.
  • Himanshu chardeH Offline
    Himanshu chardeH Offline
    Himanshu charde
    wrote on last edited by Himanshu charde
    #1

    void DSTableWidget::dragMoveEvent(QDragMoveEvent *event)
    {

    int newRow = this->indexAt(event->pos()).row();
    qDebug(PriorityP1()) << "Hey its moving on row = " << newRow;
    this->setCurrentCell(newRow, 1);
    event->acceptProposedAction();
    int min_slider_pos = this->verticalScrollBar()->minimum();
    qDebug()<<"min_slider_pos=="<<min_slider_pos<<this->verticalScrollBar()->sliderPosition();
    bool move_slider_to_up = false;
    if(this->verticalScrollBar()->sliderPosition() == min_slider_pos)
    {
        move_slider_to_up = true;
    }
    if(move_slider_to_up)
    {
        qDebug()<<"Moving up";
        this->verticalScrollBar()->setSliderPosition(this->verticalScrollBar()->maximum());
    }
    else
    {
        qDebug()<<"Moving down";
        this->verticalScrollBar()->setSliderPosition(this->verticalScrollBar()->minimum());
    }
    

    }

    previously i make use of following lines to make table widget item shipment using drag event but it is shaking in both the cases i used.

    this->verticalScrollBar()->setSliderPosition(this->verticalScrollBar()->minimum());
    this->verticalScrollBar()->setSliderPosition(this->verticalScrollBar()->maximum());

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

      Hi,

      Can you explain what exactly you are trying to achieve ?

      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