From cf5d9e9eb5c4ad77f68aa2787bfb81550ded9c23 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 8 Mar 2023 20:05:01 +0100 Subject: QWidget: add overload to set tab order as a list of widgets The "two widgets at a time" API to set the tab order is awkward and easily misused (as the documentation explicitly explains). Add an inline overload that takes an initializer_list, and call the existing function for each consecutive pair of widgets in the list. Add documentation with snippet, and a test. Change-Id: I8e6f14a242866e3ee7cfb8ecade4697d6bdfb4d4 Reviewed-by: Christian Ehrlicher Reviewed-by: Richard Moe Gustavsen --- src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/widgets/doc/snippets/code') diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp index 8f0c2968738..603ce14f80b 100644 --- a/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp +++ b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp @@ -61,6 +61,11 @@ setTabOrder(c, d); // a to b to c to d //! [9] +//! [9.list] +setTabOrder({a, b, c, d}); // a to b to c to d +//! [9.list] + + //! [10] // WRONG setTabOrder(c, d); // c to d -- cgit v1.2.3