I have a QToolTip on a QLineEdit that is set in the init. Within the text of tool tip are several variables.

The issue: It seems like the variables are not updated automatically when they are changed by the program.

For example, I hover the mouse over the line edit, and the tooltip and variable values are displayed. I the change something in the program that changes the variables, but when I go back and hover over the line edit again, the old variable values (instead of the new variable values) are displayed.

I can fix the issue by moving the setting of the tooltip from the init to a function and calling it (essentially running .setToolTip) each time ANYTHING is changed in the program. But this seems a little weird.

Here is the code to set the tooltip and variables (this is the code in the init):
Qt Code:
  1. self.ui.YourSSAmount.setToolTip(
  2. '<span>Click Reports/Social Security to see your<br>SS income at each start age'
  3. '<br><br>Your inf adj FRA amt at age {}:&nbsp;&nbsp;${:,.0f}'
  4. '<br>Age adjustment:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:.0f}%'
  5. '<br>SS Income at age {}:&nbsp;&nbsp;&nbsp;&nbsp;${:,.0f}</span>'.format(
  6. self.generator.YouSSStartAge, self.generator.your_new_FRA_amt,
  7. self.generator.SS66.get(self.generator.YouSSStartAge, 1.32) * 100, self.generator.YouSSStartAge,
  8. self.generator.YourSSAmount))
To copy to clipboard, switch view to plain text mode 
Do variables not update automatically in a QToolTip (variables update automatically when contained in a QMessageBox, for example)???