Results 1 to 6 of 6

Thread: freeze first two columns in PyQt(QTableView)

  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Platforms
    Windows

    Default freeze first two columns in PyQt(QTableView)

    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.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: freeze first two columns in PyQt(QTableView)

    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?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: freeze first two columns in PyQt(QTableView)

    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.

  4. #4
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Platforms
    Windows

    Default Re: freeze first two columns in PyQt(QTableView)

    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.
    Last edited by ramesh03; 23rd December 2011 at 05:46.

  5. #5
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: freeze first two columns in PyQt(QTableView)

    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.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  6. #6
    Join Date
    Mar 2013
    Posts
    1
    Qt products
    Platforms
    Windows

    Default Re: freeze first two columns in PyQt(QTableView)

    somebody convert C++ Freeze column example to python ??

    I tried to convert but I can't.

    Thanks.

Similar Threads

  1. Sorting columns of the QTableView
    By Qiieha in forum Qt Programming
    Replies: 8
    Last Post: 9th May 2011, 19:24
  2. Validator for QTableView columns
    By sasi in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2009, 08:10
  3. updating QTableView with new qsl columns
    By sylvainb in forum Qt Programming
    Replies: 2
    Last Post: 28th January 2009, 20:51
  4. set the width of the columns of QTableView
    By zhanglr in forum Qt Programming
    Replies: 6
    Last Post: 31st July 2008, 15:29
  5. autoexpanding QTableView columns
    By ucntcme in forum Qt Programming
    Replies: 6
    Last Post: 11th March 2008, 09:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.