Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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());


  • Lifetime Qt Champion

    Hi,

    Can you explain what exactly you are trying to achieve ?