PDA

View Full Version : [QT3] Implement "Freeze Panes" features in QListView



Syphius
30th December 2008, 11:05
Hello!

I'm using QT 3.3.5 (and I can't change). I need to implement the "freeze panes" features in a QListView. In other word :
The first column is always visible when you scroll horizontally.

Does somebody has a little hack to make it possible?

Thanks in Advance,

Syphius.

wysota
30th December 2008, 11:20
There is no hack. Put another list view (or a listbox) on the form next to the original one, make it display a single column and synchronize vertical scrollbars of both widgets.

Syphius
30th December 2008, 15:44
Thanks for reply.

But I need one big horizontal scrollbar for the two widgets, How can I do that?

wysota
31st December 2008, 01:37
What for? You won't be able to scroll the first view anyway, right? You can always disable scrollbar in the listview and then place another scrollbar beneath the view and synchronize the view's scrollbar with it (and vice versa).

Syphius
31st December 2008, 14:32
Good idea, but no signal is emitted or event processed when scrollbar is always off. I test it, and I look in the code.

Moreover in QT3 there isn't lots of signals emitted by the scrollbar, two scrollbar can't be synchronise.

wysota
31st December 2008, 14:58
I'm sure valueChanged() is emitted by the scrollbar regardless of its visibility. There is also contentsMoving() signal in QScrollView.

Syphius
5th January 2009, 11:04
The valueChanged signal is only emitted when the scrollbar is visible. And I want something that hide and show automaticly like the normal scroll and its min and max value must change too with the size of the list view.

wysota
5th January 2009, 21:25
The valueChanged signal is only emitted when the scrollbar is visible.
That's clearly a bug then. Are you using the latest release? Maybe it was fixed in 3.3.8? Maybe you could even patch Qt yourself so that the signal is emitted, it should be easy...


And I want something that hide and show automaticly like the normal scroll and its min and max value must change too with the size of the list view.

I'm sure there is a way to do it.