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.cpp | |
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.cpp')
-rw-r--r-- | src/libs/installer/scriptengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs/installer/scriptengine.cpp b/src/libs/installer/scriptengine.cpp index adf841bde..79f813572 100644 --- a/src/libs/installer/scriptengine.cpp +++ b/src/libs/installer/scriptengine.cpp @@ -212,6 +212,12 @@ void GuiProxy::setSilent(bool silent) m_gui->setSilent(silent); } +void GuiProxy::setTextItems(QObject *object, const QStringList &items) +{ + if (m_gui) + m_gui->setTextItems(object, items); +} + void GuiProxy::cancelButtonClicked() { if (m_gui) |