Results 1 to 5 of 5

Thread: QGradiant::StretchToDeviceMode

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QGradiant::StretchToDeviceMode

    Hi

    I use the QGradient to color a QTableWidgetItem in a special way. On Linux the QTableWidgetItem looks like I want, but under Windows the effects aren't shown, because
    the linear gradient doesn't scale. If I extend the column the effect are visible, but they have to visible everytime...

    Qt Code:
    1. QLinearGradient gradient(0,0,1,0);
    2. gradient.setSpread(QGradient::PadSpread);
    3. gradient.setCoordinateMode(QGradient::StretchToDeviceMode);
    4. QGradientStops qStops;
    5. QGradientStop qStop1(0.180095,color);//0.464929
    6. QGradientStop qStop2(0.49763,QColor(255,255,255,255));//0.8540281
    7.  
    8. qStops.append(qStop1);
    9. qStops.append(qStop2);
    10. gradient.setStops(qStops);
    11. return gradient;
    12.  
    13. //....
    14.  
    15. QBrush color(gradient);
    16. item.setBackground(color);
    To copy to clipboard, switch view to plain text mode 

    What can I do?

    thank u
    Last edited by Qiieha; 24th November 2011 at 16:35.

  2. #2
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGradiant::StretchToDeviceMode

    Does nobody know a solution?

  3. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGradiant::StretchToDeviceMode

    Hi I send you an example. Maybe somebody can try it on Linux and on Windows. Just compile and see...
    Attached Files Attached Files

  4. #4
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGradiant::StretchToDeviceMode

    Nobody can help ?

  5. #5
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGradiant::StretchToDeviceMode

    It seems to be a Windows-Bug.
    Last edited by Qiieha; 7th December 2011 at 08:45.

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.