1

I'm working on some Qt GUI application with shiny glossy design.

I have a list view customized with my QItemDeleagte subclass. I draw items in paint virtual method. Selected items need to be drawn with glow effect on the border. Normal items must be without glow effect

That's RectangularGlow QML Type which is exactly what I need my view items border to look like. Unfortunately the app was written in Qt 4.7 and there is no way to port the app and all its dependencies to Qt 5.

QGraphicsDropShadowEffect is not sutable since shadow gradient has one direction and an offset. QLinearGradient doesn't help too or I don't know how to use it.

I consider drawing some kind of border image.

Is there any proper and elegant way to implement this using gradients or graphics effects?

EDIT: As cmannett85 pointed out QGraphicsDropShadowEffect seems to be ok. However graphics effect may be installed on a whole paintdevice and for view item i cant just draw only selected item border rectangle with glow effect and leave other elements in a normal state. Instead all drawing on a list view affected

EDIT2: I found a solution in an answer for another question. So I think this question may be closed

Community
  • 1
  • 1
Andrey Sboev
  • 7,454
  • 1
  • 20
  • 37
  • If you set the `QGraphicsDropShadowEffect` offset to zero and set the blur radius to your desired glow radius, isn't the effect the same? – cmannett85 Mar 28 '15 at 10:03
  • Yea, thanks, i didnt notice that :) but graphicseffect may be installed on a whole paintdevice and i cant just draw only border rectangle with glow effect and leave other elements in a normal state, for example drawTex affected too – Andrey Sboev Mar 28 '15 at 12:25
  • Moreover, glow effect is selectioin indicator, and normal items must be drawn without effects – Andrey Sboev Mar 28 '15 at 12:39
  • possible duplicate of [How can i apply a graphic effect to the image in qlistview?](http://stackoverflow.com/questions/23698114/how-can-i-apply-a-graphic-effect-to-the-image-in-qlistview) – Andrey Sboev Mar 29 '15 at 18:07

0 Answers0