Results 1 to 7 of 7

Thread: how to synchronize 2 view's (Table & tree) scrolls.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: how to synchronize 2 view's (Table & tree) scrolls.

    Quote Originally Posted by prasad_N View Post
    could you elaborate this little more.
    Let say one range is 0-100 and the other is 0-200, then a value of 20 in range 1 would be 40 in range 2

    Something like
    Qt Code:
    1. int range1 = r1Max - r1Min;
    2. int value1 = value - r1Min;
    3. double relValue = value1/double(range1);
    4.  
    5. int range2 = r2Max - r2Min;
    6. int value2 = range2 * relValue;
    7. value = value2 + r2Min;
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. #2
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: how to synchronize 2 view's (Table & tree) scrolls.

    This is some how change the behavior But not exactly the way I wanted. Because of the (int/double) header is moving step by step instead in-sync with actual view.
    Actual view is moving smoothly but header is moving step by step, this looks so odd to user, Even If I change both the header ranges to 0 to 100 I could see same behavior.

    I am attaching more code here, Please have a look. simpletreemodel.zip
    Qt5.4.0 & Compiled on Windows7.
    Thanks :-)

  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: how to synchronize 2 view's (Table & tree) scrolls.

    Any help..?? Still struggling with this issue..!
    Thanks :-)

  4. #4
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: how to synchronize 2 view's (Table & tree) scrolls.

    Using Table view/Table widget with QTreeview and trying to sync is not working as expected, But after bit experiments using two tree views is working as expect (being both the ranges are same its working as expected. so suggesting to use same view in case you need sync).
    Thanks :-)

Similar Threads

  1. Building Tree view from Table view which is already build.
    By DURGAPRASAD NEELAM in forum Newbie
    Replies: 1
    Last Post: 6th June 2015, 17:26
  2. Building Tree view from Table view which is already build.
    By DURGAPRASAD NEELAM in forum Newbie
    Replies: 6
    Last Post: 18th May 2015, 08:18
  3. table view and tree view
    By MKSPulok in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2012, 22:48
  4. Display sql table menu in a tree view
    By mat.brighi in forum Newbie
    Replies: 2
    Last Post: 19th October 2011, 00:49
  5. Replies: 33
    Last Post: 7th December 2009, 11:11

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
  •  
Qt is a trademark of The Qt Company.