[SOLVED]QLineEdit size with PlaceHolder



  • Hello,
    does anybody know if it's possible to fit size of QLineEdit to PlaceHolder text?

    Is any metod or I have to use fixed size??

    BR
    Tomek



  • Hi,

    you could use QFontMetrics::width() to get the widht of the placeholder text. Then use that width to set the sizeHint


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.