PDA

View Full Version : freeze first two columns in PyQt(QTableView)



ramesh03
22nd December 2011, 11:38
Hi,

I am working on QTableView in PyQt.My tableview has nearly 7 column, i want to freeze first two columns.So how to do this in PyQt.Please explain me with example.

Thanks.

amleto
22nd December 2011, 18:53
explain more. what does freeze mean? how many columns total in your model?

I'm guessing you have more than 7 columns, but only show 7 at a time?

ChrisW67
23rd December 2011, 02:17
I think ramesh03 means that the leftmost two columns stay fixed while scrolling left-right moves the other columns.

I have only seen this done by overlaying one QTableView, showing all columns, with another, showing the 'frozen' columns, and then linking their vertical scrolling. See the Frozen Column Example.

ramesh03
23rd December 2011, 05:39
amleto and ChrisW67 Thanks for your reply.

Yes, ChrisW67.I need exactly like that,So how to do that in Python(PyQt).I dono about QT(c++).

amleto, I am uploading my images here.If i move my slider left and right ID,NAME is not visible.I need to display ID,NAME always, if i move my slider Left and Right.

http://picturepush.com/public/7205759




Thanks.

amleto
23rd December 2011, 10:57
If nokia have an example, I'd follow their lead ;) :)

It should be 'simple' to translate the c++ class and methods/calls into the pyqt bindings.

ricki
14th March 2013, 12:49
somebody convert C++ Freeze column example to python ??

I tried to convert but I can't.

Thanks.