Results 1 to 3 of 3

Thread: MAC ONLY- Vertical Scroll problem with QTableWidget

  1. #1
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default MAC ONLY- Vertical Scroll problem with QTableWidget

    Hello Everyone.

    In QTable Widget, i am adding some items in certain columns using “setCellWidget()”. Whereas, to add items in other columns of the same row I am using “setItem()”.
    When I tried to use vertical scroll bar, the items added by using “setItem()” scroll properly. But the items added by “setCellWidget()” do not scroll at all . They are frozen.

    I tried following options:-

    [1] I tried setting the stylesheet –
    Qt Code:
    1. QString scrollStyleSheet = “QTableWidget {}”
    To copy to clipboard, switch view to plain text mode 
    ; // tried few variations too , but this works the best
    Qt Code:
    1. ui->deviceGridTable->setStyleSheet(scrollStyleSheet )
    To copy to clipboard, switch view to plain text mode 
    ;

    It works fine, so long as I do not scroll, when items are getting added. Before adding new items or after adding new items, if I scroll, it works fine. However, if I scroll, while new items are being added one by one , it shows the same old ugly characteristics which I just described.

    [2] I tried setting “VerticalScrollMode” to “ScrollPerPixel”. It does not work at all.

    What else can I try to fix the problem of vertical scrolling while items are detting added ? (Only for those items which are added using “setCellWidget()”. The problem is only on Mac OSX 10.8.1. I am using Qt 4.8.3

    Thanks a lot.

  2. #2
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: MAC ONLY- Vertical Scroll problem with QTableWidget

    Same thread exists but no reply
    http://www.qtcentre.org/threads/5387...tion-on-MacOsX

    I have also seen a reply but unable to get my problem resolved...

    Have a look if u got your problem solved then let me know.
    http://stackoverflow.com/questions/1...erly-in-mac-os

  3. #3
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Thumbs up Re: MAC ONLY- Vertical Scroll problem with QTableWidget

    After a long compiling of Qt source .... and YAY
    i got my problem resolved....
    I applied this patch provided to me by Qt Commercial Support. This resolved my Mac scroll problems on Qt 4.8.5:
    Qt Code:
    1. --- /Users/irfanomair/dev/qt-src-carbon-4.8.0/src/gui/kernel/qwidget_mac.mm 2011-12-15 10:38:21.000000000 -0800
    2. +++ kernel/qwidget_mac.mm 2012-09-18 17:17:03.000000000 -0700
    3. @@ -1,22 +1,41 @@
    4.  
    5. @@ -4684,15 +4703,14 @@
    6. }
    7.  
    8. // Scroll the whole widget if qscrollRect is not valid:
    9. - QRect validScrollRect = qscrollRect.isValid() ? qscrollRect : q->rect();
    10. - validScrollRect &= clipRect();
    11. + QRect validScrollRect = qscrollRect.isValid() ? qscrollRect : QRect(0, 0, q->width(), q->height());
    12.  
    13. // If q is overlapped by other widgets, we cannot just blit pixels since
    14. // this will move overlapping widgets as well. In case we just update:
    15. const bool overlapped = isOverlapped(validScrollRect.translated(data.crect.topLeft()));
    16. const bool accelerateScroll = accelEnv && isOpaque && !overlapped;
    17. const bool isAlien = (q->internalWinId() == 0);
    18. - const QPoint scrollDelta(dx, dy);
    19. +
    20.  
    21. // If qscrollRect is valid, we are _not_ supposed to scroll q's children (as documented).
    22. // But we do scroll children (and the whole of q) if qscrollRect is invalid. This case is
    23. @@ -4714,7 +4732,6 @@
    24. }else {
    25. update_sys(qscrollRect);
    26. }
    27. - return;
    28. }
    29.  
    30. #ifdef QT_MAC_USE_COCOA
    31. @@ -4731,6 +4748,7 @@
    32. // moved when the parent is scrolled. All directly or indirectly moved
    33. // children will receive a move event before the function call returns.
    34. QWidgetList movedChildren;
    35. + const QPoint scrollDelta(dx, dy);
    36. if (scrollChildren) {
    37. QObjectList children = q->children();
    To copy to clipboard, switch view to plain text mode 
    Last edited by karankumar1609; 26th March 2013 at 10:48.

Similar Threads

  1. Replies: 0
    Last Post: 8th March 2013, 02:40
  2. hangup vertical scroll bar in qtextedit
    By mero in forum Qt Programming
    Replies: 1
    Last Post: 19th February 2011, 18:59
  3. How to disable vertical scroll bar in QTableWidget
    By grsandeep85 in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2009, 11:07
  4. vertical scroll bar in Qt box.
    By rajveer in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2008, 07:41
  5. Vertical Scroll Bar - Style Sheet
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2007, 19:03

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.