Closed cmft closed 4 years ago
Done
I did some heavy refactoring. Can some @taurus-org/integrators test it?
Here is a snippet of a code that can be used to test:
from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.panel import TaurusForm
import taurus
def myformatter(*a, **kw):
return "**{1.2e}**"
if __name__ == '__main__':
import sys
app = TaurusApplication(cmd_line_parser=None)
w = TaurusForm()
w.setModifiableByUser(True)
model = ['sys/tg_test/1/float_scalar', 'sys/tg_test/1/double_scalar']
w.setModel(model)
w.show()
from taurus.core.tango.util import tangoFormatter
# w[0].setFormat(tangoFormatter)
# w[0].setFormat('taurus.core.tango.util.tangoFormatter')
# w[0].setFormat(myformatter)
w[0].setFormat('///{:1.2f}///')
# show setFormatter dialog
w[0].onSetFormatter()
sys.exit(app.exec_())
I just see one thing missing: if the selected formatter happens to be UPDATE: this is taken care of in cf9be81None
(which is often the case for the class formatter), onSetFormatter
does not set it. This requires either deprecating the onSetFormatter
/showFormatterDlg
API or breaking it. I do not expect anyone having reimplemented these methods in their own code, so I vote for breaking in this corner case
mmm... I clearly broke the formatters with my refactoring... I'll investigate and fix
All clear now. Merging
Fixes #1035