Results 1 to 5 of 5

Thread: [QTable] Disable centering of rows on mouseclick

  1. #1
    Join Date
    Jan 2006
    Location
    Netherlands
    Posts
    56
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Question [QTable] Disable centering of rows on mouseclick

    Hello

    I have a question for you, i'm sitting here with a little bit weird problem.

    Let me explain...
    I have a QTable, what happens now is... if I have row 1 (see screenshot) just half visible on the screen, it will update itself (scroll to the start of row 1) on a click on a cell in that row... So the whole row 1 becomes visible.
    All I want to do is disabling this "feature", so if I click on a cell in that row, the scrollbars must stay in place and not move .....

    It's really boggling my mind

    Does anybody know what i mean? or could help me solving the struggle?

    ..:: Still Standing Strong ::..

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: [QTable] Disable centering of rows on mouseclick

    Does it get centered, if you select that row programmatically?

  3. #3
    Join Date
    Jan 2006
    Location
    Netherlands
    Posts
    56
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Re: [QTable] Disable centering of rows on mouseclick

    Quote Originally Posted by jacek View Post
    Does it get centered, if you select that row programmatically?
    You mean by calling the function QTable::selectRow(int row) ?

    I will try tomorrow @ work...

    This is just a sample screenshot.. For the application i need this I created already a subclass from QTable and reimplemented the selectRow(int row) function and left it empty.. but also then it centers on a mouseclick.
    ..:: Still Standing Strong ::..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: [QTable] Disable centering of rows on mouseclick

    Quote Originally Posted by BrainB0ne View Post
    but also then it centers on a mouseclick
    My idea is to intercept mouse click with event filter and invoke selectRow() instead.

  5. The following user says thank you to jacek for this useful post:

    BrainB0ne (30th October 2006)

  6. #5
    Join Date
    Jan 2006
    Location
    Netherlands
    Posts
    56
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Re: [QTable] Disable centering of rows on mouseclick

    Quote Originally Posted by jacek View Post
    My idea is to intercept mouse click with event filter and invoke selectRow() instead.
    Great! I solved it thanx to you...

    I reimplemented the viewportMousePressEvent( QMouseEvent *e ) function at my table subclass.. and catched the mouse event, from there i call the functions i need
    ..:: Still Standing Strong ::..

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.