Hi,

I'm in a weird situation, which I'm not sure is a bug or not. Basically, I have a QMainWindow with a QTabWidget. The style sheet for the QMainWindow is:

Qt Code:
  1. color: rgb(227, 227, 227);
  2. font: 75 10pt "Lucida Sans";
  3. }
  4.  
  5. QMainWindow, QWidget#mywidgetWidget, QTabWidget, QWidget#tabGeneral, QWidget#tabPlugins {
  6. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(43, 43, 43, 141), stop:0.497175 rgba(0, 0, 0, 147), stop:0.497326 rgba(0, 0, 0, 147), stop:1 rgba(90, 90, 90, 147));
  7. }
To copy to clipboard, switch view to plain text mode 

While the style sheet for the QTabWidget is basically the example from the docs:

Qt Code:
  1. QTabWidget::pane { /* The tab widget frame */
  2. border-top: 2px solid #C2C7CB;
  3. }
  4.  
  5. QTabWidget::tab-bar {
  6. left: 5px; /* move to the right by 5px */
  7. }
  8.  
  9. /* Style the tab using the tab sub-control. Note that
  10. it reads QTabBar _not_ QTabWidget */
  11. QTabBar::tab {
  12. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
  13. stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
  14. stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
  15. border: 2px solid #C4C4C3;
  16. border-bottom-color: #C2C7CB; /* same as the pane color */
  17. border-top-left-radius: 4px;
  18. border-top-right-radius: 4px;
  19. min-width: 8ex;
  20. padding: 2px;
  21. }
  22.  
  23. QTabBar::tab:selected, QTabBar::tab:hover {
  24. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
  25. stop: 0 #fafafa, stop: 0.4 #f4f4f4,
  26. stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
  27. }
  28.  
  29. QTabBar::tab:selected {
  30. border-color: #9B9B9B;
  31. border-bottom-color: #C2C7CB; /* same as pane color */
  32. }
  33.  
  34. QTabBar::tab:!selected {
  35. margin-top: 2px; /* make non-selected tabs look smaller */
  36. }
  37.  
  38. /* make use of negative margins for overlapping tabs */
  39. QTabBar::tab:selected {
  40. /* expand/overlap to the left and right by 4px */
  41. margin-left: -4px;
  42. margin-right: -4px;
  43. }
  44.  
  45. QTabBar::tab:first:selected {
  46. margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
  47. }
  48.  
  49. QTabBar::tab:last:selected {
  50. margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
  51. }
  52.  
  53. QTabBar::tab:only-one {
  54. margin: 0; /* if there is only one tab, we don't want overlapping margins */
  55. }
To copy to clipboard, switch view to plain text mode 


Basically, when I switch tabs, you can see a "ghost" of the old widgets very faintly. These ghosts disappear. This issue doesn't happen when I remove the stylesheet from the QTabWidget. Any feedback is appreciated.


Before.pngmywidget.uiAfter.png