Results 1 to 3 of 3

Thread: why there is no update on maximize? [QTableWidget]

  1. #1
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default why there is no update on maximize? [QTableWidget]

    Hello,

    Application -> MDI window (maximized to the size of the app) -> qtablewidget.

    My aim: keep the current cell in the view when the user resize application (scrollToItem does not work, please keep it out of the discussion -- I would like to focus on one issue per thread).

    My solution:
    * override resizeEvent
    * use scrollbars to scroll the table

    It works really, really fine... except when the application is maximized. Of course even then there is resize event but somehow the content is not scrolled properly. It is scrolled (i.e. there is scroll call), ok, but the visual effect is not correct (cell is out of the view).
    When I then "manually" call my method to maintain cell in the view (via direct call from menu), table is scrolled and I can see the active cell.

    So why on resize is an update and it works but on maximize (which is some kind of resize) there is an update too but this one does not work.
    For me it almost look like:
    maximize = resize + extra size adjustment

    And this extra something change the size of the app but the resize event is not called. Or maybe in maximize event the visual update should be treated specially?

    My method of keeping the current cell visible (in the view):
    QScrollBar *scrollbar = table->verticalScrollBar();
    scrollbar->setValue(currentRow());
    For my needs it is more than ok -- except for this maximize problem.

    Any help is appreciated! :-)

    have a nice day, bye

    PS. Dead-ends -- changeEvent is not propagated to qtablewidget, I can call my method from the window level on ChangeEvent but it does not change a thing.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: why there is no update on maximize? [QTableWidget]

    Quote Originally Posted by macias View Post
    changeEvent is not propagated to qtablewidget
    What about the corresponding QMdiSubWindow, does it receive a change event?
    J-P Nurmi

  3. #3
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: why there is no update on maximize? [QTableWidget]

    Quote Originally Posted by jpn View Post
    What about the corresponding QMdiSubWindow, does it receive a change event?
    Well, I can pass it manually.

    However, till now I could not solve this issue, however I found out a workaround. Switch scrollbars to per pixel scrolling instead of per row + in my reimplementation of resizeEvent I call the inherited resizeEvent twice.
    Strange, a bit ugly, but works.

    I think that the correct solution cannot be done without fixing some kind of bug, or a glitch in Qt itself. I already reported this problem to Trolltech.

    have a nice day, bye

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.