diff options
author | Frerich Raabe <raabe@froglogic.com> | 2016-06-03 16:07:52 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2016-06-15 09:48:16 +0000 |
commit | 86c218e7fa619864112abba5fa607f847fc114f3 (patch) | |
tree | d181721919542754fd3445150a49754cba5e6a59 /doc | |
parent | b4a1a89e306367feaec56ce9902d15234ece5f84 (diff) |
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 <katja.marttila@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/scripting-api/gui.qdoc | 7 |
1 files changed, 7 insertions, 0 deletions
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. +*/ |