How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created?

Michael Torrie torriem at gmail.com
Tue Oct 1 15:11:01 EDT 2019


On 10/1/19 9:51 AM, Spencer Du wrote:
> Hi
> How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created meaning if a configuration file exists then set the UI with value from the config file otherwise load ui with nothing set to any value.

Your code appears to try to do all this in the printValue() method of
your class, however nothing calls that method.  Most likely you'd want
to move that code to the __init__() initializer.  I can't really comment
further since your code cannot be run as posted, since it imports a
"myconfig" module that is not provided.

More specific help regarding PyQt perhaps may be found at the PyQt
mailing list that Riverbank Software (the makers of PyQt) host).



More information about the Python-list mailing list