Results 1 to 7 of 7

Thread: QTableWidget showing white line

  1. #1
    Join Date
    Jan 2011
    Location
    Sri Lanaka
    Posts
    64
    Thanks
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QTableWidget showing white line

    hello

    I have attached a image of my tablewidget. i have highlighted area in red..
    i wont to remove it...

    TableWidget.png

    its a tablewidget inside a panel and its inside Gridlayout with no spacing in layout.

    i have 2 stylesheets
    Panle style sheet :-
    Qt Code:
    1. background-color: qlineargradient(spread:pad, x1:0.489, y1:0, x2:0.489, y2:0.086, stop:0 rgba(209, 224, 255, 255), stop:0.977273 rgba(255, 255, 255, 255));
    To copy to clipboard, switch view to plain text mode 

    Tablewidgeet stylesheet :-
    Qt Code:
    1. /* QHeaderView::section {
    2. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:0.892, stop:0 rgba(212, 236, 255, 255), stop:1 rgba(225, 240, 255, 255));
    3.  
    4.   border: 1px solid rgb(188,188,191);
    5.  }*/
    6. QHeaderView::section {
    7. background-color: qlineargradient(spread:reflect, x1:0.500318, y1:1, x2:0.512, y2:0.211, stop:0.0795455 rgba(164, 221, 255, 234), stop:1 rgba(234, 254, 255, 227));
    8. border: 1px solid rgb(188,188,191);
    9. }
    10.  
    11.  
    12. gridline-color: rgb(188, 188, 188);
    13. background-color: rgba(255, 255, 255,0);
    14. /*alternate-background-color: rgba(241, 241, 241,190);*/
    15. }
    16.  
    17. QTableWidget::item::selected{
    18. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(229, 255, 189, 245), stop:1 rgba(229, 255, 189, 255));
    19. selection-color:black;
    20. }
    21.  
    22. /*=====================================================*/
    23.  
    24. background-color: rgb(255, 255, 255);
    25. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget showing white line

    Set QHeaderView::Stretch to the last section.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    deepal_de (24th May 2011)

  4. #3
    Join Date
    Jan 2011
    Location
    Sri Lanaka
    Posts
    64
    Thanks
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QTableWidget showing white line

    Thanks for the reply..

    thing is i dont wont to Stretch the tablewidget...
    i wont the table occupy space as it require.. but for the extra space panel background should be visible.
    I can get that by the configuration on the image..but that white line appears.. how to remove that line??

  5. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget showing white line

    I would say that you are seeing the table background which is white.
    Alos, have a look at this:
    http://doc.qt.nokia.com/latest/qwidg...ackground-prop
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. The following user says thank you to high_flyer for this useful post:

    deepal_de (24th May 2011)

  7. #5
    Join Date
    Jan 2011
    Location
    Sri Lanaka
    Posts
    64
    Thanks
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QTableWidget showing white line

    I even changed the background color of both header and table to transparent,still that white line is there??
    any idea why??
    can it be something wrong with the style sheet.. i even removed it and tried but still its there..

  8. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget showing white line

    I even changed the background color of both header and table to transparent,still that white line is there??
    I would try to make the header background opaque, and not transparent.
    Try setting the window role color to something else, like red, then you can see for sure if what you see is the header background or not.
    an it be something wrong with the style sheet.. i even removed it and tried but still its there..
    It could be that style sheets to not effect that part of the header - stylesheets don't effect everything.
    Last edited by high_flyer; 24th May 2011 at 13:40. Reason: typos
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. The following user says thank you to high_flyer for this useful post:

    deepal_de (24th May 2011)

  10. #7
    Join Date
    Jan 2011
    Location
    Sri Lanaka
    Posts
    64
    Thanks
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QTableWidget showing white line

    I tried what you said, but still its there..

    Qt Code:
    1. QHeaderView::section {
    2. background-color: qlineargradient(spread:reflect, x1:0.500318, y1:1, x2:0.512, y2:0.211, stop:0.0795455 rgba(164, 221, 255, 234), stop:1 rgba(234, 254, 255, 227));
    3. border: 1px solid rgb(188,188,191);
    4. }
    5.  
    6.  
    7. gridline-color: rgb(188, 188, 188);
    8. background-color: rgba(255, 255, 255,0);
    9. /*alternate-background-color: rgba(241, 241, 241,190);*/
    10. }
    11.  
    12. QTableWidget::item::selected{
    13. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(229, 255, 189, 245), stop:1 rgba(229, 255, 189, 255));
    14. selection-color:black;
    15. }
    16.  
    17. /*=====================================================*/
    18.  
    19. background-color: rgb(255, 255, 255);
    20. }
    To copy to clipboard, switch view to plain text mode 

    can it be because of QHeaderView::section in the style sheet...
    but as i said before, i tried without style sheet..but still its there..

Similar Threads

  1. Change line type for a particular cell in QTableWidget
    By ricardosf in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2010, 15:47
  2. Replies: 1
    Last Post: 25th May 2010, 15:44
  3. New Line at the the of QTableWidget
    By aekilic in forum Qt Programming
    Replies: 2
    Last Post: 18th November 2009, 16:45
  4. Replies: 8
    Last Post: 23rd October 2009, 16:33
  5. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.