Results 1 to 2 of 2

Thread: Qt QTableWidget - Cell Widget static position on MacOsX

  1. #1
    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

    Exclamation Qt QTableWidget - Cell Widget static position on MacOsX

    Hello Everyone,

    I have got stucked in a problem which works fine on my windows OS and not on MAC OSX.

    I have added a QPushButton in my table widget but when the list of table widget increases then on scrolling added push button not move.

    Qt Code:
    1. QPushButton *deleteButton = new QPushButton(Delete);
    2. deleteButton->setFixedSize(32, 32);
    3. deleteButton->setStyleSheet("QPushButton { border-image: url(:/Resource/Images/DashBoard/checkout.png); }");
    4. ui->tableWidget_fileList->setCellWidget(row, 4, deleteButton);
    To copy to clipboard, switch view to plain text mode 

    it seems that the position of the buttons are static.
    Unable to get out of this problem, anyone have adea about that?
    Last edited by karankumar1609; 25th March 2013 at 13:21.

  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

    Thumbs up Re: Qt QTableWidget - Cell Widget static position on MacOsX

    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 

Similar Threads

  1. Replies: 3
    Last Post: 9th November 2012, 18:55
  2. Replies: 2
    Last Post: 18th July 2011, 00:25
  3. Many cell widget in QTableWidget
    By Benarez in forum Qt Programming
    Replies: 3
    Last Post: 21st January 2010, 07:02
  4. Replies: 1
    Last Post: 7th December 2009, 18:56
  5. Center a widget in a cell on a QTableWidget
    By roleroz in forum Qt Programming
    Replies: 16
    Last Post: 5th March 2009, 14:47

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.