def property_changed(prop):
q.put_nowait(prop.get(prop_name))
print(f'callback: {q.qsize()}')
in_data = [....]
for i in in_data:
if isinstance(i, int) and not i%2:
{bla bla bla}
if isinstance(i, float) and not i%2:
{bla bla bla}
in_data = [....]
floats = filter(isinstance(i, float), in_data))
ints = filter(isinstance(i, int), in_data))
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
def toggle_state(*_):
if entry.var.get():
button['state'] = 'normal'
else:
button['state'] = 'disabled'
if __name__ == '__main__':
root = tk.Tk()
entry = tk.Entry(root)
entry.var = tk.StringVar()
entry['textvariable'] = entry.var
entry.var.trace_add('write', toggle_state)
button = tk.Button(root, text="Button", state='disabled')
entry.pack()
button.pack()
tk.mainloop()
QCompleter* mycompletear = new QCompleter(this);
mycompletear->setCaseSensitivity(Qt::CaseInsensitive);
mycompletear->setModel(proxyModel);
mycompletear->setCompletionColumn(1);
mycompletear->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
ui->comp_comb->setCompleter(mycompletear)