Hey Santosh,
Thanks again for taking the time to answer with detailed code.
I'm afraid I wasn't very clear on my problem, so I created a small test application (Windows, x64) that illustrates well the issue I'm trying to solve:
- scrollToColumn-x64.zip (17 KB, assumes you have the Qt 5.0.2 DLLs lying around)
- scrollToColumn-x64-standalone.zip (14 MB, includes all required Qt DLLs)
- scrollToColumn-src.zip (Qt Creator 5.0.2 project)
Start the application, then press the "Select Random Item" button at the bottom to select a random item in the tree widget. As you will notice, although the tree widget scrolls horizontally to the selected item, the actual text of the item isn't visible as it's too far on the right (due to the indentation). What I'm trying to do is to always make the text of the item visible.
(Note that, although the tree widget has two columns, only the first one (at index 0) is populated and this is the one I would like to make visible.)
Franz
Bookmarks