From 36f43b13f79988ac2fb59b4f8459ea126382711a Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Fri, 24 Feb 2023 10:18:12 -0800 Subject: [PATCH] qtutils: add a default value argument to get() Signed-off-by: David Aguilar --- cola/qtutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cola/qtutils.py b/cola/qtutils.py index da7be262..480bded9 100644 --- a/cola/qtutils.py +++ b/cola/qtutils.py @@ -76,7 +76,7 @@ def disconnect(signal): pass -def get(widget): +def get(widget, default=None): """Query a widget for its python value""" if hasattr(widget, 'isChecked'): value = widget.isChecked() @@ -91,7 +91,7 @@ def get(widget): elif hasattr(widget, 'date'): value = widget.date().toString(Qt.ISODate) else: - value = None + value = default return value -- 2.11.4.GIT