PDA

View Full Version : how to scroll tablewidget from outside placed scrollbar



chemstar
31st May 2006, 19:11
hi,

i have to use an external scrollbar to scroll my tablewidgets.
i#m catching the valueChanged(int) signal from scrollbars and use it to set the new position of the table scrollbar. but this works only partially. i have 24 rows and it is only scrolling the visible area.
doews anyone know why?

wysota
31st May 2006, 20:46
Can we see the code?

chemstar
1st June 2006, 11:44
connect(verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollVerticaly(int)));
connect(horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollHorizontaly(int)));

void CMatrixWidget::scrollVerticaly(int value)
{
table3->verticalScrollBar()->setSliderPosition(value);
table1->verticalScrollBar()->setSliderPosition(value);
}

void CMatrixWidget::scrollHorizontaly(int value)
{
table2->horizontalScrollBar()->setSliderPosition(value);
}

munna
1st June 2006, 11:50
Try calling reset() after setting the slider value.

chemstar
1st June 2006, 12:51
doesn't work

wysota
1st June 2006, 15:42
How about:


connect(verticalScrollBar, SIGNAL(valueChanged(int)), tableWidget->verticalScrollBar(), SLOT(setValue(int)));
connect(horizontalScrollBar, SIGNAL(valueChanged(int)), tableWidget->horizontalScrollBar(), SLOT(setValue(int)));