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 /src/libs/installer/scriptengine_p.h | |
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 'src/libs/installer/scriptengine_p.h')
-rw-r--r-- | src/libs/installer/scriptengine_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/installer/scriptengine_p.h b/src/libs/installer/scriptengine_p.h index b15478680..90ff56475 100644 --- a/src/libs/installer/scriptengine_p.h +++ b/src/libs/installer/scriptengine_p.h @@ -160,6 +160,8 @@ public: Q_INVOKABLE void setSilent(bool silent); + Q_INVOKABLE void setTextItems(QObject *object, const QStringList &items); + signals: void interrupted(); void languageChanged(); |