I've subclassed QStyle
to control the aspect of my app. After customizing the aspect of the QLineEdits
, I need to add an icon inside the QLineEdit
and it has to be clickable by the user. I've seen that I can use the method QLineEdit::addAction
to add an action and an icon in the QLineEdit
. The problem arises with the position in which it draws the icon because as I have the customized QLineEdit
, the icon draws too near the edge of QLineEdit
. I need to separate more icon QLineEdit
edge. Does anyone know how to control the position of the icon in the QLineEdit
?
Asked
Active
Viewed 290 times
1
-
I think you'll need to provide more information with regard to precisely *how* your custom style affects the `QLineEdit`. If you don't apply your custom style does the problem still exist? – G.M. Sep 07 '16 at 17:42
-
No, if I don't apply my custom style, the problem dissapears. The custom style applies a shadow when the user set the focus on him and the edge of the control is more inward. For this reason, I think Qt set the icon from the shadow of the QLineEdit, not from the edge and then the icon appears too near to the edge – PinTxO Sep 08 '16 at 14:44