PDA

View Full Version : Widget highlight problem



shadowfax
13th July 2009, 12:37
I've problem with making custom widget for context menu. I made custom widget by subclassing QWidget class. In paintEvent method I use brush with QPalette.Highlight color to draw active menu entry, and QPalette.Window color for unhighlited menu entry.
But I can't obtain the same look with different QApplication style. Highlight color and Window color are different when using Linux and Windows.Additionaly cleanlooks highlighted menu entry have slightly rounded edges. How can I achieve the same look on both platform ?

e8johan
14th July 2009, 10:23
You will probably have to use QStyle and draw a QStyle::CE_MenuItem.