From 86c218e7fa619864112abba5fa607f847fc114f3 Mon Sep 17 00:00:00 2001 From: Frerich Raabe Date: Fri, 3 Jun 2016 16:07:52 +0200 Subject: Introduced gui.setTextItems() method This utility function can be used to populate a Qt control which is backed by some QAbstractItemModel with a list of strings. E.g. this can be used to populate a QComboBox or any QAbstractItemView with some items. This is very useful since in many cases, the methods for adding elements to such controls are neither slots, nor marked with Q_INVOKABLE and such unreachable from the script code. Change-Id: I2195f41e53765ef3a798477ed08d8f09ab5c4379 Reviewed-by: Katja Marttila --- doc/scripting-api/gui.qdoc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/scripting-api/gui.qdoc b/doc/scripting-api/gui.qdoc index 5883fb50c..4a669a769 100644 --- a/doc/scripting-api/gui.qdoc +++ b/doc/scripting-api/gui.qdoc @@ -168,3 +168,10 @@ /*! \qmlmethod void gui::setModified(boolean value) */ + +/*! + \qmlmethod void gui::setTextItems(object control, string[] items) + + Updates the model of \a control (which must be a QComboBox or QAbstractItemView) + such that it contains the given \a items. +*/ -- cgit v1.2.3