Hello together!

i am trying to draw a sunken border frame with white background, something looking like QLineEdit. This is the code i came up with after quite some experimenting and qt-source digging:

Qt Code:
  1. option.initFrom(this);
  2. option.state |= QStyle::State_Sunken;
  3. option.rect.setRect(x,y,width,height);
  4. QApplication::style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, painter);
  5. QApplication::style()->drawPrimitive(QStyle::PE_FrameLineEdit, &option, painter);
To copy to clipboard, switch view to plain text mode 

Problem is that the white panels edges are not rounded (i am using KDE oxygen style) like the frame and are visible outside the frame at the edges. Just a few pixels, but that looks ugly! Any idea whats wrong with this code?

And another problem that came up in this respekt: how can i draw the focused and mouse_over states? It seems they are not drawn by PE_FrameLineEdit itself and PE_FrameFocusRect primitive does nothing for me.

Thanks for any help,
Stefan