discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Formatter callback in QT QUI Label widget


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] Formatter callback in QT QUI Label widget
Date: Wed, 11 Mar 2015 11:27:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 03/11/2015 11:16 AM, Tom Rondeau wrote:
On Tue, Mar 10, 2015 at 8:26 PM, Marcus D. Leech <address@hidden> wrote:
Does the formatter callback work?  I can't get it to do anything useful, using a lambda _expression_ stuffed into a variable.  How does the widget calll the desired function?

Hmm, just tried this and it worked:

lambda x: "Value = {0} (put units here)".format(perform_function_on(x))

So the _expression_ returns a string.

Tom


I actually took a different approach last night that works.

I set the type of the label to string, and have an external variable that does the formatting I need, returning a string, and it is that string that is used in the Qt label.  No formatter callback required.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]