how to scroll tablewidget from outside placed scrollbar
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?
Re: how to scroll tablewidget from outside placed scrollbar
Re: how to scroll tablewidget from outside placed scrollbar
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);
}
Re: how to scroll tablewidget from outside placed scrollbar
Try calling reset() after setting the slider value.
Re: how to scroll tablewidget from outside placed scrollbar
Re: how to scroll tablewidget from outside placed scrollbar
How about:
Code:
connect(verticalScrollBar, SIGNAL(valueChanged(int)), tableWidget->verticalScrollBar(), SLOT(setValue(int)));
connect(horizontalScrollBar, SIGNAL(valueChanged(int)), tableWidget->horizontalScrollBar(), SLOT(setValue(int)));