
Originally Posted by
anda_skoa
Do the two scrollbars have the same range?_
No, they are different. that is the reason I am just trying to adjust the header range to actual views range in below way, Now this range is getting changed but the behavior is same.
connect(m_header->horizontalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(rangeChanged(int,int)));
void treeView::rangeChanged(int min, int max)
{
//Eevn If I don't do this also, I could see same behavior
m_header->horizontalScrollBar()->setRange(s2->minimum(), s2->maximum());
qDebug() << "min = " << min << " max = " << max;
}
connect(m_header->horizontalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(rangeChanged(int,int)));
void treeView::rangeChanged(int min, int max)
{
//Eevn If I don't do this also, I could see same behavior
QScrollBar* s2 = horizontalScrollBar();
m_header->horizontalScrollBar()->setRange(s2->minimum(), s2->maximum());
qDebug() << "min = " << min << " max = " << max;
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
anda_skoa
If not, you might need to calculate the relative position and apply this to the other's range._
could you elaborate this little more.
Bookmarks